Discussion:
[Winpcap-users] Packet32.h(209) : error C2079: 'IPAddress' uses undefined struct 'sockaddr_storage'
Steven Smethurst
2006-06-21 23:49:10 UTC
Permalink
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
Vasily Borovyak
2006-06-22 05:08:43 UTC
Permalink
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* <sockaddr_2.htm> 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* <sockaddr_2.htm> 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 <http://www.ietf.org>.


Requirements

*Client: *Requires Windows XP.
*Server: *Requires Windows Server 2003.
*Header: *Declared in _*Winsock2.h*_.
Post by Steven Smethurst
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
https://www.winpcap.org/mailman/listinfo/winpcap-users
--
Best regards. Vasily Borovyak <***@isd.dp.ua>
Gianluca Varenni
2006-06-22 06:36:19 UTC
Permalink
Steven,

you probably installed the wrong version of the Platform SDK: the latest versions of the PSDK are *not* compatible with Visual Studio. A version of the Microsoft Platform Software Development Kit (SDK) that is compatible with Visual Studio 6 (Platform SDK February 2003) is available on the Microsoft web site at http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm. It can be ordered online at http://www.qmedia.ca/launch/psdk.htm, and it's also available to Microsoft MSDN subscribers on the Subscribers Downloads web site.

NOTE: after installing it, you should register it within visual studio, go to start->AllPrograms->Microsoft Platform sDK Feb2003->Visual Studio registration->register PSDK directories within visual studio.

Have a nice day
GV


----- Original Message -----
From: Steven Smethurst
To: winpcap-***@winpcap.org
Sent: Wednesday, June 21, 2006 4:49 PM
Subject: [Winpcap-users] Packet32.h(209) : error C2079: 'IPAddress' usesundefined struct 'sockaddr_storage'


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
Steven Smethurst
2006-06-22 22:44:55 UTC
Permalink
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-***@winpcap.org
[mailto:winpcap-users-***@winpcap.org] On Behalf Of Vasily Borovyak
Sent: Wednesday, June 21, 2006 10:09 PM
To: winpcap-***@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-***@winpcap.org
https://www.winpcap.org/mailman/listinfo/winpcap-users
--
Best regards. Vasily Borovyak <mailto:***@isd.dp.ua> <***@isd.dp.ua>
Steven Smethurst
2006-06-22 22:46:18 UTC
Permalink
Hello



Thank you,

This solved my problem

I guess I downloaded an improper version of the windows SDK.



Thanks again for your help.



- Steven Smethurst



_____

From: winpcap-users-***@winpcap.org
[mailto:winpcap-users-***@winpcap.org] On Behalf Of Gianluca Varenni
Sent: Wednesday, June 21, 2006 11:36 PM
To: winpcap-***@winpcap.org
Subject: Re: [Winpcap-users] Packet32.h(209) : error C2079:
'IPAddress'usesundefined struct 'sockaddr_storage'



Steven,



you probably installed the wrong version of the Platform SDK: the latest
versions of the PSDK are *not* compatible with Visual Studio. A version of
the Microsoft Platform Software Development Kit (SDK) that is compatible
with Visual Studio 6 (Platform SDK February 2003) is available on the
Microsoft web site at
<http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm>
http://www.microsoft.com/msdownload/platformsdk/sdkupdate/psdk-full.htm. It
can be ordered online at <http://www.qmedia.ca/launch/psdk.htm>
http://www.qmedia.ca/launch/psdk.htm, and it's also available to Microsoft
MSDN subscribers on the Subscribers Downloads web site.



NOTE: after installing it, you should register it within visual studio, go
to start->AllPrograms->Microsoft Platform sDK Feb2003->Visual Studio
registration->register PSDK directories within visual studio.



Have a nice day

GV




----- Original Message -----

From: Steven Smethurst <mailto:***@funvill.com>

To: winpcap-***@winpcap.org

Sent: Wednesday, June 21, 2006 4:49 PM

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



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






_____

Loading...