[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


Hello 

 

This did work for me, 

BUT 

 

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

The solution is described here 

http://www.winpcap.org/pipermail/winpcap-users/2006-June/001149.html

 

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:


SOCKADDR_STORAGE


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];
} SOCKADDR_STORAGE, 
*PSOCKADDR_STORAGE;

Members


ss_family 

Address family of the socket, such as AF_INET. 

__ss_pad1 

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

__ss_align 

Reserved. Used by the compiler to align the structure. 

__ss_pad2 

Reserved. Used by the compiler to align the structure. 


Remarks


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
SOCKADDR_STORAGE.

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


Requirements


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



Steven Smethurst wrote: 

Hello 

 

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

\Examples-remote\PacketDriver\GetMacAddress

 

And I am getting the following errors 

Compiling...

GetMacAddress.c

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
address.

            struct sockaddr_storage Broadcast;        ///< Broadcast
address.

}npf_if_addr;

--------------------------------------------------------------------

 

 

 

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 

http://www.microsoft.com/msdownload/platformsdk/sdkupdate

 

 

 





  _____  



 
_______________________________________________
Winpcap-users mailing list
Winpcap-users at winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
  





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