summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c')
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c76
1 files changed, 40 insertions, 36 deletions
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
index 9f170677f9..009ae582a5 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
@@ -23,42 +23,33 @@ Abstract:
#define TCP_COMP_VAL(Min, Max, Default, Val) \
((((Val) <= (Max)) && ((Val) >= (Min))) ? (Val) : (Default))
+/**
+ Add or remove a route entry in the IP route table associated with this TCP instance.
+
+ @param Tcb Pointer to the TCP_CB of this TCP instance.
+ @param RouteInfo Pointer to the route info to be processed.
+
+ @retval EFI_SUCCESS The operation completed successfully.
+ @retval EFI_NOT_STARTED The driver instance has not been started.
+ @retval EFI_NO_MAPPING When using the default address, configuration(DHCP,
+ BOOTP, RARP, etc.) is not finished yet.
+ @retval EFI_OUT_OF_RESOURCES Could not add the entry to the routing table.
+ @retval EFI_NOT_FOUND This route is not in the routing table
+ (when RouteInfo->DeleteRoute is TRUE).
+ @retval EFI_ACCESS_DENIED The route is already defined in the routing table
+ (when RouteInfo->DeleteRoute is FALSE).
+**/
EFI_STATUS
Tcp4Route (
IN TCP_CB *Tcb,
IN TCP4_ROUTE_INFO *RouteInfo
)
-/*++
-
-Routine Description:
-
- Add or remove a route entry in the IP route table associated
- with this TCP instance.
-
-Arguments:
-
- Tcb - Pointer to the TCP_CB of this TCP instance.
- RouteInfo - Pointer to the route info to be processed.
-
-Returns:
-
- EFI_SUCCESS - The operation completed successfully.
- EFI_NOT_STARTED - The driver instance has not been started.
- EFI_NO_MAPPING - When using the default address, configuration(DHCP,
- BOOTP, RARP, etc.) is not finished yet.
- EFI_OUT_OF_RESOURCES - Could not add the entry to the routing table.
- EFI_NOT_FOUND - This route is not in the routing table
- (when RouteInfo->DeleteRoute is TRUE).
- EFI_ACCESS_DENIED - The route is already defined in the routing table
- (when RouteInfo->DeleteRoute is FALSE).
-
---*/
{
EFI_IP4_PROTOCOL *Ip;
Ip = Tcb->IpInfo->Ip;
- ASSERT (Ip);
+ ASSERT (Ip != NULL);
return Ip->Routes (
Ip,
@@ -67,7 +58,7 @@ Returns:
RouteInfo->SubnetMask,
RouteInfo->GatewayAddress
);
-
+
}
@@ -147,7 +138,7 @@ Tcp4GetMode (
}
Ip = Tcb->IpInfo->Ip;
- ASSERT (Ip);
+ ASSERT (Ip != NULL);
return Ip->GetModeData (Ip, Mode->Ip4ModeData, Mode->MnpConfigData, Mode->SnpModeData);
}
@@ -224,9 +215,7 @@ Tcp4Bind (
@param Tcb Pointer to the TCP_CB to be flushed.
- None
-
- **/
+**/
VOID
Tcp4FlushPcb (
IN TCP_CB *Tcb
@@ -260,6 +249,15 @@ Tcp4FlushPcb (
NetbufFreeList (&Tcb->RcvQue);
}
+/**
+ Attach a Tcb to the socket.
+
+ @param Sk Pointer to the socket of this TCP instance.
+
+ @retval EFI_SUCCESS The operation is completed successfully.
+ @retval EFI_OUT_OF_RESOURCES Failed due to resource limit.
+
+**/
EFI_STATUS
Tcp4AttachPcb (
IN SOCKET *Sk
@@ -302,6 +300,12 @@ Tcp4AttachPcb (
return EFI_SUCCESS;
}
+/**
+ Detach the Tcb of the socket.
+
+ @param Sk Pointer to the socket of this TCP instance.
+
+**/
VOID
Tcp4DetachPcb (
IN SOCKET *Sk
@@ -349,7 +353,7 @@ Tcp4ConfigurePcb (
TCP4_PROTO_DATA *TcpProto;
TCP_CB *Tcb;
- ASSERT (CfgData && Sk && Sk->SockHandle);
+ ASSERT ((CfgData != NULL) && (Sk != NULL) && (Sk->SockHandle != NULL));
TcpProto = (TCP4_PROTO_DATA *) Sk->ProtoReserved;
Tcb = TcpProto->TcpPcb;
@@ -617,13 +621,13 @@ Tcp4Dispatcher (
// notify TCP using this message to give it a chance to send out
// window update information
//
- ASSERT (Tcb);
+ ASSERT (Tcb != NULL);
TcpOnAppConsume (Tcb);
break;
case SOCK_SND:
- ASSERT (Tcb);
+ ASSERT (Tcb != NULL);
TcpOnAppSend (Tcb);
break;
@@ -686,7 +690,7 @@ Tcp4Dispatcher (
case SOCK_MODE:
- ASSERT (Data && Tcb);
+ ASSERT ((Data != NULL) && (Tcb != NULL));
return Tcp4GetMode (Tcb, (TCP4_MODE_DATA *) Data);
@@ -694,7 +698,7 @@ Tcp4Dispatcher (
case SOCK_ROUTE:
- ASSERT (Data && Tcb);
+ ASSERT ((Data != NULL) && (Tcb != NULL));
return Tcp4Route (Tcb, (TCP4_ROUTE_INFO *) Data);