netgraph.h (859a4d166c0fc97b248bf33c8745b7494934b0bf) | netgraph.h (589f6ed8ce4b9da11cbdce95d6dcf9ad45792175) |
---|---|
1 2/* 3 * netgraph.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 --- 158 unchanged lines hidden (view full) --- 167 * Note the input queueing system is to allow modules 168 * to 'release the stack' or to pass data across spl layers. 169 * The data will be redelivered as soon as the NETISR code runs 170 * which may be almost immediatly. A node may also do it's own queueing 171 * for other reasons (e.g. device output queuing). 172 */ 173struct ng_type { 174 | 1 2/* 3 * netgraph.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 --- 158 unchanged lines hidden (view full) --- 167 * Note the input queueing system is to allow modules 168 * to 'release the stack' or to pass data across spl layers. 169 * The data will be redelivered as soon as the NETISR code runs 170 * which may be almost immediatly. A node may also do it's own queueing 171 * for other reasons (e.g. device output queuing). 172 */ 173struct ng_type { 174 |
175 u_int32_t version; /* must equal NG_VERSION */ | 175 u_int32_t version; /* must equal NG_API_VERSION */ |
176 const char *name; /* Unique type name */ 177 modeventhand_t mod_event; /* Module event handler (optional) */ 178 ng_constructor_t *constructor; /* Node constructor */ 179 ng_rcvmsg_t *rcvmsg; /* control messages come here */ 180 ng_shutdown_t *shutdown; /* reset, and free resources */ 181 ng_newhook_t *newhook; /* first notification of new hook */ 182 ng_findhook_t *findhook; /* only if you have lots of hooks */ 183 ng_connect_t *connect; /* final notification of new hook */ 184 ng_rcvdata_t *rcvdata; /* data comes here */ 185 ng_disconnect_t *disconnect; /* notify on disconnect */ 186 187 const struct ng_cmdlist *cmdlist; /* commands we can convert */ 188 189 /* R/W data private to the base netgraph code DON'T TOUCH! */ 190 LIST_ENTRY(ng_type) types; /* linked list of all types */ 191 int refs; /* number of instances */ 192}; 193 | 176 const char *name; /* Unique type name */ 177 modeventhand_t mod_event; /* Module event handler (optional) */ 178 ng_constructor_t *constructor; /* Node constructor */ 179 ng_rcvmsg_t *rcvmsg; /* control messages come here */ 180 ng_shutdown_t *shutdown; /* reset, and free resources */ 181 ng_newhook_t *newhook; /* first notification of new hook */ 182 ng_findhook_t *findhook; /* only if you have lots of hooks */ 183 ng_connect_t *connect; /* final notification of new hook */ 184 ng_rcvdata_t *rcvdata; /* data comes here */ 185 ng_disconnect_t *disconnect; /* notify on disconnect */ 186 187 const struct ng_cmdlist *cmdlist; /* commands we can convert */ 188 189 /* R/W data private to the base netgraph code DON'T TOUCH! */ 190 LIST_ENTRY(ng_type) types; /* linked list of all types */ 191 int refs; /* number of instances */ 192}; 193 |
194/* 195 * This defines the in-kernel binary interface version. 196 * It is possible to change this but leave the external message 197 * API the same. Each type also has it's own cookies for versioning as well. 198 */ 199#define NG_ABI_VERSION 5 200 |
|
194/* Send data packet with meta-data */ 195#define NG_SEND_DATA(err, hook, m, meta) \ 196 do { \ 197 (err) = ng_send_data((hook), (m), (meta), \ 198 NULL, NULL, NULL); \ 199 (m) = NULL; \ 200 (meta) = NULL; \ 201 } while (0) --- 114 unchanged lines hidden --- | 201/* Send data packet with meta-data */ 202#define NG_SEND_DATA(err, hook, m, meta) \ 203 do { \ 204 (err) = ng_send_data((hook), (m), (meta), \ 205 NULL, NULL, NULL); \ 206 (m) = NULL; \ 207 (meta) = NULL; \ 208 } while (0) --- 114 unchanged lines hidden --- |