From 5ffe214ae95be9cb3dfca3d1dc254ad9f1f6fe45 Mon Sep 17 00:00:00 2001 From: Jiaxin Wu Date: Tue, 31 May 2016 22:17:26 +0800 Subject: NetworkPkg: Support TCP Cancel function This path is used to support TCP Cancel function to abort an asynchronous connection, listen, transmission or receive request. If any TCP CompletionToken is not signaled, it should not be closed directly by calling CloseEvent (Still in the TCP TokenList). If not, any exception behavior may be triggered. We should cancel it by calling Tcp->Cancel() first. In such a case, TCP Cancel function is necessary. Cc: Ye Ting Cc: Fu Siyuan Cc: Zhang Lubo Cc: Hegde Nagaraj P Cc: Gary Lin Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu Reviewed-by: Gary Lin Reviewed-by: Hegde Nagaraj P Reviewed-by: Ye Ting Tested-by: Gary Lin Tested-by: Hegde Nagaraj P --- NetworkPkg/TcpDxe/Socket.h | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'NetworkPkg/TcpDxe/Socket.h') diff --git a/NetworkPkg/TcpDxe/Socket.h b/NetworkPkg/TcpDxe/Socket.h index 5a63047f90..371e9abd84 100644 --- a/NetworkPkg/TcpDxe/Socket.h +++ b/NetworkPkg/TcpDxe/Socket.h @@ -1,7 +1,7 @@ /** @file Common head file for TCP socket. - Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -864,6 +864,24 @@ SockClose ( IN BOOLEAN OnAbort ); +/** + Abort the socket associated connection, listen, transmission or receive request. + + @param[in, out] Sock Pointer to the socket to abort. + @param[in] Token Pointer to a token that has been issued by + Connect(), Accept(), Transmit() or Receive(). If + NULL, all pending tokens issued by the four + functions listed above will be aborted. + + @retval EFI_UNSUPPORTED The operation is not supported in the current + implementation. +**/ +EFI_STATUS +SockCancel ( + IN OUT SOCKET *Sock, + IN VOID *Token + ); + /** Get the mode data of the low layer protocol. -- cgit v1.2.3