Changeset af0dafa in network-demos


Ignore:
Timestamp:
Aug 12, 1998, 11:07:14 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.11, master, netdemos-4-5-branch, network-demos-4-10-branch, network-demos-4-6-branch, network-demos-4-7-branch, network-demos-4-8-branch, network-demos-4-9-branch, rtems-4-5-branch
Children:
3b67d88
Parents:
db1377f
Message:

Added foreground task which can print KA9Q tables.

Location:
ttcp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ttcp/init.c

    rdb1377f raf0dafa  
    4141#endif
    4242
     43volatile int ttcp_running;
     44
    4345/*
    4446 * Suspend execution for the specified number of seconds
     
    5153
    5254/*
     55 * Display the contents of several KA9Q tables
     56 */
     57void
     58show_ka9q_tables (void)
     59{
     60        printf ("\n****************** MALLOC Statistics ***************\n");
     61        malloc_dump ();
     62        printf ("\n****************** MBUF Statistics ***************\n");
     63        mbufstat ();
     64        mbufsizes ();
     65        printf ("\n****************** Routing Table ***************\n");
     66        rtems_ka9q_execute_command ("route");
     67        printf ("\n****************** ARP Table ***************\n");
     68        rtems_ka9q_execute_command ("arp");
     69        printf ("\n****************** Driver Statistics ***************\n");
     70        rtems_ka9q_execute_command ("ifconfig rtems");
     71        printf ("\n****************** Ip Statistics ***************\n");
     72        rtems_ka9q_execute_command ("ip status");
     73        printf ("\n****************** ICMP Statistics ***************\n");
     74        rtems_ka9q_execute_command ("icmp status");
     75        printf ("\n****************** UDP Statistics ***************\n");
     76        rtems_ka9q_execute_command ("udp status");
     77        printf ("\n****************** TCP Statistics ***************\n");
     78        rtems_ka9q_execute_command ("tcp status");
     79}
     80
     81/*
    5382 * RTEMS Startup Task
    5483 */
     
    75104#endif
    76105
     106        ttcp_running = 0;
     107
    77108        /*
    78109         * Start KA9Q
     
    84115         * Hook up drivers
    85116         */
    86 #if (defined (USE_BOOTP))
    87117        if (rtems_ka9q_execute_command ("attach rtems"
    88                                         " rbuf 24 tbuf 5"
     118                                        /* " rbuf 24 tbuf 5" */
     119                                        " rbuf 100 tbuf 10"
     120#if !(defined (USE_BOOTP))
     121                                        " ip " MY_IP_ADDRESS
     122#endif
    89123                                        " ether " MY_ETHERNET_ADDRESS))
    90 #else
    91         if (rtems_ka9q_execute_command ("attach rtems"
    92                                         " rbuf 24 tbuf 5"
    93                                         " ip " MY_IP_ADDRESS
    94                                         " ether " MY_ETHERNET_ADDRESS))
    95 #endif
    96124                rtems_panic ("Can't attach Ethernet driver.\n");
    97125
     
    146174        rtems_ka9q_execute_command ("route");
    147175#endif
    148 
     176        /*
     177         * Issue a gratuitous ARP request to update tables in
     178         * other hosts on this network.
     179         */
     180        if (rtems_ka9q_execute_command ("arp gratuitous rtems"))
     181                rtems_panic ("Can't send gratuitous ARP.\n");
     182       
    149183        rtems_ka9q_execute_command ("tcp window");
    150184        rtems_ka9q_execute_command ("tcp window 4096");
     
    165199         */
    166200        test_network ();
     201
     202        /*
     203         * Wait for characters from console terminal
     204         */
     205        do {
     206                rtems_task_wake_after( 1 );
     207        } while ( !ttcp_running );
     208        printf( "Now accepting input from the console\n" );
     209        for (;;) {
     210                switch (getchar ()) {
     211                case '\004':
     212                        printf( "Exiting test\n" );
     213                        return;
     214
     215                case 's':
     216                        /*
     217                         * Show what's been accomplished
     218                         */
     219                        show_ka9q_tables ();
     220                        break;
     221                }
     222        }
    167223        exit (0);
    168224}
  • ttcp/rtems_ttcp.c

    rdb1377f raf0dafa  
    120120}
    121121
    122 /*
    123  * Display the contents of several KA9Q tables
    124  */
    125 static void
    126 show_ka9q_tables (void)
    127 {
    128         printf ("\n****************** MBUF Statistics ***************\n");
    129         mbufstat ();
    130         mbufsizes ();
    131         printf ("\n****************** Routing Table ***************\n");
    132         rtems_ka9q_execute_command ("route");
    133         printf ("\n****************** ARP Table ***************\n");
    134         rtems_ka9q_execute_command ("arp");
    135         printf ("\n****************** Driver Statistics ***************\n");
    136         rtems_ka9q_execute_command ("ifconfig rtems");
    137         printf ("\n****************** Ip Statistics ***************\n");
    138         rtems_ka9q_execute_command ("ip status");
    139         printf ("\n****************** ICMP Statistics ***************\n");
    140         rtems_ka9q_execute_command ("icmp status");
    141         printf ("\n****************** UDP Statistics ***************\n");
    142         rtems_ka9q_execute_command ("udp status");
    143         printf ("\n****************** TCP Statistics ***************\n");
    144         rtems_ka9q_execute_command ("tcp status");
    145 }
     122void show_ka9q_tables (void);
    146123
    147124static void
     
    155132        exit (code);
    156133}
     134
     135extern volatile int ttcp_running;
    157136
    158137/*
     
    217196                printf ("         -t destination.internet.address\n");
    218197        }
     198        ttcp_running = 1;
    219199        code = rtems_ttcp_main (argc, argv);
    220200        rtems_ttcp_exit (code);
     
    279259                return;
    280260        }
    281         rtems_task_suspend (RTEMS_SELF);
     261        /* rtems_task_suspend (RTEMS_SELF); */
    282262}
    283263
Note: See TracChangeset for help on using the changeset viewer.