Changeset 2df6b31 in rtemslibbsd
 Timestamp:
 Oct 23, 2012, 7:13:08 PM (9 years ago)
 Branches:
 4.11, 5, 5freebsd12, 6freebsd12, freebsd9.3, master
 Children:
 d422d0d
 Parents:
 25f7f0f
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

freebsduserspace/commands/usr.bin/netstat/main.c
r25f7f0f r2df6b31 366 366 int live; /* true if we are examining a live system */ 367 367 368 369 #ifdef __rtems__ 370 static int main_netstat(int argc, char *argv[]); 371 static int rtems_shell_main_netstat(int argc, char *argv[]) 372 { 373 int i; 374 rtems_shell_globals_t netstat_globals; 375 rtems_shell_globals = &netstat_globals; 376 memset (rtems_shell_globals, 0, sizeof (netstat_globals)); 377 378 i = 0; 379 protox[i].pr_index = N_TCBINFO; 380 protox[i].pr_sindex = N_TCPSTAT; 381 protox[i].pr_wanted = 1; 382 protox[i].pr_cblocks = protopr; 383 protox[i].pr_stats = tcp_stats; 384 protox[i].pr_istats = NULL; 385 protox[i].pr_name = "tcp"; 386 protox[i].pr_usesysctl = 1; 387 protox[i].pr_protocol = IPPROTO_TCP; 388 i++; 389 protox[i].pr_index = N_UDBINFO; 390 protox[i].pr_sindex = N_UDPSTAT; 391 protox[i].pr_wanted = 1; 392 protox[i].pr_cblocks = protopr; 393 protox[i].pr_stats = udp_stats; 394 protox[i].pr_istats = NULL; 395 protox[i].pr_name = "udp"; 396 protox[i].pr_usesysctl = 1; 397 protox[i].pr_protocol = IPPROTO_UDP; 398 i++; 399 #ifdef SCTP 400 protox[i].pr_index = 1; 401 protox[i].pr_sindex = N_SCTPSTAT; 402 protox[i].pr_wanted = 1; 403 protox[i].pr_cblocks = sctp_protopr; 404 protox[i].pr_stats = sctp_stats; 405 protox[i].pr_istats = NULL; 406 protox[i].pr_name = "sctp"; 407 protox[i].pr_usesysctl = 1; 408 protox[i].pr_protocol = IPPROTO_SCTP; 409 i++; 410 #endif 411 protox[i].pr_index = N_DIVCBINFO; 412 protox[i].pr_sindex = 1; 413 protox[i].pr_wanted = 1; 414 protox[i].pr_cblocks = protopr; 415 protox[i].pr_stats = NULL; 416 protox[i].pr_istats = NULL; 417 protox[i].pr_name = "divert"; 418 protox[i].pr_usesysctl = 1; 419 protox[i].pr_protocol = IPPROTO_DIVERT; 420 i++; 421 protox[i].pr_index = N_RIPCBINFO; 422 protox[i].pr_sindex = N_IPSTAT; 423 protox[i].pr_wanted = 1; 424 protox[i].pr_cblocks = protopr; 425 protox[i].pr_stats = ip_stats; 426 protox[i].pr_istats = NULL; 427 protox[i].pr_name = "ip"; 428 protox[i].pr_usesysctl = 1; 429 protox[i].pr_protocol = IPPROTO_RAW; 430 i++; 431 protox[i].pr_index = N_RIPCBINFO; 432 protox[i].pr_sindex = N_ICMPSTAT; 433 protox[i].pr_wanted = 1; 434 protox[i].pr_cblocks = protopr; 435 protox[i].pr_stats = icmp_stats; 436 protox[i].pr_istats = NULL; 437 protox[i].pr_name = "icmp"; 438 protox[i].pr_usesysctl = 1; 439 protox[i].pr_protocol = IPPROTO_ICMP; 440 i++; 441 protox[i].pr_index = N_RIPCBINFO; 442 protox[i].pr_sindex = N_IGMPSTAT; 443 protox[i].pr_wanted = 1; 444 protox[i].pr_cblocks = protopr; 445 protox[i].pr_stats = igmp_stats; 446 protox[i].pr_istats = NULL; 447 protox[i].pr_name = "igmp"; 448 protox[i].pr_usesysctl = 1; 449 protox[i].pr_protocol = IPPROTO_IGMP; 450 i++; 451 #ifdef IPSEC 452 protox[i].pr_index = 1; 453 protox[i].pr_sindex = N_IPSECSTAT; 454 protox[i].pr_wanted = 1; 455 protox[i].pr_cblocks = NULL; 456 protox[i].pr_stats = ipsec_stats; 457 protox[i].pr_istats = NULL; 458 protox[i].pr_name = "ipsec"; 459 protox[i].pr_usesysctl = 0; 460 protox[i].pr_protocol = 0; 461 i++; 462 protox[i].pr_index = 1; 463 protox[i].pr_sindex = N_AHSTAT; 464 protox[i].pr_wanted = 1; 465 protox[i].pr_cblocks = NULL; 466 protox[i].pr_stats = ah_stats; 467 protox[i].pr_istats = NULL; 468 protox[i].pr_name = "ah"; 469 protox[i].pr_usesysctl = 0; 470 protox[i].pr_protocol = 0; 471 i++; 472 protox[i].pr_index = 1; 473 protox[i].pr_sindex = N_ESPSTAT; 474 protox[i].pr_wanted = 1; 475 protox[i].pr_cblocks = NULL; 476 protox[i].pr_stats = esp_stats; 477 protox[i].pr_istats = NULL; 478 protox[i].pr_name = "esp"; 479 protox[i].pr_usesysctl = 0; 480 protox[i].pr_protocol = 0; 481 i++; 482 protox[i].pr_index = 1; 483 protox[i].pr_sindex = N_IPCOMPSTAT; 484 protox[i].pr_wanted = 1; 485 protox[i].pr_cblocks = NULL; 486 protox[i].pr_stats = ipcomp_stats; 487 protox[i].pr_istats = NULL; 488 protox[i].pr_name = "ipcomp"; 489 protox[i].pr_usesysctl = 0; 490 protox[i].pr_protocol = 0; 491 i++; 492 #endif 493 protox[i].pr_index = N_RIPCBINFO; 494 protox[i].pr_sindex = N_PIMSTAT; 495 protox[i].pr_wanted = 1; 496 protox[i].pr_cblocks = protopr; 497 protox[i].pr_stats = pim_stats; 498 protox[i].pr_istats = NULL; 499 protox[i].pr_name = "pim"; 500 protox[i].pr_usesysctl = 1; 501 protox[i].pr_protocol = IPPROTO_PIM; 502 i++; 503 protox[i].pr_index = 1; 504 protox[i].pr_sindex = N_CARPSTAT; 505 protox[i].pr_wanted = 1; 506 protox[i].pr_cblocks = NULL; 507 protox[i].pr_stats = carp_stats; 508 protox[i].pr_istats = NULL; 509 protox[i].pr_name = "carp"; 510 protox[i].pr_usesysctl = 1; 511 protox[i].pr_protocol = 0; 512 i++; 513 protox[i].pr_index = 1; 514 protox[i].pr_sindex = N_PFSYNCSTAT; 515 protox[i].pr_wanted = 1; 516 protox[i].pr_cblocks = NULL; 517 protox[i].pr_stats = pfsync_stats; 518 protox[i].pr_istats = NULL; 519 protox[i].pr_name = "pfsync"; 520 protox[i].pr_usesysctl = 1; 521 protox[i].pr_protocol = 0; 522 i++; 523 protox[i].pr_index = 1; 524 protox[i].pr_sindex = N_ARPSTAT; 525 protox[i].pr_wanted = 1; 526 protox[i].pr_cblocks = NULL; 527 protox[i].pr_stats = arp_stats; 528 protox[i].pr_istats = NULL; 529 protox[i].pr_name = "arp"; 530 protox[i].pr_usesysctl = 1; 531 protox[i].pr_protocol = 0; 532 i++; 533 protox[i].pr_index = 1; 534 protox[i].pr_sindex = 1; 535 protox[i].pr_wanted = 0; 536 protox[i].pr_cblocks = NULL; 537 protox[i].pr_stats = NULL; 538 protox[i].pr_istats = NULL; 539 protox[i].pr_name = NULL; 540 protox[i].pr_usesysctl = 0; 541 protox[i].pr_protocol = 0; 542 543 #ifdef INET6 544 i=0; 545 ip6protox[i].pr_index = N_TCBINFO; 546 ip6protox[i].pr_sindex = N_TCPSTAT; 547 ip6protox[i].pr_wanted = 1; 548 ip6protox[i].pr_cblocks = protopr; 549 ip6protox[i].pr_stats = tcp_stats; 550 ip6protox[i].pr_istats = NULL; 551 ip6protox[i].pr_name = "tcp"; 552 ip6protox[i].pr_usesysctl = 1; 553 ip6protox[i].pr_protocol = ; 554 i++; 555 ip6protox[i].pr_index = N_UDBINFO; 556 ip6protox[i].pr_sindex = N_UDPSTAT; 557 ip6protox[i].pr_wanted = 1; 558 ip6protox[i].pr_cblocks = protopr; 559 ip6protox[i].pr_stats = udp_stats; 560 ip6protox[i].pr_istats = NULL; 561 ip6protox[i].pr_name = "udp"; 562 ip6protox[i].pr_usesysctl = 1; 563 ip6protox[i].pr_protocol = IPPROTO_UDP; 564 i++; 565 ip6protox[i].pr_index = N_RIPCBINFO; 566 ip6protox[i].pr_sindex = N_IP6STAT; 567 ip6protox[i].pr_wanted = 1; 568 ip6protox[i].pr_cblocks = protopr; 569 ip6protox[i].pr_stats = ip6_stats; 570 ip6protox[i].pr_istats = ip6_ifstats; 571 ip6protox[i].pr_name = "ip6"; 572 ip6protox[i].pr_usesysctl = 1; 573 ip6protox[i].pr_protocol = IPPROTO_RAW; 574 i++; 575 ip6protox[i].pr_index = N_RIPCBINFO; 576 ip6protox[i].pr_sindex = N_ICMP6STAT; 577 ip6protox[i].pr_wanted = 1; 578 ip6protox[i].pr_cblocks = protopr; 579 ip6protox[i].pr_stats = icmp6_stats; 580 ip6protox[i].pr_istats = icmp6_ifstats; 581 ip6protox[i].pr_name = "icmp6"; 582 ip6protox[i].pr_usesysctl = 1; 583 ip6protox[i].pr_protocol = IPPROTO_ICMPV6; 584 i++; 585 #ifdef IPSEC 586 ip6protox[i].pr_index = 1; 587 ip6protox[i].pr_sindex = N_IPSEC6STAT; 588 ip6protox[i].pr_wanted = 1; 589 ip6protox[i].pr_cblocks = NULL; 590 ip6protox[i].pr_stats = ipsec_stats; 591 ip6protox[i].pr_istats = NULL; 592 ip6protox[i].pr_name = "ipsec6"; 593 ip6protox[i].pr_usesysctl = 0; 594 ip6protox[i].pr_protocol = 0; 595 i++; 596 #endif 597 #ifdef notyet 598 ip6protox[i].pr_index = 1; 599 ip6protox[i].pr_sindex = N_PIM6STAT; 600 ip6protox[i].pr_wanted = 1; 601 ip6protox[i].pr_cblocks = NULL; 602 ip6protox[i].pr_stats = pim6_stats; 603 ip6protox[i].pr_istats = NULL; 604 ip6protox[i].pr_name = "pim6"; 605 ip6protox[i].pr_usesysctl = 1; 606 ip6protox[i].pr_protocol = 0; 607 i++; 608 #endif 609 ip6protox[i].pr_index = 1; 610 ip6protox[i].pr_sindex = N_RIP6STAT; 611 ip6protox[i].pr_wanted = 1; 612 ip6protox[i].pr_cblocks = NULL; 613 ip6protox[i].pr_stats = rip6_stats; 614 ip6protox[i].pr_istats = NULL; 615 ip6protox[i].pr_name = "rip6"; 616 ip6protox[i].pr_usesysctl = 1; 617 ip6protox[i].pr_protocol = 0; 618 i++; 619 ip6protox[i].pr_index = 1; 620 ip6protox[i].pr_sindex = 1; 621 ip6protox[i].pr_wanted = 0; 622 ip6protox[i].pr_cblocks = NULL; 623 ip6protox[i].pr_stats = NULL; 624 ip6protox[i].pr_istats = NULL; 625 ip6protox[i].pr_name = NULL; 626 ip6protox[i].pr_usesysctl = 0; 627 ip6protox[i].pr_protocol = 0; 628 i++; 629 #endif /*INET6*/ 630 631 #ifdef IPSEC 632 i=0; 633 pfkeyprotox[i].pr_index = 1; 634 pfkeyprotox[i].pr_sindex = N_PFKEYSTAT; 635 pfkeyprotox[i].pr_wanted = 1; 636 pfkeyprotox[i].pr_cblocks = NULL; 637 pfkeyprotox[i].pr_stats = pfkey_stats; 638 pfkeyprotox[i].pr_istats = NULL; 639 pfkeyprotox[i].pr_name = "pfkey"; 640 pfkeyprotox[i].pr_usesysctl = 0; 641 pfkeyprotox[i].pr_protocol = 0; 642 i++; 643 pfkeyprotox[i].pr_index = 1; 644 pfkeyprotox[i].pr_sindex = 1; 645 pfkeyprotox[i].pr_wanted = 0; 646 pfkeyprotox[i].pr_cblocks = NULL; 647 pfkeyprotox[i].pr_stats = NULL; 648 pfkeyprotox[i].pr_istats = NULL; 649 pfkeyprotox[i].pr_name = NULL; 650 pfkeyprotox[i].pr_usesysctl = 0; 651 pfkeyprotox[i].pr_protocol = 0; 652 #endif 653 654 #ifdef NETGRAPH 655 netgraphprotox[i].pr_index = N_NGSOCKS; 656 netgraphprotox[i].pr_sindex = 1; 657 netgraphprotox[i].pr_wanted = 1; 658 netgraphprotox[i].pr_cblocks = netgraphprotopr; 659 netgraphprotox[i].pr_stats = NULL; 660 netgraphprotox[i].pr_istats = NULL; 661 netgraphprotox[i].pr_name = "ctrl"; 662 netgraphprotox[i].pr_usesysctl = 0; 663 netgraphprotox[i].pr_protocol = 0; 664 i++; 665 netgraphprotox[i].pr_index = N_NGSOCKS; 666 netgraphprotox[i].pr_sindex = 1; 667 netgraphprotox[i].pr_wanted = 1; 668 netgraphprotox[i].pr_cblocks = netgraphprotopr; 669 netgraphprotox[i].pr_stats = NULL; 670 netgraphprotox[i].pr_istats = NULL; 671 netgraphprotox[i].pr_name = "data"; 672 netgraphprotox[i].pr_usesysctl = 0; 673 netgraphprotox[i].pr_protocol = 0; 674 i++; 675 netgraphprotox[i].pr_index = 1; 676 netgraphprotox[i].pr_sindex = 1; 677 netgraphprotox[i].pr_wanted = 0; 678 netgraphprotox[i].pr_cblocks = NULL; 679 netgraphprotox[i].pr_stats = NULL; 680 netgraphprotox[i].pr_istats = NULL; 681 netgraphprotox[i].pr_name = NULL; 682 netgraphprotox[i].pr_usesysctl = 0; 683 netgraphprotox[i].pr_protocol = 0; 684 #endif 685 #ifdef IPX 686 i=0; 687 ipxprotox[i].pr_index = N_IPX; 688 ipxprotox[i].pr_sindex = N_IPXSTAT; 689 ipxprotox[i].pr_wanted = 1; 690 ipxprotox[i].pr_cblocks = ipxprotopr; 691 ipxprotox[i].pr_stats = ipx_stats; 692 ipxprotox[i].pr_istats = NULL; 693 ipxprotox[i].pr_name = "ipx"; 694 ipxprotox[i].pr_usesysctl = 0; 695 ipxprotox[i].pr_protocol = 0; 696 i++; 697 ipxprotox[i].pr_index = N_IPX; 698 ipxprotox[i].pr_sindex = N_SPXSTAT; 699 ipxprotox[i].pr_wanted = 1; 700 ipxprotox[i].pr_cblocks = ipxprotopr; 701 ipxprotox[i].pr_stats = spx_stats; 702 ipxprotox[i].pr_istats = NULL; 703 ipxprotox[i].pr_name = "spx"; 704 ipxprotox[i].pr_usesysctl = 0; 705 ipxprotox[i].pr_protocol = 0; 706 i++; 707 ipxprotox[i].pr_index = 1; 708 ipxprotox[i].pr_sindex = 1; 709 ipxprotox[i].pr_wanted = 0; 710 ipxprotox[i].pr_cblocks = NULL; 711 ipxprotox[i].pr_stats = NULL; 712 ipxprotox[i].pr_istats = NULL; 713 ipxprotox[i].pr_name = 0; 714 ipxprotox[i].pr_usesysctl = 0; 715 ipxprotox[i].pr_protocol = 0; 716 i++; 717 #endif 718 719 i=0; 720 protoprotox[i] = protox; 721 i++; 722 #ifdef INET6 723 protoprotox[i] = ip6protox, 724 i++; 725 #endif 726 #ifdef IPSEC 727 protoprotox[i] = pfkeyprotox, 728 i++; 729 #endif 730 #ifdef IPX 731 protoprotox[i] = ipxprotox, 732 #endif 733 noutputs = 0; 734 735 netstat_globals.exit_code = 1; 736 if (setjmp (netstat_globals.exit_jmp) == 0) 737 return main_netstat (argc, argv); 738 return netstat_globals.exit_code; 739 } 740 #endif 741 368 742 int 369 743 #ifdef __rtems__ … … 844 1218 "netstat [args]", /* usage */ 845 1219 "net", /* topic */ 846 main_netstat,/* command */1220 rtems_shell_main_netstat, /* command */ 847 1221 NULL, /* alias */ 848 1222 NULL /* next */
Note: See TracChangeset
for help on using the changeset viewer.