Finally stumbled onto PF_PACKET.....

On 2.2 kernels you really want to use PF_PACKET instead of SOCK_PACKET.  After
allocating a
PF_PACKET socket, you setup the sockaddr_ll approprately then use sendto(2) to
send the data..   If you use a SOCK_DGRAM then the phyiscal data link headers
are setup for you.   Otherwise if using SOCK_RAW you will also need to format
the physical headers (e.g., ETHERNET, IEEE802, etc).
This is all explained better  in packet(4)

                    good luck!

                                    /ron        .

JF Omhover wrote:

> Is there a way for an application to write directly to the datalink layer?
>
> I know i can read it with libpcap or SOCK_PACKET but.. how to write?
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-net" in
> the body of a message to [EMAIL PROTECTED]

-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to