summaryrefslogtreecommitdiffstats
path: root/share/man/man4/netgraph.4
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2003-11-12 13:24:03 +0000
committerharti <harti@FreeBSD.org>2003-11-12 13:24:03 +0000
commit855fcc6f63987689c99598593af8f7d265483238 (patch)
treefbd07f379b7326fbb93011df856fdcf68facb0dd /share/man/man4/netgraph.4
parent173237aab3267754048a84a6b70fb2a52e6e4dc3 (diff)
downloadFreeBSD-src-855fcc6f63987689c99598593af8f7d265483238.zip
FreeBSD-src-855fcc6f63987689c99598593af8f7d265483238.tar.gz
Document that the length of a command string is now 32. Also change all
occurences of the old *LEN definitions to the new *SIZ definitions. Correct the example how to compare a nodename. strncmp(name, "fred", NG_NODELEN) may step behind "fred" if the node name is really fred. Reminded by: ru
Diffstat (limited to 'share/man/man4/netgraph.4')
-rw-r--r--share/man/man4/netgraph.412
1 files changed, 6 insertions, 6 deletions
diff --git a/share/man/man4/netgraph.4 b/share/man/man4/netgraph.4
index 0c0ba98..77d8208 100644
--- a/share/man/man4/netgraph.4
+++ b/share/man/man4/netgraph.4
@@ -103,7 +103,7 @@ The name must not contain the characters
or
.Dq \&:
and is limited to
-.Dv "NG_NODELEN + 1"
+.Dv "NG_NODESIZ"
characters (including NUL byte).
.Pp
Each node instance has a unique
@@ -134,7 +134,7 @@ or a
.Dq \&:
and is
limited to
-.Dv "NG_HOOKLEN + 1"
+.Dv "NG_HOOKSIZ"
characters (including NUL byte).
.It
A hook is always connected to another hook.
@@ -696,9 +696,9 @@ if
.Fn ( NG_NODE_NAME "node"
[0]) ....
.Pp
-if (strncmp(
+if (strcmp(
.Fn NG_NODE_NAME "node" ,
-"fred", NG_NODELEN)) ...
+"fred")) ...
.Pp
.It
A node dependent opaque cookie
@@ -815,7 +815,7 @@ and should be used as a starting point for new node writers.
.Ss Netgraph Message Structure
Control messages have the following structure:
.Bd -literal
-#define NG_CMDSTRLEN 15 /* Max command string (16 with null) */
+#define NG_CMDSTRSIZ 32 /* Max command string (including nul) */
struct ng_mesg {
struct ng_msghdr {
@@ -826,7 +826,7 @@ struct ng_mesg {
u_long token; /* Reply should have the same token */
u_long typecookie; /* Node type understanding this message */
u_long cmd; /* Command identifier */
- u_char cmdstr[NG_CMDSTRLEN+1]; /* Cmd string (for debug) */
+ u_char cmdstr[NG_CMDSTRSIZ]; /* Cmd string (for debug) */
} header;
char data[0]; /* Start of cmd/resp data */
};
OpenPOWER on IntegriCloud