//========================================================================== // // tests/host_echo.c // // Simple TCP throughput test - echo component FOR *HOST* // * CAUTION: host, i.e. non eCos, only * // //========================================================================== // ####BSDALTCOPYRIGHTBEGIN#### // ------------------------------------------- // Portions of this software may have been derived from FreeBSD, OpenBSD, // or other sources, and if so are covered by the appropriate copyright // and license included herein. // ------------------------------------------- // ####BSDALTCOPYRIGHTEND#### //========================================================================== //#####DESCRIPTIONBEGIN#### // // Author(s): gthomas // Contributors: gthomas // Date: 2000-01-10 // Purpose: // Description: This is the middle part of a three part test. The idea is // to test the throughput of box in a configuration like this: // // +------+ port +----+ port +----+ // |SOURCE|=========>|ECHO|============>|SINK| // +------+ 9990 +----+ 9991 +----+ // // //####DESCRIPTIONEND#### // //========================================================================== #undef _KERNEL #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define true 1 #define false 1 #define TNR_ON() #define TNR_OFF() #define diag_printf printf void pexit(char *s) { perror(s); exit(1); } #define SOURCE_PORT 9990 #define SINK_PORT 9991 #define MAX_BUF 8192 static unsigned char data_buf[MAX_BUF]; struct test_params { long nbufs; long bufsize; long load; }; struct test_status { long ok; }; int max( int a, int b ) { return (a>b)?a:b; } int min( int a, int b ) { return (a