]> git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/OobRx/OobRx.h
Update the sockets applications
[mirror_edk2.git] / AppPkg / Applications / Sockets / OobRx / OobRx.h
1 /** @file
2 Definitions for the OOB Receive application
3
4 Copyright (c) 2011, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _OOB_RX_H_
16 #define _OOB_RX_H_
17
18 //------------------------------------------------------------------------------
19 // Include Files
20 //------------------------------------------------------------------------------
21
22 #ifdef BUILD_FOR_WINDOWS
23 //
24 // Build for Windows environment
25 //
26
27 #include <winsock2.h>
28
29 #define CLOSE_SOCKET closesocket
30 #define SIN_ADDR(port) port.sin_addr.S_un.S_addr
31 #define SIN_FAMILY(port) port.sin_family
32 #define SIN_LEN(port) port.sin_family
33 #define SIN_PORT(port) port.sin_port
34 #define GET_ERRNO WSAGetLastError ( )
35
36 #define RX_TIMEOUT_ERROR WSAETIMEDOUT
37 #define ssize_t int
38 #define socklen_t int
39
40 #else // BUILD_FOR_WINDOWS
41 //
42 // Build for EFI environment
43 //
44
45 #include <Uefi.h>
46 #include <errno.h>
47 #include <stdlib.h>
48
49 #include <netinet/in.h>
50
51 #include <sys/EfiSysCall.h>
52 #include <sys/endian.h>
53 #include <sys/socket.h>
54 #include <sys/time.h>
55
56 #define CLOSE_SOCKET close
57 #define SIN_ADDR(port) port.sin_addr.s_addr
58 #define SIN_FAMILY(port) port.sin_family
59 #define SIN_LEN(port) port.sin_len
60 #define SIN_PORT(port) port.sin_port
61 #define SOCKET int
62 #define GET_ERRNO errno
63 #define RX_TIMEOUT_ERROR ETIMEDOUT
64
65 #endif // BUILD_FOR_WINDOWS
66
67 #include <stdio.h>
68
69 //------------------------------------------------------------------------------
70 // Constants
71 //------------------------------------------------------------------------------
72
73 #define OOB_RX_PORT 12344
74
75 //------------------------------------------------------------------------------
76 // API
77 //------------------------------------------------------------------------------
78
79 /**
80 Run the OOB receive application
81
82 @param [in] ArgC Argument count
83 @param [in] ArgV Argument value array
84
85 @retval 0 Successfully operation
86 **/
87
88 int
89 OobRx (
90 IN int ArgC,
91 IN char **ArgV
92 );
93
94 //------------------------------------------------------------------------------
95
96 #endif // _OOB_RX_H_