ng_source.c (108107) | ng_source.c (108172) |
---|---|
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 108107 2002-12-19 22:58:27Z bmilekic $ | 37 * $FreeBSD: head/sys/netgraph/ng_source.c 108172 2002-12-22 05:35:03Z hsu $ |
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. --- 430 unchanged lines hidden (view full) --- 476 if (msg->header.arglen < sizeof(u_int32_t)) 477 return (EINVAL); 478 479 if_index = *(u_int32_t *)msg->data; 480 /* Could use ifindex2ifnet[if_index] except that we have no 481 * way of verifying if_index is valid since if_indexlim is 482 * local to if_attach() 483 */ | 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. --- 430 unchanged lines hidden (view full) --- 476 if (msg->header.arglen < sizeof(u_int32_t)) 477 return (EINVAL); 478 479 if_index = *(u_int32_t *)msg->data; 480 /* Could use ifindex2ifnet[if_index] except that we have no 481 * way of verifying if_index is valid since if_indexlim is 482 * local to if_attach() 483 */ |
484 IFNET_RLOCK(); |
|
484 TAILQ_FOREACH(ifp, &ifnet, if_link) { 485 if (ifp->if_index == if_index) 486 break; 487 } | 485 TAILQ_FOREACH(ifp, &ifnet, if_link) { 486 if (ifp->if_index == if_index) 487 break; 488 } |
489 IFNET_RUNLOCK(); |
|
488 489 if (ifp == NULL) { 490 printf("%s: can't find interface %d\n", __FUNCTION__, if_index); 491 return (EINVAL); 492 } 493 sc->output_ifp = ifp; 494 495#if 1 --- 187 unchanged lines hidden --- | 490 491 if (ifp == NULL) { 492 printf("%s: can't find interface %d\n", __FUNCTION__, if_index); 493 return (EINVAL); 494 } 495 sc->output_ifp = ifp; 496 497#if 1 --- 187 unchanged lines hidden --- |