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