Take advantage of the new unsigned and hex integer types.

This commit is contained in:
Archie Cobbs 2000-08-10 22:45:54 +00:00
parent 8fccb7e954
commit 57b57be3ec
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=64508
10 changed files with 95 additions and 95 deletions

View File

@ -71,14 +71,14 @@ struct ng_async_stat {
/* Keep this in sync with the above structure definition */
#define NG_ASYNC_STATS_TYPE_INFO { \
{ \
{ "syncOctets", &ng_parse_int32_type }, \
{ "syncFrames", &ng_parse_int32_type }, \
{ "syncOverflows", &ng_parse_int32_type }, \
{ "asyncOctets", &ng_parse_int32_type }, \
{ "asyncFrames", &ng_parse_int32_type }, \
{ "asyncRunts", &ng_parse_int32_type }, \
{ "asyncOverflows", &ng_parse_int32_type }, \
{ "asyncBadCheckSums",&ng_parse_int32_type }, \
{ "syncOctets", &ng_parse_uint32_type }, \
{ "syncFrames", &ng_parse_uint32_type }, \
{ "syncOverflows", &ng_parse_uint32_type }, \
{ "asyncOctets", &ng_parse_uint32_type }, \
{ "asyncFrames", &ng_parse_uint32_type }, \
{ "asyncRunts", &ng_parse_uint32_type }, \
{ "asyncOverflows", &ng_parse_uint32_type }, \
{ "asyncBadCheckSums",&ng_parse_uint32_type }, \
{ NULL }, \
} \
}
@ -95,9 +95,9 @@ struct ng_async_cfg {
#define NG_ASYNC_CONFIG_TYPE_INFO { \
{ \
{ "enabled", &ng_parse_int8_type }, \
{ "amru", &ng_parse_int16_type }, \
{ "smru", &ng_parse_int16_type }, \
{ "accm", &ng_parse_int32_type }, \
{ "amru", &ng_parse_uint16_type }, \
{ "smru", &ng_parse_uint16_type }, \
{ "accm", &ng_parse_hint32_type }, \
{ NULL }, \
} \
}

View File

@ -94,10 +94,10 @@ static int ng_bpf_setprog(hook_p hook, const struct ng_bpf_hookprog *hp);
/* Parse type for one struct bfp_insn */
static const struct ng_parse_struct_info ng_bpf_insn_type_info = {
{
{ "code", &ng_parse_int16_type },
{ "jt", &ng_parse_int8_type },
{ "jf", &ng_parse_int8_type },
{ "k", &ng_parse_int32_type },
{ "code", &ng_parse_hint16_type },
{ "jt", &ng_parse_uint8_type },
{ "jf", &ng_parse_uint8_type },
{ "k", &ng_parse_uint32_type },
{ NULL }
}
};

View File

@ -84,12 +84,12 @@ struct ng_bpf_hookstat {
/* Keep this in sync with the above structure definition */
#define NG_BPF_HOOKSTAT_TYPE_INFO { \
{ \
{ "recvFrames", &ng_parse_int64_type }, \
{ "recvOctets", &ng_parse_int64_type }, \
{ "recvMatchFrames", &ng_parse_int64_type }, \
{ "recvMatchOctets", &ng_parse_int64_type }, \
{ "xmitFrames", &ng_parse_int64_type }, \
{ "xmitOctets", &ng_parse_int64_type }, \
{ "recvFrames", &ng_parse_uint64_type }, \
{ "recvOctets", &ng_parse_uint64_type }, \
{ "recvMatchFrames", &ng_parse_uint64_type }, \
{ "recvMatchOctets", &ng_parse_uint64_type }, \
{ "xmitFrames", &ng_parse_uint64_type }, \
{ "xmitOctets", &ng_parse_uint64_type }, \
{ NULL }, \
} \
}

View File

@ -84,8 +84,8 @@ struct ng_cisco_stats {
/* Keep this in sync with the above structure definition */
#define NG_CISCO_STATS_TYPE_INFO { \
{ \
{ "seqRetries", &ng_parse_int32_type }, \
{ "keepAlivePeriod", &ng_parse_int32_type }, \
{ "seqRetries", &ng_parse_uint32_type }, \
{ "keepAlivePeriod", &ng_parse_uint32_type }, \
{ NULL }, \
} \
}

