summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_parse.h
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>2000-08-10 22:43:38 +0000
committerarchie <archie@FreeBSD.org>2000-08-10 22:43:38 +0000
commit2b894febddb9182b5c54bce2a6f3f60fc05b6095 (patch)
treee15523e08d4f2cd89ee4d42a89aac2e6b9eeeaaf /sys/netgraph/ng_parse.h
parent126052eaab1fbd5898f2028cb6026585ff118d15 (diff)
downloadFreeBSD-src-2b894febddb9182b5c54bce2a6f3f60fc05b6095.zip
FreeBSD-src-2b894febddb9182b5c54bce2a6f3f60fc05b6095.tar.gz
- Add new unsigned and hex integer parse types
- Fix bug in commented example code
Diffstat (limited to 'sys/netgraph/ng_parse.h')
-rw-r--r--sys/netgraph/ng_parse.h18
1 files changed, 16 insertions, 2 deletions
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
*
OpenPOWER on IntegriCloud