📄 protinit.c
字号:
/*************************************************************************
*
* CopyrIght (c) 1993 - 2001 Accelerated Technology, Inc.
*
* PROPRIETARY RIGHTS of Accelerated Technology are involved in the
* subject matter of this material. All manufacturing, reproduction,
* use, and sales rights pertaining to this subject matter are governed
* by the license agreement. The recipient of this software implicitly
* accepts the terms of the license.
*
*************************************************************************/
/* Portions of this program were written by: */
/*************************************************************************
*
* part of:
* TCP/UDP/ICMP/IP Network kernel for NCSA Telnet
* by Tim Krauskopf
*
* National Center for Supercomputing Applications
* 152 Computing Applications Building
* 605 E. Springfield Ave.
* Champaign, IL 61820
**************************************************************************
* 'protinit' initializes packets to make them ready for transmission.
* For many purposes, pre-initialized packets are created for use by the
* protocol routines, especially to save time creating packets for
* transmit.
*
*
* As this is a convenient place for it, this file contains many of the
* data declarations for packets which are mostly static (pre-allocated).
*************************************************************************/
/*************************************************************************
*
* FILENAME VERSION
*
* protinit.c 4.4
*
* COMPONENT
*
* IP Layer
*
* DESCRIPTION
*
* This file contains functions to initialize packets in preparation
* for transmission.
*
* DATA STRUCTURES
*
* None
*
* FUNCTIONS
*
* PROT_Protocol_Init
* PROT_TCP_Timer_Init
* PROT_UDP_Init
* PROT_TCP_Init
* PROT_IPRaw_Init
* PROT_Net_Init
*
* DEPENDENCIES
*
* nucleus.h
* target.h
* externs.h
* net_extr.h
* socketd.h
* ip.h
* netevent.h
* nerrs.h
* tcpdefs.h
* tcp.h
* dns.h
* udp.h
* ipraw.h
* dhcp.h
*
*************************************************************************/
#include "plus/nucleus.h"
#include "net/target.h"
#include "net/inc/externs.h"
#include "net/inc/net_extr.h"
#include "net/inc/socketd.h"
#include "net/inc/ip.h"
#include "net/inc/netevent.h"
#include "net/inc/nerrs.h"
#include "net/inc/tcpdefs.h"
#include "net/inc/tcp.h"
#include "net/inc/dns.h"
#include "net/inc/udp.h"
#include "net/inc/ipraw.h"
#include "net/inc/dhcp.h"
#if (INCLUDE_SNMP == NU_TRUE)
#include SNMP_GLUE
#endif
extern int TCP_Backoff[];
/* Local Prototypes */
static VOID PROT_TCP_Init (VOID);
static STATUS PROT_Protocol_Init(VOID);
static VOID PROT_TCP_Timer_Init (VOID);
#if (INCLUDE_UDP == NU_TRUE)
static VOID PROT_UDP_Init (VOID);
#endif
#if INCLUDE_IP_RAW
static VOID PROT_IPRaw_Init(VOID);
#endif
/* Import the global function pointer that lets NET pass
packets to SPAN. */
extern UINT32 (*span_process_packet) (UINT8 *, UINT32, UINT32);
/* Import PPPoE input function pointer for initialization. */
extern VOID (*ppe_process_packet)(UINT16);
#if (INCLUDE_TCP == NU_TRUE)
/* Import the TCP acktimeout variable so that TCP init can set it. */
extern UINT32 TCP_ACK_Timeout;
#endif
/*************************************************************************
*
* FUNCTION
*
* PROT_Tcp_Timer_Init
*
* DESCRIPTION
*
* Initialize the head and tail pointers of both the EQ_Event_List
* and the EQ_Event_Freelist to 0.
*
* INPUTS
*
* None
*
* OUTPUTS
*
* None
*
*************************************************************************/
static VOID PROT_TCP_Timer_Init(VOID)
{
/* Initialize the head and tail pointers to 0 */
EQ_Event_Freelist.flink = EQ_Event_Freelist.blink = NU_NULL;
EQ_Event_List.flink = EQ_Event_List.blink = NU_NULL;
} /* end PROT_Tcp_Timer_Init() */
/************************************************************************
*
* FUNCTION
*
* PROT_Protocol_Init
*
* DESCRIPTION
*
* Calls all the other packet initialization keep this order as some
* packet inits require lower layers already be initialized.
*
* INPUTS
*
* None
*
* OUTPUTS
*
* NU_SUCCESS
* NU_MEM_ALLOC
*
*************************************************************************/
static STATUS PROT_Protocol_Init(VOID)
{
INT i;
for (i = 0; i < NSOCKETS; i++)
SCK_Sockets[i] = NU_NULL;
/* Zero the SPAN function pointer. When, and if, SPAN is
initialized it will setup this pointer to the correct
function. */
span_process_packet = NU_NULL;
/* Zero the PPPoE input function pointer. This will be initialized
within the PPPoE library if it is included. */
ppe_process_packet = NU_NULL;
SR_SNMP_Initialize();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -