/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Utility */ /** */ /** NetX Duo IPerf Test Program */ /** */ /**************************************************************************/ /**************************************************************************/ #ifndef NX_IPERF_H #define NX_IPERF_H /* Enable authentication. #define NX_IPERF_AUTH_ENABLE */ #ifndef NX_IPERF_TCP_RX_PORT #define NX_IPERF_TCP_RX_PORT 5001 #endif #ifndef NX_IPERF_UDP_RX_PORT #define NX_IPERF_UDP_RX_PORT 5001 #endif #ifndef NX_IPERF_DESTINATION_PORT #define NX_IPERF_DESTINATION_PORT 5001 #endif #ifndef NX_IPERF_THREAD_PRIORITY #define NX_IPERF_THREAD_PRIORITY 1 #endif #ifndef ULONG64_DEFINED #define ULONG64_DEFINED #define ULONG64 unsigned long long #endif #define NX_IPERF_CTRL_SIGN_MASK 0x0F #define NX_IPERF_CLEAN_UP_MASK 0x01 typedef struct { ULONG CmdID; ULONG version; ULONG ip; ULONG ipv6[4]; ULONG port; UCHAR ctrl_sign; UINT ErrorCode; ULONG WperfPort; ULONG64 PacketsTxed; ULONG64 PacketsRxed; ULONG64 BytesTxed; ULONG64 BytesRxed; ULONG64 StartTime; ULONG64 RunTime; ULONG64 TestTime; ULONG64 ThroughPut; ULONG64 PacketSize; ULONG64 Rate; UINT TestStatus; /* 0 means no test is running. 1 means Test Thread is created and is running. 2 means a test has finished. */ ULONG64 idleTime; } ctrl_info; /*test list for wperf*/ typedef struct { ULONG cmdID; ULONG threadID; } thread_list; /* test type enum */ enum testTypeList { UNKNOWN_TEST = 0, TCP_RX_START = 1, UDP_RX_START = 3, TCP_TX_START = 5, UDP_TX_START = 7, UDP_RX_STOP, TCP_RX_STOP, UDP_TX_STOP, TCP_TX_STOP }; enum errorCodeList { UDP_RX_STOP_ERROR = 5000, UDP_RX_CREATE_ERROR, UDP_TX_STOP_ERROR, UDP_TX_CREATE_ERROR, TCP_RX_STOP_ERROR, TCP_RX_CREATE_ERROR, TCP_TX_STOP_ERROR, TCP_TX_CREATE_ERROR }; typedef struct { int udp_id; ULONG tv_sec; ULONG tv_usec; } udp_payload; #define htmlwrite(p, s, l) (nx_packet_data_append(p, s, l, server_ptr -> nx_web_http_server_packet_pool_ptr, NX_WAIT_FOREVER)) #define htmlresponse "HTTP/1.0 200 \r\nContent-Type: text/html\r\n\r\n" #define htmltag "" #define htmlendtag "" #define titleline "NetX IPerf Demonstration\r\n" #define bodytag "\r\n" #define bodyendtag "\r\n" #define logo_area \ "" \ "
" \ "
" #define hrline "
" #define h1line1 "

NetX IP Address: " #define h1line2 "


\r\n" #define tabletag "" #define fonttag "" #define fontcolortag "" #define fontendtag "" #define centertag "
\r\n" #define centerendtag "
" #define outtermosttable "
" #define trendtag "" #define tdtag "\r\n" #define doublebr "

\r\n" #define spanline "
" #define rightspanline "" #define tdcentertag "\r\n" \ "" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" #define UDPRXSTRING "Start UDP Receive Test" #define UDP_Rx "UDP_Rx" #define udprxsubmittag1 \ "
\r\n" \ "
\r\n" \ "" \ "\r\n" \ "\r\n" \ "\r\n" #define TCP_Tx "TCP_Tx" #define tcptxsubmittag1 \ "
\r\n" \ "
\r\n" \ "" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" \ "\r\n" #define TCP_Rx "TCP_Rx" #define tcprxsubmittag1 \ "
\r\n" \ "
\r\n" \ "" \ "\r\n" \ "\r\n" \ "\r\n\r\n" #define choosetesttag \ "\r\n" #endif /* NX_IPERF_H */
\r\n" #define maintabletag "
\r\n" #define tableendtag "
" #define trtag "
" #define toptdtag "" #define tdcolspan4tag "" #define tdcolspan3tag "" #define tdcolspan2tag "" #define tdendtag "




" #define formtag "
" #define formendtag "
" #define UDPTXSTRING "Start UDP Transmit Test" #define UDP_Tx "UDP_Tx" #define udptxsubmittag1 \ "
\r\n" \ "
"fonttag "Destination IP Address:
"fonttag "Destination Port:
"fonttag "Test Time(Seconds):
"fonttag "Packet size:


"fonttag "Test Time(Seconds):


"fonttag "Destination IP Address:
"fonttag "Destination Port:
"fonttag "Test Time(Seconds):


"fonttag "Test Time(Seconds):


Choose a test from the left.