[Winpcap-users] Packet32.h(209) : error C2079: 'IPAddress' usesundefined struct 'sockaddr_storage'

Steven Smethurst funvill at funvill.com
Thu Jun 22 22:44:55 GMT 2006



This did work for me, 



As it turns out I didn’t have the right Windows SDK installed and linked.

The solution is described here 



Thanks for your help 


- Steven Smethurst 



From: winpcap-users-bounces at winpcap.org
[mailto:winpcap-users-bounces at winpcap.org] On Behalf Of Vasily Borovyak
Sent: Wednesday, June 21, 2006 10:09 PM
To: winpcap-users at winpcap.org
Subject: Re: [Winpcap-users] Packet32.h(209) : error C2079: 'IPAddress'
usesundefined struct 'sockaddr_storage'


Hi Steven.

Simply try to include Winsock2.h.
Here is MSDN:


The SOCKADDR_STORAGE structure stores socket address information. Since the
SOCKADDR_STORAGE structure is sufficiently large to store IPv4 or IPv6
address information, or others, its use promotes protocol-family and
protocol-version independence, and simplifies cross-platform development.
Use the SOCKADDR_STORAGE structure in place of the sockaddr structure.

typedef struct sockaddr_storage {
  short ss_family;
  char __ss_pad1[_SS_PAD1SIZE];
  __int64 __ss_align;
  char __ss_pad2[_SS_PAD2SIZE];



Address family of the socket, such as AF_INET. 


Reserved. Defined as a 48-bit pad that ensures SOCKADDR_STORAGE achieves
64-bit alignment. 


Reserved. Used by the compiler to align the structure. 


Reserved. Used by the compiler to align the structure. 


Application developers use only the ss_family member of the
SOCKADDR_STORAGE. The remaining three members ensure the SOCKADDR_STORAGE is
padded appropriately to achieve 64-bit alignment. Such alignment enables
protocol-specific socket address data structures to access fields within a
SOCKADDR_STORAGE structure without alignment problems. With its padding, the
SOCKADDR_STORAGE structure is 128 bytes in length.

The member field of the SOCKADDR_STORAGE structure is isomorphic with the
sockaddr structure to enable simplified transition from sockaddr to

For more information about platform-independent SOCKADDR_STORAGE
implementation recommendations, refer to RFC 2553, available at


Client: Requires Windows XP.
Server: Requires Windows Server 2003.
Header: Declared in Winsock2.h.

Steven Smethurst wrote: 



I am trying to build one of the examples that came with Winpcap version 3.1 



And I am getting the following errors 



c:\dev\sdk\wpdpack\include\packet32.h(209) : error C2079: 'IPAddress' uses
undefined struct 'sockaddr_storage'

c:\dev\sdk\wpdpack\include\packet32.h(210) : error C2079: 'SubnetMask' uses
undefined struct 'sockaddr_storage'

c:\dev\sdk\wpdpack\include\packet32.h(211) : error C2079: 'Broadcast' uses
undefined struct 'sockaddr_storage'



Snippet from c:\dev\sdk\wpdpack\include\packet32.h



  \brief Addresses of a network adapter.


  This structure is used by the PacketGetNetInfoEx() function to return the
IP addresses associated with 

  an adapter.



typedef struct npf_if_addr {

            struct sockaddr_storage IPAddress;        ///< IP address.

            struct sockaddr_storage SubnetMask;     ///< Netmask for that

            struct sockaddr_storage Broadcast;        ///< Broadcast






I am able to build all the \Examples-pcap example with out any problems. 

Any help or suggestions would be greatly appreciated. 



Using WinPcap version 3.1 

With Visual studios 6.0

I have also updated my platformsdk 






Winpcap-users mailing list
Winpcap-users at winpcap.org

Best regards. Vasily Borovyak  <mailto:vbor at isd.dp.ua> <vbor at isd.dp.ua>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20060622/7679c703/attachment-0001.htm

More information about the Winpcap-users mailing list