Ethereal-dev: RE: [Ethereal-dev] Re: Subject: [Ethereal-users] Undefined struct 'sockaddr_stor

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

Date: Mon, 15 Aug 2005 11:08:18 -0700
Title: RE: [Ethereal-dev] Re: Subject: [Ethereal-users] Undefined struct'sockaddr_storage' compiling under Win32

I worked around this by adding the following code to packet32.h.  I added it just above where sockaddr_storage is used - approx line 204.

It compiles under Visual Studio 6.0.

/* until my next comment, copied from winsock2.h  D.Kaatz */
/*
 * Portable socket structure (RFC 2553).
 */

/*
 * Desired design of maximum size and alignment.
 * These are implementation specific.
 */
#define _SS_MAXSIZE 128                  // Maximum size.
#define _SS_ALIGNSIZE (sizeof(__int64))  // Desired alignment.

/*
 * Definitions used for sockaddr_storage structure paddings design.
 */
#define _SS_PAD1SIZE (_SS_ALIGNSIZE - sizeof (short))
#define _SS_PAD2SIZE (_SS_MAXSIZE - (sizeof (short) + _SS_PAD1SIZE \
                                                    + _SS_ALIGNSIZE))

struct sockaddr_storage {
    short ss_family;               /* Address family.                          */
    char __ss_pad1[_SS_PAD1SIZE];  /* 6 byte pad, this is to make              */
                                   /* implementation specific pad up to        */
                                   /* alignment field that follows explicit    */
                                   /* in the data structure.                   */
    __int64 __ss_align;            /* Field to force desired structure.        */
    char __ss_pad2[_SS_PAD2SIZE];  /* 112 byte pad to achieve desired size;    */
                                   /* _SS_MAXSIZE value minus size of          */
                                   /* ss_family, __ss_pad1, and                */
                                   /* __ss_align fields is 112.                */
};
/* end of added code D.Kaatz */


Dave

-----Original Message-----
From: ethereal-dev-bounces@xxxxxxxxxxxx [mailto:ethereal-dev-bounces@xxxxxxxxxxxx] On Behalf Of Ulf Lamping
Sent: Monday, August 15, 2005 10:46 AM
To: rcarlson@xxxxxxxxxx; Ethereal development
Subject: Re: [Ethereal-dev] Re: Subject: [Ethereal-users] Undefined struct'sockaddr_storage' compiling under Win32

Ross Carlson wrote:

>Is there any thought as to how to resolve this on platforms that do not
>have the VS.NET with Platform SDK?

>
See: http://bugs.ethereal.com/bugzilla/show_bug.cgi?id=340

Regards, ULFL

_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev
"This message is intended only for the named recipient. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited."