Deleted Added
full compact
main.c (13433) main.c (13940)
1/*
2 * Copyright (c) 1983, 1988, 1993
3 * Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

175 { N_IDP, N_SPPSTAT, 1, nsprotopr,
176 spp_stats, "spp" },
177 { -1, N_NSERR, 1, 0,
178 nserr_stats, "ns_err" },
179 { -1, -1, 0, 0,
180 0, 0 }
181};
182
1/*
2 * Copyright (c) 1983, 1988, 1993
3 * Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

175 { N_IDP, N_SPPSTAT, 1, nsprotopr,
176 spp_stats, "spp" },
177 { -1, N_NSERR, 1, 0,
178 nserr_stats, "ns_err" },
179 { -1, -1, 0, 0,
180 0, 0 }
181};
182
183#ifdef ISO
183struct protox isoprotox[] = {
184 { ISO_TP, N_TPSTAT, 1, iso_protopr,
185 tp_stats, "tp" },
186 { N_CLTP, N_CLTPSTAT, 1, iso_protopr,
187 cltp_stats, "cltp" },
188 { -1, N_CLNPSTAT, 1, 0,
189 clnp_stats, "clnp"},
190 { -1, N_ESISSTAT, 1, 0,
191 esis_stats, "esis"},
192 { -1, -1, 0, 0,
193 0, 0 }
194};
184struct protox isoprotox[] = {
185 { ISO_TP, N_TPSTAT, 1, iso_protopr,
186 tp_stats, "tp" },
187 { N_CLTP, N_CLTPSTAT, 1, iso_protopr,
188 cltp_stats, "cltp" },
189 { -1, N_CLNPSTAT, 1, 0,
190 clnp_stats, "clnp"},
191 { -1, N_ESISSTAT, 1, 0,
192 esis_stats, "esis"},
193 { -1, -1, 0, 0,
194 0, 0 }
195};
196#endif
195
197
196struct protox *protoprotox[] = { protox, ipxprotox, nsprotox, isoprotox, NULL };
198struct protox *protoprotox[] = { protox, ipxprotox, nsprotox,
199#ifdef ISO
200 isoprotox,
201#endif
202 NULL };
197
198static void printproto __P((struct protox *, char *));
199static void usage __P((void));
200static struct protox *name2protox __P((char *));
201static struct protox *knownname __P((char *));
202
203kvm_t *kvmd;
204

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

241 if (strcmp(optarg, "ns") == 0)
242 af = AF_NS;
243 else if (strcmp(optarg, "ipx") == 0)
244 af = AF_IPX;
245 else if (strcmp(optarg, "inet") == 0)
246 af = AF_INET;
247 else if (strcmp(optarg, "unix") == 0)
248 af = AF_UNIX;
203
204static void printproto __P((struct protox *, char *));
205static void usage __P((void));
206static struct protox *name2protox __P((char *));
207static struct protox *knownname __P((char *));
208
209kvm_t *kvmd;
210

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

247 if (strcmp(optarg, "ns") == 0)
248 af = AF_NS;
249 else if (strcmp(optarg, "ipx") == 0)
250 af = AF_IPX;
251 else if (strcmp(optarg, "inet") == 0)
252 af = AF_INET;
253 else if (strcmp(optarg, "unix") == 0)
254 af = AF_UNIX;
255#ifdef ISO
249 else if (strcmp(optarg, "iso") == 0)
250 af = AF_ISO;
256 else if (strcmp(optarg, "iso") == 0)
257 af = AF_ISO;
258#endif
251 else {
252 errx(1, "%s: unknown address family", optarg);
253 }
254 break;
255 case 'g':
256 gflag = 1;
257 break;
258 case 'I': {

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

414 endprotoent();
415 }
416 if (af == AF_IPX || af == AF_UNSPEC)
417 for (tp = ipxprotox; tp->pr_name; tp++)
418 printproto(tp, tp->pr_name);
419 if (af == AF_NS || af == AF_UNSPEC)
420 for (tp = nsprotox; tp->pr_name; tp++)
421 printproto(tp, tp->pr_name);
259 else {
260 errx(1, "%s: unknown address family", optarg);
261 }
262 break;
263 case 'g':
264 gflag = 1;
265 break;
266 case 'I': {

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

422 endprotoent();
423 }
424 if (af == AF_IPX || af == AF_UNSPEC)
425 for (tp = ipxprotox; tp->pr_name; tp++)
426 printproto(tp, tp->pr_name);
427 if (af == AF_NS || af == AF_UNSPEC)
428 for (tp = nsprotox; tp->pr_name; tp++)
429 printproto(tp, tp->pr_name);
430#ifdef ISO
422 if (af == AF_ISO || af == AF_UNSPEC)
423 for (tp = isoprotox; tp->pr_name; tp++)
424 printproto(tp, tp->pr_name);
431 if (af == AF_ISO || af == AF_UNSPEC)
432 for (tp = isoprotox; tp->pr_name; tp++)
433 printproto(tp, tp->pr_name);
434#endif
425 if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag)
426 unixpr(nl[N_UNIXSW].n_value);
427 exit(0);
428}
429
430/*
431 * Print out protocol statistics or control blocks (per sflag).
432 * If the interface was not specifically requested, and the symbol

--- 142 unchanged lines hidden ---
435 if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag)
436 unixpr(nl[N_UNIXSW].n_value);
437 exit(0);
438}
439
440/*
441 * Print out protocol statistics or control blocks (per sflag).
442 * If the interface was not specifically requested, and the symbol

--- 142 unchanged lines hidden ---