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

📄 target.h-bak

📁 mcf5307实验源代码
💻 H-BAK
字号:


/****************************************************************************/
/*                                                                          */
/*      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.                              */
/*                                                                          */
/* AUTHOR                                                                   */
/*                                                                          */
/*  Bill Haggerty                                                           */
/*                                                                          */
/* DATA STRUCTURES                                                          */
/*                                                                          */
/*  None.                                                                   */
/*                                                                          */
/* FUNCTIONS                                                                */
/*                                                                          */
/*  None.                                                                   */
/*                                                                          */
/* DEPENDENCIES                                                             */
/*                                                                          */
/*  None.                                                                   */
/*                                                                          */
/* HISTORY                                                                  */
/*                                                                          */
/*        NAME             DATE                     REMARKS                 */
/*                                                                          */
/*     B. Haggerty       09-16-1997             Created version 1.0         */
/*                                                                          */
/****************************************************************************/

#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 system dependent.
 */
#define SECONDS(x)   (x * 160)

/*
*  Setup the current limits and size type defs for the defined processor.
*  This will define constants for the sizes of integral types, with
*  minimums and maximum values allowed for the define.
*  Note: mins and maxs will be different for different processors.
*                               Size (Bytes)    Alignment (Bytes)
*/
/* size casting */
typedef char int8;              /*  1                   1   */
typedef unsigned char uint8;    /*  1                   1   */
typedef short int int16;        /*  2                   2   */
typedef unsigned short uint16;  /*  2                   2   */
typedef long int int32;         /*  4                   4   */
typedef unsigned long uint32;   /*  4                   4   */

/* 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 SWAPPING*/

#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. */
// modified by Ason. (1998.4.29.)
#define 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     160     /* approximate adjustment for use of 10ms tick */
#define WRAPTIME        86400    /*  Clock wraparound time in seconds. */

// modified by Ason. (1998.5.25.)
#define POKEINTERVAL    (3000 * TIME_ADJUST)
//#define POKEINTERVAL    (3 * TIME_ADJUST)
// modified by Ason. (1998.5.28. original 100 and 20)
#define MAXRTO           (5 * TIME_ADJUST)
#define MINRTO            (5 * TIME_ADJUST)
#define MINDOMTO           (4 * TIME_ADJUST)
#define MAXDOMTO          (20 * TIME_ADJUST)
// modified by Ason. (1998.5.28. original 20)
#define ARPTO             (2 * TIME_ADJUST)
#define CACHETO         (7000 * TIME_ADJUST)
#define TICKSPERSEC        (1 * TIME_ADJUST)
#define SMINRTO            (5 * TIME_ADJUST)
// modified by Ason. (1998.5.29. original 35, now wait for 10 tick=100ms)
#define WAITTIME           (20 * TIME_ADJUST)
#define LASTTIME        (4000 * TIME_ADJUST)
#define CACHELEN           10
#define MAXSEG           1024
#define CREDIT           4096

// modified by Ason. (1998.5.25. original 20)
//#define CONNWAITTIME      (20 * TIME_ADJUST)
#define CONNWAITTIME      (4 * TIME_ADJUST)

#define CACHELEN           10                   /* Size of the ARP cache. */
#define CREDIT           4096

//modified by Ason. (1998.5.27. original 50 and 30)
#define NPORTS          50              /* Maximum number of TCP ports. */
#define NUPORTS         30             /* Maximum number of UDP ports.  */
// modified by Ason.(1998.5.27. originally 20)

//#define MAXBUFFERS      100
#define MAXBUFFERS      100
// mordified by Ason (1998.7.29.)
		/* The max number of incoming packets
					 * that can be held in the queue. */
// modified by Ason. (1998.5.28. orignial 5)
#define MAX_RETRANSMITS 2               /* The max number of times to

// modified by Ason. (16000,1998.5.25.)                                         * retransmit a packet. */
#define WINDOWSIZE      4096           /* Size of buffers for TCP in/out */
#define UMAXDGRAMS      5              /* Maximum UDP data grams that
					   can be buffered for a single port */

/* This is the local host's name.  It can be a maximum of 32 charaters long. */
#define HOSTNAME   "ati"

/* Nucleus NET relies on a couple of tasks to perform its duties. The priority
 * of each is defiend below. */
#define EV_PRIORITY   42  /* The Events Dispather priority. */
#define TM_PRIORITY   42   /* The Timer Task priority. */

/* 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.  RFC 1122 recommends a delay of 0.1 to 1.0 seconds.  We
   default to a delay of a 1/4 second. */

// modified by Ason. (1998.5.6.)
#define SWSOVERRIDE       (TICKSPERSEC >> 8)  /* Delay of a 1/256 second */

/*  PROBETIMEOUT  is the delay before a window probe is sent.  */
#define  PROBETIMEOUT     (TICKSPERSEC * 2)    /*  Delay of 2 seconds. */

/* CFG_NETMASK is the mask used by the protocol stack to decide if a node is
 * on the local network.  If a value of 0 is used, then the protocol stack
 * chooses a mask based on the local host's IP address.  If any other value is
 * used, that value will become the network mask.  Allowing the protocol stack
 * to choose the net work mask is recommended.
 */
#define CFG_NETMASK  0x0L

