ng_device.c (84333769ed314d1ca2a58571f06b08ca214794f9) ng_device.c (b3e3ef9836f7918fd91253e8083a9a635334c750)
1/*
2 * Copyright (c) 2002 Mark Santcroos <marks@ripe.net>
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

26 * This node presents a /dev/ngd%d device that interfaces to an other
27 * netgraph node.
28 *
29 * $FreeBSD$
30 *
31 */
32
33#include <sys/param.h>
1/*
2 * Copyright (c) 2002 Mark Santcroos <marks@ripe.net>
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

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

26 * This node presents a /dev/ngd%d device that interfaces to an other
27 * netgraph node.
28 *
29 * $FreeBSD$
30 *
31 */
32
33#include <sys/param.h>
34#include <sys/systm.h>
34#include <sys/conf.h>
35#include <sys/ioccom.h>
35#include <sys/kernel.h>
36#include <sys/kernel.h>
36#include <sys/mbuf.h>
37#include <sys/uio.h>
38#include <sys/queue.h>
39#include <sys/malloc.h>
37#include <sys/malloc.h>
40#include <sys/conf.h>
38#include <sys/mbuf.h>
41#include <sys/poll.h>
39#include <sys/poll.h>
42#include <sys/ioccom.h>
40#include <sys/queue.h>
41#include <sys/systm.h>
42#include <sys/uio.h>
43
44#include <netgraph/ng_message.h>
45#include <netgraph/netgraph.h>
43
44#include <netgraph/ng_message.h>
45#include <netgraph/netgraph.h>
46#include <netgraph/ng_device.h>
46
47
47#include "ng_device.h"
48
49/* turn this on for verbose messages */
50#define NGD_DEBUG
51
52/* Netgraph methods */
53static ng_constructor_t ng_device_cons;
54static ng_rcvmsg_t ng_device_rcvmsg;
55static ng_newhook_t ng_device_newhook;
56static ng_connect_t ng_device_connect;

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

472 printf("%s(): msg == NULL\n",__func__);
473 goto nomsg;
474 }
475
476 /* pass the ioctl data into the ->data area */
477 datap = (struct ngd_param_s *)msg->data;
478 datap->p = addr;
479
48/* turn this on for verbose messages */
49#define NGD_DEBUG
50
51/* Netgraph methods */
52static ng_constructor_t ng_device_cons;
53static ng_rcvmsg_t ng_device_rcvmsg;
54static ng_newhook_t ng_device_newhook;
55static ng_connect_t ng_device_connect;

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

471 printf("%s(): msg == NULL\n",__func__);
472 goto nomsg;
473 }
474
475 /* pass the ioctl data into the ->data area */
476 datap = (struct ngd_param_s *)msg->data;
477 datap->p = addr;
478
480 /* NG_SEND_MSG_HOOK(error, here, msg, hook, retaddr) */
481 NG_SEND_MSG_HOOK(error, sc->node, msg, connection->active_hook, NULL);
479 NG_SEND_MSG_HOOK(error, sc->node, msg, connection->active_hook, 0);
482 if(error)
483 printf("%s(): NG_SEND_MSG_HOOK error: %d\n",__func__,error);
484
485nomsg:
486
487 return(0);
488}
489

--- 135 unchanged lines hidden ---
480 if(error)
481 printf("%s(): NG_SEND_MSG_HOOK error: %d\n",__func__,error);
482
483nomsg:
484
485 return(0);
486}
487

--- 135 unchanged lines hidden ---