G
Guest
I need to receive UDP packets with the IP header
information. I can see how to do this in XP, which is
similar to how it is done in BSD with recvmsg.
But that mechanism is exclusive to XP/2003. How do I do
this in Windows 2000? The documentation seems to imply
raw sockets will always give the IP header when reading
data, but I'm not seeing it.
Fragements of my code:
s = socket (AF_INET, SOCK_RAW, IPPROTO_UDP);
memset (&sin, 0, sizeof (sin));
sin.sin_family = AF_INET;
sin.sin_port = htons (5002);
sin.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (s, (const struct sockaddr *)&sin, sizeof
(sin))) ...
sinlen = sizeof (sin);
r = recvfrom (s, buf, sizeof (buf), 0, (struct
sockaddr *) &sin, &sinlen);
information. I can see how to do this in XP, which is
similar to how it is done in BSD with recvmsg.
But that mechanism is exclusive to XP/2003. How do I do
this in Windows 2000? The documentation seems to imply
raw sockets will always give the IP header when reading
data, but I'm not seeing it.
Fragements of my code:
s = socket (AF_INET, SOCK_RAW, IPPROTO_UDP);
memset (&sin, 0, sizeof (sin));
sin.sin_family = AF_INET;
sin.sin_port = htons (5002);
sin.sin_addr.s_addr = htonl (INADDR_ANY);
if (bind (s, (const struct sockaddr *)&sin, sizeof
(sin))) ...
sinlen = sizeof (sin);
r = recvfrom (s, buf, sizeof (buf), 0, (struct
sockaddr *) &sin, &sinlen);