On Thu, May 03, 2001 at 10:20:45AM +0200, Gunnar Olsson wrote:
> I have a process in user space, that wants to send a packet
> direct on the ethernet, not encapsulate the packet in IP.
> When I read about netgraph, it looks like it possible to do, or?
> When I hook to a upper or a lower hook, does the kernel create
> the ethernet header, or do I have to create the ethernet header
> in the user process myself before sending down?
>
> If the kernal is adding the ethernet header,
> what is actually sent out on the wire? Usaully an ARPLOOKUP
> is done and maps the IP dst to a MAC dst, but now I do not
> have the IP header. How to get the MAC dst field filled in?
It's rather unnecessicary to use netgraph for this purpose. Instead you
can use the well hidden feature of the bpf device that it can write as
well as read. If you want to send packets with arbitrary sender
addresses, you will want to use the BIOCGHDRCMPLT ioctl to enable that
(not all cards support this, for instance wireless cards do not.) You
might also look at libnet which provides wrappers for this, but I seem
to recall that it doesn't support BIOCGHDRCMPLT.
-- Brooks
--
Any statement of the form "X is the one, true Y" is FALSE.
PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4
PGP signature