This question is related specifically to the WinPcap library v 3.1 beta 4. I'm using VC++ 6.0 on a WinXP machine.

I'm trying to compile a small amount of code containing the following function (this code is taken from the WinPcap library v 3.1 beta 4 tutorial, lesson #2, and can be found in its entirity at You will see in large print "Modules", and 8 lines underneath it will be a link called "Obtaining advanced information about installed drivers". Clicking it will bring up the entire code I am trying to compile).

char* ip6tos(struct sockaddr *sockaddr, char *address, int addrlen)
    socklen_t sockaddrlen;

    #ifdef WIN32
    sockaddrlen = sizeof(struct sockaddr_in6);
    sockaddrlen = sizeof(struct sockaddr_storage);

        NI_NUMERICHOST) != 0) address = NULL;

    return address;
When I try to compile the program, I am getting "undeclared identifier" errors for "socklen_t", and subsequently for the variable of that type "sockaddrlen". The function contained in the if statement's condition, getnameinfo(), is also being flagged as an undeclared identifier, and it's last parameter "NI_NUMERICHOST" is as well.

From the above listed link you can find all the documentation on this library. I dug through it looking for ANY mention of the items for which I am getting "undeclared identifier" errors, and can find none. I searched MSDN for them, and also came up with zilch.

I know I can simply skip this section of the tutorial, but really... what true programmer at heart will skip something because they can't figure it out?

Does anyone have any clue where those datatypes and that function might be defined? I realize this is a very specific question, so thank you for even reading this post, and thank you for any help you may be able to provide.