Deleted Added
full compact
ng_source.c (125029) ng_source.c (125030)
1/*
2 * ng_source.c
3 *
4 * Copyright 2002 Sandvine Inc.
5 * All rights reserved.
6 *
7 * Subject to the following obligations and disclaimer of warranty, use and
8 * redistribution of this software, in source or object code forms, with or

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

29 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF SANDVINE IS ADVISED OF THE POSSIBILITY OF SUCH
33 * DAMAGE.
34 *
35 * Author: Dave Chapeskie <dchapeskie@sandvine.com>
36 *
1/*
2 * ng_source.c
3 *
4 * Copyright 2002 Sandvine Inc.
5 * All rights reserved.
6 *
7 * Subject to the following obligations and disclaimer of warranty, use and
8 * redistribution of this software, in source or object code forms, with or

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

29 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
30 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 * THIS SOFTWARE, EVEN IF SANDVINE IS ADVISED OF THE POSSIBILITY OF SUCH
33 * DAMAGE.
34 *
35 * Author: Dave Chapeskie <dchapeskie@sandvine.com>
36 *
37 * $FreeBSD: head/sys/netgraph/ng_source.c 125029 2004-01-26 14:14:09Z harti $
37 * $FreeBSD: head/sys/netgraph/ng_source.c 125030 2004-01-26 14:44:36Z harti $
38 */
39
40/*
41 * This node is used for high speed packet geneneration. It queues
42 * all data recieved on it's 'input' hook and when told to start via
43 * a control message it sends the packets out it's 'output' hook. In
44 * this way this node can be preloaded with a packet stream which is
45 * continuously sent.

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

212/*
213 * Node constructor
214 */
215static int
216ng_source_constructor(node_p node)
217{
218 sc_p sc;
219
38 */
39
40/*
41 * This node is used for high speed packet geneneration. It queues
42 * all data recieved on it's 'input' hook and when told to start via
43 * a control message it sends the packets out it's 'output' hook. In
44 * this way this node can be preloaded with a packet stream which is
45 * continuously sent.

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

212/*
213 * Node constructor
214 */
215static int
216ng_source_constructor(node_p node)
217{
218 sc_p sc;
219
220 MALLOC(sc, sc_p, sizeof(*sc), M_NETGRAPH, M_NOWAIT);
220 sc = malloc(sizeof(*sc), M_NETGRAPH, M_NOWAIT | M_ZERO);
221 if (sc == NULL)
222 return (ENOMEM);
221 if (sc == NULL)
222 return (ENOMEM);
223 bzero(sc, sizeof(*sc));
224
225 NG_NODE_SET_PRIVATE(node, sc);
226 sc->node = node;
227 sc->snd_queue.ifq_maxlen = 2048; /* XXX not checked */
228 callout_handle_init(&sc->intr_ch); /* XXX fix.. will
229 cause problems. */
230 return (0);
231}

--- 453 unchanged lines hidden ---
223
224 NG_NODE_SET_PRIVATE(node, sc);
225 sc->node = node;
226 sc->snd_queue.ifq_maxlen = 2048; /* XXX not checked */
227 callout_handle_init(&sc->intr_ch); /* XXX fix.. will
228 cause problems. */
229 return (0);
230}

--- 453 unchanged lines hidden ---