tcpvars.c

来自「mcf5307实验源代码」· C语言 代码 · 共 396 行 · 第 1/2 页

C
396
字号
/****************************************************************************/
/*                                                                          */
/*       CopyrIght (c)  1993 - 1996 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 inplicitly     */
/* accepts the terms of the license.                                        */
/*                                                                          */
/****************************************************************************/
/****************************************************************************/
/* FILE NAME                                        VERSION                 */
/*                                                                          */
/*      TCPVARS.C                                      3.2                  */
/*                                                                          */
/* COMPONENT                                                                */
/*                                                                          */
/*                                                                          */
/*                                                                          */
/* DESCRIPTION                                                              */
/*                                                                          */
/* This file will hold all the global variables used int the current TCP/IP */
/* source call for interfacing with the packets and data.                   */
/*                                                                          */
/* AUTHOR                                                                   */
/*                                                                          */
/* Craig L. Meredith                                                        */
/*                                                                          */
/* DATA STRUCTURES                                                          */
/*                                                                          */
/*                                                                          */
/* FUNCTIONS                                                                */
/*                                                                          */
/* None.                                                                    */
/*                                                                          */
/* DEPENDENCIES                                                             */
/*                                                                          */
/* None.                                                                    */
/*                                                                          */
/* HISTORY                                                                  */
/*                                                                          */
/*     NAME             DATE        REMARKS                                 */
/*  Craig L. Meredith  02/03/94    Inital version.                          */
/*                                                                          */
/****************************************************************************/

#ifdef PLUS
#include "nucleus.h"
#else   /* !PLUS */
#include "nu_defs.h"    /* added during ATI mods - 10/20/92, bgh */
#include "nu_extr.h"
#endif  /* !PLUS */
#include "sockdefs.h"     /* socket definitions */
#include "hostform.h"
#include "target.h"
#include "protocol.h"
#include "confile.h"
#include "ip.h"

/***************************************************************************/
/*                                                                         */
/*                               uchar                                     */
/*                                                                         */
/*      Various global data variables used for maintaining TCP/IP stack    */
/*      information.                                                       */
/*                                                                         */
/*                                                                         */
/***************************************************************************/

/*  my ethernet hardware address.  Initialized by NU_Get_Address */
uchar   nnmyaddr[DADDLEN];

/*  the hardware broadcast address */
const uchar   broadaddr[DADDLEN] = {0xff,0xff,0xff,0xff,0xff,0xff};

/*  my ip number.   Initialized in netsetip. */
uchar   nnipnum[4];

/*  address for icmp redirect.  Initialized in icmpinterpret */
uchar   nnicmpsave[4];

/*  new gateway from icmp redirect.  Initialized in icmpinterpret */
uchar   nnicmpnew[4];

/*  The default subnet mask.  Initialized in netsetmask. */
uchar   nnmask[4] =  {255,255,255,0};

/* class A mask */
const uchar   nnamask[4] = {255,0,0,0};

/* class B mask */
const uchar   nnbmask[4] = {255,255,0,0};

/* class C mask */
const uchar   nncmask[4] = {255,255,255,0};

/* broadcast IP address */
const uchar   broadip[4] = {0xff,0xff,0xff,0xff};

/* NULL IP address.  */
const uchar   nullip[4]  = {0, 0, 0, 0};

/* which parms we have or have not.  Initialized in Smadd */
uchar   Sflags [NUMSPECS-95];

/****************************************************************************/
/*                                                                          */
/*                           schar                                          */
/*                                                                          */
/****************************************************************************/

/**** NONE OF THEST YET ****/

/****************************************************************************/
/*                                                                          */
/*                                 uint                                     */
/*                                                                          */
/****************************************************************************/

const uint IN_TCP_IP_Host = 0;          /* initial offset into machine def array */

/* A global counter of the number of buffers that are currently allocated.
 * Initialized in initbuffer. */
uint16 Buffers_Used;

/****************************************************************************/
/*                                                                          */
/*                               sint                                       */
/*                                                                          */
/*      Various global data variables used for maintaining TCP/IP stack     */
/*      information.                                                        */
/*                                                                          */
/*                                                                          */
/****************************************************************************/

/* A global counter of the number of tasks waiting for buffers to be freed
 * so that data can be sent via TCP.  Initialized in tcpinit. */
int16 tasks_waiting_to_send;

/*  ident field of outgoing ip packets. Initialized in ipinit */
int16 nnipident;

/* limited window in some cases */
const uint16 nncredit = CREDIT;

/* maximum segment size  (intswapped) */
const int16  nnsegsize = MAX_SEGMENT_LEN;

sint mno = 0;
sint SQwait = 0;
sint OKpackets = 0;

#ifdef INTERRUPT
    /* vector number used for interrupt handler.  Initialized in etherinit. */
    int16 NU_Vect_Number = -1;
#endif  /* INTERRUPT */

/****************************************************************************/
/*                                                                          */
/*                                 ulint                                    */
/*                                                                          */
/****************************************************************************/

/**** NO OF THESE YET ****/

/****************************************************************************/
/*                                                                          */
/*                                 slint                                    */
/*                                                                          */
/****************************************************************************/

/**** NO OF THESE YET ****/

/****************************************************************************/
/*                                                                          */
/*                                 void                                     */
/*                                                                          */
/****************************************************************************/

#ifdef PLUS
#ifdef INTERRUPT
    /* used to hold the old vector routine used before we loaded the Ethernet
     * handler interrupt routine
     */
    void (*NU_old_vect_routine)(INT);
#endif    /* INTERRUPT */
#else   /* RTX */
    /* used to hold the old vector address from the DOS call */
    int16 *NU_old_vect_RTX;
#endif  /* RTX */

/****************************************************************************/
/*                                                                          */
/*                          MISCELLANEOUS                                   */
/*                                                                          */
/*      Various global data variables used for maintaining TCP/IP stack     */
/*      information.                                                        */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?