]> git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/OobRx/OobRx.h
13b6539fac0f7943042a38d206cf17e0b385070a
[mirror_edk2.git] / AppPkg / Applications / Sockets / OobRx / OobRx.h
1 /** @file
2 Definitions for the OOB Receive application
3
4 Copyright (c) 2011-2012, Intel Corporation. All rights reserved.
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _OOB_RX_H_
10 #define _OOB_RX_H_
11
12 //------------------------------------------------------------------------------
13 // Include Files
14 //------------------------------------------------------------------------------
15
16 #ifdef BUILD_FOR_WINDOWS
17 //
18 // Build for Windows environment
19 //
20
21 #include <winsock2.h>
22
23 #define CLOSE_SOCKET closesocket
24 #define SIN_ADDR(port) port.sin_addr.S_un.S_addr
25 #define SIN_FAMILY(port) port.sin_family
26 #define SIN_LEN(port) port.sin_family
27 #define SIN_PORT(port) port.sin_port
28 #define GET_ERRNO WSAGetLastError ( )
29
30 #define RX_TIMEOUT_ERROR WSAETIMEDOUT
31 #define ssize_t int
32 #define socklen_t int
33
34 #else // BUILD_FOR_WINDOWS
35 //
36 // Build for EFI environment
37 //
38
39 #include <Uefi.h>
40 #include <errno.h>
41 #include <stdlib.h>
42 #include <string.h>
43
44 #include <netinet/in.h>
45
46 #include <sys/EfiSysCall.h>
47 #include <sys/endian.h>
48 #include <sys/socket.h>
49 #include <sys/time.h>
50
51 #define CLOSE_SOCKET close
52 #define SIN_ADDR(port) port.sin_addr.s_addr
53 #define SIN_FAMILY(port) port.sin_family
54 #define SIN_LEN(port) port.sin_len
55 #define SIN_PORT(port) port.sin_port
56 #define SOCKET int
57 #define GET_ERRNO errno
58 #define RX_TIMEOUT_ERROR ETIMEDOUT
59
60 #endif // BUILD_FOR_WINDOWS
61
62 #include <stdio.h>
63
64 //------------------------------------------------------------------------------
65 // Constants
66 //------------------------------------------------------------------------------
67
68 #define OOB_RX_PORT 12344
69
70 //------------------------------------------------------------------------------
71 // API
72 //------------------------------------------------------------------------------
73
74 /**
75 Run the OOB receive application
76
77 @param [in] ArgC Argument count
78 @param [in] ArgV Argument value array
79
80 @retval 0 Successfully operation
81 **/
82
83 int
84 OobRx (
85 IN int ArgC,
86 IN char **ArgV
87 );
88
89 //------------------------------------------------------------------------------
90
91 #endif // _OOB_RX_H_