How to do raw Ethernet under Win32?

Grant Edwards grante at visi.com
Thu Jul 24 10:34:21 EDT 2003


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

>> How does one do raw Ethernet under Win32?  Ultimately, I want
>> to do it in a Python program, but if somebody can point me to a
>> clue on how to do it from C, I could probably figure out the
>> rest.

> 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

I've seen vague references to this in some FAQs but could never
find out if it actually worked or how to specified what
Ethernet protocol you wanted to receive on the socket.

-- 
Grant Edwards                   grante             Yow!  The PINK SOCKS were
                                  at               ORIGINALLY from 1952!! But
                               visi.com            they went to MARS around
                                                   1953!!




More information about the Python-list mailing list