/* By default RARP is not included in the Nucleus NET build.  To include RARP
   change the 0 to a 1. See the Nucleus NET reference manual for more
   information on RARP.
*/
#define RARP_INCLUDED       0

/* By default DNS is included in the Nucleus NET build.  To exclude it change
   the 1 below to a 0.  See the Nucleus NET reference Manual for more
   information on DNS.
*/
#define DNS_INCLUDED        1

#define SNMP_INCLUDED       0
#define RMONV1_INCLUDED     0

#if (SNMP_INCLUDED == 0)
#define SNMP_sysDescr(string)
#define SNMP_sysObjectID(string)
#define SNMP_sysUpTime(value)
#define SNMP_sysUpTime_Inc
#define SNMP_sysContact(string)
#define SNMP_sysName(string)
#define SNMP_sysLocation(string)
#define SNMP_sysServices(value)
#define SNMP_ipInReceives_Inc
#define SNMP_ipInHdrErrors_Inc
#define SNMP_ipInAddrErrors_Inc
#define SNMP_ipForwDatagrams_Inc
#define SNMP_ipInUnknownProtos_Inc
#define SNMP_ipInDiscards_Inc
#define SNMP_ipInDelivers_Inc
#define SNMP_ipOutRequests_Inc
#define SNMP_ipOutDiscards_Inc
#define SNMP_ipOutNoRoutes_Inc
#define SNMP_ipReasmTimeout(value)
#define SNMP_ipReasmReqds_Inc
#define SNMP_ipReasmOKs_Inc
#define SNMP_ipReasmFails_Inc
#define SNMP_ipFragOKs_Inc
#define SNMP_ipFragFails_Inc
#define SNMP_ipFragCreates_Inc
#define SNMP_ipRoutingDiscards_Inc
#define SNMP_icmpInMsgs_Inc
#define SNMP_icmpInErrors_Inc
#define SNMP_icmpInDestUnreachs_Inc
#define SNMP_icmpInTimeExcds_Inc
#define SNMP_icmpInParmProbs_Inc
#define SNMP_icmpInSrcQuenchs_Inc
#define SNMP_icmpInRedirects_Inc
#define SNMP_icmpInEchos_Inc
#define SNMP_icmpInEchoReps_Inc
#define SNMP_icmpInTimeStamps_Inc
#define SNMP_icmpInTimeStampReps_Inc
#define SNMP_icmpInAddrMasks_Inc
#define SNMP_icmpInAddrMaskReps_Inc
#define SNMP_icmpOutMsgs_Inc
#define SNMP_icmpOutErrors_Inc
#define SNMP_icmpOutDestUnreachs_Inc
#define SNMP_icmpOutTimeExcds_Inc
#define SNMP_icmpOutParmProbs_Inc
#define SNMP_icmpOutSrcQuenchs_Inc

#define SNMP_icmpOutRedirects_Inc
#define SNMP_icmpOutEchos_Inc
#define SNMP_icmpOutEchoReps_Inc
#define SNMP_icmpOutTimestamps_Inc
#define SNMP_icmpOutTimestampReps_Inc
#define SNMP_icmpOutAddrMasks_Inc
#define SNMP_icmpOutAddrMaskReps_Inc
#define SNMP_tcpRtoAlgorithm(value)
#define SNMP_tcpRtoMin(value)
#define SNMP_tcpRtoMax(value)
#define SNMP_tcpMaxCon(value)
#define SNMP_tcpActiveOpens_Inc
#define SNMP_tcpPassiveOpens_Inc
#define SNMP_tcpAttemptFails_Inc
#define SNMP_tcpEstabResets_Inc
#define SNMP_tcpInSegs_Inc
#define SNMP_tcpOutSegs_Inc
#define SNMP_tcpRetransSegs_Inc
#define SNMP_tcpInErrs_Inc
#define SNMP_tcpOutRsts_Inc
#define SNMP_udpInDatagrams_Inc
#define SNMP_udpNoPorts_Inc
#define SNMP_udpInErrors_Inc
#define SNMP_udpoutDatagrams_Inc
#define SNMP_ifNumber(value)
#define SNMP_ifDescr(index, string)
#define SNMP_ifType(index, value)
#define SNMP_ifMtu(index, value)
#define SNMP_ifSpeed(index, value)
#define SNMP_ifPhysAddress(index, addr)
#define SNMP_ifAdminStatus(index, status)
#define SNMP_ifOperStatus(index, status)
#define SNMP_ifLastChange(index, time)
#define SNMP_ifInOctets(index, value)
#define SNMP_ifInUcastPkts_Inc(index)
#define SNMP_ifInNUcastPkts_Inc(index)
#define SNMP_ifInDiscards_Inc(index)
#define SNMP_ifInErrors_Inc(index)
#define SNMP_ifInUnknownProtos_Inc(index)
#define SNMP_ifOutOctets(index, value)
#define SNMP_ifOutUcastPkts_Inc(index)
#define SNMP_ifOutNUcastPkts_Inc(index)
#define SNMP_ifOutDiscards_Inc(index)
#define SNMP_ifOutErrors_Inc(index)
#define SNMP_ifOutQLen_Inc(index)
#define SNMP_ifSpecific(index, string)
#endif /* SNMP_INCLUDED */

#endif  /* TARGET_H */

⌨️ 快捷键说明

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