Knight KE / Mbed OS Game_Master
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers tcp_tests.h Source File

tcp_tests.h

00001 /*
00002  * Copyright (c) 2018, ARM Limited, All Rights Reserved
00003  * SPDX-License-Identifier: Apache-2.0
00004  *
00005  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00006  * not use this file except in compliance with the License.
00007  * You may obtain a copy of the License at
00008  *
00009  * http://www.apache.org/licenses/LICENSE-2.0
00010  *
00011  * Unless required by applicable law or agreed to in writing, software
00012  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00013  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  * See the License for the specific language governing permissions and
00015  * limitations under the License.
00016  */
00017 
00018 #ifndef TCP_TESTS_H
00019 #define TCP_TESTS_H
00020 
00021 NetworkInterface* get_interface();
00022 void drop_bad_packets(TCPSocket& sock, int orig_timeout);
00023 void fill_tx_buffer_ascii(char *buff, size_t len);
00024 void tcpsocket_connect_to_echo_srv(TCPSocket& sock);
00025 void tcpsocket_connect_to_discard_srv(TCPSocket& sock);
00026 
00027 namespace tcp_global
00028 {
00029 static const int TCP_OS_STACK_SIZE = 1024;
00030 
00031 static const int RX_BUFF_SIZE = 1220;
00032 static const int TX_BUFF_SIZE = 1220;
00033 
00034 extern char rx_buffer[RX_BUFF_SIZE];
00035 extern char tx_buffer[TX_BUFF_SIZE];
00036 }
00037 
00038 /*
00039  * Test cases
00040  */
00041 void TCPSOCKET_CONNECT_INVALID();
00042 void TCPSOCKET_ECHOTEST();
00043 void TCPSOCKET_ECHOTEST_NONBLOCK();
00044 void TCPSOCKET_ECHOTEST_BURST();
00045 void TCPSOCKET_ECHOTEST_BURST_NONBLOCK();
00046 void TCPSOCKET_ENDPOINT_CLOSE();
00047 void TCPSOCKET_OPEN_CLOSE_REPEAT();
00048 void TCPSOCKET_OPEN_LIMIT();
00049 void TCPSOCKET_RECV_100K();
00050 void TCPSOCKET_RECV_100K_NONBLOCK();
00051 void TCPSOCKET_RECV_TIMEOUT();
00052 void TCPSOCKET_SEND_REPEAT();
00053 void TCPSOCKET_SEND_TIMEOUT();
00054 void TCPSOCKET_THREAD_PER_SOCKET_SAFETY();
00055 
00056 #endif //TCP_TESTS_H