X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=StdLib%2FEfiSocketLib%2FSocket.h;h=583be1ffd09094ba32093aacce9d470a145d4bfa;hb=b04aba1773d313e50383b11acc599242c2723986;hp=30b642000e6e6b9d1bad9301785aad37f34c83c6;hpb=3bdf9aae5f7f4c5f47fc8f807ae4409dfe3bdd58;p=mirror_edk2.git diff --git a/StdLib/EfiSocketLib/Socket.h b/StdLib/EfiSocketLib/Socket.h index 30b642000e..583be1ffd0 100644 --- a/StdLib/EfiSocketLib/Socket.h +++ b/StdLib/EfiSocketLib/Socket.h @@ -33,9 +33,9 @@ #define DEBUG_OPTION 0x00080000 ///< Display option messages #define MAX_PENDING_CONNECTIONS 1 ///< Maximum connection FIFO depth -#define MAX_RX_DATA 65536 ///< Maximum receive data size +#define MAX_RX_DATA 0x01000000 ///< Maximum receive data size #define MAX_TX_DATA ( MAX_RX_DATA * 2 ) ///< Maximum buffered transmit data in bytes -#define RX_PACKET_DATA 16384 ///< Maximum number of bytes in a RX packet +#define RX_PACKET_DATA 0x00100000 ///< Maximum number of bytes in a RX packet #define MAX_UDP_RETRANSMIT 16 ///< UDP retransmit attempts to handle address not mapped #define ESL_STRUCTURE_ALIGNMENT_BYTES 15 ///< Number of bytes for structure alignment @@ -362,7 +362,7 @@ typedef struct { **/ typedef EFI_STATUS -(* PFN_NET_CONFIGURE) ( +(EFIAPI * PFN_NET_CONFIGURE) ( IN VOID * pProtocol, IN VOID * pConfigData ); @@ -378,7 +378,7 @@ EFI_STATUS **/ typedef EFI_STATUS -(* PFN_NET_IO_START) ( +(EFIAPI * PFN_NET_IO_START) ( IN VOID * pProtocol, IN VOID * pToken ); @@ -394,7 +394,7 @@ EFI_STATUS **/ typedef EFI_STATUS -(* PFN_NET_POLL) ( +(EFIAPI * PFN_NET_POLL) ( IN VOID * pProtocol ); @@ -920,6 +920,25 @@ VOID IN ESL_IO_MGMT * pIo ); +/** + Verify the adapter's IP address + + This support routine is called by EslSocketBindTest. + + @param [in] pPort Address of an ::ESL_PORT structure. + @param [in] pConfigData Address of the configuration data + + @retval EFI_SUCCESS - The IP address is valid + @retval EFI_NOT_STARTED - The IP address is invalid + + **/ +typedef +EFI_STATUS +(* PFN_API_VERIFY_LOCAL_IP_ADDRESS) ( + IN ESL_PORT * pPort, + IN VOID * pConfigData + ); + /** Socket type control structure @@ -960,6 +979,7 @@ typedef struct { PFN_API_TRANSMIT pfnTransmit; ///< Attempt to buffer a packet for transmit PFN_API_TX_COMPLETE pfnTxComplete; ///< TX completion for normal data PFN_API_TX_COMPLETE pfnTxOobComplete; ///< TX completion for urgent data + PFN_API_VERIFY_LOCAL_IP_ADDRESS pfnVerifyLocalIpAddress; ///< Verify the local IP address } ESL_PROTOCOL_API; @@ -989,9 +1009,10 @@ typedef struct _ESL_SOCKET { // // Socket options // + BOOLEAN bIncludeHeader; ///< TRUE if including the IP header BOOLEAN bListenCalled; ///< TRUE if listen was successfully called BOOLEAN bOobInLine; ///< TRUE if out-of-band messages are to be received inline with normal data - BOOLEAN bIncludeHeader; ///< TRUE if including the IP header + BOOLEAN bReUseAddr; ///< TRUE if using same address is allowed // // Socket data @@ -999,6 +1020,7 @@ typedef struct _ESL_SOCKET { int Domain; ///< Specifies family of protocols int Type; ///< Specifies how to make network connection int Protocol; ///< Specifies lower layer protocol to use + BOOLEAN bAddressSet; ///< Set when the address is specified BOOLEAN bConfigured; ///< Set after the socket is configured BOOLEAN bRxDisable; ///< Receive disabled via shutdown @@ -1185,6 +1207,28 @@ EslSocketCopyFragmentedBuffer ( OUT size_t * pDataLength ); +/** + Free the socket. + + This routine frees the socket structure and handle resources. + + The ::close routine calls EslServiceFreeProtocol which then calls + this routine to free the socket context structure and close the + handle. + + @param [in] pSocketProtocol Address of an ::EFI_SOCKET_PROTOCOL structure. + + @param [out] pErrno Address to receive the errno value upon completion. + + @retval EFI_SUCCESS The socket resources were returned successfully. + + **/ +EFI_STATUS +EslSocketFree ( + IN EFI_SOCKET_PROTOCOL * pSocketProtocol, + IN int * pErrno + ); + /** Free the ESL_IO_MGMT event and structure