Deleted Added
full compact
ng_source.c (132464) ng_source.c (137136)
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

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

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
38#include <sys/cdefs.h>
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

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

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
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/netgraph/ng_source.c 132464 2004-07-20 17:15:38Z julian $");
39__FBSDID("$FreeBSD: head/sys/netgraph/ng_source.c 137136 2004-11-02 20:26:41Z glebius $");
40
41/*
42 * This node is used for high speed packet geneneration. It queues
43 * all data recieved on it's 'input' hook and when told to start via
44 * a control message it sends the packets out it's 'output' hook. In
45 * this way this node can be preloaded with a packet stream which is
46 * continuously sent.
47 *

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

622 packets = ifq->ifq_maxlen - ifq->ifq_len;
623 } else
624 packets = sc->snd_queue.ifq_len;
625
626 ng_source_send(sc, packets, NULL);
627 if (sc->packets == 0)
628 ng_source_stop(sc);
629 else
40
41/*
42 * This node is used for high speed packet geneneration. It queues
43 * all data recieved on it's 'input' hook and when told to start via
44 * a control message it sends the packets out it's 'output' hook. In
45 * this way this node can be preloaded with a packet stream which is
46 * continuously sent.
47 *

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

622 packets = ifq->ifq_maxlen - ifq->ifq_len;
623 } else
624 packets = sc->snd_queue.ifq_len;
625
626 ng_source_send(sc, packets, NULL);
627 if (sc->packets == 0)
628 ng_source_stop(sc);
629 else
630 sc->intr_ch = ng_timeout(node, NULL, 0,
631 ng_source_intr, sc, NG_SOURCE_INTR_TICKS);
630 sc->intr_ch = ng_timeout(node, NULL, NG_SOURCE_INTR_TICKS,
631 ng_source_intr, sc, 0);
632}
633
634/*
635 * Send packets out our output hook
636 */
637static int
638ng_source_send (sc_p sc, int tosend, int *sent_p)
639{

--- 57 unchanged lines hidden ---
632}
633
634/*
635 * Send packets out our output hook
636 */
637static int
638ng_source_send (sc_p sc, int tosend, int *sent_p)
639{

--- 57 unchanged lines hidden ---