View File

@ -105,9 +105,9 @@ static ng_disconnect_t ng_ether_disconnect;
static int ng_ether_mod_event(module_t mod, int event, void *data);
/* Parse type for an Ethernet address. Slightly better than an array of
six int8's would be the more common colon-separated hex byte format. */
six hint8's would be the more common colon-separated hex byte format. */
static const struct ng_parse_fixedarray_info ng_ether_enaddr_type_info = {
&ng_parse_int8_type,
&ng_parse_hint8_type,
ETHER_ADDR_LEN
};
static const struct ng_parse_type ng_ether_enaddr_type = {

View File

@ -161,8 +161,8 @@ static const struct ng_parse_type ng_ksocket_generic_sockdata_type = {
/* Type for a generic struct sockaddr */
static const struct ng_parse_struct_info ng_parse_generic_sockaddr_type_info = {
{
{ "len", &ng_parse_int8_type },
{ "family", &ng_parse_int8_type },
{ "len", &ng_parse_uint8_type },
{ "family", &ng_parse_uint8_type },
{ "data", &ng_ksocket_generic_sockdata_type },
{ NULL }
}

View File

@ -69,13 +69,13 @@ struct ng_mesg {
/* Keep this in sync with the above structure definition */
#define NG_GENERIC_NG_MESG_INFO(dtype) { \
{ \
{ "version", &ng_parse_int8_type }, \
{ "spare", &ng_parse_int8_type }, \
{ "arglen", &ng_parse_int16_type }, \
{ "flags", &ng_parse_int32_type }, \
{ "token", &ng_parse_int32_type }, \
{ "typecookie", &ng_parse_int32_type }, \
{ "cmd", &ng_parse_int32_type }, \
{ "version", &ng_parse_uint8_type }, \
{ "spare", &ng_parse_uint8_type }, \
{ "arglen", &ng_parse_uint16_type }, \
{ "flags", &ng_parse_hint32_type }, \
{ "token", &ng_parse_uint32_type }, \
{ "typecookie", &ng_parse_uint32_type }, \
{ "cmd", &ng_parse_uint32_type }, \
{ "cmdstr", &ng_parse_cmdbuf_type }, \
{ "data", (dtype) }, \
{ NULL }, \
@ -190,8 +190,8 @@ struct nodeinfo {
{ \
{ "name", &ng_parse_nodebuf_type }, \
{ "type", &ng_parse_typebuf_type }, \
{ "id", &ng_parse_int32_type }, \
{ "hooks", &ng_parse_int32_type }, \
{ "id", &ng_parse_hint32_type }, \
{ "hooks", &ng_parse_uint32_type }, \
{ NULL }, \
} \
}
@ -236,7 +236,7 @@ struct namelist {
/* Keep this in sync with the above structure definition */
#define NG_GENERIC_LISTNODES_INFO(niarraytype) { \
{ \
{ "numnames", &ng_parse_int32_type }, \
{ "numnames", &ng_parse_uint32_type }, \
{ "nodeinfo", (niarraytype) }, \
{ NULL }, \
} \
@ -252,7 +252,7 @@ struct typeinfo {
#define NG_GENERIC_TYPEINFO_INFO() { \
{ \
{ "typename", &ng_parse_typebuf_type }, \
{ "typeinfo", &ng_parse_int32_type }, \
{ "numnodes", &ng_parse_uint32_type }, \
{ NULL }, \
} \
}
@ -265,7 +265,7 @@ struct typelist {
/* Keep this in sync with the above structure definition */
#define NG_GENERIC_TYPELIST_INFO(tiarraytype) { \
{ \
{ "numtypes", &ng_parse_int32_type }, \
{ "numtypes", &ng_parse_uint32_type }, \
{ "typeinfo", (tiarraytype) }, \
{ NULL }, \
} \

View File

@ -96,12 +96,12 @@ struct ng_ppp_link_conf {
/* Keep this in sync with the above structure definition */
#define NG_PPP_LINK_TYPE_INFO { \
{ \
{ "enableLink", &ng_parse_int8_type }, \
{ "enableProtoComp", &ng_parse_int8_type }, \
{ "enableACFComp", &ng_parse_int8_type }, \
{ "mru", &ng_parse_int16_type }, \
{ "latency", &ng_parse_int32_type }, \
{ "bandwidth", &ng_parse_int32_type }, \
{ "enableLink", &ng_parse_uint8_type }, \
{ "enableProtoComp", &ng_parse_uint8_type }, \
{ "enableACFComp", &ng_parse_uint8_type }, \
{ "mru", &ng_parse_uint16_type }, \
{ "latency", &ng_parse_uint32_type }, \
{ "bandwidth", &ng_parse_uint32_type }, \
{ NULL }, \
} \
}
@ -128,21 +128,21 @@ struct ng_ppp_bund_conf {
/* Keep this in sync with the above structure definition */
#define NG_PPP_BUND_TYPE_INFO { \
{ \
{ "mrru", &ng_parse_int16_type }, \
{ "enableMultilink", &ng_parse_int8_type }, \
{ "recvShortSeq", &ng_parse_int8_type }, \
{ "xmitShortSeq", &ng_parse_int8_type }, \
{ "enableRoundRobin", &ng_parse_int8_type }, \
{ "enableIP", &ng_parse_int8_type }, \
{ "enableIPv6", &ng_parse_int8_type }, \
{ "enableAtalk", &ng_parse_int8_type }, \
{ "enableIPX", &ng_parse_int8_type }, \
{ "enableCompression", &ng_parse_int8_type }, \
{ "enableDecompression", &ng_parse_int8_type }, \
{ "enableEncryption", &ng_parse_int8_type }, \
{ "enableDecryption", &ng_parse_int8_type }, \
{ "enableVJCompression", &ng_parse_int8_type }, \
{ "enableVJDecompression", &ng_parse_int8_type }, \
{ "mrru", &ng_parse_uint16_type }, \
{ "enableMultilink", &ng_parse_uint8_type }, \
{ "recvShortSeq", &ng_parse_uint8_type }, \
{ "xmitShortSeq", &ng_parse_uint8_type }, \
{ "enableRoundRobin", &ng_parse_uint8_type }, \
{ "enableIP", &ng_parse_uint8_type }, \
{ "enableIPv6", &ng_parse_uint8_type }, \
{ "enableAtalk", &ng_parse_uint8_type }, \
{ "enableIPX", &ng_parse_uint8_type }, \
{ "enableCompression", &ng_parse_uint8_type }, \
{ "enableDecompression", &ng_parse_uint8_type }, \
{ "enableEncryption", &ng_parse_uint8_type }, \
{ "enableDecryption", &ng_parse_uint8_type }, \
{ "enableVJCompression", &ng_parse_uint8_type }, \
{ "enableVJDecompression", &ng_parse_uint8_type }, \
{ NULL } \
} \
}
@ -177,14 +177,14 @@ struct ng_ppp_link_stat {
/* Keep this in sync with the above structure definition */
#define NG_PPP_STATS_TYPE_INFO { \
{ \
{ "xmitFrames", &ng_parse_int32_type }, \
{ "xmitOctets", &ng_parse_int32_type }, \
{ "recvFrames", &ng_parse_int32_type }, \
{ "recvOctets", &ng_parse_int32_type }, \
{ "badProtos", &ng_parse_int32_type }, \
{ "runts", &ng_parse_int32_type }, \
{ "dupFragments", &ng_parse_int32_type }, \
{ "dropFragments", &ng_parse_int32_type }, \
{ "xmitFrames", &ng_parse_uint32_type }, \
{ "xmitOctets", &ng_parse_uint32_type }, \
{ "recvFrames", &ng_parse_uint32_type }, \
{ "recvOctets", &ng_parse_uint32_type }, \
{ "badProtos", &ng_parse_uint32_type }, \
{ "runts", &ng_parse_uint32_type }, \
{ "dupFragments", &ng_parse_uint32_type }, \
{ "dropFragments", &ng_parse_uint32_type }, \
{ NULL } \
} \
}

View File

@ -66,13 +66,13 @@ struct ng_pptpgre_conf {
/* Keep this in sync with the above structure definition */
#define NG_PPTPGRE_CONF_TYPE_INFO { \
{ \
{ "enabled", &ng_parse_int8_type }, \
{ "enableDelayedAck", &ng_parse_int8_type }, \
{ "enableAlwaysAck", &ng_parse_int8_type }, \
{ "cid", &ng_parse_int16_type }, \
{ "peerCid", &ng_parse_int16_type }, \
{ "recvWin", &ng_parse_int16_type }, \
{ "peerPpd", &ng_parse_int16_type }, \
{ "enabled", &ng_parse_uint8_type }, \
{ "enableDelayedAck", &ng_parse_uint8_type }, \
{ "enableAlwaysAck", &ng_parse_uint8_type }, \
{ "cid", &ng_parse_hint16_type }, \
{ "peerCid", &ng_parse_hint16_type }, \
{ "recvWin", &ng_parse_uint16_type }, \
{ "peerPpd", &ng_parse_uint16_type }, \
{ NULL }, \
} \
}
@ -100,22 +100,22 @@ struct ng_pptpgre_stats {
/* Keep this in sync with the above structure definition */
#define NG_PPTPGRE_STATS_TYPE_INFO { \
{ \
{ "xmitPackets", &ng_parse_int32_type }, \
{ "xmitOctets", &ng_parse_int32_type }, \
{ "xmitLoneAcks", &ng_parse_int32_type }, \
{ "xmitDrops", &ng_parse_int32_type }, \
{ "xmitTooBig", &ng_parse_int32_type }, \
{ "recvPackets", &ng_parse_int32_type }, \
{ "recvOctets", &ng_parse_int32_type }, \
{ "recvRunts", &ng_parse_int32_type }, \
{ "recvBadGRE", &ng_parse_int32_type }, \
{ "recvBadAcks", &ng_parse_int32_type }, \
{ "recvBadCID", &ng_parse_int32_type }, \
{ "recvOutOfOrder", &ng_parse_int32_type }, \
{ "recvDuplicates", &ng_parse_int32_type }, \
{ "recvLoneAcks", &ng_parse_int32_type }, \
{ "recvAckTimeouts", &ng_parse_int32_type }, \
{ "memoryFailures", &ng_parse_int32_type }, \
{ "xmitPackets", &ng_parse_uint32_type }, \
{ "xmitOctets", &ng_parse_uint32_type }, \
{ "xmitLoneAcks", &ng_parse_uint32_type }, \
{ "xmitDrops", &ng_parse_uint32_type }, \
{ "xmitTooBig", &ng_parse_uint32_type }, \
{ "recvPackets", &ng_parse_uint32_type }, \
{ "recvOctets", &ng_parse_uint32_type }, \
{ "recvRunts", &ng_parse_uint32_type }, \
{ "recvBadGRE", &ng_parse_uint32_type }, \
{ "recvBadAcks", &ng_parse_uint32_type }, \
{ "recvBadCID", &ng_parse_uint32_type }, \
{ "recvOutOfOrder", &ng_parse_uint32_type }, \
{ "recvDuplicates", &ng_parse_uint32_type }, \
{ "recvLoneAcks", &ng_parse_uint32_type }, \
{ "recvAckTimeouts", &ng_parse_uint32_type }, \
{ "memoryFailures", &ng_parse_uint32_type }, \
{ NULL } \
} \
}

View File

@ -68,8 +68,8 @@ enum {
/* This structure is returned by the NGM_XXX_GET_STATUS command */
struct ngxxxstat {
u_int packets_in; /* packets in from downstream */
u_int packets_out; /* packets out towards downstream */
u_int32_t packets_in; /* packets in from downstream */
u_int32_t packets_out; /* packets out towards downstream */
};
/*
@ -81,8 +81,8 @@ struct ngxxxstat {
*/
#define NG_XXX_STATS_TYPE_INFO { \
{ \
{ "packets_in", &ng_parse_int32_type }, \
{ "packets_out", &ng_parse_int32_type }, \
{ "packets_in", &ng_parse_uint32_type }, \
{ "packets_out", &ng_parse_uint32_type }, \
{ NULL }, \
} \
}