28 IN UINT32 FragmentCount,
36 for (Index = 0, Len = 0; Index < FragmentCount; Index++) {
37 if (FragmentTable[Index].FragmentBuffer ==
NULL) {
38 return EFI_INVALID_PARAMETER;
41 Len = Len + FragmentTable[Index].FragmentLength;
45 return EFI_INVALID_PARAMETER;
89 return EFI_INVALID_PARAMETER;
92 Sock = SOCK_FROM_THIS (This);
94 TcpMode.Tcp4State = Tcp4State;
95 TcpMode.Tcp4ConfigData = Tcp4ConfigData;
96 TcpMode.Ip4ModeData = Ip4ModeData;
97 TcpMode.MnpConfigData = MnpConfigData;
98 TcpMode.SnpModeData = SnpModeData;
139 return EFI_INVALID_PARAMETER;
145 if (
NULL != TcpConfigData) {
146 CopyMem (&Ip, &TcpConfigData->AccessPoint.RemoteAddress, sizeof (IP4_ADDR));
147 if (IP4_IS_LOCAL_BROADCAST (NTOHL (Ip))) {
148 return EFI_INVALID_PARAMETER;
151 if (TcpConfigData->AccessPoint.ActiveFlag && ((0 == TcpConfigData->AccessPoint.RemotePort) || (Ip == 0))) {
152 return EFI_INVALID_PARAMETER;
155 if (!TcpConfigData->AccessPoint.UseDefaultAddress) {
156 CopyMem (&Ip, &TcpConfigData->AccessPoint.StationAddress, sizeof (IP4_ADDR));
157 CopyMem (&SubnetMask, &TcpConfigData->AccessPoint.SubnetMask, sizeof (IP4_ADDR));
158 if (!IP4_IS_VALID_NETMASK (NTOHL (SubnetMask)) ||
159 ((SubnetMask != 0) && !
NetIp4IsUnicast (NTOHL (Ip), NTOHL (SubnetMask))))
161 return EFI_INVALID_PARAMETER;
165 Option = TcpConfigData->ControlOption;
166 if ((
NULL != Option) && (Option->EnableSelectiveAck || Option->EnablePathMtuDiscovery)) {
167 return EFI_UNSUPPORTED;
171 Sock = SOCK_FROM_THIS (This);
173 if (
NULL == TcpConfigData) {
179 if (EFI_NO_MAPPING == Status) {
180 Sock->ConfigureState = SO_NO_MAPPING;
215 IN BOOLEAN DeleteRoute,
225 return EFI_INVALID_PARAMETER;
228 Sock = SOCK_FROM_THIS (This);
230 RouteInfo.DeleteRoute = DeleteRoute;
231 RouteInfo.SubnetAddress = SubnetAddress;
232 RouteInfo.SubnetMask = SubnetMask;
233 RouteInfo.GatewayAddress = GatewayAddress;
266 if ((
NULL == This) || (
NULL == ConnectionToken) || (
NULL == ConnectionToken->CompletionToken.Event)) {
267 return EFI_INVALID_PARAMETER;
270 Sock = SOCK_FROM_THIS (This);
304 if ((
NULL == This) || (
NULL == ListenToken) || (
NULL == ListenToken->CompletionToken.Event)) {
305 return EFI_INVALID_PARAMETER;
308 Sock = SOCK_FROM_THIS (This);
352 if ((
NULL == This) ||
354 (
NULL == Token->CompletionToken.Event) ||
355 (
NULL == Token->Packet.TxData) ||
356 (0 == Token->Packet.TxData->FragmentCount) ||
357 (0 == Token->Packet.TxData->DataLength)
360 return EFI_INVALID_PARAMETER;
364 Token->Packet.TxData->DataLength,
365 Token->Packet.TxData->FragmentCount,
366 Token->Packet.TxData->FragmentTable
368 if (EFI_ERROR (Status)) {
372 Sock = SOCK_FROM_THIS (This);
418 if ((
NULL == This) ||
420 (
NULL == Token->CompletionToken.Event) ||
421 (
NULL == Token->Packet.RxData) ||
422 (0 == Token->Packet.RxData->FragmentCount) ||
423 (0 == Token->Packet.RxData->DataLength)
426 return EFI_INVALID_PARAMETER;
430 Token->Packet.RxData->DataLength,
431 Token->Packet.RxData->FragmentCount,
432 Token->Packet.RxData->FragmentTable
434 if (EFI_ERROR (Status)) {
438 Sock = SOCK_FROM_THIS (This);
474 if ((
NULL == This) || (
NULL == CloseToken) || (
NULL == CloseToken->CompletionToken.Event)) {
475 return EFI_INVALID_PARAMETER;
478 Sock = SOCK_FROM_THIS (This);
480 return SockClose (Sock, CloseToken, CloseToken->AbortOnClose);
517 return EFI_INVALID_PARAMETER;
520 Sock = SOCK_FROM_THIS (This);
549 return EFI_INVALID_PARAMETER;
552 Sock = SOCK_FROM_THIS (This);
602 return EFI_INVALID_PARAMETER;
605 Sock = SOCK_FROM_THIS (This);
607 TcpMode.Tcp6State = Tcp6State;
608 TcpMode.Tcp6ConfigData = Tcp6ConfigData;
609 TcpMode.Ip6ModeData = Ip6ModeData;
610 TcpMode.MnpConfigData = MnpConfigData;
611 TcpMode.SnpModeData = SnpModeData;
676 return EFI_INVALID_PARAMETER;
682 if (
NULL != Tcp6ConfigData) {
683 Ip = &Tcp6ConfigData->AccessPoint.RemoteAddress;
685 return EFI_INVALID_PARAMETER;
688 if (Tcp6ConfigData->AccessPoint.ActiveFlag &&
692 return EFI_INVALID_PARAMETER;
695 Ip = &Tcp6ConfigData->AccessPoint.StationAddress;
697 return EFI_INVALID_PARAMETER;
700 Option = Tcp6ConfigData->ControlOption;
702 return EFI_UNSUPPORTED;
706 Sock = SOCK_FROM_THIS (This);
708 if (
NULL == Tcp6ConfigData) {
714 if (EFI_NO_MAPPING == Status) {
715 Sock->ConfigureState = SO_NO_MAPPING;
760 if ((
NULL == This) || (
NULL == ConnectionToken) || (
NULL == ConnectionToken->CompletionToken.Event)) {
761 return EFI_INVALID_PARAMETER;
764 Sock = SOCK_FROM_THIS (This);
813 if ((
NULL == This) || (
NULL == ListenToken) || (
NULL == ListenToken->CompletionToken.Event)) {
814 return EFI_INVALID_PARAMETER;
817 Sock = SOCK_FROM_THIS (This);
869 if ((
NULL == This) ||
871 (
NULL == Token->CompletionToken.Event) ||
872 (
NULL == Token->Packet.TxData) ||
873 (0 == Token->Packet.TxData->FragmentCount) ||
874 (0 == Token->Packet.TxData->DataLength)
877 return EFI_INVALID_PARAMETER;
881 Token->Packet.TxData->DataLength,
882 Token->Packet.TxData->FragmentCount,
885 if (EFI_ERROR (Status)) {
889 Sock = SOCK_FROM_THIS (This);
950 if ((
NULL == This) ||
952 (
NULL == Token->CompletionToken.Event) ||
953 (
NULL == Token->Packet.RxData) ||
954 (0 == Token->Packet.RxData->FragmentCount) ||
955 (0 == Token->Packet.RxData->DataLength)
958 return EFI_INVALID_PARAMETER;
962 Token->Packet.RxData->DataLength,
963 Token->Packet.RxData->FragmentCount,
966 if (EFI_ERROR (Status)) {
970 Sock = SOCK_FROM_THIS (This);
1011 if ((
NULL == This) || (
NULL == CloseToken) || (
NULL == CloseToken->CompletionToken.Event)) {
1012 return EFI_INVALID_PARAMETER;
1015 Sock = SOCK_FROM_THIS (This);
1017 return SockClose (Sock, CloseToken, CloseToken->AbortOnClose);
1065 return EFI_INVALID_PARAMETER;
1068 Sock = SOCK_FROM_THIS (This);
1100 return EFI_INVALID_PARAMETER;
1103 Sock = SOCK_FROM_THIS (This);
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
BOOLEAN EFIAPI NetIp4IsUnicast(IN IP4_ADDR Ip, IN IP4_ADDR NetMask)
BOOLEAN EFIAPI NetIp6IsValidUnicast(IN EFI_IPv6_ADDRESS *Ip6)
BOOLEAN EFIAPI NetIp6IsUnspecifiedAddr(IN EFI_IPv6_ADDRESS *Ip6)
EFI_STATUS SockFlush(IN OUT SOCKET *Sock)
EFI_STATUS SockClose(IN OUT SOCKET *Sock, IN VOID *Token, IN BOOLEAN OnAbort)
EFI_STATUS SockConnect(IN SOCKET *Sock, IN VOID *Token)
EFI_STATUS SockRcv(IN SOCKET *Sock, IN VOID *Token)
#define SOCK_POLL
Need to poll to the protocol layer.
EFI_STATUS SockRoute(IN SOCKET *Sock, IN VOID *RouteInfo)
EFI_STATUS SockSend(IN SOCKET *Sock, IN VOID *Token)
EFI_STATUS SockAccept(IN SOCKET *Sock, IN VOID *Token)
EFI_STATUS SockGetMode(IN SOCKET *Sock, IN OUT VOID *Mode)
EFI_STATUS SockCancel(IN OUT SOCKET *Sock, IN VOID *Token)
EFI_STATUS SockConfigure(IN SOCKET *Sock, IN VOID *ConfigData)
EFI_TCP4_CONNECTION_STATE
EFI_TCP6_CONNECTION_STATE
EFI_STATUS EFIAPI Tcp4GetModeData(IN EFI_TCP4_PROTOCOL *This, OUT EFI_TCP4_CONNECTION_STATE *Tcp4State OPTIONAL, OUT EFI_TCP4_CONFIG_DATA *Tcp4ConfigData OPTIONAL, OUT EFI_IP4_MODE_DATA *Ip4ModeData OPTIONAL, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
EFI_STATUS EFIAPI Tcp4Accept(IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_LISTEN_TOKEN *ListenToken)
EFI_STATUS EFIAPI Tcp4Cancel(IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_COMPLETION_TOKEN *Token OPTIONAL)
EFI_STATUS EFIAPI Tcp4Receive(IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp6Close(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CLOSE_TOKEN *CloseToken)
EFI_STATUS EFIAPI Tcp6Connect(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CONNECTION_TOKEN *ConnectionToken)
EFI_STATUS EFIAPI Tcp6GetModeData(IN EFI_TCP6_PROTOCOL *This, OUT EFI_TCP6_CONNECTION_STATE *Tcp6State OPTIONAL, OUT EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL, OUT EFI_IP6_MODE_DATA *Ip6ModeData OPTIONAL, OUT EFI_MANAGED_NETWORK_CONFIG_DATA *MnpConfigData OPTIONAL, OUT EFI_SIMPLE_NETWORK_MODE *SnpModeData OPTIONAL)
EFI_STATUS EFIAPI Tcp6Configure(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_CONFIG_DATA *Tcp6ConfigData OPTIONAL)
EFI_STATUS EFIAPI Tcp6Receive(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp4Transmit(IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp4Close(IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CLOSE_TOKEN *CloseToken)
EFI_STATUS EFIAPI Tcp6Poll(IN EFI_TCP6_PROTOCOL *This)
EFI_STATUS EFIAPI Tcp4Poll(IN EFI_TCP4_PROTOCOL *This)
EFI_STATUS EFIAPI Tcp6Transmit(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_IO_TOKEN *Token)
EFI_STATUS EFIAPI Tcp6Cancel(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_COMPLETION_TOKEN *Token OPTIONAL)
EFI_STATUS TcpChkDataBuf(IN UINT32 DataLen, IN UINT32 FragmentCount, IN EFI_TCP4_FRAGMENT_DATA *FragmentTable)
EFI_STATUS EFIAPI Tcp4Routes(IN EFI_TCP4_PROTOCOL *This, IN BOOLEAN DeleteRoute, IN EFI_IPv4_ADDRESS *SubnetAddress, IN EFI_IPv4_ADDRESS *SubnetMask, IN EFI_IPv4_ADDRESS *GatewayAddress)
EFI_STATUS EFIAPI Tcp6Accept(IN EFI_TCP6_PROTOCOL *This, IN EFI_TCP6_LISTEN_TOKEN *ListenToken)
EFI_STATUS EFIAPI Tcp4Connect(IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONNECTION_TOKEN *ConnectionToken)
EFI_STATUS EFIAPI Tcp4Configure(IN EFI_TCP4_PROTOCOL *This, IN EFI_TCP4_CONFIG_DATA *TcpConfigData OPTIONAL)
SOCK_PROTO_HANDLER ProtoHandler
The request handler of protocol.
BOOLEAN EnablePathMtuDiscovery
BOOLEAN EnableSelectiveAck