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 --- 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/netgraph.h 70159 2000-12-18 20:03:32Z julian $ |
40 * $Whistle: netgraph.h,v 1.29 1999/11/01 07:56:13 julian Exp $ 41 */ 42 43#ifndef _NETGRAPH_NETGRAPH_H_ 44#define _NETGRAPH_NETGRAPH_H_ 1 45 46#include <sys/queue.h> 47#include <sys/malloc.h> --- 119 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_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 |
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 |
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 --- |