summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_hole.c
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2001-01-06 00:46:47 +0000
committerjulian <julian@FreeBSD.org>2001-01-06 00:46:47 +0000
commitf0c46a9d00fc9fe4644cef5784e76b360f5036c7 (patch)
tree561902279f2f361f3e137f7fc029ce2714981289 /sys/netgraph/ng_hole.c
parente06f071f56cf6badae9215f8a14ccc66a3fc0f5a (diff)
downloadFreeBSD-src-f0c46a9d00fc9fe4644cef5784e76b360f5036c7.zip
FreeBSD-src-f0c46a9d00fc9fe4644cef5784e76b360f5036c7.tar.gz
Rewrite of netgraph to start getting ready for SMP.
This version is functional and is aproaching solid.. notice I said APROACHING. There are many node types I cannot test I have tested: echo hole ppp socket vjc iface tee bpf async tty The rest compile and "Look" right. More changes to follow. DEBUGGING is enabled in this code to help if people have problems.
Diffstat (limited to 'sys/netgraph/ng_hole.c')
-rw-r--r--sys/netgraph/ng_hole.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/sys/netgraph/ng_hole.c b/sys/netgraph/ng_hole.c
index 1da47b6..92fa603 100644
--- a/sys/netgraph/ng_hole.c
+++ b/sys/netgraph/ng_hole.c
@@ -53,33 +53,42 @@
#include <netgraph/ng_hole.h>
/* Netgraph methods */
+static ng_constructor_t ngh_cons;
static ng_rcvdata_t ngh_rcvdata;
static ng_disconnect_t ngh_disconnect;
static struct ng_type typestruct = {
NG_ABI_VERSION,
NG_HOLE_NODE_TYPE,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- ngh_rcvdata,
- ngh_disconnect,
- NULL
+ NULL, /* modeventhand_t */
+ ngh_cons, /* ng_constructor_t */
+ NULL, /* ng_rcvmsg_t */
+ NULL, /* ng_shutdown_t */
+ NULL, /* ng_newhook_t */
+ NULL, /* ng_findhook_t */
+ NULL, /* ng_connect_t */
+ ngh_rcvdata, /* ng_rcvdata_t */
+ ngh_disconnect, /* ng_disconnect_t */
+ NULL /* ng_cmdlist */
};
NETGRAPH_INIT(hole, &typestruct);
+/*
+ * Be obliging. but no work to do.
+ */
+static int
+ngh_cons(node_p node)
+{
+ return(0);
+}
+
/*
* Receive data
*/
static int
-ngh_rcvdata(hook_p hook, struct mbuf *m, meta_p meta,
- struct mbuf **ret_m, meta_p *ret_meta, struct ng_mesg **resp)
+ngh_rcvdata(hook_p hook, item_p item)
{
- NG_FREE_DATA(m, meta);
+ NG_FREE_ITEM(item);
return 0;
}
@@ -90,6 +99,6 @@ static int
ngh_disconnect(hook_p hook)
{
if (hook->node->numhooks == 0)
- ng_rmnode(hook->node);
+ ng_rmnode_self(hook->node);
return (0);
}
OpenPOWER on IntegriCloud