From dab714aa1171a7916df00486f077dc8e923d8ab1 Mon Sep 17 00:00:00 2001 From: niry Date: Fri, 16 Jan 2009 06:56:18 +0000 Subject: 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 --- .../Universal/Network/Tcp4Dxe/ComponentName.c | 1 + MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c | 1 + MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.h | 1 + .../Universal/Network/Tcp4Dxe/SockInterface.c | 1 + MdeModulePkg/Universal/Network/Tcp4Dxe/Socket.h | 181 ++++++++++++++++++++- .../Universal/Network/Tcp4Dxe/Tcp4Dispatcher.c | 1 + .../Universal/Network/Tcp4Dxe/Tcp4Driver.c | 1 + .../Universal/Network/Tcp4Dxe/Tcp4Driver.h | 1 + MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Func.h | 1 + MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Main.h | 2 + .../Universal/Network/Tcp4Dxe/Tcp4Option.h | 1 + MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Proto.h | 17 +- 12 files changed, 201 insertions(+), 8 deletions(-) (limited to 'MdeModulePkg/Universal/Network/Tcp4Dxe') 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
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
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
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
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
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 #include #include +#include #include #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
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
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
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
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
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
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
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 -- cgit v1.2.3