📄 target.h
字号:
#error UDP must be included in order to use BOOTP
#endif
/* By default IP reassembly is included in the Nucleus NET library. Change
this definition to a NU_FALSE to exclude IP reassembly. */
#define INCLUDE_IP_REASSEMBLY NU_TRUE
/* By default IP fragmentation is included in the Nucleus NET library. Change
this definition to a NU_FALSE to exclude IP fragmentation. */
#define INCLUDE_IP_FRAGMENT NU_TRUE
/* By default IP Multicasting is included in the Nucleus NET library. Change
this definition to a NU_FALSE to exclude IP Multicasting. */
#define INCLUDE_IP_MULTICASTING NU_TRUE
/* By default NAT is not included in the Nucleus NET library. Change this
definition to NU_TRUE to include NAT. */
#define INCLUDE_NAT NU_FALSE
/* Make sure that the above configuration is ok for protocols
that make use of UDP. */
/* Is it ok for SNMP? */
#if ((INCLUDE_UDP == NU_FALSE) && (INCLUDE_SNMP == NU_TRUE))
#error UDP must be included in order to use SNMP
#endif
/******************** End Protocol Configuration ****************************/
/******************* Nucleus NET Stack Tunning Section **********************
In this section can be found various timeouts and size limitations used
by the NET stack.
*/
/* 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. */
#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
#define MAXRTO ((UINT32)(240 * SCK_Ticks_Per_Second)) /* Maximum retransmit timeout.*/
#define MINRTO ((UINT32)(SCK_Ticks_Per_Second >> 2)) /* Min. retransmit timeout. */
#define ARPTO ((UINT32)(1 * SCK_Ticks_Per_Second)) /* ARP retransmit timeout. */
#define CACHETO ((UINT32)(400 * SCK_Ticks_Per_Second)) /* ARP cache timeout. */
#define WAITTIME ((UINT32)(2 * SCK_Ticks_Per_Second)) /* Length of time to wait before
reusing a port. */
#define ARP_CACHE_LENGTH 10 /* Size of the ARP cache. */
#define CREDIT 4096
#if (INCLUDE_TCP == NU_TRUE)
#define TCP_MAX_PORTS 30 /* Maximum number of TCP ports. */
#else
#define TCP_MAX_PORTS 0
#endif
#if (INCLUDE_UDP == NU_TRUE)
#define UDP_MAX_PORTS 30 /* Maximum number of UDP ports. */
#else
#define UDP_MAX_PORTS 0
#endif
#if (INCLUDE_IP_RAW == NU_TRUE)
#define IPR_MAX_PORTS 30 /* Maximum number of RAW IP ports. */
#else
#define IPR_MAX_PORTS 0
#endif
/* Total number of socket descriptors. This should be
TCP_MAX_PORTS + UDP_MAX_PORTS + IPR_MAX_PORTS */
#define NSOCKETS (TCP_MAX_PORTS + UDP_MAX_PORTS + IPR_MAX_PORTS)
#define MAX_BUFFERS 200 /* The max number of internal NET */
/* buffers. These are used for TX */
/* and RX of data packets. */
#define MAX_RETRANSMITS 5 /* The max number of times to */
/* retransmit a packet before */
/* giving up. */
#define WINDOW_SIZE 16000 /* Size of buffers for TCP in/out */
/* windows. */
#define UMAX_DGRAMS 5 /* Maximum number UDP data grams */
/* that can be buffered for a */
/* single port. */
#define IMAX_DGRAMS 10 /* Maximum number RAW IP 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.net"
/* Nucleus NET relies on a couple of tasks to perform its duties. The priority
* of each is defiend below. */
#define EV_PRIORITY 3 /* The Events Dispather priority. */
#define TM_PRIORITY 3 /* 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. */
#define SWSOVERRIDE (TICKS_PER_SECOND >> 2) /* Delay of a 1/4 second */
/* PROBETIMEOUT is the delay before a window probe is sent. */
#define PROBETIMEOUT (TICKS_PER_SECOND << 1) /* 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 network mask is recommended.
*/
#define CFG_NETMASK 0x0L
/***************** End Nucleus NET Stack Tunning Section ********************/
/* These typedef's are not target specific, but it is useful to have them here. */
typedef struct _RTAB_Route RTAB_ROUTE;
typedef struct SCK_IP_ADDR_STRUCT SCK_IP_ADDR;
typedef struct _DV_DEVICE_ENTRY DV_DEVICE_ENTRY;
typedef struct _DEV_DEVICE DEV_DEVICE;
typedef struct _DV_REQ DV_REQ;
typedef struct _IP_MULTI IP_MULTI;
typedef struct _IP_MULTI_OPTIONS IP_MULTI_OPTIONS;
typedef struct sock_struct SOCKET;
typedef struct SCK_SOCKADDR_IP_STRUCT SCK_SOCKADDR_IP;
#define GET32(bufferP, offset) \
TLS_Get32((unsigned char *)bufferP, offset)
#define PUT32(bufferP, offset, value) \
TLS_Put32((unsigned char *)bufferP, offset, (value))
#define GET16(bufferP, offset) \
TLS_Get16((unsigned char *)bufferP, offset)
#define PUT16(bufferP, offset, value) \
TLS_Put16((unsigned char *)bufferP, offset, (value))
#define GET8(bufferP, offset) \
(((unsigned char *)(bufferP))[offset])
#define PUT8(bufferP, offset, value) \
(((unsigned char *)(bufferP))[offset]) = (value)
#define PUT_STRING(dest, offset, src, size) \
TLS_Put_String((unsigned char *)(dest), (offset), \
(unsigned char *)(src), (size))
#define GET_STRING(src, offset, dest, size) \
TLS_Get_String((unsigned char *)(src), (offset), \
(unsigned char *)(dest), (size))
#define EQ_STRING(packet, offset, local, size) \
TLS_Eq_String((unsigned char *)(packet), (offset), \
(unsigned char *)(local), (size))
/* Map the 'C' library macros used by Nucleus NET and other networking
protocol products to the actual functions supplied by Nucleus NET.
If needed, these mappings can be changed to use a different set
of functions, possible from a customer/tool supplied 'C' library.
*/
#define NU_STRICMP NCL_Stricmp
#define NU_ITOA NCL_Itoa
#define NU_ULTOA NCL_Ultoa
#define NU_ATOI NCL_Atoi
#define NU_ATOL NCL_Atol
#define NU_TOUPPER NCL_To_Upper
#define NU_BLOCK_COPY memcpy
/* This macro is used to remove warnings. */
#define UNUSED_PARAMETER(x) TLS_Unused_Parameter = ((UINT32)(x))
/* Define Supervisor and User mode functions */
#if (!defined(NU_SUPERV_USER_VARIABLES))
#define NU_IS_SUPERVISOR_MODE() (NU_TRUE)
#define NU_SUPERVISOR_MODE() ((void) 0)
#define NU_USER_MODE() ((void) 0)
#define NU_SUPERV_USER_VARIABLES /* Not a Supervisor/User kernel */
#endif /* NU_SUPERV_USER_MODE */
/* Redefine the VDRV_Lookup_Host to NU_Lookup_Host. This is specific to the
MNT/VNET prototyping environment. */
#define NU_Lookup_Host VDRV_Lookup_Host
#endif /* TARGET_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -