Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: TYBLE16_simple_data_logger TYBLE16_MP3_Air
lwiperf.h
00001 /** 00002 * @file 00003 * lwIP iPerf server implementation 00004 */ 00005 00006 /* 00007 * Copyright (c) 2014 Simon Goldschmidt 00008 * All rights reserved. 00009 * 00010 * Redistribution and use in source and binary forms, with or without modification, 00011 * are permitted provided that the following conditions are met: 00012 * 00013 * 1. Redistributions of source code must retain the above copyright notice, 00014 * this list of conditions and the following disclaimer. 00015 * 2. Redistributions in binary form must reproduce the above copyright notice, 00016 * this list of conditions and the following disclaimer in the documentation 00017 * and/or other materials provided with the distribution. 00018 * 3. The name of the author may not be used to endorse or promote products 00019 * derived from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 00022 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00023 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 00024 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00025 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 00026 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00027 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00028 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 00029 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 00030 * OF SUCH DAMAGE. 00031 * 00032 * This file is part of the lwIP TCP/IP stack. 00033 * 00034 * Author: Simon Goldschmidt 00035 * 00036 */ 00037 #ifndef LWIP_HDR_APPS_LWIPERF_H 00038 #define LWIP_HDR_APPS_LWIPERF_H 00039 00040 #include "lwip/opt.h" 00041 #include "lwip/ip_addr.h" 00042 00043 #ifdef __cplusplus 00044 extern "C" { 00045 #endif 00046 00047 #define LWIPERF_TCP_PORT_DEFAULT 5001 00048 00049 /** lwIPerf test results */ 00050 enum lwiperf_report_type 00051 { 00052 /** The server side test is done */ 00053 LWIPERF_TCP_DONE_SERVER, 00054 /** The client side test is done */ 00055 LWIPERF_TCP_DONE_CLIENT, 00056 /** Local error lead to test abort */ 00057 LWIPERF_TCP_ABORTED_LOCAL, 00058 /** Data check error lead to test abort */ 00059 LWIPERF_TCP_ABORTED_LOCAL_DATAERROR, 00060 /** Transmit error lead to test abort */ 00061 LWIPERF_TCP_ABORTED_LOCAL_TXERROR, 00062 /** Remote side aborted the test */ 00063 LWIPERF_TCP_ABORTED_REMOTE 00064 }; 00065 00066 /** Control */ 00067 enum lwiperf_client_type 00068 { 00069 /** Unidirectional tx only test */ 00070 LWIPERF_CLIENT, 00071 /** Do a bidirectional test simultaneously */ 00072 LWIPERF_DUAL, 00073 /** Do a bidirectional test individually */ 00074 LWIPERF_TRADEOFF 00075 }; 00076 00077 /** Prototype of a report function that is called when a session is finished. 00078 This report function can show the test results. 00079 @param report_type contains the test result */ 00080 typedef void (*lwiperf_report_fn)(void *arg, enum lwiperf_report_type report_type, 00081 const ip_addr_t* local_addr, u16_t local_port, const ip_addr_t* remote_addr, u16_t remote_port, 00082 u32_t bytes_transferred, u32_t ms_duration, u32_t bandwidth_kbitpsec); 00083 00084 void* lwiperf_start_tcp_server(const ip_addr_t* local_addr, u16_t local_port, 00085 lwiperf_report_fn report_fn, void* report_arg); 00086 void* lwiperf_start_tcp_server_default(lwiperf_report_fn report_fn, void* report_arg); 00087 void* lwiperf_start_tcp_client(const ip_addr_t* remote_addr, u16_t remote_port, 00088 enum lwiperf_client_type type, 00089 lwiperf_report_fn report_fn, void* report_arg); 00090 void* lwiperf_start_tcp_client_default(const ip_addr_t* remote_addr, 00091 lwiperf_report_fn report_fn, void* report_arg); 00092 00093 void lwiperf_abort(void* lwiperf_session); 00094 00095 00096 #ifdef __cplusplus 00097 } 00098 #endif 00099 00100 #endif /* LWIP_HDR_APPS_LWIPERF_H */
Generated on Tue Jul 12 2022 13:54:30 by
