/** Detach the Pcb of the socket. @param Sk Pointer to the socket of this TCP instance. **/ VOID Tcp4DetachPcb ( IN SOCKET *Sk ) { TCP4_PROTO_DATA *ProtoData; TCP_CB *Tcb; ProtoData = (TCP4_PROTO_DATA *) Sk->ProtoReserved; Tcb = ProtoData->TcpPcb; ASSERT (Tcb != NULL); Tcp4FlushPcb (Tcb); // // Close the IP protocol. // gBS->CloseProtocol ( Tcb->IpInfo->ChildHandle, &gEfiIp4ProtocolGuid, ProtoData->TcpService->IpIo->Image, Sk->SockHandle ); IpIoRemoveIp (ProtoData->TcpService->IpIo, Tcb->IpInfo); FreePool (Tcb); ProtoData->TcpPcb = NULL; }
/** Detach the Pcb of the socket. @param Sk Pointer to the socket of this TCP instance. **/ VOID Tcp4DetachPcb ( IN SOCKET *Sk ) { TCP4_PROTO_DATA *ProtoData; TCP_CB *Tcb; ProtoData = (TCP4_PROTO_DATA *) Sk->ProtoReserved; Tcb = ProtoData->TcpPcb; ASSERT (Tcb != NULL); Tcp4FlushPcb (Tcb); IpIoRemoveIp (ProtoData->TcpService->IpIo, Tcb->IpInfo); FreePool (Tcb); ProtoData->TcpPcb = NULL; }