]> git.proxmox.com Git - mirror_edk2.git/blobdiff - AppPkg/Applications/Sockets/OobRx/OobRx.h
Update the sockets applications
[mirror_edk2.git] / AppPkg / Applications / Sockets / OobRx / OobRx.h
diff --git a/AppPkg/Applications/Sockets/OobRx/OobRx.h b/AppPkg/Applications/Sockets/OobRx/OobRx.h
new file mode 100644 (file)
index 0000000..37730ca
--- /dev/null
@@ -0,0 +1,96 @@
+/** @file\r
+  Definitions for the OOB Receive application\r
+\r
+  Copyright (c) 2011, Intel Corporation\r
+  All rights reserved. This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef _OOB_RX_H_\r
+#define _OOB_RX_H_\r
+\r
+//------------------------------------------------------------------------------\r
+//  Include Files\r
+//------------------------------------------------------------------------------\r
+\r
+#ifdef  BUILD_FOR_WINDOWS\r
+//\r
+//  Build for Windows environment\r
+//\r
+\r
+#include <winsock2.h>\r
+\r
+#define CLOSE_SOCKET      closesocket\r
+#define SIN_ADDR(port)    port.sin_addr.S_un.S_addr\r
+#define SIN_FAMILY(port)  port.sin_family\r
+#define SIN_LEN(port)     port.sin_family\r
+#define SIN_PORT(port)    port.sin_port\r
+#define GET_ERRNO         WSAGetLastError ( )\r
+\r
+#define RX_TIMEOUT_ERROR  WSAETIMEDOUT\r
+#define ssize_t           int\r
+#define socklen_t         int\r
+\r
+#else   //  BUILD_FOR_WINDOWS\r
+//\r
+//  Build for EFI environment\r
+//\r
+\r
+#include <Uefi.h>\r
+#include <errno.h>\r
+#include <stdlib.h>\r
+\r
+#include <netinet/in.h>\r
+\r
+#include <sys/EfiSysCall.h>\r
+#include <sys/endian.h>\r
+#include <sys/socket.h>\r
+#include <sys/time.h>\r
+\r
+#define CLOSE_SOCKET      close\r
+#define SIN_ADDR(port)    port.sin_addr.s_addr\r
+#define SIN_FAMILY(port)  port.sin_family\r
+#define SIN_LEN(port)     port.sin_len\r
+#define SIN_PORT(port)    port.sin_port\r
+#define SOCKET            int\r
+#define GET_ERRNO         errno\r
+#define RX_TIMEOUT_ERROR  ETIMEDOUT\r
+\r
+#endif  //  BUILD_FOR_WINDOWS\r
+\r
+#include <stdio.h>\r
+\r
+//------------------------------------------------------------------------------\r
+//  Constants\r
+//------------------------------------------------------------------------------\r
+\r
+#define OOB_RX_PORT       12344\r
+\r
+//------------------------------------------------------------------------------\r
+//  API\r
+//------------------------------------------------------------------------------\r
+\r
+/**\r
+  Run the OOB receive application\r
+\r
+  @param [in] ArgC      Argument count\r
+  @param [in] ArgV      Argument value array\r
+\r
+  @retval 0             Successfully operation\r
+ **/\r
+\r
+int\r
+OobRx (\r
+  IN int ArgC,\r
+  IN char **ArgV\r
+  );\r
+\r
+//------------------------------------------------------------------------------\r
+\r
+#endif  //  _OOB_RX_H_\r