summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/Tcp4Dxe
diff options
context:
space:
mode:
authorniry <niry@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-16 06:56:18 +0000
committerniry <niry@6f19259b-4bc3-4df7-8a09-765794883524>2009-01-16 06:56:18 +0000
commitdab714aa1171a7916df00486f077dc8e923d8ab1 (patch)
treea187ecf53a5ba50e9ce6f0c09a101c8824be7030 /MdeModulePkg/Universal/Network/Tcp4Dxe
parentbd59b46eb41585a8977f30067c111b30278bf391 (diff)
downloadedk2-platforms-dab714aa1171a7916df00486f077dc8e923d8ab1.tar.xz
Insert comments for functions/macros and add the file headers.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7293 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Tcp4Dxe')
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h181
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h2
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h1
-rw-r--r--MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h17
12 files changed, 201 insertions, 8 deletions
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
index 85afc525e8..a458fd3711 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/ComponentName.c
@@ -1,4 +1,5 @@
/** @file
+ UEFI Component Name(2) protocol implementation for Tcp4Dxe driver.
Copyright (c) 2005 - 2007, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
index b8a8258bed..243cb681ac 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
@@ -1,4 +1,5 @@
/** @file
+ Implementation of the Socket.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
index 840f6b1693..004f1cbec4 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h
@@ -1,4 +1,5 @@
/** @file
+ Socket implementation header file.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
index f7b0e99c39..17227424a1 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
@@ -1,4 +1,5 @@
/** @file
+ Interface function of the Socket.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
index 0992a2c15b..6f66857415 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h
@@ -1,4 +1,5 @@
/** @file
+ Socket header file.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
@@ -24,6 +25,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/DebugLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
+#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiLib.h>
#define SOCK_SND_BUF 0
@@ -81,55 +83,224 @@ typedef enum {
SO_NO_MAPPING
} SOCK_CONFIGURE_STATE;
+/**
+ Set socket SO_NO_MORE_DATA flag.
+
+ @param Sock Pointer to the socket
+
+**/
#define SOCK_NO_MORE_DATA(Sock) ((Sock)->Flag |= SO_NO_MORE_DATA)
+/**
+ Check whether the socket is unconfigured.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is unconfigued
+ @retval False The socket is not unconfigued
+
+**/
#define SOCK_IS_UNCONFIGURED(Sock) ((Sock)->ConfigureState == SO_UNCONFIGURED)
+/**
+ Check whether the socket is configured.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is configued
+ @retval False The socket is not configued
+
+**/
#define SOCK_IS_CONFIGURED(Sock) \
(((Sock)->ConfigureState == SO_CONFIGURED_ACTIVE) || \
((Sock)->ConfigureState == SO_CONFIGURED_PASSIVE))
+/**
+ Check whether the socket is configured to active mode.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is configued to active mode
+ @retval False The socket is not configued to active mode
+
+**/
#define SOCK_IS_CONFIGURED_ACTIVE(Sock) \
((Sock)->ConfigureState == SO_CONFIGURED_ACTIVE)
+/**
+ Check whether the socket is configured to passive mode.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is configued to passive mode
+ @retval False The socket is not configued to passive mode
+
+**/
#define SOCK_IS_CONNECTED_PASSIVE(Sock) \
((Sock)->ConfigureState == SO_CONFIGURED_PASSIVE)
+/**
+ Check whether the socket is mapped.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is no mapping
+ @retval False The socket is mapped
+
+**/
#define SOCK_IS_NO_MAPPING(Sock) \
((Sock)->ConfigureState == SO_NO_MAPPING)
+/**
+ Check whether the socket is closed.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is closed
+ @retval False The socket is not closed
+
+**/
#define SOCK_IS_CLOSED(Sock) ((Sock)->State == SO_CLOSED)
+/**
+ Check whether the socket is listening.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is listening
+ @retval False The socket is not listening
+
+**/
#define SOCK_IS_LISTENING(Sock) ((Sock)->State == SO_LISTENING)
+/**
+ Check whether the socket is connecting.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is connecting
+ @retval False The socket is not connecting
+
+**/
#define SOCK_IS_CONNECTING(Sock) ((Sock)->State == SO_CONNECTING)
+/**
+ Check whether the socket has connected.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket has connected
+ @retval False The socket has not connected
+
+**/
#define SOCK_IS_CONNECTED(Sock) ((Sock)->State == SO_CONNECTED)
+/**
+ Check whether the socket is disconnecting.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is disconnecting
+ @retval False The socket is not disconnecting
+
+**/
#define SOCK_IS_DISCONNECTING(Sock) ((Sock)->State == SO_DISCONNECTING)
+/**
+ Check whether the socket is no more data.
+
+ @param Sock Pointer to the socket
+
+ @retval True The socket is no more data
+ @retval False The socket still has data
+
+**/
#define SOCK_IS_NO_MORE_DATA(Sock) (0 != ((Sock)->Flag & SO_NO_MORE_DATA))
-#define SOCK_SIGNATURE SIGNATURE_32 ('S', 'O', 'C', 'K')
-
-#define SOCK_FROM_THIS(a) CR ((a), SOCKET, NetProtocol, SOCK_SIGNATURE)
+/**
+ Set the size of the receive buffer.
+
+ @param Sock Pointer to the socket
+ @param Size The size to set
+**/
#define SET_RCV_BUFFSIZE(Sock, Size) ((Sock)->RcvBuffer.HighWater = (Size))
+/**
+ Get the size of the receive buffer.
+
+ @param Sock Pointer to the socket
+
+ @return The receive buffer size
+
+**/
#define GET_RCV_BUFFSIZE(Sock) ((Sock)->RcvBuffer.HighWater)
+/**
+ Get the size of the receive data.
+
+ @param Sock Pointer to the socket
+
+ @return The received data size
+
+**/
#define GET_RCV_DATASIZE(Sock) (((Sock)->RcvBuffer.DataQueue)->BufSize)
+/**
+ Set the size of the send buffer.
+
+ @param Sock Pointer to the socket
+ @param Size The size to set
+
+**/
#define SET_SND_BUFFSIZE(Sock, Size) ((Sock)->SndBuffer.HighWater = (Size))
+/**
+ Get the size of the send buffer.
+
+ @param Sock Pointer to the socket
+
+ @return The send buffer size
+
+**/
#define GET_SND_BUFFSIZE(Sock) ((Sock)->SndBuffer.HighWater)
+/**
+ Get the size of the send data.
+
+ @param Sock Pointer to the socket
+
+ @return The send data size
+
+**/
#define GET_SND_DATASIZE(Sock) (((Sock)->SndBuffer.DataQueue)->BufSize)
+/**
+ Set the backlog value of the socket.
+
+ @param Sock Pointer to the socket
+ @param Value The value to set
+
+**/
#define SET_BACKLOG(Sock, Value) ((Sock)->BackLog = (Value))
+/**
+ Get the backlog value of the socket.
+
+ @param Sock Pointer to the socket
+
+ @return The backlog value
+
+**/
#define GET_BACKLOG(Sock) ((Sock)->BackLog)
+/**
+ Set the socket with error state.
+
+ @param Sock Pointer to the socket
+ @param Error The error state
+
+**/
#define SOCK_ERROR(Sock, Error) ((Sock)->SockError = (Error))
#define SND_BUF_HDR_LEN(Sock) \
@@ -138,6 +309,10 @@ typedef enum {
#define RCV_BUF_HDR_LEN(Sock) \
((SockBufFirst (&((Sock)->RcvBuffer)))->TotalSize)
+#define SOCK_SIGNATURE SIGNATURE_32 ('S', 'O', 'C', 'K')
+
+#define SOCK_FROM_THIS(a) CR ((a), SOCKET, NetProtocol, SOCK_SIGNATURE)
+
#define SOCK_FROM_TOKEN(Token) (((SOCK_TOKEN *) (Token))->Sock)
#define PROTO_TOKEN_FORM_SOCK(SockToken, Type) \
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
index dbc82b51c1..e04e5eb038 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c
@@ -1,4 +1,5 @@
/** @file
+ Tcp request dispatcher implementation.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
index 94a1753b81..d4ea65d723 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.c
@@ -1,4 +1,5 @@
/** @file
+ Tcp driver function.
Copyright (c) 2005 - 2007, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
index 4aee9592a3..09388b5d83 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Driver.h
@@ -1,4 +1,5 @@
/** @file
+ Tcp driver function header.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
index ae2c666bf2..fc14b3b4a6 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h
@@ -1,4 +1,5 @@
/** @file
+ Tcp function header file.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h
index 3c2accf9eb..763789e410 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h
@@ -1,4 +1,5 @@
/** @file
+ TCP4 protocol services header file.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
@@ -17,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "Socket.h"
#include "Tcp4Proto.h"
+#include "Tcp4Func.h"
#include "Tcp4Driver.h"
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h
index 2caa1a4a05..243def839a 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Option.h
@@ -1,4 +1,5 @@
/** @file
+ Tcp option's routine header file.
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
index f1eaad5be1..56b68db904 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h
@@ -1,5 +1,6 @@
/** @file
-
+ Tcp Protocol header file.
+
Copyright (c) 2005 - 2006, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -311,18 +312,25 @@ extern UINT32 mTcpTick;
//
#define TCP_SUB_SEQ(Seq1, Seq2) ((UINT32) ((Seq1) - (Seq2)))
+//
+// Check whether Flag is on
+//
#define TCP_FLG_ON(Value, Flag) ((BOOLEAN) (((Value) & (Flag)) != 0))
+
+//
+// Set and Clear operation on a Flag
+//
#define TCP_SET_FLG(Value, Flag) ((Value) |= (Flag))
#define TCP_CLEAR_FLG(Value, Flag) ((Value) &= ~(Flag))
//
-// test whether two peers are equal
+// Test whether two peers are equal
//
#define TCP_PEER_EQUAL(Pa, Pb) \
(((Pa)->Ip == (Pb)->Ip) && ((Pa)->Port == (Pb)->Port))
//
-// test whether Pa matches Pb, or Pa is more specific
+// Test whether Pa matches Pb, or Pa is more specific
// than pb. Zero means wildcard.
//
#define TCP_PEER_MATCH(Pa, Pb) \
@@ -342,8 +350,7 @@ extern UINT32 mTcpTick;
typedef
VOID
(*TCP_TIMER_HANDLER) (
- IN TCP_CB *Tcb
+ IN OUT TCP_CB *Tcb
);
-#include "Tcp4Func.h"
#endif