EDK2 doxygen online documents - Firmware Encoding Index 1
EDK2 doxygen online documents - Firmware Encoding Index

AppPkg/Applications/Sockets/RawIp4Tx/RawIp4Tx.h

Go to the documentation of this file.
00001 
00015 #ifndef _RAW_IP4_TX_H_
00016 #define _RAW_IP4_TX_H_
00017 
00018 //------------------------------------------------------------------------------
00019 //  Include Files
00020 //------------------------------------------------------------------------------
00021 
00022 #ifdef  BUILD_FOR_WINDOWS
00023 //
00024 //  Build for Windows environment
00025 //
00026 
00027 #include <winsock2.h>
00028 
00029 #define CHAR8             char
00030 #define CLOSE_SOCKET      closesocket
00031 #define EINVAL            22    //  Invalid argument
00032 #define GET_ERRNO         WSAGetLastError ( )
00033 #define SIN_ADDR(port)    port.sin_addr.S_un.S_addr
00034 #define SIN_FAMILY(port)  port.sin_family
00035 #define SIN_LEN(port)     port.sin_family
00036 #define SIN_PORT(port)    port.sin_port
00037 #define socklen_t         int
00038 #define ssize_t           int
00039 
00040 #else   //  BUILD_FOR_WINDOWS
00041 //
00042 //  Build for EFI environment
00043 //
00044 
00045 #include <Uefi.h>
00046 #include <errno.h>
00047 #include <stdlib.h>
00048 
00049 #include <netinet/in.h>
00050 
00051 #include <sys/EfiSysCall.h>
00052 #include <sys/endian.h>
00053 #include <sys/socket.h>
00054 
00055 #define CLOSE_SOCKET      close
00056 #define GET_ERRNO         errno
00057 #define SIN_ADDR(port)    port.sin_addr.s_addr
00058 #define SIN_FAMILY(port)  port.sin_family
00059 #define SIN_LEN(port)     port.sin_len
00060 #define SIN_PORT(port)    port.sin_port
00061 #define SOCKET            int
00062 
00063 #endif  //  BUILD_FOR_WINDOWS
00064 
00065 #include <stdio.h>
00066 
00067 //------------------------------------------------------------------------------
00068 //  Constants
00069 //------------------------------------------------------------------------------
00070 
00071 //
00072 //  See http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xml
00073 //  and http://tools.ietf.org/html/rfc3692
00074 //
00075 #define RAW_PROTOCOL      253
00076 
00077 //------------------------------------------------------------------------------
00078 //  API
00079 //------------------------------------------------------------------------------
00080 
00090 int
00091 RawIp4Tx (
00092   IN int ArgC,
00093   IN char **ArgV
00094   );
00095 
00096 //------------------------------------------------------------------------------
00097 
00098 #endif  //  _RAW_IP4_TX_H_
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Defines