I've run into a bit of a problem with the tutorial lesson #2 and its corresponding sample code (this lesson is entitled "Obtaining Advanced Information About Installed Drivers"). If you look at the webpage for tutorial lesson #2 near the bottom of the code you will find the following function:
<code> char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen) { socklen_t sockaddrlen;
#ifdef WIN32 sockaddrlen = sizeof(struct sockaddr_in6); #else sockaddrlen = sizeof(struct sockaddr_storage); #endif
if(getnameinfo(sockaddr, sockaddrlen, address, addrlen, NULL, 0, NI_NUMERICHOST) != 0) address = NULL;
return address; }</code>
When I try to compile, I'm getting an "undeclared identifier" error on both socklen_t (and it goes without saying, sockaddrlen as well), and the function getnameinfo(). Also, the compiler is complaining that NI_NUMERICHOST is an undeclared identifier. So I went to the online documentation for WinPcap v3.1 beta 4 and started digging, and unfortunately found nothing on the above listed items for which I am receiving errors. If you look at the very top of the code snippet for lesson#2, you will find 2 include statements (under the #ifndef WIN32 line, which should be my case since I'm using a non-MFC project in VC++ 6.0): 1) #include <sys/socket.h>, and 2) #include <netinet/in.h>. I was going to dig in these 2 files , however, they didn't come with the developer kit version of WinPcap 3.1 beta 4. And actually if you think about it, it's impossible for those files to exist since Windows naming conventions don't allow a "/" in a file name :-( Finally I began looking in MSDN for any sign of the above mentioned 3 things, and again found nothing. Anyone have any ideas where these 2 datatypes, and the function are defined, and where the documentation on them can be found? I mean theoretically anyone who has ever programmed using the WinPcap library should've ran into this same problem...
Sorry my question ended up so long, but I wanted to save people some time in case they thought to try looking in the online documentation etc. etc. since I already did :-)
cheers, Mario
================================================================== This is the WinPcap users list. It is archived at http://www.mail-archive.com/winpcap-users@winpcap.polito.it/
To unsubscribe use mailto: [EMAIL PROTECTED]
==================================================================