Fix GCC warnings caused by initializing a zero length array. In the process,
simply things a bit by getting rid of 'struct ng_parse_struct_info' which was useless because it only contained one field. MFC after: 2 weeks
This commit is contained in:
parent
cbcfdbcfe6
commit
f0184ff8e3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97685
@ -105,19 +105,19 @@ static int nga_rcv_sync(const sc_p sc, item_p item);
|
||||
static int nga_rcv_async(const sc_p sc, item_p item);
|
||||
|
||||
/* Parse type for struct ng_async_cfg */
|
||||
static const struct ng_parse_struct_info
|
||||
nga_config_type_info = NG_ASYNC_CONFIG_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field nga_config_type_fields[]
|
||||
= NG_ASYNC_CONFIG_TYPE_INFO;
|
||||
static const struct ng_parse_type nga_config_type = {
|
||||
&ng_parse_struct_type,
|
||||
&nga_config_type_info
|
||||
&nga_config_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_async_stat */
|
||||
static const struct ng_parse_struct_info
|
||||
nga_stats_type_info = NG_ASYNC_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field nga_stats_type_fields[]
|
||||
= NG_ASYNC_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type nga_stats_type = {
|
||||
&ng_parse_struct_type,
|
||||
&nga_stats_type_info,
|
||||
&nga_stats_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -70,7 +70,6 @@ struct ng_async_stat {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_ASYNC_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "syncOctets", &ng_parse_uint32_type }, \
|
||||
{ "syncFrames", &ng_parse_uint32_type }, \
|
||||
{ "syncOverflows", &ng_parse_uint32_type }, \
|
||||
@ -79,8 +78,7 @@ struct ng_async_stat {
|
||||
{ "asyncRunts", &ng_parse_uint32_type }, \
|
||||
{ "asyncOverflows", &ng_parse_uint32_type }, \
|
||||
{ "asyncBadCheckSums",&ng_parse_uint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Configuration for this node */
|
||||
@ -93,13 +91,11 @@ struct ng_async_cfg {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_ASYNC_CONFIG_TYPE_INFO { \
|
||||
{ \
|
||||
{ "enabled", &ng_parse_int8_type }, \
|
||||
{ "amru", &ng_parse_uint16_type }, \
|
||||
{ "smru", &ng_parse_uint16_type }, \
|
||||
{ "accm", &ng_parse_hint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Commands */
|
||||
|
@ -355,11 +355,11 @@ static ng_ID_t nextID = 1;
|
||||
|
||||
/* Handy structure parse type defining macro */
|
||||
#define DEFINE_PARSE_STRUCT_TYPE(lo, up, args) \
|
||||
static const struct ng_parse_struct_info \
|
||||
ng_ ## lo ## _type_info = NG_GENERIC_ ## up ## _INFO args; \
|
||||
static const struct ng_parse_struct_field \
|
||||
ng_ ## lo ## _type_fields[] = NG_GENERIC_ ## up ## _INFO args; \
|
||||
static const struct ng_parse_type ng_generic_ ## lo ## _type = { \
|
||||
&ng_parse_struct_type, \
|
||||
&ng_ ## lo ## _type_info \
|
||||
&ng_ ## lo ## _type_fields \
|
||||
}
|
||||
|
||||
DEFINE_PARSE_STRUCT_TYPE(mkpeer, MKPEER, ());
|
||||
|
@ -98,18 +98,16 @@ static ng_disconnect_t ng_bpf_disconnect;
|
||||
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 = {
|
||||
{
|
||||
static const struct ng_parse_struct_field ng_bpf_insn_type_fields[] = {
|
||||
{ "code", &ng_parse_hint16_type },
|
||||
{ "jt", &ng_parse_uint8_type },
|
||||
{ "jf", &ng_parse_uint8_type },
|
||||
{ "k", &ng_parse_uint32_type },
|
||||
{ NULL }
|
||||
}
|
||||
};
|
||||
static const struct ng_parse_type ng_bpf_insn_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_bpf_insn_type_info
|
||||
&ng_bpf_insn_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for the field 'bpf_prog' in struct ng_bpf_hookprog */
|
||||
@ -135,19 +133,19 @@ static const struct ng_parse_type ng_bpf_hookprogary_type = {
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_bpf_hookprog */
|
||||
static const struct ng_parse_struct_info ng_bpf_hookprog_type_info
|
||||
static const struct ng_parse_struct_field ng_bpf_hookprog_type_fields[]
|
||||
= NG_BPF_HOOKPROG_TYPE_INFO(&ng_bpf_hookprogary_type);
|
||||
static const struct ng_parse_type ng_bpf_hookprog_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_bpf_hookprog_type_info
|
||||
&ng_bpf_hookprog_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_bpf_hookstat */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_bpf_hookstat_type_info = NG_BPF_HOOKSTAT_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_bpf_hookstat_type_fields[]
|
||||
= NG_BPF_HOOKSTAT_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_bpf_hookstat_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_bpf_hookstat_type_info
|
||||
&ng_bpf_hookstat_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -61,14 +61,12 @@ struct ng_bpf_hookprog {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_BPF_HOOKPROG_TYPE_INFO(bptype) { \
|
||||
{ \
|
||||
{ "thisHook", &ng_parse_hookbuf_type }, \
|
||||
{ "ifMatch", &ng_parse_hookbuf_type }, \
|
||||
{ "ifNotMatch", &ng_parse_hookbuf_type }, \
|
||||
{ "bpf_prog_len", &ng_parse_int32_type }, \
|
||||
{ "bpf_prog", (bptype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Statistics structure for one hook */
|
||||
@ -83,15 +81,13 @@ struct ng_bpf_hookstat {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_BPF_HOOKSTAT_TYPE_INFO { \
|
||||
{ \
|
||||
{ "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 }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Netgraph commands */
|
||||
|
@ -171,11 +171,11 @@ ng_bridge_getTableLength(const struct ng_parse_type *type,
|
||||
}
|
||||
|
||||
/* Parse type for struct ng_bridge_host_ary */
|
||||
static const struct ng_parse_struct_info ng_bridge_host_type_info
|
||||
static const struct ng_parse_struct_field ng_bridge_host_type_fields[]
|
||||
= NG_BRIDGE_HOST_TYPE_INFO(&ng_ether_enaddr_type);
|
||||
static const struct ng_parse_type ng_bridge_host_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_bridge_host_type_info
|
||||
&ng_bridge_host_type_fields
|
||||
};
|
||||
static const struct ng_parse_array_info ng_bridge_hary_type_info = {
|
||||
&ng_bridge_host_type,
|
||||
@ -185,11 +185,11 @@ static const struct ng_parse_type ng_bridge_hary_type = {
|
||||
&ng_parse_array_type,
|
||||
&ng_bridge_hary_type_info
|
||||
};
|
||||
static const struct ng_parse_struct_info ng_bridge_host_ary_type_info
|
||||
static const struct ng_parse_struct_field ng_bridge_host_ary_type_fields[]
|
||||
= NG_BRIDGE_HOST_ARY_TYPE_INFO(&ng_bridge_hary_type);
|
||||
static const struct ng_parse_type ng_bridge_host_ary_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_bridge_host_ary_type_info
|
||||
&ng_bridge_host_ary_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_bridge_config */
|
||||
@ -201,19 +201,19 @@ static const struct ng_parse_type ng_bridge_ipfwary_type = {
|
||||
&ng_parse_fixedarray_type,
|
||||
&ng_bridge_ipfwary_type_info
|
||||
};
|
||||
static const struct ng_parse_struct_info ng_bridge_config_type_info
|
||||
static const struct ng_parse_struct_field ng_bridge_config_type_fields[]
|
||||
= NG_BRIDGE_CONFIG_TYPE_INFO(&ng_bridge_ipfwary_type);
|
||||
static const struct ng_parse_type ng_bridge_config_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_bridge_config_type_info
|
||||
&ng_bridge_config_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_bridge_link_stat */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_bridge_stats_type_info = NG_BRIDGE_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_bridge_stats_type_fields[]
|
||||
= NG_BRIDGE_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_bridge_stats_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_bridge_stats_type_info
|
||||
&ng_bridge_stats_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -64,14 +64,12 @@ struct ng_bridge_config {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_BRIDGE_CONFIG_TYPE_INFO(ainfo) { \
|
||||
{ \
|
||||
{ "ipfw", (ainfo) }, \
|
||||
{ "debugLevel", &ng_parse_uint8_type }, \
|
||||
{ "loopTimeout", &ng_parse_uint32_type }, \
|
||||
{ "maxStaleness", &ng_parse_uint32_type }, \
|
||||
{ "minStableAge", &ng_parse_uint32_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Statistics structure (one for each link) */
|
||||
@ -94,7 +92,6 @@ struct ng_bridge_link_stats {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_BRIDGE_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "recvOctets", &ng_parse_uint64_type }, \
|
||||
{ "recvPackets", &ng_parse_uint64_type }, \
|
||||
{ "recvMulticast", &ng_parse_uint64_type }, \
|
||||
@ -110,7 +107,6 @@ struct ng_bridge_link_stats {
|
||||
{ "loopDetects", &ng_parse_uint64_type }, \
|
||||
{ "memoryFailures", &ng_parse_uint64_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Structure describing a single host */
|
||||
@ -123,13 +119,11 @@ struct ng_bridge_host {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_BRIDGE_HOST_TYPE_INFO(entype) { \
|
||||
{ \
|
||||
{ "addr", (entype) }, \
|
||||
{ "linkNum", &ng_parse_uint16_type }, \
|
||||
{ "age", &ng_parse_uint16_type }, \
|
||||
{ "staleness", &ng_parse_uint16_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Structure returned by NGM_BRIDGE_GET_TABLE */
|
||||
@ -140,11 +134,9 @@ struct ng_bridge_host_ary {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_BRIDGE_HOST_ARY_TYPE_INFO(harytype) { \
|
||||
{ \
|
||||
{ "numHosts", &ng_parse_uint32_type }, \
|
||||
{ "hosts", (harytype) }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Netgraph control messages */
|
||||
|
@ -128,19 +128,19 @@ static void cisco_keepalive(void *arg);
|
||||
static int cisco_send(sc_p sc, int type, long par1, long par2);
|
||||
|
||||
/* Parse type for struct ng_cisco_ipaddr */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_cisco_ipaddr_type_info = NG_CISCO_IPADDR_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_cisco_ipaddr_type_fields[]
|
||||
= NG_CISCO_IPADDR_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_cisco_ipaddr_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_cisco_ipaddr_type_info
|
||||
&ng_cisco_ipaddr_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_async_stat */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_cisco_stats_type_info = NG_CISCO_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_cisco_stats_type_fields[]
|
||||
= NG_CISCO_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_cisco_stats_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_cisco_stats_type_info,
|
||||
&ng_cisco_stats_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -69,11 +69,9 @@ struct ng_cisco_ipaddr {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_CISCO_IPADDR_TYPE_INFO { \
|
||||
{ \
|
||||
{ "ipaddr", &ng_parse_ipaddr_type }, \
|
||||
{ "netmask", &ng_parse_ipaddr_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
struct ng_cisco_stats {
|
||||
@ -83,11 +81,9 @@ struct ng_cisco_stats {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_CISCO_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "seqRetries", &ng_parse_uint32_type }, \
|
||||
{ "keepAlivePeriod", &ng_parse_uint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
#endif /* _NETGRAPH_CISCO_H_ */
|
||||
|
@ -57,6 +57,8 @@
|
||||
#include <net/ethernet.h>
|
||||
#include <net/if_arp.h>
|
||||
|
||||
static const struct ng_parse_struct_field ng_eiface_par_fields[]
|
||||
= NG_EIFACE_PAR_FIELDS;
|
||||
|
||||
static const struct ng_parse_type ng_eiface_par_type = {
|
||||
&ng_parse_struct_type,
|
||||
|
@ -68,17 +68,15 @@ struct ng_eiface_par {
|
||||
u_char oct5;
|
||||
};
|
||||
|
||||
static const struct ng_parse_struct_info ng_eiface_par_fields = {
|
||||
{
|
||||
{ "oct0", &ng_parse_int8_type },
|
||||
{ "oct1", &ng_parse_int8_type },
|
||||
{ "oct2", &ng_parse_int8_type },
|
||||
{ "oct3", &ng_parse_int8_type },
|
||||
{ "oct4", &ng_parse_int8_type },
|
||||
{ "oct5", &ng_parse_int8_type },
|
||||
{ NULL },
|
||||
}
|
||||
};
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_EIFACE_PAR_FIELDS { \
|
||||
{ "oct0", &ng_parse_int8_type }, \
|
||||
{ "oct1", &ng_parse_int8_type }, \
|
||||
{ "oct2", &ng_parse_int8_type }, \
|
||||
{ "oct3", &ng_parse_int8_type }, \
|
||||
{ "oct4", &ng_parse_int8_type }, \
|
||||
{ "oct5", &ng_parse_int8_type }, \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
#endif /* _NETGRAPH_EIFACE_H_ */
|
||||
|
@ -70,18 +70,18 @@ static ng_rcvdata_t ng_etf_rcvdata; /* note these are both ng_rcvdata_t */
|
||||
static ng_disconnect_t ng_etf_disconnect;
|
||||
|
||||
/* Parse type for struct ng_etfstat */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_etf_stat_type_info = NG_ETF_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_etf_stat_type_fields[]
|
||||
= NG_ETF_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_etf_stat_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_etf_stat_type_info
|
||||
&ng_etf_stat_type_fields
|
||||
};
|
||||
/* Parse type for struct ng_setfilter */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_etf_filter_type_info = NG_ETF_FILTER_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_etf_filter_type_fields[]
|
||||
= NG_ETF_FILTER_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_etf_filter_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_etf_filter_type_info
|
||||
&ng_etf_filter_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -65,11 +65,9 @@ struct ng_etfstat {
|
||||
* This needs to be kept in sync with the above structure definition
|
||||
*/
|
||||
#define NG_ETF_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "packets_in", &ng_parse_uint32_type }, \
|
||||
{ "packets_out", &ng_parse_uint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* This structure is returned by the NGM_ETF_GET_STATUS command */
|
||||
@ -82,11 +80,9 @@ struct ng_etffilter {
|
||||
* This needs to be kept in sync with the above structure definition
|
||||
*/
|
||||
#define NG_ETF_FILTER_TYPE_INFO { \
|
||||
{ \
|
||||
{ "matchhook", &ng_parse_hookbuf_type }, \
|
||||
{ "ethertype", &ng_parse_uint16_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
#endif /* _NETGRAPH_ETHERTYPE_FILTER_H_ */
|
||||
|
@ -145,11 +145,11 @@ static const struct ng_parse_type ng_iface_ifname_type = {
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_cisco_ipaddr */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_cisco_ipaddr_type_info = NG_CISCO_IPADDR_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_cisco_ipaddr_type_fields[]
|
||||
= NG_CISCO_IPADDR_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_cisco_ipaddr_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_cisco_ipaddr_type_info
|
||||
&ng_cisco_ipaddr_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -184,17 +184,16 @@ 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 = {
|
||||
{
|
||||
static const struct ng_parse_struct_field
|
||||
ng_parse_generic_sockaddr_type_fields[] = {
|
||||
{ "len", &ng_parse_uint8_type },
|
||||
{ "family", &ng_parse_uint8_type },
|
||||
{ "data", &ng_ksocket_generic_sockdata_type },
|
||||
{ NULL }
|
||||
}
|
||||
};
|
||||
static const struct ng_parse_type ng_ksocket_generic_sockaddr_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_parse_generic_sockaddr_type_info
|
||||
&ng_parse_generic_sockaddr_type_fields
|
||||
};
|
||||
|
||||
/* Convert a struct sockaddr from ASCII to binary. If its a protocol
|
||||
@ -414,19 +413,19 @@ static const struct ng_parse_type ng_ksocket_sockoptval_type = {
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_ksocket_sockopt */
|
||||
static const struct ng_parse_struct_info ng_ksocket_sockopt_type_info
|
||||
static const struct ng_parse_struct_field ng_ksocket_sockopt_type_fields[]
|
||||
= NG_KSOCKET_SOCKOPT_INFO(&ng_ksocket_sockoptval_type);
|
||||
static const struct ng_parse_type ng_ksocket_sockopt_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_ksocket_sockopt_type_info,
|
||||
&ng_ksocket_sockopt_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_ksocket_accept */
|
||||
static const struct ng_parse_struct_info ng_ksocket_accept_type_info
|
||||
static const struct ng_parse_struct_field ng_ksocket_accept_type_fields[]
|
||||
= NGM_KSOCKET_ACCEPT_INFO;
|
||||
static const struct ng_parse_type ng_ksocket_accept_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_ksocket_accept_type_info
|
||||
&ng_ksocket_accept_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -63,12 +63,10 @@ struct ng_ksocket_sockopt {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_KSOCKET_SOCKOPT_INFO(svtype) { \
|
||||
{ \
|
||||
{ "level", &ng_parse_int32_type }, \
|
||||
{ "name", &ng_parse_int32_type }, \
|
||||
{ "value", (svtype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* For NGM_KSOCKET_ACCEPT control message responses */
|
||||
@ -79,11 +77,9 @@ struct ng_ksocket_accept {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NGM_KSOCKET_ACCEPT_INFO { \
|
||||
{ \
|
||||
{ "nodeid", &ng_parse_hint32_type }, \
|
||||
{ "addr", &ng_ksocket_generic_sockaddr_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Netgraph commands */
|
||||
|
@ -71,7 +71,6 @@ struct ng_mesg {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_NG_MESG_INFO(dtype) { \
|
||||
{ \
|
||||
{ "version", &ng_parse_uint8_type }, \
|
||||
{ "spare", &ng_parse_uint8_type }, \
|
||||
{ "arglen", &ng_parse_uint16_type }, \
|
||||
@ -81,8 +80,7 @@ struct ng_mesg {
|
||||
{ "cmd", &ng_parse_uint32_type }, \
|
||||
{ "cmdstr", &ng_parse_cmdbuf_type }, \
|
||||
{ "data", (dtype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/*
|
||||
@ -161,12 +159,10 @@ struct ngm_mkpeer {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_MKPEER_INFO() { \
|
||||
{ \
|
||||
{ "type", &ng_parse_typebuf_type }, \
|
||||
{ "ourhook", &ng_parse_hookbuf_type }, \
|
||||
{ "peerhook", &ng_parse_hookbuf_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Structure used for NGM_CONNECT */
|
||||
@ -178,12 +174,10 @@ struct ngm_connect {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_CONNECT_INFO() { \
|
||||
{ \
|
||||
{ "path", &ng_parse_pathbuf_type }, \
|
||||
{ "ourhook", &ng_parse_hookbuf_type }, \
|
||||
{ "peerhook", &ng_parse_hookbuf_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Structure used for NGM_NAME */
|
||||
@ -193,10 +187,8 @@ struct ngm_name {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_NAME_INFO() { \
|
||||
{ \
|
||||
{ "name", &ng_parse_nodebuf_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Structure used for NGM_RMHOOK */
|
||||
@ -206,10 +198,8 @@ struct ngm_rmhook {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_RMHOOK_INFO() { \
|
||||
{ \
|
||||
{ "hook", &ng_parse_hookbuf_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Structure used for NGM_NODEINFO */
|
||||
@ -222,13 +212,11 @@ struct nodeinfo {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_NODEINFO_INFO() { \
|
||||
{ \
|
||||
{ "name", &ng_parse_nodebuf_type }, \
|
||||
{ "type", &ng_parse_typebuf_type }, \
|
||||
{ "id", &ng_parse_hint32_type }, \
|
||||
{ "hooks", &ng_parse_uint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Structure used for NGM_LISTHOOKS */
|
||||
@ -240,12 +228,10 @@ struct linkinfo {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_LINKINFO_INFO(nitype) { \
|
||||
{ \
|
||||
{ "ourhook", &ng_parse_hookbuf_type }, \
|
||||
{ "peerhook", &ng_parse_hookbuf_type }, \
|
||||
{ "nodeinfo", (nitype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
struct hooklist {
|
||||
@ -255,11 +241,9 @@ struct hooklist {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_HOOKLIST_INFO(nitype,litype) { \
|
||||
{ \
|
||||
{ "nodeinfo", (nitype) }, \
|
||||
{ "linkinfo", (litype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Structure used for NGM_LISTNAMES/NGM_LISTNODES */
|
||||
@ -270,11 +254,9 @@ struct namelist {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_LISTNODES_INFO(niarraytype) { \
|
||||
{ \
|
||||
{ "numnames", &ng_parse_uint32_type }, \
|
||||
{ "nodeinfo", (niarraytype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Structure used for NGM_LISTTYPES */
|
||||
@ -285,11 +267,9 @@ struct typeinfo {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_TYPEINFO_INFO() { \
|
||||
{ \
|
||||
{ "typename", &ng_parse_typebuf_type }, \
|
||||
{ "numnodes", &ng_parse_uint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
struct typelist {
|
||||
@ -299,11 +279,9 @@ struct typelist {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_TYPELIST_INFO(tiarraytype) { \
|
||||
{ \
|
||||
{ "numtypes", &ng_parse_uint32_type }, \
|
||||
{ "typeinfo", (tiarraytype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
struct ngm_bandwidth {
|
||||
@ -315,13 +293,11 @@ struct ngm_bandwidth {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_BANDWIDTH_INFO() { \
|
||||
{ \
|
||||
{ "nominal_in", &ng_parse_uint64_type }, \
|
||||
{ "seen_in", &ng_parse_uint64_type }, \
|
||||
{ "nominal_out", &ng_parse_uint64_type }, \
|
||||
{ "seen_out", &ng_parse_uint64_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/*
|
||||
@ -345,14 +321,12 @@ struct ngm_queue_state {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_QUEUE_INFO() { \
|
||||
{ \
|
||||
{ "max_queuelen_bytes", &ng_parse_uint_type }, \
|
||||
{ "max_queuelen_packets", &ng_parse_uint_type }, \
|
||||
{ "high_watermark", &ng_parse_uint_type }, \
|
||||
{ "low_watermark", &ng_parse_uint_type }, \
|
||||
{ "current", &ng_parse_uint_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Tell a node who to send async flow control info to. */
|
||||
@ -362,10 +336,8 @@ struct flow_manager {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_GENERIC_FLOW_MANAGER_INFO() { \
|
||||
{ \
|
||||
{ "id", &ng_parse_hint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
|
||||
|
@ -105,19 +105,19 @@ static const struct ng_parse_type ng_one2many_enableLinks_array_type = {
|
||||
&ng_parse_fixedarray_type,
|
||||
&ng_one2many_enableLinks_array_type_info,
|
||||
};
|
||||
static const struct ng_parse_struct_info ng_one2many_config_type_info
|
||||
static const struct ng_parse_struct_field ng_one2many_config_type_fields[]
|
||||
= NG_ONE2MANY_CONFIG_TYPE_INFO(&ng_one2many_enableLinks_array_type);
|
||||
static const struct ng_parse_type ng_one2many_config_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_one2many_config_type_info,
|
||||
&ng_one2many_config_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_one2many_link_stats */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_one2many_link_stats_type_info = NG_ONE2MANY_LINK_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_one2many_link_stats_type_fields[]
|
||||
= NG_ONE2MANY_LINK_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_one2many_link_stats_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_one2many_link_stats_type_info
|
||||
&ng_one2many_link_stats_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -73,12 +73,10 @@ struct ng_one2many_config {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_ONE2MANY_CONFIG_TYPE_INFO(atype) { \
|
||||
{ \
|
||||
{ "xmitAlg", &ng_parse_uint32_type }, \
|
||||
{ "failAlg", &ng_parse_uint32_type }, \
|
||||
{ "enabledLinks", (atype) }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Statistics structure (one for each link) */
|
||||
@ -92,14 +90,12 @@ struct ng_one2many_link_stats {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_ONE2MANY_LINK_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "recvOctets", &ng_parse_uint64_type }, \
|
||||
{ "recvPackets", &ng_parse_uint64_type }, \
|
||||
{ "xmitOctets", &ng_parse_uint64_type }, \
|
||||
{ "xmitPackets", &ng_parse_uint64_type }, \
|
||||
{ "memoryFailures", &ng_parse_uint64_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Netgraph control messages */
|
||||
|
@ -212,11 +212,10 @@ ng_struct_getDefault(const struct ng_parse_type *type,
|
||||
static int
|
||||
ng_struct_getAlign(const struct ng_parse_type *type)
|
||||
{
|
||||
const struct ng_parse_struct_info *si = type->info;
|
||||
const struct ng_parse_struct_field *field;
|
||||
int align = 0;
|
||||
|
||||
for (field = si->fields; field->name != NULL; field++) {
|
||||
for (field = type->info; field->name != NULL; field++) {
|
||||
int falign = ALIGNMENT(field->type);
|
||||
|
||||
if (falign > align)
|
||||
@ -1116,11 +1115,11 @@ static const struct ng_parse_type ng_msg_data_type = {
|
||||
};
|
||||
|
||||
/* Type for the entire struct ng_mesg header with data section */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_parse_ng_mesg_type_info = NG_GENERIC_NG_MESG_INFO(&ng_msg_data_type);
|
||||
static const struct ng_parse_struct_field ng_parse_ng_mesg_type_fields[]
|
||||
= NG_GENERIC_NG_MESG_INFO(&ng_msg_data_type);
|
||||
const struct ng_parse_type ng_parse_ng_mesg_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_parse_ng_mesg_type_info,
|
||||
&ng_parse_ng_mesg_type_fields,
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
@ -1202,8 +1201,8 @@ ng_parse_composite(const struct ng_parse_type *type, const char *s,
|
||||
nextIndex = index + 1;
|
||||
*off += len + len2;
|
||||
} else { /* a structure field */
|
||||
const struct ng_parse_struct_field *field = NULL;
|
||||
const struct ng_parse_struct_info *si = type->info;
|
||||
const struct ng_parse_struct_field *const
|
||||
fields = type->info;
|
||||
|
||||
/* Find the field by name (required) in field list */
|
||||
if (tok != T_WORD) {
|
||||
@ -1211,7 +1210,9 @@ ng_parse_composite(const struct ng_parse_type *type, const char *s,
|
||||
goto done;
|
||||
}
|
||||
for (index = 0; index < num; index++) {
|
||||
field = &si->fields[index];
|
||||
const struct ng_parse_struct_field *const
|
||||
field = &fields[index];
|
||||
|
||||
if (strncmp(&s[*off], field->name, len) == 0
|
||||
&& field->name[len] == '\0')
|
||||
break;
|
||||
@ -1358,9 +1359,10 @@ ng_unparse_composite(const struct ng_parse_type *type, const u_char *data,
|
||||
}
|
||||
nextIndex++;
|
||||
} else {
|
||||
const struct ng_parse_struct_info *si = type->info;
|
||||
const struct ng_parse_struct_field *const
|
||||
fields = type->info;
|
||||
|
||||
NG_PARSE_APPEND("%s=", si->fields[index].name);
|
||||
NG_PARSE_APPEND("%s=", fields[index].name);
|
||||
}
|
||||
|
||||
/* Print value */
|
||||
@ -1439,12 +1441,12 @@ ng_get_composite_len(const struct ng_parse_type *type,
|
||||
switch (ctype) {
|
||||
case CT_STRUCT:
|
||||
{
|
||||
const struct ng_parse_struct_info *const si = type->info;
|
||||
const struct ng_parse_struct_field *const fields = type->info;
|
||||
int numFields = 0;
|
||||
|
||||
for (numFields = 0; ; numFields++) {
|
||||
const struct ng_parse_struct_field *const
|
||||
fi = &si->fields[numFields];
|
||||
fi = &fields[numFields];
|
||||
|
||||
if (fi->name == NULL)
|
||||
break;
|
||||
@ -1481,9 +1483,9 @@ ng_get_composite_etype(const struct ng_parse_type *type,
|
||||
switch (ctype) {
|
||||
case CT_STRUCT:
|
||||
{
|
||||
const struct ng_parse_struct_info *const si = type->info;
|
||||
const struct ng_parse_struct_field *const fields = type->info;
|
||||
|
||||
etype = si->fields[index].type;
|
||||
etype = fields[index].type;
|
||||
break;
|
||||
}
|
||||
case CT_ARRAY:
|
||||
@ -1521,10 +1523,10 @@ ng_parse_get_elem_pad(const struct ng_parse_type *type,
|
||||
/* Get element's alignment, and possibly override */
|
||||
align = ALIGNMENT(etype);
|
||||
if (ctype == CT_STRUCT) {
|
||||
const struct ng_parse_struct_info *si = type->info;
|
||||
const struct ng_parse_struct_field *const fields = type->info;
|
||||
|
||||
if (si->fields[index].alignment != 0)
|
||||
align = si->fields[index].alignment;
|
||||
if (fields[index].alignment != 0)
|
||||
align = fields[index].alignment;
|
||||
}
|
||||
|
||||
/* Return number of bytes to skip to align */
|
||||
|
@ -162,15 +162,13 @@
|
||||
};
|
||||
|
||||
// Super-type info for struct foo
|
||||
struct ng_parse_struct_info foo_fields = {
|
||||
{
|
||||
struct ng_parse_struct_field foo_fields[] = {
|
||||
{ "ip", &ng_parse_ipaddr_type },
|
||||
{ "bar", &ng_parse_int32_type },
|
||||
{ "label", &foo_label_type },
|
||||
{ "alen", &ng_parse_uint8_type },
|
||||
{ "ary", &foo_ary_type },
|
||||
{ NULL }
|
||||
}
|
||||
};
|
||||
|
||||
// Parse type for struct foo
|
||||
@ -300,7 +298,7 @@ struct ng_parse_type {
|
||||
* field order, no matter what order they are listed in the ASCII string.
|
||||
*
|
||||
* Default value: Determined on a per-field basis
|
||||
* Additional info: struct ng_parse_struct_info *
|
||||
* Additional info: struct ng_parse_struct_field *
|
||||
*/
|
||||
extern const struct ng_parse_type ng_parse_struct_type;
|
||||
|
||||
@ -308,13 +306,10 @@ extern const struct ng_parse_type ng_parse_struct_type;
|
||||
override is non-zero, the alignment is determined from the field type.
|
||||
Note: add an extra struct ng_parse_struct_field with name == NULL
|
||||
to indicate the end of the list. */
|
||||
struct ng_parse_struct_info {
|
||||
struct ng_parse_struct_field {
|
||||
const char *name; /* field name */
|
||||
const struct ng_parse_type
|
||||
*type; /* field type */
|
||||
int alignment; /* override alignment */
|
||||
} fields[0];
|
||||
struct ng_parse_struct_field {
|
||||
const char *name; /* field name */
|
||||
const struct ng_parse_type *type; /* field type */
|
||||
int alignment; /* override alignment */
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -254,27 +254,27 @@ static const struct ng_parse_type ng_ppp_rseq_array_type = {
|
||||
&ng_parse_fixedarray_type,
|
||||
&ng_ppp_rseq_array_info,
|
||||
};
|
||||
static const struct ng_parse_struct_info ng_ppp_mp_state_type_info
|
||||
static const struct ng_parse_struct_field ng_ppp_mp_state_type_fields[]
|
||||
= NG_PPP_MP_STATE_TYPE_INFO(&ng_ppp_rseq_array_type);
|
||||
static const struct ng_parse_type ng_ppp_mp_state_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_ppp_mp_state_type_info,
|
||||
&ng_ppp_mp_state_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_ppp_link_conf */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_ppp_link_type_info = NG_PPP_LINK_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_ppp_link_type_fields[]
|
||||
= NG_PPP_LINK_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_ppp_link_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_ppp_link_type_info,
|
||||
&ng_ppp_link_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_ppp_bund_conf */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_ppp_bund_type_info = NG_PPP_BUND_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_ppp_bund_type_fields[]
|
||||
= NG_PPP_BUND_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_ppp_bund_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_ppp_bund_type_info,
|
||||
&ng_ppp_bund_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_ppp_node_conf */
|
||||
@ -286,19 +286,19 @@ static const struct ng_parse_type ng_ppp_link_array_type = {
|
||||
&ng_parse_fixedarray_type,
|
||||
&ng_ppp_array_info,
|
||||
};
|
||||
static const struct ng_parse_struct_info ng_ppp_conf_type_info
|
||||
static const struct ng_parse_struct_field ng_ppp_conf_type_fields[]
|
||||
= NG_PPP_CONFIG_TYPE_INFO(&ng_ppp_bund_type, &ng_ppp_link_array_type);
|
||||
static const struct ng_parse_type ng_ppp_conf_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_ppp_conf_type_info
|
||||
&ng_ppp_conf_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_ppp_link_stat */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_ppp_stats_type_info = NG_PPP_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_ppp_stats_type_fields[]
|
||||
= NG_PPP_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_ppp_stats_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_ppp_stats_type_info
|
||||
&ng_ppp_stats_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -93,12 +93,10 @@ struct ng_ppp_mp_state {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPP_MP_STATE_TYPE_INFO(atype) { \
|
||||
{ \
|
||||
{ "rseq", (atype) }, \
|
||||
{ "mseq", &ng_parse_hint32_type }, \
|
||||
{ "xseq", &ng_parse_hint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Per-link config structure */
|
||||
@ -113,15 +111,13 @@ struct ng_ppp_link_conf {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPP_LINK_TYPE_INFO { \
|
||||
{ \
|
||||
{ "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 }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Bundle config structure */
|
||||
@ -145,7 +141,6 @@ struct ng_ppp_bund_conf {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPP_BUND_TYPE_INFO { \
|
||||
{ \
|
||||
{ "mrru", &ng_parse_uint16_type }, \
|
||||
{ "enableMultilink", &ng_parse_uint8_type }, \
|
||||
{ "recvShortSeq", &ng_parse_uint8_type }, \
|
||||
@ -162,7 +157,6 @@ struct ng_ppp_bund_conf {
|
||||
{ "enableVJCompression", &ng_parse_uint8_type }, \
|
||||
{ "enableVJDecompression", &ng_parse_uint8_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Total node config structure */
|
||||
@ -173,11 +167,9 @@ struct ng_ppp_node_conf {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPP_CONFIG_TYPE_INFO(bctype, arytype) { \
|
||||
{ \
|
||||
{ "bund", (bctype) }, \
|
||||
{ "links", (arytype) }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Statistics struct for a link (or the bundle if NG_PPP_BUNDLE_LINKNUM) */
|
||||
@ -194,7 +186,6 @@ struct ng_ppp_link_stat {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPP_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "xmitFrames", &ng_parse_uint32_type }, \
|
||||
{ "xmitOctets", &ng_parse_uint32_type }, \
|
||||
{ "recvFrames", &ng_parse_uint32_type }, \
|
||||
@ -204,7 +195,6 @@ struct ng_ppp_link_stat {
|
||||
{ "dupFragments", &ng_parse_uint32_type }, \
|
||||
{ "dropFragments", &ng_parse_uint32_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
#endif /* _NETGRAPH_PPP_H_ */
|
||||
|
@ -84,19 +84,19 @@ static ng_rcvdata_t ng_pppoe_rcvdata;
|
||||
static ng_disconnect_t ng_pppoe_disconnect;
|
||||
|
||||
/* Parse type for struct ngpppoe_init_data */
|
||||
static const struct ng_parse_struct_info ngpppoe_init_data_type_info
|
||||
static const struct ng_parse_struct_field ngpppoe_init_data_type_fields[]
|
||||
= NG_PPPOE_INIT_DATA_TYPE_INFO;
|
||||
static const struct ng_parse_type ngpppoe_init_data_state_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ngpppoe_init_data_type_info
|
||||
&ngpppoe_init_data_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ngpppoe_sts */
|
||||
static const struct ng_parse_struct_info ng_pppoe_sts_type_info
|
||||
static const struct ng_parse_struct_field ng_pppoe_sts_type_fields[]
|
||||
= NG_PPPOE_STS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_pppoe_sts_state_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_pppoe_sts_type_info
|
||||
&ng_pppoe_sts_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -91,11 +91,9 @@ struct ngpppoestat {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPPOESTAT_TYPE_INFO { \
|
||||
{ \
|
||||
{ "packets_in", &ng_parse_uint_type }, \
|
||||
{ "packets_out", &ng_parse_uint_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
@ -124,11 +122,9 @@ struct ngpppoe_init_data {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPPOE_INIT_DATA_TYPE_INFO { \
|
||||
{ \
|
||||
{ "hook", &ng_parse_hookbuf_type }, \
|
||||
{ "data", &ng_parse_sizedstring_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/*
|
||||
@ -142,10 +138,8 @@ struct ngpppoe_sts {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPPOE_STS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "hook", &ng_parse_hookbuf_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
|
@ -191,19 +191,19 @@ static void ng_pptpgre_reset(node_p node);
|
||||
static pptptime_t ng_pptpgre_time(node_p node);
|
||||
|
||||
/* Parse type for struct ng_pptpgre_conf */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_pptpgre_conf_type_info = NG_PPTPGRE_CONF_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_pptpgre_conf_type_fields[]
|
||||
= NG_PPTPGRE_CONF_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_pptpgre_conf_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_pptpgre_conf_type_info,
|
||||
&ng_pptpgre_conf_type_fields,
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_pptpgre_stats */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_pptpgre_stats_type_info = NG_PPTPGRE_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_pptpgre_stats_type_fields[]
|
||||
= NG_PPTPGRE_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_pptp_stats_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_pptpgre_stats_type_info
|
||||
&ng_pptpgre_stats_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -65,7 +65,6 @@ struct ng_pptpgre_conf {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPTPGRE_CONF_TYPE_INFO { \
|
||||
{ \
|
||||
{ "enabled", &ng_parse_uint8_type }, \
|
||||
{ "enableDelayedAck", &ng_parse_uint8_type }, \
|
||||
{ "enableAlwaysAck", &ng_parse_uint8_type }, \
|
||||
@ -73,8 +72,7 @@ struct ng_pptpgre_conf {
|
||||
{ "peerCid", &ng_parse_hint16_type }, \
|
||||
{ "recvWin", &ng_parse_uint16_type }, \
|
||||
{ "peerPpd", &ng_parse_uint16_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Statistics struct */
|
||||
@ -99,7 +97,6 @@ struct ng_pptpgre_stats {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_PPTPGRE_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "xmitPackets", &ng_parse_uint32_type }, \
|
||||
{ "xmitOctets", &ng_parse_uint32_type }, \
|
||||
{ "xmitLoneAcks", &ng_parse_uint32_type }, \
|
||||
@ -117,7 +114,6 @@ struct ng_pptpgre_stats {
|
||||
{ "recvAckTimeouts", &ng_parse_uint32_type }, \
|
||||
{ "memoryFailures", &ng_parse_uint32_type }, \
|
||||
{ NULL } \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Netgraph commands */
|
||||
|
@ -76,11 +76,11 @@ static ng_rcvdata_t ng_xxx_rcvdata; /* note these are both ng_rcvdata_t */
|
||||
static ng_disconnect_t ng_xxx_disconnect;
|
||||
|
||||
/* Parse type for struct ngxxxstat */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_xxx_stat_type_info = NG_XXX_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_struct_field ng_xxx_stat_type_fields[]
|
||||
= NG_XXX_STATS_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_xxx_stat_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_xxx_stat_type_info
|
||||
&ng_xxx_stat_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -80,11 +80,9 @@ struct ngxxxstat {
|
||||
* This needs to be kept in sync with the above structure definition
|
||||
*/
|
||||
#define NG_XXX_STATS_TYPE_INFO { \
|
||||
{ \
|
||||
{ "packets_in", &ng_parse_uint32_type }, \
|
||||
{ "packets_out", &ng_parse_uint32_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
#endif /* _NETGRAPH_SAMPLE_H_ */
|
||||
|
@ -85,19 +85,19 @@ static ng_rcvdata_t ngt_rcvdata;
|
||||
static ng_disconnect_t ngt_disconnect;
|
||||
|
||||
/* Parse type for struct ng_tee_hookstat */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_tee_hookstat_type_info = NG_TEE_HOOKSTAT_INFO;
|
||||
static const struct ng_parse_struct_field ng_tee_hookstat_type_fields[]
|
||||
= NG_TEE_HOOKSTAT_INFO;
|
||||
static const struct ng_parse_type ng_tee_hookstat_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_tee_hookstat_type_info,
|
||||
&ng_tee_hookstat_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for struct ng_tee_stats */
|
||||
static const struct ng_parse_struct_info
|
||||
ng_tee_stats_type_info = NG_TEE_STATS_INFO(&ng_tee_hookstat_type);
|
||||
static const struct ng_parse_struct_field ng_tee_stats_type_fields[]
|
||||
= NG_TEE_STATS_INFO(&ng_tee_hookstat_type);
|
||||
static const struct ng_parse_type ng_tee_stats_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_tee_stats_type_info,
|
||||
&ng_tee_stats_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -63,13 +63,11 @@ struct ng_tee_hookstat {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_TEE_HOOKSTAT_INFO { \
|
||||
{ \
|
||||
{ "inOctets", &ng_parse_uint64_type }, \
|
||||
{ "inFrames", &ng_parse_uint64_type }, \
|
||||
{ "outOctets", &ng_parse_uint64_type }, \
|
||||
{ "outFrames", &ng_parse_uint64_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Statistics structure returned by NGM_TEE_GET_STATS */
|
||||
@ -82,13 +80,11 @@ struct ng_tee_stats {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_TEE_STATS_INFO(hstype) { \
|
||||
{ \
|
||||
{ "right", (hstype) }, \
|
||||
{ "left", (hstype) }, \
|
||||
{ "right2left", (hstype) }, \
|
||||
{ "left2right", (hstype) }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Netgraph commands */
|
||||
|
@ -98,11 +98,11 @@ static ng_disconnect_t ng_vjc_disconnect;
|
||||
static struct mbuf *ng_vjc_pulluphdrs(struct mbuf *m, int knownTCP);
|
||||
|
||||
/* Parse type for struct ngm_vjc_config */
|
||||
static const struct ng_parse_struct_info ng_vjc_config_type_info
|
||||
static const struct ng_parse_struct_field ng_vjc_config_type_fields[]
|
||||
= NG_VJC_CONFIG_TYPE_INFO;
|
||||
static const struct ng_parse_type ng_vjc_config_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_vjc_config_type_info
|
||||
&ng_vjc_config_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for the 'last_cs' and 'cs_next' fields in struct slcompress,
|
||||
@ -127,19 +127,17 @@ static const struct ng_parse_type ng_vjc_cs_hdr_type = {
|
||||
};
|
||||
|
||||
/* Parse type for a struct cstate */
|
||||
static const struct ng_parse_struct_info ng_vjc_cstate_type_info = {
|
||||
{
|
||||
static const struct ng_parse_struct_field ng_vjc_cstate_type_fields[] = {
|
||||
{ "cs_next", NG_VJC_TSTATE_PTR_TYPE },
|
||||
{ "cs_hlen", &ng_parse_uint16_type },
|
||||
{ "cs_id", &ng_parse_uint8_type },
|
||||
{ "cs_filler", &ng_parse_uint8_type },
|
||||
{ "cs_hdr", &ng_vjc_cs_hdr_type },
|
||||
{ NULL },
|
||||
}
|
||||
{ NULL }
|
||||
};
|
||||
static const struct ng_parse_type ng_vjc_cstate_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_vjc_cstate_type_info
|
||||
&ng_vjc_cstate_type_fields
|
||||
};
|
||||
|
||||
/* Parse type for an array of MAX_STATES struct cstate's, ie, tstate & rstate */
|
||||
@ -154,8 +152,7 @@ static const struct ng_parse_type ng_vjc_cstatearray_type = {
|
||||
|
||||
/* Parse type for struct slcompress. Keep this in sync with the
|
||||
definition of struct slcompress defined in <net/slcompress.h> */
|
||||
static const struct ng_parse_struct_info ng_vjc_slcompress_type_info = {
|
||||
{
|
||||
static const struct ng_parse_struct_field ng_vjc_slcompress_type_fields[] = {
|
||||
{ "last_cs", NG_VJC_TSTATE_PTR_TYPE },
|
||||
{ "last_recv", &ng_parse_uint8_type },
|
||||
{ "last_xmit", &ng_parse_uint8_type },
|
||||
@ -172,12 +169,11 @@ static const struct ng_parse_struct_info ng_vjc_slcompress_type_info = {
|
||||
#endif
|
||||
{ "tstate", &ng_vjc_cstatearray_type },
|
||||
{ "rstate", &ng_vjc_cstatearray_type },
|
||||
{ NULL },
|
||||
}
|
||||
{ NULL }
|
||||
};
|
||||
static const struct ng_parse_type ng_vjc_slcompress_type = {
|
||||
&ng_parse_struct_type,
|
||||
&ng_vjc_slcompress_type_info
|
||||
&ng_vjc_slcompress_type_fields
|
||||
};
|
||||
|
||||
/* List of commands and how to convert arguments to/from ASCII */
|
||||
|
@ -67,13 +67,11 @@ struct ngm_vjc_config {
|
||||
|
||||
/* Keep this in sync with the above structure definition */
|
||||
#define NG_VJC_CONFIG_TYPE_INFO { \
|
||||
{ \
|
||||
{ "enableComp", &ng_parse_uint8_type }, \
|
||||
{ "enableDecomp", &ng_parse_uint8_type }, \
|
||||
{ "maxChannel", &ng_parse_uint8_type }, \
|
||||
{ "compressCID", &ng_parse_uint8_type }, \
|
||||
{ NULL }, \
|
||||
} \
|
||||
{ NULL } \
|
||||
}
|
||||
|
||||
/* Netgraph commands */
|
||||
|
Loading…
Reference in New Issue
Block a user