Mercurial > ecos
diff packages/net/lwip_tcpip/current/tests/nc_test_framework.h @ 2934:d6c0c0e0431c
* net/lwip_tcpip/current/*: Major update of lwIP TCP/IP stack to version 1.3.2.
* io/eth/current/cdl/eth_drivers.cdl, include/eth_drv.h: Minor changes for
lwIP 1.3.x.
* io/eth/current/src/lwip/eth_drv.c: Rework for lwIP 1.3.x based on standalone
driver for RedBoot.
* io/eth/current/src/lwip/eth_conf.inl: Add static interface configuration.
| author | jld |
|---|---|
| date | Tue, 26 Jan 2010 11:27:47 +0000 |
| parents | 74dbf4c3f2e1 |
| children |
line wrap: on
line diff
--- a/packages/net/lwip_tcpip/current/tests/nc_test_framework.h +++ b/packages/net/lwip_tcpip/current/tests/nc_test_framework.h @@ -5,22 +5,25 @@ // Network characterization tests framework // //========================================================================== -// ####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#### +//####BSDCOPYRIGHTBEGIN#### +// +// ------------------------------------------- +// +// Portions of this software may have been derived from OpenBSD or other sources, +// and are covered by the appropriate copyright disclaimers included herein. +// +// ------------------------------------------- +// +//####BSDCOPYRIGHTEND#### //========================================================================== //#####DESCRIPTIONBEGIN#### // // Author(s): gthomas // Contributors: gthomas // Date: 2000-01-10 -// Purpose: -// Description: -// +// Purpose: +// Description: +// // //####DESCRIPTIONEND#### // @@ -29,7 +32,6 @@ #ifndef _TESTS_NC_TEST_FRAMEWORK_H_ #define _TESTS_NC_TEST_FRAMEWORK_H_ - #define test_printf diag_printf typedef cyg_addrword_t test_param_t; @@ -64,78 +66,71 @@ typedef cyg_addrword_t test_param_t; // been sent. // -#define MAX_ERRORS 5 // Give up after this many errors - -#define NC_REPLY_TIMEOUT 10 // The slave may be slow -#define NC_TEST_TIMEOUT 3 // More generous for tests -#define NC_RESULTS_TIMEOUT (MAX_ERRORS+2)*NC_TEST_TIMEOUT +#define MAX_ERRORS 5 // Give up after this many errors +#define NC_REPLY_TIMEOUT 10 // The slave may be slow +#define NC_TEST_TIMEOUT 3 // More generous for tests +#define NC_RESULTS_TIMEOUT (MAX_ERRORS+2)*NC_TEST_TIMEOUT struct nc_request { - int type; // Description of request - int seq; // Sequence number, used to build response - int nbufs; // Number of "buffers" to send - int buflen; // Length of each buffer - int slave_port; // Network ports to use + int type; // Description of request + int seq; // Sequence number, used to build response + int nbufs; // Number of "buffers" to send + int buflen; // Length of each buffer + int slave_port; // Network ports to use int master_port; - int timeout; // Max time to wait for any packet + int timeout; // Max time to wait for any packet }; -#define NC_REQUEST_DISCONNECT 0x0001 -#define NC_REQUEST_UDP_SEND 0x0010 // Slave to send UDP data -#define NC_REQUEST_UDP_RECV 0x0011 // Slave to receive UDP data -#define NC_REQUEST_UDP_ECHO 0x0012 // Master->slave->master -#define NC_REQUEST_TCP_SEND 0x0020 // Slave to send TCP data -#define NC_REQUEST_TCP_RECV 0x0021 // Slave to receive TCP data -#define NC_REQUEST_TCP_ECHO 0x0022 // Master->slave->master -#define NC_REQUEST_START_IDLE 0x0100 // Start some idle processing -#define NC_REQUEST_STOP_IDLE 0x0101 // Stop idle processing -#define NC_REQUEST_SET_LOAD 0x0200 // Set the background load level +#define NC_REQUEST_DISCONNECT 0x0001 +#define NC_REQUEST_UDP_SEND 0x0010 // Slave to send UDP data +#define NC_REQUEST_UDP_RECV 0x0011 // Slave to receive UDP data +#define NC_REQUEST_UDP_ECHO 0x0012 // Master->slave->master +#define NC_REQUEST_TCP_SEND 0x0020 // Slave to send TCP data +#define NC_REQUEST_TCP_RECV 0x0021 // Slave to receive TCP data +#define NC_REQUEST_TCP_ECHO 0x0022 // Master->slave->master +#define NC_REQUEST_START_IDLE 0x0100 // Start some idle processing +#define NC_REQUEST_STOP_IDLE 0x0101 // Stop idle processing +#define NC_REQUEST_SET_LOAD 0x0200 // Set the background load level struct nc_reply { - int response; // ACK or NAK - int seq; // Must match request - int reason; // If NAK, why request turned down - union { // Miscellaneous data, depending on request + int response; // ACK or NAK + int seq; // Must match request + int reason; // If NAK, why request turned down + union { // Miscellaneous data, depending on request struct { - long elapsed_time; // In 10ms "ticks" - long count[2]; // Result + long elapsed_time; // In 10ms "ticks" + long count[2]; // Result } idle_results; } misc; }; -#define NC_REPLY_ACK 0x0001 // Request accepted -#define NC_REPLY_NAK 0x0000 // Request denied - -#define NC_REPLY_NAK_UNKNOWN_REQUEST 0x0001 -#define NC_REPLY_NAK_BAD_REQUEST 0x0002 // Slave can't handle -#define NC_REPLY_NAK_NO_BACKGROUND 0x0003 // Slave can't do background/idle +#define NC_REPLY_ACK 0x0001 // Request accepted +#define NC_REPLY_NAK 0x0000 // Request denied +#define NC_REPLY_NAK_UNKNOWN_REQUEST 0x0001 +#define NC_REPLY_NAK_BAD_REQUEST 0x0002 // Slave can't handle +#define NC_REPLY_NAK_NO_BACKGROUND 0x0003 // Slave can't do background/idle -// // Test data 'packets' look like this - struct nc_test_data { - long key1; - int seq; - int len; - long key2; - char data[0]; // Actual data + long key1; + int seq; + int len; + long key2; + char data[0]; // Actual data }; #define NC_TEST_DATA_KEY1 0xC0DEADC0 #define NC_TEST_DATA_KEY2 0xC0DEADC1 struct nc_test_results { - long key1; // Identify uniquely as a response record - int seq; // Matches request - int nsent; - int nrecvd; - long key2; // Additional verification + long key1; // Identify uniquely as a response record + int seq; // Matches request + int nsent; + int nrecvd; + long key2; // Additional verification }; #define NC_TEST_RESULT_KEY1 0xDEADC0DE #define NC_TEST_RESULT_KEY2 0xDEADC1DE #endif // _TESTS_NC_TEST_FRAMEWORK_H_ - - -
