summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2000-07-03 13:34:18 +0000
committerphk <phk@FreeBSD.org>2000-07-03 13:34:18 +0000
commitaec15566c7a9b50127fb40fbf5ae9c66b1bbf018 (patch)
treeb89fa950ecba2c01b005278180f73adcbadfac27
parente7f486457aa7b52a0c996b41a4351c072e162f5a (diff)
downloadFreeBSD-src-aec15566c7a9b50127fb40fbf5ae9c66b1bbf018.zip
FreeBSD-src-aec15566c7a9b50127fb40fbf5ae9c66b1bbf018.tar.gz
Experiemntal ascii based device configuration mechanism.
This may or may not survive, decision will be made well before 5.0-R
-rw-r--r--sys/netgraph/ng_base.c8
-rw-r--r--sys/netgraph/ng_message.h1
-rw-r--r--usr.sbin/ngctl/Makefile2
-rw-r--r--usr.sbin/ngctl/main.c1
-rw-r--r--usr.sbin/ngctl/ngctl.h1
5 files changed, 12 insertions, 1 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index 1c0d80e..00ba31a 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -267,6 +267,13 @@ static const struct ng_cmdlist ng_generic_cmds[] = {
},
{
NGM_GENERIC_COOKIE,
+ NGM_TEXT_CONFIG,
+ "textconfig",
+ NULL,
+ &ng_parse_string_type
+ },
+ {
+ NGM_GENERIC_COOKIE,
NGM_TEXT_STATUS,
"textstatus",
NULL,
@@ -1589,6 +1596,7 @@ ng_generic_msg(node_p here, struct ng_mesg *msg, const char *retaddr,
break;
}
+ case NGM_TEXT_CONFIG:
case NGM_TEXT_STATUS:
/*
* This one is tricky as it passes the command down to the
diff --git a/sys/netgraph/ng_message.h b/sys/netgraph/ng_message.h
index 7eeb97c..12b65ef 100644
--- a/sys/netgraph/ng_message.h
+++ b/sys/netgraph/ng_message.h
@@ -115,6 +115,7 @@ struct ng_mesg {
#define NGM_TEXT_STATUS 11 /* (optional) get text status report */
#define NGM_BINARY2ASCII 12 /* convert struct ng_mesg to ascii */
#define NGM_ASCII2BINARY 13 /* convert ascii to struct ng_mesg */
+#define NGM_TEXT_CONFIG 14 /* (optional) get/set text config */
/* Structure used for NGM_MKPEER */
struct ngm_mkpeer {
diff --git a/usr.sbin/ngctl/Makefile b/usr.sbin/ngctl/Makefile
index 468a17c..d8dee7c 100644
--- a/usr.sbin/ngctl/Makefile
+++ b/usr.sbin/ngctl/Makefile
@@ -2,7 +2,7 @@
# $Whistle: Makefile,v 1.3 1999/01/16 00:10:11 archie Exp $
PROG= ngctl
-SRCS= main.c mkpeer.c connect.c name.c show.c list.c \
+SRCS= main.c mkpeer.c config.c connect.c name.c show.c list.c \
msg.c debug.c shutdown.c rmhook.c status.c types.c
MAN8= ngctl.8
DPADD+= ${LIBNETGRAPH}
diff --git a/usr.sbin/ngctl/main.c b/usr.sbin/ngctl/main.c
index 67ffde3..9668fbe 100644
--- a/usr.sbin/ngctl/main.c
+++ b/usr.sbin/ngctl/main.c
@@ -59,6 +59,7 @@ static int QuitCmd(int ac, char **av);
/* List of commands */
static const struct ngcmd *const cmds[] = {
+ &config_cmd,
&connect_cmd,
&debug_cmd,
&help_cmd,
diff --git a/usr.sbin/ngctl/ngctl.h b/usr.sbin/ngctl/ngctl.h
index b66e74b..56d0a3d 100644
--- a/usr.sbin/ngctl/ngctl.h
+++ b/usr.sbin/ngctl/ngctl.h
@@ -75,6 +75,7 @@ struct ngcmd {
#define CMDRTN_QUIT 3
/* Available commands */
+extern const struct ngcmd config_cmd;
extern const struct ngcmd connect_cmd;
extern const struct ngcmd debug_cmd;
extern const struct ngcmd help_cmd;
OpenPOWER on IntegriCloud