summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ngctl/ngctl.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 /usr.sbin/ngctl/ngctl.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 'usr.sbin/ngctl/ngctl.h')
-rw-r--r--usr.sbin/ngctl/ngctl.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/ngctl/ngctl.h b/usr.sbin/ngctl/ngctl.h
index 817c6e8..8c7155b 100644
--- a/usr.sbin/ngctl/ngctl.h
+++ b/usr.sbin/ngctl/ngctl.h
@@ -58,12 +58,15 @@
#include <netgraph/ng_socket.h>
#include <netgraph/ng_message.h>
+#define MAX_CMD_ALIAS 8
+
/* Command descriptors */
struct ngcmd {
- int (*func)(int ac, char **av);
- const char *cmd;
- const char *desc;
- const char *help;
+ int (*func)(int ac, char **av); /* command function */
+ const char *cmd; /* command usage */
+ const char *desc; /* description */
+ const char *help; /* help text */
+ const char *aliases[MAX_CMD_ALIAS]; /* command aliases */
};
/* Command return values */
@@ -78,6 +81,7 @@ extern const struct ngcmd debug_cmd;
extern const struct ngcmd help_cmd;
extern const struct ngcmd list_cmd;
extern const struct ngcmd mkpeer_cmd;
+extern const struct ngcmd msg_cmd;
extern const struct ngcmd name_cmd;
extern const struct ngcmd read_cmd;
extern const struct ngcmd rmhook_cmd;
OpenPOWER on IntegriCloud