Пример #1
0
/**
  Flush the Tcb add its associated protocols.

  @param  Tcb                    Pointer to the TCP_CB to be flushed.

**/
VOID
Tcp4FlushPcb (
  IN TCP_CB *Tcb
  )
{
  SOCKET           *Sock;

  IpIoConfigIp (Tcb->IpInfo, NULL);

  Sock     = Tcb->Sk;

  if (SOCK_IS_CONFIGURED (Sock)) {
    RemoveEntryList (&Tcb->List);

    //
    // Uninstall the device path protocol.
    //
    if (Sock->DevicePath != NULL) {
      gBS->UninstallProtocolInterface (
             Sock->SockHandle,
             &gEfiDevicePathProtocolGuid,
             Sock->DevicePath
             );
      FreePool (Sock->DevicePath);
    }
  }

  NetbufFreeList (&Tcb->SndQue);
  NetbufFreeList (&Tcb->RcvQue);
  Tcb->State = TCP_CLOSED;
}
Пример #2
0
/**
  Flush the Tcb add its associated protocols.

  @param  Tcb                    Pointer to the TCP_CB to be flushed.

**/
VOID
Tcp4FlushPcb (
  IN TCP_CB *Tcb
  )
{
  SOCKET           *Sock;
  TCP4_PROTO_DATA  *TcpProto;

  IpIoConfigIp (Tcb->IpInfo, NULL);

  Sock     = Tcb->Sk;
  TcpProto = (TCP4_PROTO_DATA *) Sock->ProtoReserved;

  if (SOCK_IS_CONFIGURED (Sock)) {
    RemoveEntryList (&Tcb->List);

    //
    // Uninstall the device path protocol.
    //
    if (Sock->DevicePath != NULL) {
      gBS->UninstallProtocolInterface (
             Sock->SockHandle,
             &gEfiDevicePathProtocolGuid,
             Sock->DevicePath
             );
      FreePool (Sock->DevicePath);
    }

    TcpSetVariableData (TcpProto->TcpService);
  }

  NetbufFreeList (&Tcb->SndQue);
  NetbufFreeList (&Tcb->RcvQue);
  Tcb->State = TCP_CLOSED;
}
Пример #3
0
/**
  Close the TCP connection.

  @param  Tcb      Pointer to the TCP_CB of this TCP instance.

**/
VOID
TcpClose (
  IN OUT TCP_CB *Tcb
  )
{
  NetbufFreeList (&Tcb->SndQue);
  NetbufFreeList (&Tcb->RcvQue);

  TcpSetState (Tcb, TCP_CLOSED);
}
Пример #4
0
/**
  The callback function to free the net buffer list.

  @param[in]  Arg The opaque parameter.

**/
VOID
EFIAPI
FreeNbufList (
  IN VOID *Arg
  )
{
  ASSERT (Arg != NULL);

  NetbufFreeList ((LIST_ENTRY *) Arg);
  FreePool (Arg);
}