ng_base.c (159331) | ng_base.c (159373) |
---|---|
1/* 2 * ng_base.c 3 */ 4 5/*- 6 * Copyright (c) 1996-1999 Whistle Communications, Inc. 7 * All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36 * OF SUCH DAMAGE. 37 * 38 * Authors: Julian Elischer <julian@freebsd.org> 39 * Archie Cobbs <archie@freebsd.org> 40 * | 1/* 2 * ng_base.c 3 */ 4 5/*- 6 * Copyright (c) 1996-1999 Whistle Communications, Inc. 7 * All rights reserved. 8 * --- 24 unchanged lines hidden (view full) --- 33 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 35 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY 36 * OF SUCH DAMAGE. 37 * 38 * Authors: Julian Elischer <julian@freebsd.org> 39 * Archie Cobbs <archie@freebsd.org> 40 * |
41 * $FreeBSD: head/sys/netgraph/ng_base.c 159331 2006-06-06 08:05:27Z glebius $ | 41 * $FreeBSD: head/sys/netgraph/ng_base.c 159373 2006-06-07 12:42:15Z glebius $ |
42 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ 43 */ 44 45/* 46 * This file implements the base netgraph code. 47 */ 48 49#include <sys/param.h> --- 2599 unchanged lines hidden (view full) --- 2649 nl = (struct namelist *) resp->data; 2650 2651 /* Cycle through the linked list of nodes */ 2652 nl->numnames = 0; 2653 mtx_lock(&ng_nodelist_mtx); 2654 LIST_FOREACH(node, &ng_nodelist, nd_nodes) { 2655 struct nodeinfo *const np = &nl->nodeinfo[nl->numnames]; 2656 | 42 * $Whistle: ng_base.c,v 1.39 1999/01/28 23:54:53 julian Exp $ 43 */ 44 45/* 46 * This file implements the base netgraph code. 47 */ 48 49#include <sys/param.h> --- 2599 unchanged lines hidden (view full) --- 2649 nl = (struct namelist *) resp->data; 2650 2651 /* Cycle through the linked list of nodes */ 2652 nl->numnames = 0; 2653 mtx_lock(&ng_nodelist_mtx); 2654 LIST_FOREACH(node, &ng_nodelist, nd_nodes) { 2655 struct nodeinfo *const np = &nl->nodeinfo[nl->numnames]; 2656 |
2657 if (NG_NODE_NOT_VALID(node)) 2658 continue; 2659 if (!unnamed && (! NG_NODE_HAS_NAME(node))) 2660 continue; |
|
2657 if (nl->numnames >= num) { 2658 log(LOG_ERR, "%s: number of %s changed\n", 2659 __func__, "nodes"); 2660 break; 2661 } | 2661 if (nl->numnames >= num) { 2662 log(LOG_ERR, "%s: number of %s changed\n", 2663 __func__, "nodes"); 2664 break; 2665 } |
2662 if (NG_NODE_NOT_VALID(node)) 2663 continue; 2664 if (!unnamed && (! NG_NODE_HAS_NAME(node))) 2665 continue; | |
2666 if (NG_NODE_HAS_NAME(node)) 2667 strcpy(np->name, NG_NODE_NAME(node)); 2668 strcpy(np->type, node->nd_type->name); 2669 np->id = ng_node2ID(node); 2670 np->hooks = node->nd_numhooks; 2671 nl->numnames++; 2672 } 2673 mtx_unlock(&ng_nodelist_mtx); --- 1013 unchanged lines hidden --- | 2666 if (NG_NODE_HAS_NAME(node)) 2667 strcpy(np->name, NG_NODE_NAME(node)); 2668 strcpy(np->type, node->nd_type->name); 2669 np->id = ng_node2ID(node); 2670 np->hooks = node->nd_numhooks; 2671 nl->numnames++; 2672 } 2673 mtx_unlock(&ng_nodelist_mtx); --- 1013 unchanged lines hidden --- |