printf(NLS_CATGETS(catfd, netstatSet, netstat_internet, "Active Internet connections "));  if (flag_all) printf(NLS_CATGETS(catfd, netstatSet, netstat_servers, "(including servers)"));  else printf(NLS_CATGETS(catfd, netstatSet, netstat_noservers, "(w/o servers)"));
printf(_("Active Internet connections "));  if (flag_all) printf(_("(including servers)"));  else printf(_("(w/o servers)"));
int main(int argc, char *argv[]){  int i;  int lop;  struct option longopts[]=  {    AFTRANS_OPTS,    {"version",		0,	0,	'V'},    {"interfaces",	0,	0,	'i'},    {"help",		0,	0,	'h'},    {"route",		0,	0,	'r'},    {"netlink",		2,	0,	'L'},    {"masquerade",	0,	0,	'M'},    {"protocol",	1,	0,	'A'},    {"tcp",		0,	0,	't'},    {"udp",		0,	0,	'u'},    {"raw",		0,	0,	'w'},    {"unix",		0,	0,	'x'},    {"listening",	0,	0,	'a'},    {"all",		0,	0,	'a'},    {"timers",		0,	0,	'o'},    {"continuous",	0,	0,	'c'},    {"extend",		0,	0,	'e'},    {"verbose",		0,	0,	'v'},    {"statistics",	0,	0,	's'},    {"numeric",		0,	0,	'n'},    {"symbolic",	0,	0,	'N'},    {"cache",		0,	0,	'C'},    {"fib",		0,	0,	'F'},    {NULL,		0,	0,	0}  };  #if NLS  setlocale (LC_MESSAGES, "");  catfd = catopen ("nettools", MCLoadBySet);#endif  getroute_init(); 			/* Set up AF routing support */  afname[0]='\0';  while ((i = getopt_long(argc, argv, "MLCFA:acdehinNorstuVv?wx", longopts, &lop)) != EOF) switch(i) {  case -1:    break;  case 1:    if (lop < 0 || lop >= AFTRANS_CNT) {      EINTERN("netstat.c","longopts 1 range");      break;    }    if (aftrans_opt(longopts[lop].name)) {      NLS_CATCLOSE(catfd)	exit(1);    }    break;  case 'A':    if (aftrans_opt(optarg)) {      NLS_CATCLOSE(catfd)	exit(1);    }    break;  case 'L':    flag_nlp++;    break;  case 'M':    flag_mas++;    break;  case 'a':    flag_all++;    break;  case 'c':    flag_cnt++;    break;      case 'd':    flag_deb++;    break;  case 'e':    flag_exp++;    break;  case 'i':    flag_int++;    break;      case 'n':    flag_not|=FLAG_NUM;    break;  case 'N':    flag_not|=FLAG_SYM;    break;  case 'C':    flag_cf|=FLAG_CACHE;    break;  case 'F':    flag_cf|=FLAG_FIB;    break;  case 'o':    flag_opt++;    break;  case 'V':    version();    /*NOTREACHED*/  case 'v':    flag_ver|=FLAG_VERBOSE;    break;  case 'r':    flag_rou++;    break;      case 't':    flag_tcp++;    break;      case 'u':    flag_udp++;    break;  case 'w':    flag_raw++;    break;  case 'x':    if (aftrans_opt("unix")) {      NLS_CATCLOSE(catfd)	exit(1);    }    break;  case '?':  case 'h':    usage();  case 's':    inittab();    parsesnmp();    exit(0);  }    if (flag_int + flag_rou + flag_nlp + flag_mas > 1)    usage();    if (flag_inet)    flag_tcp = flag_udp = flag_raw = 1;    flag_arg = flag_tcp + flag_udp + flag_raw + flag_unx + flag_ipx     + flag_ax25 + flag_netrom;    if (flag_nlp) {#if HAVE_RT_NETLINK && 0    i=netlink_print();#else    ENOSUPP("netstat.c","RT_NETLINK");    i=-1;#endif	    NLS_CATCLOSE(catfd)      return(i);  }  if (flag_mas) {#if HAVE_FW_MASQUERADE && HAVE_AFINET#if MORE_THAN_ONE_MASQ_AF    if (!afname[0])      strcpy(afname,DFLT_AF);#endif      for(;;) {      i = ip_masq_info(flag_not, flag_exp);      if (i || !flag_cnt) break;      sleep(1);    }#else    ENOSUPP("netstat.c","FW_MASQUERADE");    i=-1;#endif    NLS_CATCLOSE(catfd)      return(i);  }  if (flag_rou) {    int options=0;        if (!afname[0])      strcpy(afname,DFLT_AF);        if (flag_exp == 2)      flag_exp = 1;    else if (flag_exp == 1)      flag_exp = 2;        options = (flag_exp & FLAG_EXT) | flag_not | flag_cf | flag_ver ;    if (!flag_cf)      options |= FLAG_FIB;        for(;;) {      i = route_info(afname,options);      if (i || !flag_cnt) break;      sleep(1);    }    NLS_CATCLOSE(catfd)      return(i);  }    if (flag_int) {    for (;;) {      i = iface_info();      if (!flag_cnt || i) break;      sleep(1);    }    NLS_CATCLOSE(catfd)      return(i);  }    for (;;) {    if (!flag_arg || flag_tcp || flag_udp || flag_raw) {#if HAVE_AFINET      printf(NLS_CATGETS(catfd, netstatSet, netstat_internet, "Active Internet connections ")); /* xxx */      if (flag_all) printf(NLS_CATGETS(catfd, netstatSet, netstat_servers, "(including servers)")); /* xxx */      else printf(NLS_CATGETS(catfd, netstatSet, netstat_noservers, "(w/o servers)")); /* xxx */            printf(NLS_CATGETS(catfd, netstatSet, netstat_header_internet,			 "\nProto Recv-Q Send-Q Local Address           Foreign Address         State      ")); /* xxx */      if (flag_exp > 1)	printf(NLS_CATGETS(catfd, netstatSet, netstat_header_internet2,			   " User      ")); /* xxx */      if (flag_opt)	printf(NLS_CATGETS(catfd, netstatSet, netstat_header_internet3,			   " Timer")); /* xxx */      printf("\n");#else      if (flag_arg) { 	i = 1; 	ENOSUPP("netstat","AF INET");       }#endif    }#if HAVE_AFINET    if (!flag_arg || flag_tcp) {      i = tcp_info();      if (i) {  NLS_CATCLOSE(catfd)  return(i); }    }        if (!flag_arg || flag_udp) {      i = udp_info();      if (i) {  NLS_CATCLOSE(catfd)  return(i); }    }        if (!flag_arg || flag_raw) {      i = raw_info();      if (i) {  NLS_CATCLOSE(catfd)  return(i); }    }#endif        if (!flag_arg || flag_unx) {#if HAVE_AFUNIX      i = unix_info();      if (i) {  NLS_CATCLOSE(catfd)  return(i); }#else      if (flag_arg)	{ i=1; ENOSUPP("netstat","AF UNIX"); }#endif    }        if(!flag_arg || flag_ipx) {#if HAVE_AFIPX      i = ipx_info();      if(i) {  NLS_CATCLOSE(catfd)  return(i); }#else      if (flag_arg)	{ i=1; ENOSUPP("netstat","AF IPX"); }#endif    }        if(!flag_arg || flag_ax25) {#if HAVE_AFAX25      i = ax25_info();      if(i) {  NLS_CATCLOSE(catfd)  return(i); }#else      if (flag_arg)	{ i=1; ENOSUPP("netstat","AF AX25"); }#endif    }        if(!flag_arg || flag_netrom) {#if HAVE_AFNETROM      i = netrom_info();      if(i) {  NLS_CATCLOSE(catfd)  return(i); }#else      if (flag_arg)	{ i=1; ENOSUPP("netstat","AF NETROM"); }#endif    }        if (!flag_cnt || i) break;    sleep(1);  }    NLS_CATCLOSE(catfd)    return(i);}