summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_async.h
diff options
context:
space:
mode:
authorarchie <archie@FreeBSD.org>1999-11-30 02:45:32 +0000
committerarchie <archie@FreeBSD.org>1999-11-30 02:45:32 +0000
commit81fceb37a95304786f88f6611289a27c7262d394 (patch)
tree321a35b746bb34b931d0691c03f9888db83ed68b /sys/netgraph/ng_async.h
parent9716636318d4160418baceabe7ba05ce065692fc (diff)
downloadFreeBSD-src-81fceb37a95304786f88f6611289a27c7262d394.zip
FreeBSD-src-81fceb37a95304786f88f6611289a27c7262d394.tar.gz
Add two new generic control messages, NGM_ASCII2BINARY and
NGM_BINARY2ASCII, which convert control messages to ASCII and back. This allows control messages to be sent and received in ASCII form using ngctl(8), which makes ngctl a lot more useful. This also allows all the type-specific debugging code in libnetgraph to go away -- instead, we just ask the node itself to do the ASCII translation for us. Currently, all generic control messages are supported, as well as messages associated with the following node types: async, cisco, ksocket, and ppp. See /usr/share/examples/netgraph/ngctl for an example of using this. Also give ngctl(8) the ability to print out incoming data and control messages at any time. Eventually nghook(8) may be subsumed. Several other misc. bug fixes. Reviewed by: julian
Diffstat (limited to 'sys/netgraph/ng_async.h')
-rw-r--r--sys/netgraph/ng_async.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/sys/netgraph/ng_async.h b/sys/netgraph/ng_async.h
index a91ef16..63f6e43 100644
--- a/sys/netgraph/ng_async.h
+++ b/sys/netgraph/ng_async.h
@@ -45,7 +45,7 @@
/* Type name and cookie */
#define NG_ASYNC_NODE_TYPE "async"
-#define NGM_ASYNC_COOKIE 886473718
+#define NGM_ASYNC_COOKIE 886473717
/* Hook names */
#define NG_ASYNC_HOOK_SYNC "sync" /* Sync frames */
@@ -68,6 +68,21 @@ struct ng_async_stat {
u_int32_t asyncBadCheckSums;
};
+/* 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 }, \
+ { NULL }, \
+ } \
+}
+
/* Configuration for this node */
struct ng_async_cfg {
u_char enabled; /* Turn encoding on/off */
@@ -76,6 +91,17 @@ struct ng_async_cfg {
u_int32_t accm; /* ACCM encoding */
};
+/* Keep this in sync with the above structure definition */
+#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 }, \
+ { NULL }, \
+ } \
+}
+
/* Commands */
enum {
NGM_ASYNC_CMD_GET_STATS = 1, /* returns struct ng_async_stat */
OpenPOWER on IntegriCloud