Deleted Added
full compact
ng_message.h (69922) ng_message.h (70159)
1
2/*
3 * ng_message.h
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

--- 22 unchanged lines hidden (view full) ---

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * Author: Julian Elischer <julian@freebsd.org>
38 *
1
2/*
3 * ng_message.h
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

--- 22 unchanged lines hidden (view full) ---

31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * Author: Julian Elischer <julian@freebsd.org>
38 *
39 * $FreeBSD: head/sys/netgraph/ng_message.h 69922 2000-12-12 18:52:14Z julian $
39 * $FreeBSD: head/sys/netgraph/ng_message.h 70159 2000-12-18 20:03:32Z julian $
40 * $Whistle: ng_message.h,v 1.12 1999/01/25 01:17:44 archie Exp $
41 */
42
43#ifndef _NETGRAPH_NG_MESSAGE_H_
44#define _NETGRAPH_NG_MESSAGE_H_ 1
45
46/* ASCII string size limits */
47#define NG_TYPELEN 15 /* max type name len (16 with null) */
48#define NG_HOOKLEN 15 /* max hook name len (16 with null) */
49#define NG_NODELEN 15 /* max node name len (16 with null) */
50#define NG_PATHLEN 511 /* max path len (512 with null) */
51#define NG_CMDSTRLEN 15 /* max command string (16 with null) */
52#define NG_TEXTRESPONSE 1024 /* allow this length for a text response */
53
54/* A netgraph message */
55struct ng_mesg {
56 struct ng_msghdr {
40 * $Whistle: ng_message.h,v 1.12 1999/01/25 01:17:44 archie Exp $
41 */
42
43#ifndef _NETGRAPH_NG_MESSAGE_H_
44#define _NETGRAPH_NG_MESSAGE_H_ 1
45
46/* ASCII string size limits */
47#define NG_TYPELEN 15 /* max type name len (16 with null) */
48#define NG_HOOKLEN 15 /* max hook name len (16 with null) */
49#define NG_NODELEN 15 /* max node name len (16 with null) */
50#define NG_PATHLEN 511 /* max path len (512 with null) */
51#define NG_CMDSTRLEN 15 /* max command string (16 with null) */
52#define NG_TEXTRESPONSE 1024 /* allow this length for a text response */
53
54/* A netgraph message */
55struct ng_mesg {
56 struct ng_msghdr {
57 u_char version; /* must == NG_VERSION */
57 u_char version; /* == NGM_VERSION */
58 u_char spare; /* pad to 2 bytes */
59 u_int16_t arglen; /* length of data */
60 u_int32_t flags; /* message status */
61 u_int32_t token; /* match with reply */
62 u_int32_t typecookie; /* node's type cookie */
63 u_int32_t cmd; /* command identifier */
64 u_char cmdstr[NG_CMDSTRLEN+1]; /* cmd string + \0 */
65 } header;
66 char data[0]; /* placeholder for actual data */
67};
68
58 u_char spare; /* pad to 2 bytes */
59 u_int16_t arglen; /* length of data */
60 u_int32_t flags; /* message status */
61 u_int32_t token; /* match with reply */
62 u_int32_t typecookie; /* node's type cookie */
63 u_int32_t cmd; /* command identifier */
64 u_char cmdstr[NG_CMDSTRLEN+1]; /* cmd string + \0 */
65 } header;
66 char data[0]; /* placeholder for actual data */
67};
68
69
69/* Keep this in sync with the above structure definition */
70#define NG_GENERIC_NG_MESG_INFO(dtype) { \
71 { \
72 { "version", &ng_parse_uint8_type }, \
73 { "spare", &ng_parse_uint8_type }, \
74 { "arglen", &ng_parse_uint16_type }, \
75 { "flags", &ng_parse_hint32_type }, \
76 { "token", &ng_parse_uint32_type }, \
77 { "typecookie", &ng_parse_uint32_type }, \
78 { "cmd", &ng_parse_uint32_type }, \
79 { "cmdstr", &ng_parse_cmdbuf_type }, \
80 { "data", (dtype) }, \
81 { NULL }, \
82 } \
83}
84
70/* Keep this in sync with the above structure definition */
71#define NG_GENERIC_NG_MESG_INFO(dtype) { \
72 { \
73 { "version", &ng_parse_uint8_type }, \
74 { "spare", &ng_parse_uint8_type }, \
75 { "arglen", &ng_parse_uint16_type }, \
76 { "flags", &ng_parse_hint32_type }, \
77 { "token", &ng_parse_uint32_type }, \
78 { "typecookie", &ng_parse_uint32_type }, \
79 { "cmd", &ng_parse_uint32_type }, \
80 { "cmdstr", &ng_parse_cmdbuf_type }, \
81 { "data", (dtype) }, \
82 { NULL }, \
83 } \
84}
85
85/* Negraph type binary compatibility field */
86/*
87 * Netgraph message header compatibility field
88 * Interfaces within the kernel are defined by a different
89 * value (see NG_ABI_VERSION in netgraph.g)
90 */
86#define NG_VERSION 4
87
88/* Flags field flags */
89#define NGF_ORIG 0x0000 /* the msg is the original request */
90#define NGF_RESP 0x0001 /* the message is a response */
91
92/* Type of a unique node ID */
93#define ng_ID_t unsigned int

--- 326 unchanged lines hidden ---
91#define NG_VERSION 4
92
93/* Flags field flags */
94#define NGF_ORIG 0x0000 /* the msg is the original request */
95#define NGF_RESP 0x0001 /* the message is a response */
96
97/* Type of a unique node ID */
98#define ng_ID_t unsigned int

--- 326 unchanged lines hidden ---