main.c revision 151557
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 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by the University of 16 * California, Berkeley and its contributors. 17 * 4. Neither the name of the University nor the names of its contributors 18 * may be used to endorse or promote products derived from this software 19 * without specific prior written permission. 20 * 21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35char const copyright[] = 36"@(#) Copyright (c) 1983, 1988, 1993\n\ 37 Regents of the University of California. All rights reserved.\n"; 38#endif /* not lint */ 39 40#if 0 41#ifndef lint 42static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 3/1/94"; 43#endif /* not lint */ 44#endif 45 46#include <sys/cdefs.h> 47__FBSDID("$FreeBSD: head/usr.bin/netstat/main.c 151557 2005-10-22 17:50:45Z mlaier $"); 48 49#include <sys/param.h> 50#include <sys/file.h> 51#include <sys/protosw.h> 52#include <sys/socket.h> 53 54#include <netinet/in.h> 55 56#include <netgraph/ng_socket.h> 57 58#include <ctype.h> 59#include <err.h> 60#include <errno.h> 61#include <kvm.h> 62#include <limits.h> 63#include <netdb.h> 64#include <nlist.h> 65#include <paths.h> 66#include <stdio.h> 67#include <stdlib.h> 68#include <string.h> 69#include <unistd.h> 70#include "netstat.h" 71 72static struct nlist nl[] = { 73#define N_IFNET 0 74 { "_ifnet" }, 75#define N_RTSTAT 1 76 { "_rtstat" }, 77#define N_RTREE 2 78 { "_rt_tables"}, 79#define N_MRTSTAT 3 80 { "_mrtstat" }, 81#define N_MFCTABLE 4 82 { "_mfctable" }, 83#define N_VIFTABLE 5 84 { "_viftable" }, 85#define N_IPX 6 86 { "_ipxpcb_list"}, 87#define N_IPXSTAT 7 88 { "_ipxstat"}, 89#define N_SPXSTAT 8 90 { "_spx_istat"}, 91#define N_DDPSTAT 9 92 { "_ddpstat"}, 93#define N_DDPCB 10 94 { "_ddpcb"}, 95#define N_NGSOCKS 11 96 { "_ngsocklist"}, 97#define N_IP6STAT 12 98 { "_ip6stat" }, 99#define N_ICMP6STAT 13 100 { "_icmp6stat" }, 101#define N_IPSECSTAT 14 102 { "_ipsecstat" }, 103#define N_IPSEC6STAT 15 104 { "_ipsec6stat" }, 105#define N_PIM6STAT 16 106 { "_pim6stat" }, 107#define N_MRT6STAT 17 108 { "_mrt6stat" }, 109#define N_MF6CTABLE 18 110 { "_mf6ctable" }, 111#define N_MIF6TABLE 19 112 { "_mif6table" }, 113#define N_PFKEYSTAT 20 114 { "_pfkeystat" }, 115#define N_MBSTAT 21 116 { "_mbstat" }, 117#define N_MBTYPES 22 118 { "_mbtypes" }, 119#define N_NMBCLUSTERS 23 120 { "_nmbclusters" }, 121#define N_NMBUFS 24 122 { "_nmbufs" }, 123#define N_MBHI 25 124 { "_mbuf_hiwm" }, 125#define N_CLHI 26 126 { "_clust_hiwm" }, 127#define N_NCPUS 27 128 { "_smp_cpus" }, 129#define N_PAGESZ 28 130 { "_pagesize" }, 131#define N_MBPSTAT 29 132 { "_mb_statpcpu" }, 133#define N_RTTRASH 30 134 { "_rttrash" }, 135#define N_MBLO 31 136 { "_mbuf_lowm" }, 137#define N_CLLO 32 138 { "_clust_lowm" }, 139#define N_CARPSTAT 33 140 { "_carpstats" }, 141#define N_PFSYNCSTAT 34 142 { "_pfsyncstats" }, 143 { "" }, 144}; 145 146struct protox { 147 u_char pr_index; /* index into nlist of cb head */ 148 u_char pr_sindex; /* index into nlist of stat block */ 149 u_char pr_wanted; /* 1 if wanted, 0 otherwise */ 150 void (*pr_cblocks)(u_long, const char *, int); 151 /* control blocks printing routine */ 152 void (*pr_stats)(u_long, const char *, int); 153 /* statistics printing routine */ 154 void (*pr_istats)(char *); /* per/if statistics printing routine */ 155 const char *pr_name; /* well-known name */ 156 u_long pr_usesysctl; /* non-zero if we use sysctl, not kvm */ 157} protox[] = { 158 { -1, -1, 1, protopr, 159 tcp_stats, NULL, "tcp", IPPROTO_TCP }, 160 { -1, -1, 1, protopr, 161 udp_stats, NULL, "udp", IPPROTO_UDP }, 162 { -1, -1, 1, protopr, 163 NULL, NULL, "divert",IPPROTO_DIVERT }, 164 { -1, -1, 1, protopr, 165 ip_stats, NULL, "ip", IPPROTO_RAW }, 166 { -1, -1, 1, protopr, 167 icmp_stats, NULL, "icmp", IPPROTO_ICMP }, 168 { -1, -1, 1, protopr, 169 igmp_stats, NULL, "igmp", IPPROTO_IGMP }, 170#ifdef IPSEC 171 { -1, N_IPSECSTAT, 1, NULL, 172 ipsec_stats, NULL, "ipsec", 0}, 173#endif 174 { -1, -1, 1, protopr, 175 pim_stats, NULL, "pim", IPPROTO_PIM }, 176 { -1, N_CARPSTAT, 1, 0, 177 carp_stats, NULL, "carp", 0}, 178 { -1, -1, 1, NULL, 179 pfsync_stats, NULL, "pfsync", 1}, 180 { -1, -1, 0, NULL, 181 NULL, NULL, NULL, 0 } 182}; 183 184#ifdef INET6 185struct protox ip6protox[] = { 186 { -1, -1, 1, protopr, 187 tcp_stats, NULL, "tcp", IPPROTO_TCP }, 188 { -1, -1, 1, protopr, 189 udp_stats, NULL, "udp", IPPROTO_UDP }, 190 { -1, N_IP6STAT, 1, protopr, 191 ip6_stats, ip6_ifstats, "ip6", IPPROTO_RAW }, 192 { -1, N_ICMP6STAT, 1, protopr, 193 icmp6_stats, icmp6_ifstats, "icmp6",IPPROTO_ICMPV6 }, 194#ifdef IPSEC 195 { -1, N_IPSEC6STAT, 1, NULL, 196 ipsec_stats, NULL, "ipsec6",0 }, 197#endif 198#ifdef notyet 199 { -1, N_PIM6STAT, 1, NULL, 200 pim6_stats, NULL, "pim6", 0 }, 201#endif 202 { -1, -1, 1, NULL, 203 rip6_stats, NULL, "rip6", 0 }, 204 { -1, -1, 0, NULL, 205 NULL, NULL, NULL, 0 } 206}; 207#endif /*INET6*/ 208 209#ifdef IPSEC 210struct protox pfkeyprotox[] = { 211 { -1, N_PFKEYSTAT, 1, NULL, 212 pfkey_stats, NULL, "pfkey", 0 }, 213 { -1, -1, 0, NULL, 214 NULL, NULL, NULL, 0 } 215}; 216#endif 217 218struct protox atalkprotox[] = { 219 { N_DDPCB, N_DDPSTAT, 1, atalkprotopr, 220 ddp_stats, NULL, "ddp", 0 }, 221 { -1, -1, 0, NULL, 222 NULL, NULL, NULL, 0 } 223}; 224 225struct protox netgraphprotox[] = { 226 { N_NGSOCKS, -1, 1, netgraphprotopr, 227 NULL, NULL, "ctrl", 0 }, 228 { N_NGSOCKS, -1, 1, netgraphprotopr, 229 NULL, NULL, "data", 0 }, 230 { -1, -1, 0, NULL, 231 NULL, NULL, NULL, 0 } 232}; 233 234#ifdef IPX 235struct protox ipxprotox[] = { 236 { N_IPX, N_IPXSTAT, 1, ipxprotopr, 237 ipx_stats, NULL, "ipx", 0 }, 238 { N_IPX, N_SPXSTAT, 1, ipxprotopr, 239 spx_stats, NULL, "spx", 0 }, 240 { -1, -1, 0, NULL, 241 NULL, NULL, 0, 0 } 242}; 243#endif 244 245struct protox *protoprotox[] = { 246 protox, 247#ifdef INET6 248 ip6protox, 249#endif 250#ifdef IPSEC 251 pfkeyprotox, 252#endif 253#ifdef IPX 254 ipxprotox, 255#endif 256 atalkprotox, NULL }; 257 258const char *pluralies(int); 259static void printproto(struct protox *, const char *); 260static void usage(void); 261static struct protox *name2protox(char *); 262static struct protox *knownname(char *); 263 264static kvm_t *kvmd; 265static char *nlistf = NULL, *memf = NULL; 266 267int Aflag; /* show addresses of protocol control block */ 268int aflag; /* show all sockets (including servers) */ 269int Bflag; /* show information about bpf consumers */ 270int bflag; /* show i/f total bytes in/out */ 271int dflag; /* show i/f dropped packets */ 272int gflag; /* show group (multicast) routing or stats */ 273int hflag; /* show counters in human readable format */ 274int iflag; /* show interfaces */ 275int Lflag; /* show size of listen queues */ 276int mflag; /* show memory stats */ 277int numeric_addr; /* show addresses numerically */ 278int numeric_port; /* show ports numerically */ 279static int pflag; /* show given protocol */ 280int rflag; /* show routing tables (or routing stats) */ 281int sflag; /* show protocol statistics */ 282int tflag; /* show i/f watchdog timers */ 283int Wflag; /* wide display */ 284int zflag; /* zero stats */ 285 286int interval; /* repeat interval for i/f stats */ 287 288char *interface; /* desired i/f for stats, or NULL for all i/fs */ 289int unit; /* unit number for above */ 290 291int af; /* address family */ 292 293int 294main(int argc, char *argv[]) 295{ 296 struct protox *tp = NULL; /* for printing cblocks & stats */ 297 int ch; 298 299 af = AF_UNSPEC; 300 301 while ((ch = getopt(argc, argv, "AaBbdf:ghI:iLlM:mN:np:rSstuWw:z")) != -1) 302 switch(ch) { 303 case 'A': 304 Aflag = 1; 305 break; 306 case 'a': 307 aflag = 1; 308 break; 309 case 'B': 310 Bflag = 1; 311 break; 312 case 'b': 313 bflag = 1; 314 break; 315 case 'd': 316 dflag = 1; 317 break; 318 case 'f': 319 if (strcmp(optarg, "ipx") == 0) 320 af = AF_IPX; 321 else if (strcmp(optarg, "inet") == 0) 322 af = AF_INET; 323#ifdef INET6 324 else if (strcmp(optarg, "inet6") == 0) 325 af = AF_INET6; 326#endif 327#ifdef IPSEC 328 else if (strcmp(optarg, "pfkey") == 0) 329 af = PF_KEY; 330#endif 331 else if (strcmp(optarg, "unix") == 0) 332 af = AF_UNIX; 333 else if (strcmp(optarg, "atalk") == 0) 334 af = AF_APPLETALK; 335 else if (strcmp(optarg, "ng") == 0 336 || strcmp(optarg, "netgraph") == 0) 337 af = AF_NETGRAPH; 338 else if (strcmp(optarg, "link") == 0) 339 af = AF_LINK; 340 else { 341 errx(1, "%s: unknown address family", optarg); 342 } 343 break; 344 case 'g': 345 gflag = 1; 346 break; 347 case 'h': 348 hflag = 1; 349 break; 350 case 'I': { 351 char *cp; 352 353 iflag = 1; 354 for (cp = interface = optarg; isalpha(*cp); cp++) 355 continue; 356 unit = atoi(cp); 357 break; 358 } 359 case 'i': 360 iflag = 1; 361 break; 362 case 'L': 363 Lflag = 1; 364 break; 365 case 'M': 366 memf = optarg; 367 break; 368 case 'm': 369 mflag = 1; 370 break; 371 case 'N': 372 nlistf = optarg; 373 break; 374 case 'n': 375 numeric_addr = numeric_port = 1; 376 break; 377 case 'p': 378 if ((tp = name2protox(optarg)) == NULL) { 379 errx(1, 380 "%s: unknown or uninstrumented protocol", 381 optarg); 382 } 383 pflag = 1; 384 break; 385 case 'r': 386 rflag = 1; 387 break; 388 case 's': 389 ++sflag; 390 break; 391 case 'S': 392 numeric_addr = 1; 393 break; 394 case 't': 395 tflag = 1; 396 break; 397 case 'u': 398 af = AF_UNIX; 399 break; 400 case 'W': 401 case 'l': 402 Wflag = 1; 403 break; 404 case 'w': 405 interval = atoi(optarg); 406 iflag = 1; 407 break; 408 case 'z': 409 zflag = 1; 410 break; 411 case '?': 412 default: 413 usage(); 414 } 415 argv += optind; 416 argc -= optind; 417 418#define BACKWARD_COMPATIBILITY 419#ifdef BACKWARD_COMPATIBILITY 420 if (*argv) { 421 if (isdigit(**argv)) { 422 interval = atoi(*argv); 423 if (interval <= 0) 424 usage(); 425 ++argv; 426 iflag = 1; 427 } 428 if (*argv) { 429 nlistf = *argv; 430 if (*++argv) 431 memf = *argv; 432 } 433 } 434#endif 435 436 /* 437 * Discard setgid privileges if not the running kernel so that bad 438 * guys can't print interesting stuff from kernel memory. 439 */ 440 if (nlistf != NULL || memf != NULL) 441 setgid(getgid()); 442 443 if (Bflag) { 444 bpf_stats(interface); 445 exit(0); 446 } 447 if (mflag) { 448 if (memf != NULL) { 449 if (kread(0, 0, 0) == 0) 450 mbpr(nl[N_MBSTAT].n_value, 451 nl[N_MBTYPES].n_value, 452 nl[N_NMBCLUSTERS].n_value, 453 nl[N_NMBUFS].n_value, 454 nl[N_MBHI].n_value, 455 nl[N_CLHI].n_value, 456 nl[N_MBLO].n_value, 457 nl[N_CLLO].n_value, 458 nl[N_NCPUS].n_value, 459 nl[N_PAGESZ].n_value, 460 nl[N_MBPSTAT].n_value); 461 } else 462 mbpr(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 463 exit(0); 464 } 465#if 0 466 /* 467 * Keep file descriptors open to avoid overhead 468 * of open/close on each call to get* routines. 469 */ 470 sethostent(1); 471 setnetent(1); 472#else 473 /* 474 * This does not make sense any more with DNS being default over 475 * the files. Doing a setXXXXent(1) causes a tcp connection to be 476 * used for the queries, which is slower. 477 */ 478#endif 479 if (iflag && !sflag) { 480 kread(0, 0, 0); 481 intpr(interval, nl[N_IFNET].n_value, NULL); 482 exit(0); 483 } 484 if (rflag) { 485 kread(0, 0, 0); 486 if (sflag) 487 rt_stats(nl[N_RTSTAT].n_value, nl[N_RTTRASH].n_value); 488 else 489 routepr(nl[N_RTREE].n_value); 490 exit(0); 491 } 492 if (gflag) { 493 kread(0, 0, 0); 494 if (sflag) { 495 if (af == AF_INET || af == AF_UNSPEC) 496 mrt_stats(nl[N_MRTSTAT].n_value); 497#ifdef INET6 498 if (af == AF_INET6 || af == AF_UNSPEC) 499 mrt6_stats(nl[N_MRT6STAT].n_value); 500#endif 501 } else { 502 if (af == AF_INET || af == AF_UNSPEC) 503 mroutepr(nl[N_MFCTABLE].n_value, 504 nl[N_VIFTABLE].n_value); 505#ifdef INET6 506 if (af == AF_INET6 || af == AF_UNSPEC) 507 mroute6pr(nl[N_MF6CTABLE].n_value, 508 nl[N_MIF6TABLE].n_value); 509#endif 510 } 511 ifmalist_dump(); 512 exit(0); 513 } 514 515 kread(0, 0, 0); 516 if (tp) { 517 printproto(tp, tp->pr_name); 518 exit(0); 519 } 520 if (af == AF_INET || af == AF_UNSPEC) 521 for (tp = protox; tp->pr_name; tp++) 522 printproto(tp, tp->pr_name); 523#ifdef INET6 524 if (af == AF_INET6 || af == AF_UNSPEC) 525 for (tp = ip6protox; tp->pr_name; tp++) 526 printproto(tp, tp->pr_name); 527#endif /*INET6*/ 528#ifdef IPSEC 529 if (af == PF_KEY || af == AF_UNSPEC) 530 for (tp = pfkeyprotox; tp->pr_name; tp++) 531 printproto(tp, tp->pr_name); 532#endif /*IPSEC*/ 533#ifdef IPX 534 if (af == AF_IPX || af == AF_UNSPEC) { 535 kread(0, 0, 0); 536 for (tp = ipxprotox; tp->pr_name; tp++) 537 printproto(tp, tp->pr_name); 538 } 539#endif /* IPX */ 540 if (af == AF_APPLETALK || af == AF_UNSPEC) 541 for (tp = atalkprotox; tp->pr_name; tp++) 542 printproto(tp, tp->pr_name); 543 if (af == AF_NETGRAPH || af == AF_UNSPEC) 544 for (tp = netgraphprotox; tp->pr_name; tp++) 545 printproto(tp, tp->pr_name); 546 if ((af == AF_UNIX || af == AF_UNSPEC) && !Lflag && !sflag) 547 unixpr(); 548 exit(0); 549} 550 551/* 552 * Print out protocol statistics or control blocks (per sflag). 553 * If the interface was not specifically requested, and the symbol 554 * is not in the namelist, ignore this one. 555 */ 556static void 557printproto(tp, name) 558 struct protox *tp; 559 const char *name; 560{ 561 void (*pr)(u_long, const char *, int); 562 u_long off; 563 564 if (sflag) { 565 if (iflag) { 566 if (tp->pr_istats) 567 intpr(interval, nl[N_IFNET].n_value, 568 tp->pr_istats); 569 else if (pflag) 570 printf("%s: no per-interface stats routine\n", 571 tp->pr_name); 572 return; 573 } 574 else { 575 pr = tp->pr_stats; 576 if (!pr) { 577 if (pflag) 578 printf("%s: no stats routine\n", 579 tp->pr_name); 580 return; 581 } 582 off = tp->pr_usesysctl ? tp->pr_usesysctl 583 : nl[tp->pr_sindex].n_value; 584 } 585 } else { 586 pr = tp->pr_cblocks; 587 if (!pr) { 588 if (pflag) 589 printf("%s: no PCB routine\n", tp->pr_name); 590 return; 591 } 592 off = tp->pr_usesysctl ? tp->pr_usesysctl 593 : nl[tp->pr_index].n_value; 594 } 595 if (pr != NULL && (off || af != AF_UNSPEC)) 596 (*pr)(off, name, af); 597} 598 599/* 600 * Read kernel memory, return 0 on success. 601 */ 602int 603kread(u_long addr, char *buf, int size) 604{ 605 if (kvmd == 0) { 606 /* 607 * XXX. 608 */ 609 kvmd = kvm_openfiles(nlistf, memf, NULL, O_RDONLY, buf); 610 setgid(getgid()); 611 if (kvmd != NULL) { 612 if (kvm_nlist(kvmd, nl) < 0) { 613 if(nlistf) 614 errx(1, "%s: kvm_nlist: %s", nlistf, 615 kvm_geterr(kvmd)); 616 else 617 errx(1, "kvm_nlist: %s", kvm_geterr(kvmd)); 618 } 619 620 if (nl[0].n_type == 0) { 621 if(nlistf) 622 errx(1, "%s: no namelist", nlistf); 623 else 624 errx(1, "no namelist"); 625 } 626 } else { 627 warnx("kvm not available"); 628 return(-1); 629 } 630 } 631 if (!buf) 632 return (0); 633 if (kvm_read(kvmd, addr, buf, size) != size) { 634 warnx("%s", kvm_geterr(kvmd)); 635 return (-1); 636 } 637 return (0); 638} 639 640const char * 641plural(int n) 642{ 643 return (n != 1 ? "s" : ""); 644} 645 646const char * 647plurales(int n) 648{ 649 return (n != 1 ? "es" : ""); 650} 651 652const char * 653pluralies(int n) 654{ 655 return (n != 1 ? "ies" : "y"); 656} 657 658/* 659 * Find the protox for the given "well-known" name. 660 */ 661static struct protox * 662knownname(char *name) 663{ 664 struct protox **tpp, *tp; 665 666 for (tpp = protoprotox; *tpp; tpp++) 667 for (tp = *tpp; tp->pr_name; tp++) 668 if (strcmp(tp->pr_name, name) == 0) 669 return (tp); 670 return (NULL); 671} 672 673/* 674 * Find the protox corresponding to name. 675 */ 676static struct protox * 677name2protox(char *name) 678{ 679 struct protox *tp; 680 char **alias; /* alias from p->aliases */ 681 struct protoent *p; 682 683 /* 684 * Try to find the name in the list of "well-known" names. If that 685 * fails, check if name is an alias for an Internet protocol. 686 */ 687 if ((tp = knownname(name)) != NULL) 688 return (tp); 689 690 setprotoent(1); /* make protocol lookup cheaper */ 691 while ((p = getprotoent()) != NULL) { 692 /* assert: name not same as p->name */ 693 for (alias = p->p_aliases; *alias; alias++) 694 if (strcmp(name, *alias) == 0) { 695 endprotoent(); 696 return (knownname(p->p_name)); 697 } 698 } 699 endprotoent(); 700 return (NULL); 701} 702 703static void 704usage(void) 705{ 706 (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n", 707"usage: netstat [-AaLnSW] [-f protocol_family | -p protocol]\n" 708" [-M core] [-N system]", 709" netstat -i | -I interface [-abdhnt] [-f address_family]\n" 710" [-M core] [-N system]", 711" netstat -w wait [-I interface] [-d] [-M core] [-N system]", 712" netstat -s [-s] [-z] [-f protocol_family | -p protocol] [-M core]", 713" netstat -i | -I interface -s [-f protocol_family | -p protocol]\n" 714" [-M core] [-N system]", 715" netstat -m [-M core] [-N system]", 716" netstat -B [ -I interface]", 717" netstat -r [-AenW] [-f address_family] [-M core] [-N system]", 718" netstat -rs [-s] [-M core] [-N system]", 719" netstat -g [-W] [-f address_family] [-M core] [-N system]", 720" netstat -gs [-s] [-f address_family] [-M core] [-N system]"); 721 exit(1); 722} 723