From 14cb10664f95adf9dd36c845745d3d5c87d3d636 Mon Sep 17 00:00:00 2001 From: harti Date: Mon, 26 Jan 2004 14:05:31 +0000 Subject: Get rid of the deprecated *LEN constants in favour of the new *SIZ constants that include the trailing \0 byte. --- sys/netgraph/ng_message.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'sys/netgraph/ng_message.h') diff --git a/sys/netgraph/ng_message.h b/sys/netgraph/ng_message.h index ede2b95..4a5f479 100644 --- a/sys/netgraph/ng_message.h +++ b/sys/netgraph/ng_message.h @@ -71,7 +71,7 @@ struct ng_mesg { u_int32_t token; /* match with reply */ u_int32_t typecookie; /* node's type cookie */ u_int32_t cmd; /* command identifier */ - u_char cmdstr[NG_CMDSTRLEN+1]; /* cmd string + \0 */ + u_char cmdstr[NG_CMDSTRSIZ]; /* cmd string + \0 */ } header; char data[]; /* placeholder for actual data */ }; @@ -162,9 +162,9 @@ struct ng_mesg { #define NGM_SET_FLOW_MANAGER 48 /* send flow control here */ /* Structure used for NGM_MKPEER */ struct ngm_mkpeer { - char type[NG_TYPELEN + 1]; /* peer type */ - char ourhook[NG_HOOKLEN + 1]; /* hook name */ - char peerhook[NG_HOOKLEN + 1]; /* peer hook name */ + char type[NG_TYPESIZ]; /* peer type */ + char ourhook[NG_HOOKSIZ]; /* hook name */ + char peerhook[NG_HOOKSIZ]; /* peer hook name */ }; /* Keep this in sync with the above structure definition */ @@ -177,9 +177,9 @@ struct ngm_mkpeer { /* Structure used for NGM_CONNECT */ struct ngm_connect { - char path[NG_PATHLEN + 1]; /* peer path */ - char ourhook[NG_HOOKLEN + 1]; /* hook name */ - char peerhook[NG_HOOKLEN + 1]; /* peer hook name */ + char path[NG_PATHSIZ]; /* peer path */ + char ourhook[NG_HOOKSIZ]; /* hook name */ + char peerhook[NG_HOOKSIZ]; /* peer hook name */ }; /* Keep this in sync with the above structure definition */ @@ -192,7 +192,7 @@ struct ngm_connect { /* Structure used for NGM_NAME */ struct ngm_name { - char name[NG_NODELEN + 1]; /* node name */ + char name[NG_NODESIZ]; /* node name */ }; /* Keep this in sync with the above structure definition */ @@ -203,7 +203,7 @@ struct ngm_name { /* Structure used for NGM_RMHOOK */ struct ngm_rmhook { - char ourhook[NG_HOOKLEN + 1]; /* hook name */ + char ourhook[NG_HOOKSIZ]; /* hook name */ }; /* Keep this in sync with the above structure definition */ @@ -214,8 +214,8 @@ struct ngm_rmhook { /* Structure used for NGM_NODEINFO */ struct nodeinfo { - char name[NG_NODELEN + 1]; /* node name (if any) */ - char type[NG_TYPELEN + 1]; /* peer type */ + char name[NG_NODESIZ]; /* node name (if any) */ + char type[NG_TYPESIZ]; /* peer type */ ng_ID_t id; /* unique identifier */ u_int32_t hooks; /* number of active hooks */ }; @@ -231,8 +231,8 @@ struct nodeinfo { /* Structure used for NGM_LISTHOOKS */ struct linkinfo { - char ourhook[NG_HOOKLEN + 1]; /* hook name */ - char peerhook[NG_HOOKLEN + 1]; /* peer hook */ + char ourhook[NG_HOOKSIZ]; /* hook name */ + char peerhook[NG_HOOKSIZ]; /* peer hook */ struct nodeinfo nodeinfo; }; @@ -271,8 +271,8 @@ struct namelist { /* Structure used for NGM_LISTTYPES */ struct typeinfo { - char type_name[NG_TYPELEN + 1]; /* name of type */ - u_int32_t numnodes; /* number alive */ + char type_name[NG_TYPESIZ]; /* name of type */ + u_int32_t numnodes; /* number alive */ }; /* Keep this in sync with the above structure definition */ -- cgit v1.1