summaryrefslogtreecommitdiff
path: root/Protocol/TcpSock
diff options
context:
space:
mode:
authorraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
committerraywu <raywu0301@gmail.com>2018-06-15 00:00:50 +0800
commitb7c51c9cf4864df6aabb99a1ae843becd577237c (patch)
treeeebe9b0d0ca03062955223097e57da84dd618b9a /Protocol/TcpSock
downloadzprj-b7c51c9cf4864df6aabb99a1ae843becd577237c.tar.xz
init. 1AQQW051HEADmaster
Diffstat (limited to 'Protocol/TcpSock')
-rw-r--r--Protocol/TcpSock/TcpSock.c36
-rw-r--r--Protocol/TcpSock/TcpSock.h97
2 files changed, 133 insertions, 0 deletions
diff --git a/Protocol/TcpSock/TcpSock.c b/Protocol/TcpSock/TcpSock.c
new file mode 100644
index 0000000..5206bc4
--- /dev/null
+++ b/Protocol/TcpSock/TcpSock.c
@@ -0,0 +1,36 @@
+/*++
+ This file contains 'Framework Code' and is licensed as such
+ under the terms of your license agreement with Intel or your
+ vendor. This file may not be modified, except as allowed by
+ additional terms of your license agreement.
+--*/
+/*++
+
+Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
+This software and associated documentation (if any) is furnished
+under a license and may only be used or copied in accordance
+with the terms of the license. Except as permitted by such
+license, no part of this software or documentation may be
+reproduced, stored in a retrieval system, or transmitted in any
+form or by any means without the express written consent of
+Intel Corporation.
+
+
+Module Name:
+
+ TcpSock.c
+
+Abstract:
+
+ This file abstracts the common interfaces required to
+ communicate within TCP Sockets
+
+
+--*/
+
+#include "Tiano.h"
+#include EFI_PROTOCOL_DEFINITION (TcpSock)
+
+EFI_GUID gEfiTcpSockProtocolGuid = EFI_TCP_SOCK_PROTOCOL_GUID;
+
+EFI_GUID_STRING(&gEfiTcpSockProtocolGuid, "TCP Sock Protocol", "TCP Sock Protocol");
diff --git a/Protocol/TcpSock/TcpSock.h b/Protocol/TcpSock/TcpSock.h
new file mode 100644
index 0000000..9db3c20
--- /dev/null
+++ b/Protocol/TcpSock/TcpSock.h
@@ -0,0 +1,97 @@
+//
+// This file contains 'Framework Code' and is licensed as such
+// under the terms of your license agreement with Intel or your
+// vendor. This file may not be modified, except as allowed by
+// additional terms of your license agreement.
+//
+/*++
+
+Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved
+This software and associated documentation (if any) is furnished
+under a license and may only be used or copied in accordance
+with the terms of the license. Except as permitted by such
+license, no part of this software or documentation may be
+reproduced, stored in a retrieval system, or transmitted in any
+form or by any means without the express written consent of
+Intel Corporation.
+
+
+Module Name:
+
+ TcpSock.h
+
+Abstract:
+
+ This code abstracts TCP Socket Protocol
+
+--*/
+
+#ifndef _EFI_TCP_SOCK_PROTOCOL_
+#define _EFI_TCP_SOCK_PROTOCOL_
+
+#include "Tiano.h"
+#include EFI_PROTOCOL_DEFINITION (Tcp)
+
+#define EFI_TCP_SOCK_PROTOCOL_GUID \
+ { \
+ 0x5187359b, 0x790d, 0x425b, 0xa5, 0x93, 0xca, 0x1c, 0xdb, 0x3c, 0xeb, 0xad \
+ }
+
+EFI_FORWARD_DECLARATION (EFI_TCP_SOCK_PROTOCOL);
+
+typedef
+VOID
+(EFIAPI *FIN_CALLBACK_FUNCTION) ();
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP_SOCKET_WRITE_DATA) (
+ IN EFI_TCP_SOCK_PROTOCOL * This,
+ IN UINT8 SocketId,
+ IN UINT8 *Data,
+ IN UINTN Size,
+ IN BOOLEAN Blocked
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP_SOCKET_READ_DATA) (
+ IN EFI_TCP_SOCK_PROTOCOL * This,
+ IN UINT8 SocketId,
+ IN OUT UINT8 *Data,
+ IN OUT UINTN *Size,
+ IN BOOLEAN Blocked
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP_DISCONNECT_SOCKET) (
+ IN EFI_TCP_SOCK_PROTOCOL * This,
+ UINT8 SocketId,
+ BOOLEAN Forced
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *EFI_TCP_CONNECT_SOCKET) (
+ IN EFI_TCP_SOCK_PROTOCOL * This,
+ IN EFI_IP_ADDRESS * DestIp,
+ IN UINT16 SrcPort,
+ IN UINT16 DestPort,
+ IN FIN_CALLBACK_FUNCTION FinCallback,
+ OUT UINT8 *SocketId
+ );
+
+//
+// TCP SOCK PROTOCOL
+//
+typedef struct _EFI_TCP_SOCK_PROTOCOL {
+ EFI_TCP_CONNECT_SOCKET ConnectSocket;
+ EFI_TCP_DISCONNECT_SOCKET DisconnectSocket;
+ EFI_TCP_SOCKET_READ_DATA ReadSocketData;
+ EFI_TCP_SOCKET_WRITE_DATA WriteSocketData;
+} EFI_TCP_SOCK_PROTOCOL;
+
+extern EFI_GUID gEfiTcpSockProtocolGuid;
+
+#endif