[Winpcap-users] Re: [Ethereal-dev] Re: Subject: [Ethereal-users] Undefined struct 'sockaddr_storage' compiling under Win32

Loris Degioanni loris.degioanni at gmail.com
Wed Aug 10 08:28:44 GMT 2005

the dependence on the platform SDK has been introduced, if I remember 
well, in the first alpha of 3.1, when we added the ability to return 
IPv6 addresses for the datected adapters.
The PacketGetNetInfoEx() function of packet.dll returns these addresses 
to the calling application in an application-allocated array of struct 
sockaddr_storage, and therefore the application needs the definition of 
that structure.
If I remember well, wpcap has a different approach: it provides storage 
for addresses in the list created by pcap_findalldevs, therefore the 
application can use a normal struct sockaddr and ignore the address if 
it doesn't understand IPv6. This is the reason, I think, why we don't 
document the dependence on the platform SDK in the developer's pack: 
wpcap-based apps *should* not be dependent on the platform SDK (I may be 
wrong, I didn't try without it recently), and the developer's pack *is* 
for wpcap-based apps.

The platform SDK is freely available on the internet (just google 
"platform SDK"), and in a general way it's suggested when developing 
networking applications for Windows.
BUT, since last version, MS decided to make it incompatible with Visual 
Studio 6, and therefore you are forced to have VS.NET or better to for 
the definition of struct sockaddr_storage.
Or define it on your own somewhere.


Ulf Lamping wrote:
> Hi Ross!
> I've found some time to install the WpdPack_3_1.zip and ran into the same problem than you.
> The problem is: the file Packet32.h shipped with WpdPack's version 3.1 is now using "struct sockaddr_storage" which is not part of the Win32 API but part of the Windows "Platform SDK", which is not part of MSVC (and must be installed). The platform SDK contains more recent implementations, like this struct which is used for IP V6 addressing.
> See: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/sockaddr_storage_2.asp for details of this struct.
> So the solution for now: install the Platform SDK (didn't tried myself) or use the WpdPack 3.0 for now.
> I've CC this to the WinPcap developer list if they are aware of this and what they suggest to do about it.
> At least, I didn't found any hints that the Platform SDK is required if you want to use Packet32.h in their documentation ...
> The SDK is only mentioned to compile the WinPcap drivers itself: http://www.winpcap.org/docs/docs31/html/group__compilation.html
> Regards, ULFL
> ______________________________________________________________
> Verschicken Sie romantische, coole und witzige Bilder per SMS!
> Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev at ethereal.com
> http://www.ethereal.com/mailman/listinfo/ethereal-dev

More information about the Winpcap-users mailing list