I was working on SupportNet when I realized I needed a function to tell me whether a string buffer contained a syntactically valid IPv4 *OR* IPv6 address. First thought was some string checking, but there are a *lot* of valid ways to write IP addresses, so that went out the door. I remembered discussing this with Mike W and we’d decided that using the inet_pton & inet_ntop functions were probably the way to go.
No problem. Except…I can’t find them. MSDN online has documentation for them, but the local installation doesn’t. Worse, as it turns out, I have the Windows Device Driver Kit (SDK) installed, because it had an import library for some obscure RTL functions I’d tried, and I never removed it. Bad idea, because there seem to be some overlapping definitions (macros). I uninstalled it and *those* problems went away, but I still couldn’t seem to get VS to find the inet_* functions.
Net-net: CygNet is built to run on Windows XP and later, but IPv6 isn’t supported very well there, so we’ve agreed to say “IPv6 is for Vista and later”. After dealing with the “ideal” location for the winsock2 includes, and the Windows version updates, I’ve updated CygNetStdAfx.net as follows, and this seems to work.
I also ended up having to delete every NCB (Intellisense database) in the CygnetSource tree in order to get the inet_* functions (and other new winsock2 functions) to appear in auto-completion lists. Very annoying.
//NOTE: IPv6 – trying to support v6 on XP would be a nightmare, and futile, and a PITA, and other bad things, so I’m going to require Vista or better. -Lynne
//#define WINVER 0x0501 // Windows XP+
//#define _WIN32_WINNT 0x0501 // Windows XP+
//#define _WIN32_WINDOWS 0x0501 // Windows XP+
#define WINVER NTDDI_VISTA // Vista = 0x0600
#define _WIN32_WINNT WINVER // Vista
#define _WIN32_WINDOWS WINVER
#define _WIN32_IE 0x0600 // IE 6.0+