Your problem is due to some old headers that are distributed with Microsoft
Visual C 6.0.
Please update these headers by installing the Microsoft Platform SDK, or
let's update the compiler to MS Visual Studio 2003.

Cheers,

        fulvio

> -----Original Message-----
> From: Mario Hollibaugh [mailto:
> Sent: venerd́ 25 marzo 2005 23.12
> To: winpcap-users@winpcap.polito.it
> Subject: [WinPcap-users] Undefined Functions and Data Structures in
> Tutorial Code Example2
>
>
> I'm new with WinPcap 3.1 beta4, and only this morning (and only by the
> grace of God I'm sure) did I get programs using the WinPcap library to
> start compiling, linking, and running.  I'm reading through the
> tutorials (for 3.1 beta 4, of course), disecting the code provided line
> by line until I understand it completely before moving on.
>
> 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]
> ==================================================================



================================================================= 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]
=================================================================

Reply via email to