From 2b894febddb9182b5c54bce2a6f3f60fc05b6095 Mon Sep 17 00:00:00 2001 From: archie Date: Thu, 10 Aug 2000 22:43:38 +0000 Subject: - Add new unsigned and hex integer parse types - Fix bug in commented example code --- sys/netgraph/ng_parse.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'sys/netgraph/ng_parse.h') diff --git a/sys/netgraph/ng_parse.h b/sys/netgraph/ng_parse.h index 1543c6b..fe8e553 100644 --- a/sys/netgraph/ng_parse.h +++ b/sys/netgraph/ng_parse.h @@ -163,12 +163,14 @@ // Super-type info for struct foo struct ng_parse_struct_info foo_fields = { - { "ip", &ng_parse_ipaddr_type }, + { + { "ip", &ng_parse_ipaddr_type }, { "bar", &ng_parse_int32_type }, { "label", &foo_label_type }, - { "alen", &ng_parse_int8_type }, + { "alen", &ng_parse_uint8_type }, { "ary", &foo_ary_type }, { NULL } + } }; // Parse type for struct foo @@ -413,6 +415,18 @@ extern const struct ng_parse_type ng_parse_int16_type; extern const struct ng_parse_type ng_parse_int32_type; extern const struct ng_parse_type ng_parse_int64_type; +/* Same thing but unparse as unsigned quantities */ +extern const struct ng_parse_type ng_parse_uint8_type; +extern const struct ng_parse_type ng_parse_uint16_type; +extern const struct ng_parse_type ng_parse_uint32_type; +extern const struct ng_parse_type ng_parse_uint64_type; + +/* Same thing but unparse as hex quantities, e.g., "0xe7" */ +extern const struct ng_parse_type ng_parse_hint8_type; +extern const struct ng_parse_type ng_parse_hint16_type; +extern const struct ng_parse_type ng_parse_hint32_type; +extern const struct ng_parse_type ng_parse_hint64_type; + /* * IP ADDRESS TYPE * -- cgit v1.1