How to do raw Ethernet under Win32?

Grant Edwards grante at
Thu Jul 24 18:02:02 CEST 2003

In article <GHOTa.3$dA6.755814 at>, Leopold Faschalek wrote:

>>  1) Send an arbitrary Ethernet packet.  [Well, not completely
>>     arbitrary, the source MAC will be "right", but the protocol
>>     number is a proprietary (not IP) one, and the packet isn't
>>     anything standard.
>>  2) Receive any incoming packets with a specified protocl
>>     number -- same proto number as in 1) above.

> the new winsock2.h supports more socket types:
> /*
>  * Types
>  */
> #define SOCK_STREAM     1               /* stream socket */
> #define SOCK_DGRAM      2               /* datagram socket */
> #define SOCK_RAW        3               /* raw-protocol interface */
> #define SOCK_RDM        4               /* reliably-delivered message */
> #define SOCK_SEQPACKET  5               /* sequenced packet stream */
> so you have only to define 3 as type in the socket() call

AFAICT, winsock's SOCK_RAW isn't what I need.  

It lets you imipliment protocols on top of IP -- at least
that's what the documentation implies, and that's what's being
done by all the example code I can find.

I don't want to build on top of IP.  I want to build an
arbitrary protocol on top of Ethernet, specifying the Ethernet
protocol number which I want to send/receive.

Grant Edwards                   grante             Yow!  By MEER biz doo
                                  at               SCHOIN...

More information about the Python-list mailing list