⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 target.h

📁 nucleus 的以太网协议栈
💻 H
字号:
/****************************************************************************/
/*                                                                          */
/*      Copyright (c) 1993 by 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 implicity accepts the terms   */
/* of the license.                                                          */
/*                                                                          */
/****************************************************************************/
/****************************************************************************/
/*                                                                          */
/* FILENAME                                                 VERSION         */
/*                                                                          */
/*  target                                                     1.0          */
/*                                                                          */
/* DESCRIPTION                                                              */
/*                                                                          */
/*  This file will hold all of those defines and setups used by the         */
/*  TCP/IP code which are processor dependent.                              */
/*  This version is for the QUICC and SDS compiler                          */
/*                                                                          */
/* AUTHOR                                                                   */
/*                                                                          */
/*  Maiqi Qian                                                              */
/*                                                                          */
/* DATA STRUCTURES                                                          */
/*                                                                          */
/*  None.                                                                   */
/*                                                                          */
/* FUNCTIONS                                                                */
/*                                                                          */
/*  None.                                                                   */
/*                                                                          */
/* DEPENDENCIES                                                             */
/*                                                                          */
/*  None.                                                                   */
/*                                                                          */
/* HISTORY                                                                  */
/*                                                                          */
/*  NAME        DATE        REMARKS                                         */
/*                                                                          */
/*  Maiqi Qian  08/29/95    Inital version.                                 */
/*                                                                          */
/****************************************************************************/

#ifndef TARGET_H
#define TARGET_H

#include "config.h"

/*
 * This macro define is used to handle calculating the number of actual
 * clock ticks which are needed for a 1 second delay. This value is based
 * on the current setup in the IND.ASM file and is system dependent.
 */
#define SECONDS(x)   (x * 1000)

#include "datasize.h"

/* generic names for size types */
typedef char schar;             /*  1                   1   */
typedef unsigned char uchar;    /*  1                   1   */
typedef short int sshort;       /*  2                   2   */
typedef unsigned short ushort;  /*  2                   2   */
typedef unsigned int uint;      /*  2                   2   */
typedef int sint;               /*  2                   2   */
typedef long int slint;         /*  4                   4   */
typedef long int slong;         /*  4                   4   */
typedef unsigned long ulint;    /*  4                   4   */
typedef unsigned long ulong;    /*  4                   4   */

#if 0
/* typedefs used to handle the common conversion for size_t stuff */
typedef unsigned int size_t;
#endif

/* max/mins */
#define CHAR_BIT    8
#define SHORT_BIT   16
#define INT_BIT     16
#define LONG_BIT    32
#define FLOAT_BIT   32
#define DOUBLE_BIT  64
#define PTR_BIT     32
#define SCHAR_MIN   -128
#define SCHAR_MAX   +127
#define UCHAR_MIN   0
#define UCHAR_MAX   255
#define SSHORT_MIN  -32768
#define SSHORT_MAX  +32767
#define USHORT_MIN   0
#define USHORT_MAX   65535
#define SINT_MIN    SSHORT_MIN
#define SINT_MAX    SSHORT_MAX
#define UINT_MIN    USHORT_MIN
#define UINT_MAX    USHORT_MAX
#define SLONG_MIN   -2147483648
#define SLONG_MAX   +2147483647
#define ULONG_MIN   0
#define ULONG_MAX   4294967296

#define FLT_MIN     8.43E-37
#define FLT_MAX     3.37E+38
#define FLT_EXP_BIT 8
#define FLT_MAN_BIT 23
#define DUBL_MIN    2.225074E-308
#define DUBL_MAX    1.797693E+308
#define DUBL_EXP_BIT 11
#define DUBL_MAN_BIT 20

#define HUGE
#define FAR

/* The following definitions specify which routines have been implemented
 * in assembly language.  A C implementation of each can be found in the
 * file NEW_IP.C.  An assembly implementation of tcpcheck may especially
 * increase performance.  An one indicates an assembly implementation exists.
 */
#define IPCHECK_ASM     0
#define TCPCHECK_ASM    0
#define LONGSWAP_ASM    0
#define INTSWAP_ASM     0
#define COMPAREN_ASM    0

/* The PACKET definition controls how packets are sent.  If PACKET is defined
 * then each packet is transmited as soon as it is ready.  If PACKET is
 * undefined the packets are placed into a transmit queue when they are
 * ready. */
#undef PACKET

/* The PRINT_ERROR_MSG define controls whether a error message is printed to
 * the console when NU_Tcp_Log_Error is called.  The error is logged
 * regardless of PRINT_ERROR_MSG define.  However, an error message will only
 * be printed if PRINT_ERROR_MSG is defined.   */
#undef PRINT_ERROR_MSG
 
/*
*  timing information is machine dependent
*/
#ifndef REALTIME
#define get_time(A) n_clicks()
#endif  /* REALTIME */

/*
*  timeout for response to ARP packet for Ethernet
*/
/* was 15 */
#define DLAYTIMEOUT 4
/*
*  how often to poke a TCP connection to keep it alive and make
*  sure other side hasn't crashed. (poke) in 1/18ths sec
*  And, timeout interval
*/
#define TIME_ADJUST     230     /* approximate adjustment for use of 10ms tick */
#define WRAPTIME        86400L          /*  Clock wraparound time in seconds. */

#define POKEINTERVAL    (3000 * TIME_ADJUST)
#define MAXRTO           (100 * TIME_ADJUST)
#define MINRTO           (20 * TIME_ADJUST)
#define MINDOMTO           (4 * TIME_ADJUST)
#define MAXDOMTO          (20 * TIME_ADJUST)
#define ARPTO             (20 * TIME_ADJUST)
#define CACHETO         (7000 * TIME_ADJUST)
#define TICKSPERSEC       (18 * TIME_ADJUST)
#define SMINRTO            (5 * TIME_ADJUST)
#define WAITTIME          (35 * TIME_ADJUST)
#define LASTTIME        (4000 * TIME_ADJUST)
#define CACHELEN           10
#define MAXSEG           1024
#define CREDIT           4096

/* SWSOVERIDE is the amount of time to wait before overriding the Nagle
   algorithm.  The Nagle algorithm is aimed at preventing the transmission of
   lots of tiny packets.  However, we only want to delay a packet for a short
   period of time. */
#define SWSOVERRIDE       (TICKSPERSEC >> 2)  /* Delay of a 1/4 second */

#endif  /* TARGET_H */

⌨️ 快捷键说明

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