2 Interface function of the Socket.
4 Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 Check whether the Event is in the List.
21 @param[in] List Pointer to the token list to be searched.
22 @param[in] Event The event to be checked.
24 @retval TRUE The specific Event exists in the List.
25 @retval FALSE The specific Event is not in the List.
29 SockTokenExistedInList (
34 LIST_ENTRY
*ListEntry
;
35 SOCK_TOKEN
*SockToken
;
37 NET_LIST_FOR_EACH (ListEntry
, List
) {
38 SockToken
= NET_LIST_USER_STRUCT (
44 if (Event
== SockToken
->Token
->Event
) {
53 Call SockTokenExistedInList() to check whether the Event is
54 in the related socket's lists.
56 @param[in] Sock Pointer to the instance's socket.
57 @param[in] Event The event to be checked.
59 @retval TRUE The Event exists in related socket's lists.
60 @retval FALSE The Event is not in related socket's lists.
70 if (SockTokenExistedInList (&Sock
->SndTokenList
, Event
) ||
71 SockTokenExistedInList (&Sock
->ProcessingSndTokenList
, Event
) ||
72 SockTokenExistedInList (&Sock
->RcvTokenList
, Event
) ||
73 SockTokenExistedInList (&Sock
->ListenTokenList
, Event
)
79 if ((Sock
->ConnectionToken
!= NULL
) && (Sock
->ConnectionToken
->Event
== Event
)) {
84 if ((Sock
->CloseToken
!= NULL
) && (Sock
->CloseToken
->Event
== Event
)) {
92 Buffer a token into the specific list of the socket Sock.
94 @param[in] Sock Pointer to the instance's socket.
95 @param[in] List Pointer to the list to store the token.
96 @param[in] Token Pointer to the token to be buffered.
97 @param[in] DataLen The data length of the buffer contained in Token.
99 @return Pointer to the token that wraps Token. If NULL, an error condition occurred.
110 SOCK_TOKEN
*SockToken
;
112 SockToken
= AllocateZeroPool (sizeof (SOCK_TOKEN
));
113 if (NULL
== SockToken
) {
117 "SockBufferIOToken: No Memory to allocate SockToken\n")
123 SockToken
->Sock
= Sock
;
124 SockToken
->Token
= (SOCK_COMPLETION_TOKEN
*) Token
;
125 SockToken
->RemainDataLen
= DataLen
;
126 InsertTailList (List
, &SockToken
->TokenList
);
132 Destroy the socket Sock and its associated protocol control block.
134 @param[in, out] Sock The socket to be destroyed.
136 @retval EFI_SUCCESS The socket Sock was destroyed successfully.
137 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket.
146 TCP_PROTO_DATA
*ProtoData
;
148 EFI_GUID
*IpProtocolGuid
;
149 EFI_GUID
*TcpProtocolGuid
;
152 ASSERT ((Sock
!= NULL
) && (Sock
->ProtoHandler
!= NULL
));
154 if (Sock
->InDestroy
) {
158 Sock
->InDestroy
= TRUE
;
160 if (Sock
->IpVersion
== IP_VERSION_4
) {
161 IpProtocolGuid
= &gEfiIp4ProtocolGuid
;
162 TcpProtocolGuid
= &gEfiTcp4ProtocolGuid
;
164 IpProtocolGuid
= &gEfiIp6ProtocolGuid
;
165 TcpProtocolGuid
= &gEfiTcp6ProtocolGuid
;
167 ProtoData
= (TCP_PROTO_DATA
*) Sock
->ProtoReserved
;
168 Tcb
= ProtoData
->TcpPcb
;
170 ASSERT (Tcb
!= NULL
);
172 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
173 if (EFI_ERROR (Status
)) {
177 "SockDestroyChild: Get the lock to access socket failed with %r\n",
181 return EFI_ACCESS_DENIED
;
185 // Close the IP protocol.
188 Tcb
->IpInfo
->ChildHandle
,
190 ProtoData
->TcpService
->IpIo
->Image
,
194 if (Sock
->DestroyCallback
!= NULL
) {
195 Sock
->DestroyCallback (Sock
, Sock
->Context
);
199 // Retrieve the protocol installed on this sock
201 Status
= gBS
->OpenProtocol (
207 EFI_OPEN_PROTOCOL_GET_PROTOCOL
210 if (EFI_ERROR (Status
)) {
214 "SockDestroyChild: Open protocol installed on socket failed with %r\n",
220 // Uninstall the protocol installed on this sock
222 gBS
->UninstallMultipleProtocolInterfaces (
230 // force protocol layer to detach the PCB
232 Status
= Sock
->ProtoHandler (Sock
, SOCK_DETACH
, NULL
);
234 if (EFI_ERROR (Status
)) {
238 "SockDestroyChild: Protocol detach socket failed with %r\n",
242 Sock
->InDestroy
= FALSE
;
243 } else if (SOCK_IS_CONFIGURED (Sock
)) {
245 SockConnFlush (Sock
);
246 SockSetState (Sock
, SO_CLOSED
);
248 Sock
->ConfigureState
= SO_UNCONFIGURED
;
251 EfiReleaseLock (&(Sock
->Lock
));
253 if (EFI_ERROR (Status
)) {
262 Create a socket and its associated protocol control block
263 with the intial data SockInitData and protocol specific
266 @param[in] SockInitData Inital data to setting the socket.
268 @return Pointer to the newly created socket. If NULL, an error condition occured.
273 IN SOCK_INIT_DATA
*SockInitData
279 EFI_GUID
*TcpProtocolGuid
;
282 // create a new socket
284 Sock
= SockCreate (SockInitData
);
289 "SockCreateChild: No resource to create a new socket\n")
295 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
296 if (EFI_ERROR (Status
)) {
300 "SockCreateChild: Get the lock to access socket failed with %r\n",
306 // inform the protocol layer to attach the socket
307 // with a new protocol control block
309 Status
= Sock
->ProtoHandler (Sock
, SOCK_ATTACH
, NULL
);
310 EfiReleaseLock (&(Sock
->Lock
));
311 if (EFI_ERROR (Status
)) {
315 "SockCreateChild: Protocol failed to attach a socket with %r\n",
325 if (Sock
->DestroyCallback
!= NULL
) {
326 Sock
->DestroyCallback (Sock
, Sock
->Context
);
329 if (Sock
->IpVersion
== IP_VERSION_4
) {
330 TcpProtocolGuid
= &gEfiTcp4ProtocolGuid
;
332 TcpProtocolGuid
= &gEfiTcp6ProtocolGuid
;
341 EFI_OPEN_PROTOCOL_GET_PROTOCOL
344 // Uninstall the protocol installed on this sock
346 gBS
->UninstallMultipleProtocolInterfaces (
357 Configure the specific socket Sock using configuration data ConfigData.
359 @param[in] Sock Pointer to the socket to be configured.
360 @param[in] ConfigData Pointer to the configuration data.
362 @retval EFI_SUCCESS The socket configured successfully.
363 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
364 socket is already configured.
375 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
376 if (EFI_ERROR (Status
)) {
380 "SockConfigure: Get the access for socket failed with %r",
384 return EFI_ACCESS_DENIED
;
387 if (SOCK_IS_CONFIGURED (Sock
)) {
388 Status
= EFI_ACCESS_DENIED
;
392 ASSERT (Sock
->State
== SO_CLOSED
);
394 Status
= Sock
->ProtoHandler (Sock
, SOCK_CONFIGURE
, ConfigData
);
397 EfiReleaseLock (&(Sock
->Lock
));
403 Initiate a connection establishment process.
405 @param[in] Sock Pointer to the socket to initiate the initate the
407 @param[in] Token Pointer to the token used for the connection
410 @retval EFI_SUCCESS The connection initialized successfully.
411 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
412 socket is closed, or the socket is not configured to
413 be an active one, or the token is already in one of
415 @retval EFI_NO_MAPPING The IP address configuration operation is not
417 @retval EFI_NOT_STARTED The socket is not configured.
429 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
430 if (EFI_ERROR (Status
)) {
434 "SockConnect: Get the access for socket failed with %r",
438 return EFI_ACCESS_DENIED
;
441 if (SOCK_IS_NO_MAPPING (Sock
)) {
442 Status
= EFI_NO_MAPPING
;
446 if (SOCK_IS_UNCONFIGURED (Sock
)) {
448 Status
= EFI_NOT_STARTED
;
452 if (!SOCK_IS_CLOSED (Sock
) || !SOCK_IS_CONFIGURED_ACTIVE (Sock
)) {
454 Status
= EFI_ACCESS_DENIED
;
458 Event
= ((SOCK_COMPLETION_TOKEN
*) Token
)->Event
;
460 if (SockTokenExisted (Sock
, Event
)) {
462 Status
= EFI_ACCESS_DENIED
;
466 Sock
->ConnectionToken
= (SOCK_COMPLETION_TOKEN
*) Token
;
467 SockSetState (Sock
, SO_CONNECTING
);
468 Status
= Sock
->ProtoHandler (Sock
, SOCK_CONNECT
, NULL
);
471 EfiReleaseLock (&(Sock
->Lock
));
476 Issue a listen token to get an existed connected network instance
477 or wait for a connection if there is none.
479 @param[in] Sock Pointer to the socket to accept connections.
480 @param[in] Token The token to accept a connection.
482 @retval EFI_SUCCESS Either a connection is accpeted or the Token is
483 buffered for further acception.
484 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
485 socket is closed, or the socket is not configured to
486 be a passive one, or the token is already in one of
488 @retval EFI_NO_MAPPING The IP address configuration operation is not
490 @retval EFI_NOT_STARTED The socket is not configured.
491 @retval EFI_OUT_OF_RESOURCE Failed to buffer the Token due to memory limits.
500 EFI_TCP4_LISTEN_TOKEN
*ListenToken
;
501 LIST_ENTRY
*ListEntry
;
506 ASSERT (SockStream
== Sock
->Type
);
508 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
509 if (EFI_ERROR (Status
)) {
513 "SockAccept: Get the access for socket failed with %r",
517 return EFI_ACCESS_DENIED
;
520 if (SOCK_IS_NO_MAPPING (Sock
)) {
521 Status
= EFI_NO_MAPPING
;
525 if (SOCK_IS_UNCONFIGURED (Sock
)) {
527 Status
= EFI_NOT_STARTED
;
531 if (!SOCK_IS_LISTENING (Sock
)) {
533 Status
= EFI_ACCESS_DENIED
;
537 Event
= ((SOCK_COMPLETION_TOKEN
*) Token
)->Event
;
539 if (SockTokenExisted (Sock
, Event
)) {
541 Status
= EFI_ACCESS_DENIED
;
545 ListenToken
= (EFI_TCP4_LISTEN_TOKEN
*) Token
;
548 // Check if a connection has already in this Sock->ConnectionList
550 NET_LIST_FOR_EACH (ListEntry
, &Sock
->ConnectionList
) {
552 Socket
= NET_LIST_USER_STRUCT (ListEntry
, SOCKET
, ConnectionList
);
554 if (SOCK_IS_CONNECTED (Socket
)) {
555 ListenToken
->NewChildHandle
= Socket
->SockHandle
;
556 SIGNAL_TOKEN (&(ListenToken
->CompletionToken
), EFI_SUCCESS
);
558 RemoveEntryList (ListEntry
);
560 ASSERT (Socket
->Parent
!= NULL
);
562 Socket
->Parent
->ConnCnt
--;
566 "SockAccept: Accept a socket, now conncount is %d",
567 Socket
->Parent
->ConnCnt
)
569 Socket
->Parent
= NULL
;
576 // Buffer this token for latter incoming connection request
578 if (NULL
== SockBufferToken (Sock
, &(Sock
->ListenTokenList
), Token
, 0)) {
580 Status
= EFI_OUT_OF_RESOURCES
;
584 EfiReleaseLock (&(Sock
->Lock
));
590 Issue a token with data to the socket to send out.
592 @param[in] Sock Pointer to the socket to process the token with
594 @param[in] Token The token with data that needs to send out.
596 @retval EFI_SUCCESS The token processed successfully.
597 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
598 socket is closed, or the socket is not in a
599 synchronized state , or the token is already in one
600 of this socket's lists.
601 @retval EFI_NO_MAPPING The IP address configuration operation is not
603 @retval EFI_NOT_STARTED The socket is not configured.
604 @retval EFI_OUT_OF_RESOURCE Failed to buffer the token due to memory limits.
613 SOCK_IO_TOKEN
*SndToken
;
616 EFI_TCP4_TRANSMIT_DATA
*TxData
;
618 SOCK_TOKEN
*SockToken
;
621 ASSERT (SockStream
== Sock
->Type
);
623 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
624 if (EFI_ERROR (Status
)) {
628 "SockSend: Get the access for socket failed with %r",
632 return EFI_ACCESS_DENIED
;
635 if (SOCK_IS_NO_MAPPING (Sock
)) {
636 Status
= EFI_NO_MAPPING
;
640 SndToken
= (SOCK_IO_TOKEN
*) Token
;
641 TxData
= (EFI_TCP4_TRANSMIT_DATA
*) SndToken
->Packet
.TxData
;
643 if (SOCK_IS_UNCONFIGURED (Sock
)) {
644 Status
= EFI_NOT_STARTED
;
648 if (!(SOCK_IS_CONNECTING (Sock
) || SOCK_IS_CONNECTED (Sock
))) {
650 Status
= EFI_ACCESS_DENIED
;
655 // check if a token is already in the token buffer
657 Event
= SndToken
->Token
.Event
;
659 if (SockTokenExisted (Sock
, Event
)) {
660 Status
= EFI_ACCESS_DENIED
;
664 DataLen
= TxData
->DataLength
;
667 // process this sending token now or buffer it only?
669 FreeSpace
= SockGetFreeSpace (Sock
, SOCK_SND_BUF
);
671 if ((FreeSpace
< Sock
->SndBuffer
.LowWater
) || !SOCK_IS_CONNECTED (Sock
)) {
673 SockToken
= SockBufferToken (
680 if (NULL
== SockToken
) {
681 Status
= EFI_OUT_OF_RESOURCES
;
685 SockToken
= SockBufferToken (
687 &Sock
->ProcessingSndTokenList
,
692 if (NULL
== SockToken
) {
695 "SockSend: Failed to buffer IO token into socket processing SndToken List\n",
699 Status
= EFI_OUT_OF_RESOURCES
;
703 Status
= SockProcessTcpSndData (Sock
, TxData
);
705 if (EFI_ERROR (Status
)) {
708 "SockSend: Failed to process Snd Data\n",
712 RemoveEntryList (&(SockToken
->TokenList
));
713 FreePool (SockToken
);
718 EfiReleaseLock (&(Sock
->Lock
));
723 Issue a token to get data from the socket.
725 @param[in] Sock Pointer to the socket to get data from.
726 @param[in] Token The token to store the received data from the
729 @retval EFI_SUCCESS The token processed successfully.
730 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
731 socket is closed, or the socket is not in a
732 synchronized state , or the token is already in one
733 of this socket's lists.
734 @retval EFI_NO_MAPPING The IP address configuration operation is not
736 @retval EFI_NOT_STARTED The socket is not configured.
737 @retval EFI_CONNECTION_FIN The connection is closed and there is no more data.
738 @retval EFI_OUT_OF_RESOURCE Failed to buffer the token due to memory limit.
747 SOCK_IO_TOKEN
*RcvToken
;
752 ASSERT (SockStream
== Sock
->Type
);
754 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
755 if (EFI_ERROR (Status
)) {
759 "SockRcv: Get the access for socket failed with %r",
763 return EFI_ACCESS_DENIED
;
766 if (SOCK_IS_NO_MAPPING (Sock
)) {
768 Status
= EFI_NO_MAPPING
;
772 if (SOCK_IS_UNCONFIGURED (Sock
)) {
774 Status
= EFI_NOT_STARTED
;
778 if (!(SOCK_IS_CONNECTED (Sock
) || SOCK_IS_CONNECTING (Sock
))) {
780 Status
= EFI_ACCESS_DENIED
;
784 RcvToken
= (SOCK_IO_TOKEN
*) Token
;
787 // check if a token is already in the token buffer of this socket
789 Event
= RcvToken
->Token
.Event
;
790 if (SockTokenExisted (Sock
, Event
)) {
791 Status
= EFI_ACCESS_DENIED
;
795 RcvToken
= (SOCK_IO_TOKEN
*) Token
;
796 RcvdBytes
= GET_RCV_DATASIZE (Sock
);
799 // check whether an error has happened before
801 if (EFI_ABORTED
!= Sock
->SockError
) {
803 SIGNAL_TOKEN (&(RcvToken
->Token
), Sock
->SockError
);
804 Sock
->SockError
= EFI_ABORTED
;
809 // check whether can not receive and there is no any
810 // data buffered in Sock->RcvBuffer
812 if (SOCK_IS_NO_MORE_DATA (Sock
) && (0 == RcvdBytes
)) {
814 Status
= EFI_CONNECTION_FIN
;
818 if (RcvdBytes
!= 0) {
819 SockProcessRcvToken (Sock
, RcvToken
);
821 Status
= Sock
->ProtoHandler (Sock
, SOCK_CONSUMED
, NULL
);
824 if (NULL
== SockBufferToken (Sock
, &Sock
->RcvTokenList
, RcvToken
, 0)) {
825 Status
= EFI_OUT_OF_RESOURCES
;
830 EfiReleaseLock (&(Sock
->Lock
));
835 Reset the socket and its associated protocol control block.
837 @param[in, out] Sock Pointer to the socket to be flushed.
839 @retval EFI_SUCCESS The socket is flushed successfully.
840 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket.
850 ASSERT (SockStream
== Sock
->Type
);
852 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
853 if (EFI_ERROR (Status
)) {
857 "SockFlush: Get the access for socket failed with %r",
861 return EFI_ACCESS_DENIED
;
864 if (!SOCK_IS_CONFIGURED (Sock
)) {
866 Status
= EFI_ACCESS_DENIED
;
870 Status
= Sock
->ProtoHandler (Sock
, SOCK_FLUSH
, NULL
);
871 if (EFI_ERROR (Status
)) {
875 "SockFlush: Protocol failed handling SOCK_FLUSH with %r",
882 SOCK_ERROR (Sock
, EFI_ABORTED
);
883 SockConnFlush (Sock
);
884 SockSetState (Sock
, SO_CLOSED
);
886 Sock
->ConfigureState
= SO_UNCONFIGURED
;
889 EfiReleaseLock (&(Sock
->Lock
));
894 Close or abort the socket associated connection.
896 @param[in, out] Sock Pointer to the socket of the connection to close
898 @param[in] Token The token for a close operation.
899 @param[in] OnAbort TRUE for aborting the connection; FALSE to close it.
901 @retval EFI_SUCCESS The close or abort operation initialized
903 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
904 socket is closed, or the socket is not in a
905 synchronized state , or the token is already in one
906 of this socket's lists.
907 @retval EFI_NO_MAPPING The IP address configuration operation is not
909 @retval EFI_NOT_STARTED The socket is not configured.
922 ASSERT (SockStream
== Sock
->Type
);
924 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
925 if (EFI_ERROR (Status
)) {
928 "SockClose: Get the access for socket failed with %r",
932 return EFI_ACCESS_DENIED
;
935 if (SOCK_IS_NO_MAPPING (Sock
)) {
936 Status
= EFI_NO_MAPPING
;
940 if (SOCK_IS_UNCONFIGURED (Sock
)) {
941 Status
= EFI_NOT_STARTED
;
945 if (SOCK_IS_DISCONNECTING (Sock
)) {
946 Status
= EFI_ACCESS_DENIED
;
950 Event
= ((SOCK_COMPLETION_TOKEN
*) Token
)->Event
;
952 if (SockTokenExisted (Sock
, Event
)) {
953 Status
= EFI_ACCESS_DENIED
;
957 Sock
->CloseToken
= Token
;
958 SockSetState (Sock
, SO_DISCONNECTING
);
961 Status
= Sock
->ProtoHandler (Sock
, SOCK_ABORT
, NULL
);
963 Status
= Sock
->ProtoHandler (Sock
, SOCK_CLOSE
, NULL
);
967 EfiReleaseLock (&(Sock
->Lock
));
972 Abort the socket associated connection, listen, transmission or receive request.
974 @param[in, out] Sock Pointer to the socket to abort.
975 @param[in] Token Pointer to a token that has been issued by
976 Connect(), Accept(), Transmit() or Receive(). If
977 NULL, all pending tokens issued by the four
978 functions listed above will be aborted.
980 @retval EFI_UNSUPPORTED The operation is not supported in the current
991 Status
= EFI_SUCCESS
;
993 ASSERT (SockStream
== Sock
->Type
);
995 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
996 if (EFI_ERROR (Status
)) {
999 "SockCancel: Get the access for socket failed with %r",
1003 return EFI_ACCESS_DENIED
;
1006 if (SOCK_IS_UNCONFIGURED (Sock
)) {
1007 Status
= EFI_NOT_STARTED
;
1012 // 1. Check ConnectionToken.
1014 if (Token
== NULL
|| (SOCK_COMPLETION_TOKEN
*) Token
== Sock
->ConnectionToken
) {
1015 if (Sock
->ConnectionToken
!= NULL
) {
1016 SIGNAL_TOKEN (Sock
->ConnectionToken
, EFI_ABORTED
);
1017 Sock
->ConnectionToken
= NULL
;
1020 if (Token
!= NULL
) {
1021 Status
= EFI_SUCCESS
;
1027 // 2. Check ListenTokenList.
1029 Status
= SockCancelToken (Token
, &Sock
->ListenTokenList
);
1030 if (Token
!= NULL
&& !EFI_ERROR (Status
)) {
1035 // 3. Check RcvTokenList.
1037 Status
= SockCancelToken (Token
, &Sock
->RcvTokenList
);
1038 if (Token
!= NULL
&& !EFI_ERROR (Status
)) {
1043 // 4. Check SndTokenList.
1045 Status
= SockCancelToken (Token
, &Sock
->SndTokenList
);
1046 if (Token
!= NULL
&& !EFI_ERROR (Status
)) {
1051 // 5. Check ProcessingSndTokenList.
1053 Status
= SockCancelToken (Token
, &Sock
->ProcessingSndTokenList
);
1056 EfiReleaseLock (&(Sock
->Lock
));
1062 Get the mode data of the low layer protocol.
1064 @param[in] Sock Pointer to the socket to get mode data from.
1065 @param[in, out] Mode Pointer to the data to store the low layer mode
1068 @retval EFI_SUCCESS The mode data was obtained successfully.
1069 @retval EFI_NOT_STARTED The socket is not configured.
1078 return Sock
->ProtoHandler (Sock
, SOCK_MODE
, Mode
);
1082 Configure the low level protocol to join a multicast group for
1083 this socket's connection.
1085 @param[in] Sock Pointer to the socket of the connection to join the
1086 specific multicast group.
1087 @param[in] GroupInfo Pointer to the multicast group info.
1089 @retval EFI_SUCCESS The configuration completed successfully.
1090 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket.
1091 @retval EFI_NOT_STARTED The socket is not configured.
1102 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
1104 if (EFI_ERROR (Status
)) {
1108 "SockGroup: Get the access for socket failed with %r",
1112 return EFI_ACCESS_DENIED
;
1115 if (SOCK_IS_UNCONFIGURED (Sock
)) {
1116 Status
= EFI_NOT_STARTED
;
1120 Status
= Sock
->ProtoHandler (Sock
, SOCK_GROUP
, GroupInfo
);
1123 EfiReleaseLock (&(Sock
->Lock
));
1128 Add or remove route information in IP route table associated
1131 @param[in] Sock Pointer to the socket associated with the IP route
1132 table to operate on.
1133 @param[in] RouteInfo Pointer to the route information to be processed.
1135 @retval EFI_SUCCESS The route table updated successfully.
1136 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket.
1137 @retval EFI_NO_MAPPING The IP address configuration operation is not
1139 @retval EFI_NOT_STARTED The socket is not configured.
1150 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
1151 if (EFI_ERROR (Status
)) {
1154 "SockRoute: Get the access for socket failed with %r",
1158 return EFI_ACCESS_DENIED
;
1161 if (SOCK_IS_NO_MAPPING (Sock
)) {
1162 Status
= EFI_NO_MAPPING
;
1166 if (SOCK_IS_UNCONFIGURED (Sock
)) {
1167 Status
= EFI_NOT_STARTED
;
1171 Status
= Sock
->ProtoHandler (Sock
, SOCK_ROUTE
, RouteInfo
);
1174 EfiReleaseLock (&(Sock
->Lock
));