void net_test(cyg_addrword_t param) { cyg_serial_baud_rate_t old; cyg_ppp_options_t options; cyg_ppp_handle_t ppp_handle; CYG_TEST_INIT(); diag_printf("Start TCP test - ECHO mode\n"); init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); #ifdef CYGPKG_SNMPAGENT { extern void cyg_net_snmp_init(void); cyg_net_snmp_init(); } #endif old = ppp_test_set_baud( CYGNUM_SERIAL_BAUD_115200 ); ppp_test_announce( "TCP_ECHO" ); cyg_ppp_options_init( &options ); // options.debug = 1; // options.kdebugflag = 1; // options.flowctl = CYG_PPP_FLOWCTL_SOFTWARE; ppp_handle = cyg_ppp_up( CYGPKG_PPP_TEST_DEVICE, &options ); CYG_TEST_INFO( "Waiting for PPP to come up"); cyg_ppp_wait_up( ppp_handle ); echo_test(param); CYG_TEST_INFO( "Bringing PPP down"); cyg_ppp_down( ppp_handle ); CYG_TEST_INFO( "Waiting for PPP to go down"); cyg_ppp_wait_down( ppp_handle ); cyg_thread_delay( 200 ); ppp_test_set_baud( old ); ppp_test_finish(); CYG_TEST_PASS_FINISH("TCP ECHO test OK"); }
void net_test(cyg_addrword_t param) { extern void cyg_net_snmp_init(void); CYG_TEST_INIT(); CYG_TEST_INFO("Start multiple SNMP server test"); init_all_network_interfaces(); autohost_init(); cyg_net_snmp_init(); TNR_INIT(); // Now command the host to do ping to us... #ifdef CYGHWR_NET_DRIVER_ETH0 if (eth0_up) { do_snmp_tests(ð0_bootp_data, 3, TESTTIME); } #endif #ifdef CYGHWR_NET_DRIVER_ETH1 if (eth1_up) { do_snmp_tests(ð1_bootp_data, 3, TESTTIME); } #endif // Let the server run for 5 minutes cyg_thread_delay(2*100); // let the stuff start up first TNR_ON(); cyg_thread_delay(TESTTIME*100); // FIXME - assume cS clock. // Additional delay 'cos host may be slower than us - and it has to // complete a transfer anyway: cyg_thread_delay( 30 *100); // FIXME - assume cS clock. TNR_OFF(); autohost_end( 3 * (0 #ifdef CYGHWR_NET_DRIVER_ETH0 + eth0_up #endif #ifdef CYGHWR_NET_DRIVER_ETH1 + eth1_up #endif ) ); // check for N pass messages from hosts TNR_PRINT_ACTIVITY(); CYG_TEST_EXIT("Done"); }
void net_test(cyg_addrword_t param) { diag_printf("Start TCP test - ECHO mode\n"); init_all_network_interfaces(); calibrate_load(DESIRED_BACKGROUND_LOAD); TNR_INIT(); #ifdef CYGPKG_SNMPAGENT { extern void cyg_net_snmp_init(void); cyg_net_snmp_init(); } #endif echo_test(param); TNR_PRINT_ACTIVITY(); cyg_test_exit(); }