2 Interface function of the Socket.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
13 Check whether the Event is in the List.
15 @param[in] List Pointer to the token list to be searched.
16 @param[in] Event The event to be checked.
18 @retval TRUE The specific Event exists in the List.
19 @retval FALSE The specific Event is not in the List.
23 SockTokenExistedInList (
28 LIST_ENTRY
*ListEntry
;
29 SOCK_TOKEN
*SockToken
;
31 NET_LIST_FOR_EACH (ListEntry
, List
) {
32 SockToken
= NET_LIST_USER_STRUCT (
38 if (Event
== SockToken
->Token
->Event
) {
47 Call SockTokenExistedInList() to check whether the Event is
48 in the related socket's lists.
50 @param[in] Sock Pointer to the instance's socket.
51 @param[in] Event The event to be checked.
53 @retval TRUE The Event exists in related socket's lists.
54 @retval FALSE The Event is not in related socket's lists.
63 if (SockTokenExistedInList (&Sock
->SndTokenList
, Event
) ||
64 SockTokenExistedInList (&Sock
->ProcessingSndTokenList
, Event
) ||
65 SockTokenExistedInList (&Sock
->RcvTokenList
, Event
) ||
66 SockTokenExistedInList (&Sock
->ListenTokenList
, Event
)
72 if ((Sock
->ConnectionToken
!= NULL
) && (Sock
->ConnectionToken
->Event
== Event
)) {
76 if ((Sock
->CloseToken
!= NULL
) && (Sock
->CloseToken
->Event
== Event
)) {
84 Buffer a token into the specific list of the socket Sock.
86 @param[in] Sock Pointer to the instance's socket.
87 @param[in] List Pointer to the list to store the token.
88 @param[in] Token Pointer to the token to be buffered.
89 @param[in] DataLen The data length of the buffer contained in Token.
91 @return Pointer to the token that wraps Token. If NULL, an error condition occurred.
102 SOCK_TOKEN
*SockToken
;
104 SockToken
= AllocateZeroPool (sizeof (SOCK_TOKEN
));
105 if (NULL
== SockToken
) {
108 "SockBufferIOToken: No Memory to allocate SockToken\n")
114 SockToken
->Sock
= Sock
;
115 SockToken
->Token
= (SOCK_COMPLETION_TOKEN
*)Token
;
116 SockToken
->RemainDataLen
= DataLen
;
117 InsertTailList (List
, &SockToken
->TokenList
);
123 Destroy the socket Sock and its associated protocol control block.
125 @param[in, out] Sock The socket to be destroyed.
127 @retval EFI_SUCCESS The socket Sock was destroyed successfully.
128 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket.
137 TCP_PROTO_DATA
*ProtoData
;
139 EFI_GUID
*IpProtocolGuid
;
140 EFI_GUID
*TcpProtocolGuid
;
143 ASSERT ((Sock
!= NULL
) && (Sock
->ProtoHandler
!= NULL
));
145 if (Sock
->InDestroy
) {
149 Sock
->InDestroy
= TRUE
;
151 if (Sock
->IpVersion
== IP_VERSION_4
) {
152 IpProtocolGuid
= &gEfiIp4ProtocolGuid
;
153 TcpProtocolGuid
= &gEfiTcp4ProtocolGuid
;
155 IpProtocolGuid
= &gEfiIp6ProtocolGuid
;
156 TcpProtocolGuid
= &gEfiTcp6ProtocolGuid
;
159 ProtoData
= (TCP_PROTO_DATA
*)Sock
->ProtoReserved
;
160 Tcb
= ProtoData
->TcpPcb
;
162 ASSERT (Tcb
!= NULL
);
165 // Close the IP protocol.
168 Tcb
->IpInfo
->ChildHandle
,
170 ProtoData
->TcpService
->IpIo
->Image
,
174 if (Sock
->DestroyCallback
!= NULL
) {
175 Sock
->DestroyCallback (Sock
, Sock
->Context
);
179 // Retrieve the protocol installed on this sock
181 Status
= gBS
->OpenProtocol (
187 EFI_OPEN_PROTOCOL_GET_PROTOCOL
190 if (EFI_ERROR (Status
)) {
193 "SockDestroyChild: Open protocol installed on socket failed with %r\n",
199 // Uninstall the protocol installed on this sock
201 gBS
->UninstallMultipleProtocolInterfaces (
208 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
209 if (EFI_ERROR (Status
)) {
212 "SockDestroyChild: Get the lock to access socket failed with %r\n",
216 return EFI_ACCESS_DENIED
;
220 // force protocol layer to detach the PCB
222 Status
= Sock
->ProtoHandler (Sock
, SOCK_DETACH
, NULL
);
224 if (EFI_ERROR (Status
)) {
227 "SockDestroyChild: Protocol detach socket failed with %r\n",
231 Sock
->InDestroy
= FALSE
;
232 } else if (SOCK_IS_CONFIGURED (Sock
)) {
233 SockConnFlush (Sock
);
234 SockSetState (Sock
, SO_CLOSED
);
236 Sock
->ConfigureState
= SO_UNCONFIGURED
;
239 EfiReleaseLock (&(Sock
->Lock
));
241 if (EFI_ERROR (Status
)) {
250 Create a socket and its associated protocol control block
251 with the initial data SockInitData and protocol specific
254 @param[in] SockInitData Initial data to setting the socket.
256 @return Pointer to the newly created socket. If NULL, an error condition occurred.
261 IN SOCK_INIT_DATA
*SockInitData
267 EFI_GUID
*TcpProtocolGuid
;
270 // create a new socket
272 Sock
= SockCreate (SockInitData
);
276 "SockCreateChild: No resource to create a new socket\n")
282 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
283 if (EFI_ERROR (Status
)) {
286 "SockCreateChild: Get the lock to access socket failed with %r\n",
293 // inform the protocol layer to attach the socket
294 // with a new protocol control block
296 Status
= Sock
->ProtoHandler (Sock
, SOCK_ATTACH
, NULL
);
297 EfiReleaseLock (&(Sock
->Lock
));
298 if (EFI_ERROR (Status
)) {
301 "SockCreateChild: Protocol failed to attach a socket with %r\n",
311 if (Sock
->DestroyCallback
!= NULL
) {
312 Sock
->DestroyCallback (Sock
, Sock
->Context
);
315 if (Sock
->IpVersion
== IP_VERSION_4
) {
316 TcpProtocolGuid
= &gEfiTcp4ProtocolGuid
;
318 TcpProtocolGuid
= &gEfiTcp6ProtocolGuid
;
327 EFI_OPEN_PROTOCOL_GET_PROTOCOL
330 // Uninstall the protocol installed on this sock
332 gBS
->UninstallMultipleProtocolInterfaces (
343 Configure the specific socket Sock using configuration data ConfigData.
345 @param[in] Sock Pointer to the socket to be configured.
346 @param[in] ConfigData Pointer to the configuration data.
348 @retval EFI_SUCCESS The socket configured successfully.
349 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
350 socket is already configured.
361 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
362 if (EFI_ERROR (Status
)) {
365 "SockConfigure: Get the access for socket failed with %r",
369 return EFI_ACCESS_DENIED
;
372 if (SOCK_IS_CONFIGURED (Sock
)) {
373 Status
= EFI_ACCESS_DENIED
;
377 ASSERT (Sock
->State
== SO_CLOSED
);
379 Status
= Sock
->ProtoHandler (Sock
, SOCK_CONFIGURE
, ConfigData
);
382 EfiReleaseLock (&(Sock
->Lock
));
388 Initiate a connection establishment process.
390 @param[in] Sock Pointer to the socket to initiate the
392 @param[in] Token Pointer to the token used for the connection
395 @retval EFI_SUCCESS The connection initialized successfully.
396 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
397 socket is closed, or the socket is not configured to
398 be an active one, or the token is already in one of
400 @retval EFI_NO_MAPPING The IP address configuration operation is not
402 @retval EFI_NOT_STARTED The socket is not configured.
414 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
415 if (EFI_ERROR (Status
)) {
418 "SockConnect: Get the access for socket failed with %r",
422 return EFI_ACCESS_DENIED
;
425 if (SOCK_IS_NO_MAPPING (Sock
)) {
426 Status
= EFI_NO_MAPPING
;
430 if (SOCK_IS_UNCONFIGURED (Sock
)) {
431 Status
= EFI_NOT_STARTED
;
435 if (!SOCK_IS_CLOSED (Sock
) || !SOCK_IS_CONFIGURED_ACTIVE (Sock
)) {
436 Status
= EFI_ACCESS_DENIED
;
440 Event
= ((SOCK_COMPLETION_TOKEN
*)Token
)->Event
;
442 if (SockTokenExisted (Sock
, Event
)) {
443 Status
= EFI_ACCESS_DENIED
;
447 Sock
->ConnectionToken
= (SOCK_COMPLETION_TOKEN
*)Token
;
448 SockSetState (Sock
, SO_CONNECTING
);
449 Status
= Sock
->ProtoHandler (Sock
, SOCK_CONNECT
, NULL
);
452 EfiReleaseLock (&(Sock
->Lock
));
457 Issue a listen token to get an existed connected network instance
458 or wait for a connection if there is none.
460 @param[in] Sock Pointer to the socket to accept connections.
461 @param[in] Token The token to accept a connection.
463 @retval EFI_SUCCESS Either a connection is accepted or the Token is
464 buffered for further acception.
465 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
466 socket is closed, or the socket is not configured to
467 be a passive one, or the token is already in one of
469 @retval EFI_NO_MAPPING The IP address configuration operation is not
471 @retval EFI_NOT_STARTED The socket is not configured.
472 @retval EFI_OUT_OF_RESOURCE Failed to buffer the Token due to memory limits.
481 EFI_TCP4_LISTEN_TOKEN
*ListenToken
;
482 LIST_ENTRY
*ListEntry
;
487 ASSERT (SockStream
== Sock
->Type
);
489 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
490 if (EFI_ERROR (Status
)) {
493 "SockAccept: Get the access for socket failed with %r",
497 return EFI_ACCESS_DENIED
;
500 if (SOCK_IS_NO_MAPPING (Sock
)) {
501 Status
= EFI_NO_MAPPING
;
505 if (SOCK_IS_UNCONFIGURED (Sock
)) {
506 Status
= EFI_NOT_STARTED
;
510 if (!SOCK_IS_LISTENING (Sock
)) {
511 Status
= EFI_ACCESS_DENIED
;
515 Event
= ((SOCK_COMPLETION_TOKEN
*)Token
)->Event
;
517 if (SockTokenExisted (Sock
, Event
)) {
518 Status
= EFI_ACCESS_DENIED
;
522 ListenToken
= (EFI_TCP4_LISTEN_TOKEN
*)Token
;
525 // Check if a connection has already in this Sock->ConnectionList
527 NET_LIST_FOR_EACH (ListEntry
, &Sock
->ConnectionList
) {
528 Socket
= NET_LIST_USER_STRUCT (ListEntry
, SOCKET
, ConnectionList
);
530 if (SOCK_IS_CONNECTED (Socket
)) {
531 ListenToken
->NewChildHandle
= Socket
->SockHandle
;
532 SIGNAL_TOKEN (&(ListenToken
->CompletionToken
), EFI_SUCCESS
);
534 RemoveEntryList (ListEntry
);
536 ASSERT (Socket
->Parent
!= NULL
);
538 Socket
->Parent
->ConnCnt
--;
542 "SockAccept: Accept a socket, now conncount is %d",
543 Socket
->Parent
->ConnCnt
)
545 Socket
->Parent
= NULL
;
552 // Buffer this token for latter incoming connection request
554 if (NULL
== SockBufferToken (Sock
, &(Sock
->ListenTokenList
), Token
, 0)) {
555 Status
= EFI_OUT_OF_RESOURCES
;
559 EfiReleaseLock (&(Sock
->Lock
));
565 Issue a token with data to the socket to send out.
567 @param[in] Sock Pointer to the socket to process the token with
569 @param[in] Token The token with data that needs to send out.
571 @retval EFI_SUCCESS The token processed successfully.
572 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
573 socket is closed, or the socket is not in a
574 synchronized state , or the token is already in one
575 of this socket's lists.
576 @retval EFI_NO_MAPPING The IP address configuration operation is not
578 @retval EFI_NOT_STARTED The socket is not configured.
579 @retval EFI_OUT_OF_RESOURCE Failed to buffer the token due to memory limits.
588 SOCK_IO_TOKEN
*SndToken
;
591 EFI_TCP4_TRANSMIT_DATA
*TxData
;
593 SOCK_TOKEN
*SockToken
;
596 ASSERT (SockStream
== Sock
->Type
);
598 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
599 if (EFI_ERROR (Status
)) {
602 "SockSend: Get the access for socket failed with %r",
606 return EFI_ACCESS_DENIED
;
609 if (SOCK_IS_NO_MAPPING (Sock
)) {
610 Status
= EFI_NO_MAPPING
;
614 SndToken
= (SOCK_IO_TOKEN
*)Token
;
615 TxData
= (EFI_TCP4_TRANSMIT_DATA
*)SndToken
->Packet
.TxData
;
617 if (SOCK_IS_UNCONFIGURED (Sock
)) {
618 Status
= EFI_NOT_STARTED
;
622 if (!(SOCK_IS_CONNECTING (Sock
) || SOCK_IS_CONNECTED (Sock
))) {
623 Status
= EFI_ACCESS_DENIED
;
628 // check if a token is already in the token buffer
630 Event
= SndToken
->Token
.Event
;
632 if (SockTokenExisted (Sock
, Event
)) {
633 Status
= EFI_ACCESS_DENIED
;
637 DataLen
= TxData
->DataLength
;
640 // process this sending token now or buffer it only?
642 FreeSpace
= SockGetFreeSpace (Sock
, SOCK_SND_BUF
);
644 if ((FreeSpace
< Sock
->SndBuffer
.LowWater
) || !SOCK_IS_CONNECTED (Sock
)) {
645 SockToken
= SockBufferToken (
652 if (NULL
== SockToken
) {
653 Status
= EFI_OUT_OF_RESOURCES
;
656 SockToken
= SockBufferToken (
658 &Sock
->ProcessingSndTokenList
,
663 if (NULL
== SockToken
) {
664 DEBUG ((DEBUG_ERROR
, "SockSend: Failed to buffer IO token into socket processing SndToken List\n"));
666 Status
= EFI_OUT_OF_RESOURCES
;
670 Status
= SockProcessTcpSndData (Sock
, TxData
);
672 if (EFI_ERROR (Status
)) {
673 DEBUG ((DEBUG_ERROR
, "SockSend: Failed to process Snd Data\n"));
675 RemoveEntryList (&(SockToken
->TokenList
));
676 FreePool (SockToken
);
681 EfiReleaseLock (&(Sock
->Lock
));
686 Issue a token to get data from the socket.
688 @param[in] Sock Pointer to the socket to get data from.
689 @param[in] Token The token to store the received data from the
692 @retval EFI_SUCCESS The token processed successfully.
693 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
694 socket is closed, or the socket is not in a
695 synchronized state , or the token is already in one
696 of this socket's lists.
697 @retval EFI_NO_MAPPING The IP address configuration operation is not
699 @retval EFI_NOT_STARTED The socket is not configured.
700 @retval EFI_CONNECTION_FIN The connection is closed and there is no more data.
701 @retval EFI_OUT_OF_RESOURCE Failed to buffer the token due to memory limit.
710 SOCK_IO_TOKEN
*RcvToken
;
715 ASSERT (SockStream
== Sock
->Type
);
717 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
718 if (EFI_ERROR (Status
)) {
721 "SockRcv: Get the access for socket failed with %r",
725 return EFI_ACCESS_DENIED
;
728 if (SOCK_IS_NO_MAPPING (Sock
)) {
729 Status
= EFI_NO_MAPPING
;
733 if (SOCK_IS_UNCONFIGURED (Sock
)) {
734 Status
= EFI_NOT_STARTED
;
738 if (!(SOCK_IS_CONNECTED (Sock
) || SOCK_IS_CONNECTING (Sock
))) {
739 Status
= EFI_ACCESS_DENIED
;
743 RcvToken
= (SOCK_IO_TOKEN
*)Token
;
746 // check if a token is already in the token buffer of this socket
748 Event
= RcvToken
->Token
.Event
;
749 if (SockTokenExisted (Sock
, Event
)) {
750 Status
= EFI_ACCESS_DENIED
;
754 RcvToken
= (SOCK_IO_TOKEN
*)Token
;
755 RcvdBytes
= GET_RCV_DATASIZE (Sock
);
758 // check whether an error has happened before
760 if (EFI_ABORTED
!= Sock
->SockError
) {
761 SIGNAL_TOKEN (&(RcvToken
->Token
), Sock
->SockError
);
762 Sock
->SockError
= EFI_ABORTED
;
767 // check whether can not receive and there is no any
768 // data buffered in Sock->RcvBuffer
770 if (SOCK_IS_NO_MORE_DATA (Sock
) && (0 == RcvdBytes
)) {
771 Status
= EFI_CONNECTION_FIN
;
775 if (RcvdBytes
!= 0) {
776 SockProcessRcvToken (Sock
, RcvToken
);
778 Status
= Sock
->ProtoHandler (Sock
, SOCK_CONSUMED
, NULL
);
780 if (NULL
== SockBufferToken (Sock
, &Sock
->RcvTokenList
, RcvToken
, 0)) {
781 Status
= EFI_OUT_OF_RESOURCES
;
786 EfiReleaseLock (&(Sock
->Lock
));
791 Reset the socket and its associated protocol control block.
793 @param[in, out] Sock Pointer to the socket to be flushed.
795 @retval EFI_SUCCESS The socket is flushed successfully.
796 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket.
806 ASSERT (SockStream
== Sock
->Type
);
808 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
809 if (EFI_ERROR (Status
)) {
812 "SockFlush: Get the access for socket failed with %r",
816 return EFI_ACCESS_DENIED
;
819 if (!SOCK_IS_CONFIGURED (Sock
)) {
820 Status
= EFI_ACCESS_DENIED
;
824 Status
= Sock
->ProtoHandler (Sock
, SOCK_FLUSH
, NULL
);
825 if (EFI_ERROR (Status
)) {
828 "SockFlush: Protocol failed handling SOCK_FLUSH with %r",
835 SOCK_ERROR (Sock
, EFI_ABORTED
);
836 SockConnFlush (Sock
);
837 SockSetState (Sock
, SO_CLOSED
);
839 Sock
->ConfigureState
= SO_UNCONFIGURED
;
842 EfiReleaseLock (&(Sock
->Lock
));
847 Close or abort the socket associated connection.
849 @param[in, out] Sock Pointer to the socket of the connection to close
851 @param[in] Token The token for a close operation.
852 @param[in] OnAbort TRUE for aborting the connection; FALSE to close it.
854 @retval EFI_SUCCESS The close or abort operation initialized
856 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket, or the
857 socket is closed, or the socket is not in a
858 synchronized state , or the token is already in one
859 of this socket's lists.
860 @retval EFI_NO_MAPPING The IP address configuration operation is not
862 @retval EFI_NOT_STARTED The socket is not configured.
875 ASSERT (SockStream
== Sock
->Type
);
877 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
878 if (EFI_ERROR (Status
)) {
881 "SockClose: Get the access for socket failed with %r",
885 return EFI_ACCESS_DENIED
;
888 if (SOCK_IS_NO_MAPPING (Sock
)) {
889 Status
= EFI_NO_MAPPING
;
893 if (SOCK_IS_UNCONFIGURED (Sock
)) {
894 Status
= EFI_NOT_STARTED
;
898 if (SOCK_IS_DISCONNECTING (Sock
)) {
899 Status
= EFI_ACCESS_DENIED
;
903 Event
= ((SOCK_COMPLETION_TOKEN
*)Token
)->Event
;
905 if (SockTokenExisted (Sock
, Event
)) {
906 Status
= EFI_ACCESS_DENIED
;
910 Sock
->CloseToken
= Token
;
911 SockSetState (Sock
, SO_DISCONNECTING
);
914 Status
= Sock
->ProtoHandler (Sock
, SOCK_ABORT
, NULL
);
916 Status
= Sock
->ProtoHandler (Sock
, SOCK_CLOSE
, NULL
);
920 EfiReleaseLock (&(Sock
->Lock
));
925 Abort the socket associated connection, listen, transmission or receive request.
927 @param[in, out] Sock Pointer to the socket to abort.
928 @param[in] Token Pointer to a token that has been issued by
929 Connect(), Accept(), Transmit() or Receive(). If
930 NULL, all pending tokens issued by the four
931 functions listed above will be aborted.
933 @retval EFI_UNSUPPORTED The operation is not supported in the current
944 Status
= EFI_SUCCESS
;
946 ASSERT (SockStream
== Sock
->Type
);
948 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
949 if (EFI_ERROR (Status
)) {
952 "SockCancel: Get the access for socket failed with %r",
956 return EFI_ACCESS_DENIED
;
959 if (SOCK_IS_UNCONFIGURED (Sock
)) {
960 Status
= EFI_NOT_STARTED
;
965 // 1. Check ConnectionToken.
967 if ((Token
== NULL
) || ((SOCK_COMPLETION_TOKEN
*)Token
== Sock
->ConnectionToken
)) {
968 if (Sock
->ConnectionToken
!= NULL
) {
969 SIGNAL_TOKEN (Sock
->ConnectionToken
, EFI_ABORTED
);
970 Sock
->ConnectionToken
= NULL
;
974 Status
= EFI_SUCCESS
;
980 // 2. Check ListenTokenList.
982 Status
= SockCancelToken (Token
, &Sock
->ListenTokenList
);
983 if ((Token
!= NULL
) && !EFI_ERROR (Status
)) {
988 // 3. Check RcvTokenList.
990 Status
= SockCancelToken (Token
, &Sock
->RcvTokenList
);
991 if ((Token
!= NULL
) && !EFI_ERROR (Status
)) {
996 // 4. Check SndTokenList.
998 Status
= SockCancelToken (Token
, &Sock
->SndTokenList
);
999 if ((Token
!= NULL
) && !EFI_ERROR (Status
)) {
1004 // 5. Check ProcessingSndTokenList.
1006 Status
= SockCancelToken (Token
, &Sock
->ProcessingSndTokenList
);
1009 EfiReleaseLock (&(Sock
->Lock
));
1014 Get the mode data of the low layer protocol.
1016 @param[in] Sock Pointer to the socket to get mode data from.
1017 @param[in, out] Mode Pointer to the data to store the low layer mode
1020 @retval EFI_SUCCESS The mode data was obtained successfully.
1021 @retval EFI_NOT_STARTED The socket is not configured.
1030 return Sock
->ProtoHandler (Sock
, SOCK_MODE
, Mode
);
1034 Add or remove route information in IP route table associated
1037 @param[in] Sock Pointer to the socket associated with the IP route
1038 table to operate on.
1039 @param[in] RouteInfo Pointer to the route information to be processed.
1041 @retval EFI_SUCCESS The route table updated successfully.
1042 @retval EFI_ACCESS_DENIED Failed to get the lock to access the socket.
1043 @retval EFI_NO_MAPPING The IP address configuration operation is not
1045 @retval EFI_NOT_STARTED The socket is not configured.
1056 Status
= EfiAcquireLockOrFail (&(Sock
->Lock
));
1057 if (EFI_ERROR (Status
)) {
1060 "SockRoute: Get the access for socket failed with %r",
1064 return EFI_ACCESS_DENIED
;
1067 if (SOCK_IS_NO_MAPPING (Sock
)) {
1068 Status
= EFI_NO_MAPPING
;
1072 if (SOCK_IS_UNCONFIGURED (Sock
)) {
1073 Status
= EFI_NOT_STARTED
;
1077 Status
= Sock
->ProtoHandler (Sock
, SOCK_ROUTE
, RouteInfo
);
1080 EfiReleaseLock (&(Sock
->Lock
));