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