This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Doc on error messages
- To: Puneet Singhal <puneet at opussoft dot com>
- Subject: Re: Doc on error messages
- From: Thomas Garsiot <garsiot at st2e dot com>
- Date: Mon, 26 Feb 2001 18:44:38 +0100
- CC: gcc-help at gcc dot gnu dot org
- References: <NEBBJEIPELDNPPCBOLOPIEIPCCAA.puneet@opussoft.com>
Here are the details of the code you requested :
actually this is some code extracted from UCD-SNMP :
struct sockaddr_in *pduIp;
struct snmp_pdu *template_pdu;
pduIp = (struct sockaddr_in *)&(template_pdu->agent_addr);
pduIp->sin_family = AF_INET;
----------------------------------
type definitions :
#define _UCD_SS_MAXSIZE 92 /* <= sizeof( sockaddr_un ) */
#define _UCD_SS_ALIGNSIZE (sizeof (long))
#define _UCD_SS_PAD1SIZE (_UCD_SS_ALIGNSIZE - sizeof( unsigned short ))
#define _UCD_SS_PAD2SIZE (_UCD_SS_MAXSIZE - \
(sizeof( unsigned short ) + _UCD_SS_PAD1SIZE + _UCD_SS_ALIGNSIZE ))
typedef struct {
unsigned char sa_len;
unsigned char sa_family;
char sa_data[ _UCD_SS_PAD1SIZE ];
long sa_align;
char sa_pad2[ _UCD_SS_PAD2SIZE ];
} snmp_ipaddr;
struct snmp_pdu {
[...]
snmp_ipaddr agent_addr;
[...]
};
-----------------
/*
* Socket address, internet style.
*/
struct sockaddr_in {
u_char sin_len;
u_char sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
struct in_addr {
u_long s_addr;
};
I tried to include only the useful part. Sorry if it's a little messy.
Thanks in advance for your help.
Cheers,
Thomas