]>
git.proxmox.com Git - mirror_edk2.git/blob - AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h
c37b718c5d40eb54084b8edbee5440299d0dae09
2 Definitions for the raw IP4 transmit application
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
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.
15 #ifndef _RAW_IP4_TX_H_
16 #define _RAW_IP4_TX_H_
18 //------------------------------------------------------------------------------
20 //------------------------------------------------------------------------------
22 #ifdef BUILD_FOR_WINDOWS
24 // Build for Windows environment
30 #define CLOSE_SOCKET closesocket
31 #define EINVAL 22 // Invalid argument
32 #define GET_ERRNO WSAGetLastError ( )
33 #define SIN_ADDR(port) port.sin_addr.S_un.S_addr
34 #define SIN_FAMILY(port) port.sin_family
35 #define SIN_LEN(port) port.sin_family
36 #define SIN_PORT(port) port.sin_port
40 #else // BUILD_FOR_WINDOWS
42 // Build for EFI environment
49 #include <netinet/in.h>
51 #include <sys/EfiSysCall.h>
52 #include <sys/endian.h>
53 #include <sys/socket.h>
55 #define CLOSE_SOCKET close
56 #define GET_ERRNO errno
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
63 #endif // BUILD_FOR_WINDOWS
67 //------------------------------------------------------------------------------
69 //------------------------------------------------------------------------------
72 // See http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
73 // and http://tools.ietf.org/html/rfc3692
75 #define RAW_PROTOCOL 253
77 //------------------------------------------------------------------------------
79 //------------------------------------------------------------------------------
82 Transmit raw IP4 packets to the remote system.
84 @param [in] ArgC Argument count
85 @param [in] ArgV Argument value array
87 @retval 0 Successfully operation
96 //------------------------------------------------------------------------------
98 #endif // _RAW_IP4_TX_H_