From 5d83d171df44f3eeea633909f60d663b281955df Mon Sep 17 00:00:00 2001 From: brian Date: Thu, 16 Nov 2000 23:14:53 +0000 Subject: Go back to using data_len in struct ngpppoe_init_data after discussions with Julian and Archie. Implement a new ``sizedstring'' parse type for dealing with field pairs consisting of a uint16_t followed by a data field of that size, and use this to deal with the data_len and data fields. Written by: Archie with some input by me Agreed in principle by: julian --- sys/netgraph/ng_pppoe.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'sys/netgraph/ng_pppoe.h') diff --git a/sys/netgraph/ng_pppoe.h b/sys/netgraph/ng_pppoe.h index c357ecd..94cb95b 100644 --- a/sys/netgraph/ng_pppoe.h +++ b/sys/netgraph/ng_pppoe.h @@ -49,7 +49,7 @@ /* Node type name. This should be unique among all netgraph node types */ #define NG_PPPOE_NODE_TYPE "pppoe" -#define NGM_PPPOE_COOKIE 939032004 +#define NGM_PPPOE_COOKIE 939032003 /* Number of active sessions we can handle */ #define PPPOE_NUM_SESSIONS 16 /* for now */ @@ -114,15 +114,16 @@ struct ngpppoestat { * and begin negotiation. */ struct ngpppoe_init_data { - char hook[NG_HOOKLEN + 1]; /* hook to monitor on */ - char data[1]; /* init data goes here */ + char hook[NG_HOOKLEN + 1]; /* hook to monitor on */ + u_int16_t data_len; /* Length of the service name */ + char data[0]; /* init data goes here */ }; /* Keep this in sync with the above structure definition */ #define NG_PPPOE_INIT_DATA_TYPE_INFO { \ { \ { "hook", &ng_parse_hookbuf_type }, \ - { "data", &ng_parse_string_type }, \ + { "data", &ng_parse_sizedstring_type }, \ { NULL } \ } \ } -- cgit v1.1