Deleted Added
full compact
list.c (158882) list.c (160002)
1
2/*
3 * list.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

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

29 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
30 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
1
2/*
3 * list.c
4 *
5 * Copyright (c) 1996-1999 Whistle Communications, Inc.
6 * All rights reserved.
7 *
8 * Subject to the following obligations and disclaimer of warranty, use and

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

29 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
30 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
31 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
32 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34 * THIS SOFTWARE, EVEN IF WHISTLE COMMUNICATIONS IS ADVISED OF THE POSSIBILITY
35 * OF SUCH DAMAGE.
36 *
37 * $FreeBSD: head/usr.sbin/ngctl/list.c 158882 2006-05-24 14:46:55Z glebius $
37 * $FreeBSD: head/usr.sbin/ngctl/list.c 160002 2006-06-28 10:38:38Z glebius $
38 */
39
40#include <err.h>
41#include <netgraph.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <unistd.h>
45

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

78 case 'l':
79 list_hooks = 1;
80 break;
81 case 'n':
82 named_only = 1;
83 break;
84 case '?':
85 default:
38 */
39
40#include <err.h>
41#include <netgraph.h>
42#include <stdio.h>
43#include <stdlib.h>
44#include <unistd.h>
45

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

78 case 'l':
79 list_hooks = 1;
80 break;
81 case 'n':
82 named_only = 1;
83 break;
84 case '?':
85 default:
86 return(CMDRTN_USAGE);
86 return (CMDRTN_USAGE);
87 break;
88 }
89 }
90 ac -= optind;
91 av += optind;
92
93 /* Get arguments */
94 switch (ac) {
95 case 0:
96 break;
97 default:
87 break;
88 }
89 }
90 ac -= optind;
91 av += optind;
92
93 /* Get arguments */
94 switch (ac) {
95 case 0:
96 break;
97 default:
98 return(CMDRTN_USAGE);
98 return (CMDRTN_USAGE);
99 }
100
101 /* Get list of nodes */
102 if (NgSendMsg(csock, ".", NGM_GENERIC_COOKIE,
103 named_only ? NGM_LISTNAMES : NGM_LISTNODES, NULL, 0) < 0) {
104 warn("send msg");
99 }
100
101 /* Get list of nodes */
102 if (NgSendMsg(csock, ".", NGM_GENERIC_COOKIE,
103 named_only ? NGM_LISTNAMES : NGM_LISTNODES, NULL, 0) < 0) {
104 warn("send msg");
105 return(CMDRTN_ERROR);
105 return (CMDRTN_ERROR);
106 }
107 if (NgAllocRecvMsg(csock, &resp, NULL) < 0) {
108 warn("recv msg");
106 }
107 if (NgAllocRecvMsg(csock, &resp, NULL) < 0) {
108 warn("recv msg");
109 return(CMDRTN_ERROR);
109 return (CMDRTN_ERROR);
110 }
111
112 /* Show each node */
113 nlist = (struct namelist *) resp->data;
114 printf("There are %d total %snodes:\n",
115 nlist->numnames, named_only ? "named " : "");
116 ninfo = nlist->nodeinfo;
117 if (list_hooks) {

--- 29 unchanged lines hidden ---
110 }
111
112 /* Show each node */
113 nlist = (struct namelist *) resp->data;
114 printf("There are %d total %snodes:\n",
115 nlist->numnames, named_only ? "named " : "");
116 ninfo = nlist->nodeinfo;
117 if (list_hooks) {

--- 29 unchanged lines hidden ---