2 * Copyright (c) 2019-2020 Arm Limited. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 * -----------------------------------------------------------------------------
21 * Title: SockServer definitions
23 * -----------------------------------------------------------------------------
27 #define ESC 0x1b // Ascii code for ESC
28 #define BUFF_SIZE 2000 // Size of buffers
31 #define ECHO_PORT 7 // Echo port number
32 #define DISCARD_PORT 9 // Discard port number
33 #define CHARGEN_PORT 19 // Chargen port number
34 #define ASSISTANT_PORT 5000 // Test Assistant port number
35 #define TCP_REJECTED_PORT 5001 // Rejected connection server TCP port
36 #define TCP_TIMEOUT_PORT 5002 // Non-responding server TCP port
38 // Extended option (Winsock2)
39 #ifndef SO_CONDITIONAL_ACCEPT
40 #define SO_CONDITIONAL_ACCEPT 0x3002
43 // IN_ADDR byte access definitions
44 #define s_b1 S_un.S_un_b.s_b1
45 #define s_b2 S_un.S_un_b.s_b2
46 #define s_b3 S_un.S_un_b.s_b3
47 #define s_b4 S_un.S_un_b.s_b4
49 // Socket Server threads
50 extern DWORD WINAPI EchoThread (void *argument);
51 extern DWORD WINAPI ChargenThread (void *argument);
52 extern DWORD WINAPI DiscardThread (void *argument);
53 extern DWORD WINAPI AssistantThread (void *argument);
54 extern DWORD WINAPI DgramServer (void *argument);
55 extern DWORD WINAPI StreamServer (void *argument);