Deleted Added
full compact
dot.c (124271) dot.c (125011)
1
2/*
3 * dot.c
4 *
5 * Copyright (c) 2004 Brian Fundakowski Feldman
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

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

30 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
31 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
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 *
1
2/*
3 * dot.c
4 *
5 * Copyright (c) 2004 Brian Fundakowski Feldman
6 * Copyright (c) 1996-1999 Whistle Communications, Inc.
7 * All rights reserved.
8 *

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

30 * WITHOUT LIMITATION, ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
31 * PUNITIVE, OR CONSEQUENTIAL DAMAGES, PROCUREMENT OF SUBSTITUTE GOODS OR
32 * SERVICES, LOSS OF USE, DATA OR PROFITS, HOWEVER CAUSED AND UNDER ANY
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 * $FreeBSD: head/usr.sbin/ngctl/dot.c 124271 2004-01-09 03:19:40Z green $
38 * $FreeBSD: head/usr.sbin/ngctl/dot.c 125011 2004-01-26 10:27:18Z ru $
39 */
40
41#include <inttypes.h>
42
43#include "ngctl.h"
44
45#define UNNAMED "\\<unnamed\\>"
46

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

56
57static int
58DotCmd(int ac, char **av)
59{
60 u_char nlrbuf[16 * 1024];
61 struct ng_mesg *const nlresp = (struct ng_mesg *)nlrbuf;
62 struct namelist *const nlist = (struct namelist *)nlresp->data;
63 FILE *f = stdout;
39 */
40
41#include <inttypes.h>
42
43#include "ngctl.h"
44
45#define UNNAMED "\\<unnamed\\>"
46

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

56
57static int
58DotCmd(int ac, char **av)
59{
60 u_char nlrbuf[16 * 1024];
61 struct ng_mesg *const nlresp = (struct ng_mesg *)nlrbuf;
62 struct namelist *const nlist = (struct namelist *)nlresp->data;
63 FILE *f = stdout;
64 int ch, i;
64 int ch;
65 u_int i;
65
66 /* Get options */
67 optind = 1;
68 while ((ch = getopt(ac, av, "")) != EOF) {
69 switch (ch) {
70 case '?':
71 default:
72 return (CMDRTN_USAGE);

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

124 fprintf(f, "\t};\n");
125
126 for (i = 0; i < nlist->numnames; i++) {
127 u_char hlrbuf[16 * 1024];
128 struct ng_mesg *const hlresp = (struct ng_mesg *)hlrbuf;
129 struct hooklist *const hlist = (struct hooklist *)hlresp->data;
130 struct nodeinfo *const ninfo = &hlist->nodeinfo;
131 char path[NG_PATHSIZ];
66
67 /* Get options */
68 optind = 1;
69 while ((ch = getopt(ac, av, "")) != EOF) {
70 switch (ch) {
71 case '?':
72 default:
73 return (CMDRTN_USAGE);

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

125 fprintf(f, "\t};\n");
126
127 for (i = 0; i < nlist->numnames; i++) {
128 u_char hlrbuf[16 * 1024];
129 struct ng_mesg *const hlresp = (struct ng_mesg *)hlrbuf;
130 struct hooklist *const hlist = (struct hooklist *)hlresp->data;
131 struct nodeinfo *const ninfo = &hlist->nodeinfo;
132 char path[NG_PATHSIZ];
132 int j;
133 u_int j;
133
134 (void)snprintf(path, sizeof(path), "[%jx]:",
135 (uintmax_t)nlist->nodeinfo[i].id);
136
137 /* Get node info and hook list */
138 if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_LISTHOOKS,
139 NULL, 0) < 0) {
140 warn("send listhooks msg");

--- 48 unchanged lines hidden ---
134
135 (void)snprintf(path, sizeof(path), "[%jx]:",
136 (uintmax_t)nlist->nodeinfo[i].id);
137
138 /* Get node info and hook list */
139 if (NgSendMsg(csock, path, NGM_GENERIC_COOKIE, NGM_LISTHOOKS,
140 NULL, 0) < 0) {
141 warn("send listhooks msg");

--- 48 unchanged lines hidden ---