📄 target.h
字号:
/***************************************************************************
*
* Copyright (c) 1993 - 2002 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
*
* TARGET.H
*
* DESCRIPTION
*
* This file will hold all of those defines and setups used by the
* TCP/IP code which are processor/configuration dependent.
*
* DATA STRUCTURES
*
* None.
*
* FUNCTIONS
*
* None.
*
* DEPENDENCIES
*
* None.
*
****************************************************************************/
#ifndef TARGET_H
#define TARGET_H
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "net/inc/ncl.h"
#include "plus/nucleus.h"
#include "net/inc/isnmp.h"
/* These definitions control which version of NET the build should be
compatible with. This should allow new versions of NET to be shipped but
remain compatible with applications or drivers designed for previous
versions. */
#define NET_4_0 1 /* NET 4.0 */
#define NET_4_2 2 /* NET 4.2 */
#define NET_4_3 3 /* NET 4.3 */
#define NET_4_4 4 /* NET 4.4 */
#define NET_VERSION_COMP NET_4_4 /* The version for which compatibilty
is desired. */
/********************* Nucleus NET Porting Section **************************/
/* This is the number of Nucleus PLUS timer ticks that occur per second. */
#ifndef NU_PLUS_Ticks_Per_Second
#define TICKS_PER_SECOND ((UINT32)18)
#else
#define TICKS_PER_SECOND ((UINT32)NU_PLUS_Ticks_Per_Second)
#endif
/*
* 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)
*/
#ifndef PLUS_VERSION_COMP
typedef char INT8; /* 1 1 */
typedef unsigned char UINT8; /* 1 1 */
typedef signed short INT16; /* 2 2 */
typedef unsigned short UINT16; /* 2 2 */
//typedef signed long INT32; /* 4 4 */
//typedef unsigned long UINT32; /* 4 4 */
#endif /* PLUS_VERSION_COMP */
/* These macroes are used for the versions of Nucleus NET that run in real-mode
on the PC. For all architectures other than rel-mode PC these should be
defined to be nothing.
*/
#undef FAR
#undef HUGE
#define FAR
#define HUGE
/* The following definitions specify which routines have been implemented
* in assembly language. A C implementation of each can be found in the
* file TOOLS.C. An assembly implementation of tcpcheck may especially
* increase performance. A NU_TRUE indicates an assembly implementation exists.
*/
#define IPCHECK_ASM NU_FALSE
#define TCPCHECK_ASM NU_FALSE
#define LONGSWAP_ASM NU_FALSE
#define INTSWAP_ASM NU_FALSE
#define COMPAREN_ASM NU_FALSE
/* Define the two macros that point to the NET swapping routines. These
routines are endian proof. Meaning that no matter what the endianness
of the target hardware is they will return data in the correct
byte order. Since no swapping is required on big endian platforms
these macros could be defined as nothing for a performance improvement.
ex: #define LONGSWAP
This will replace the LONGSWAPs in the code with nothing, thus using
the value of the variable.
*/
#define LONGSWAP TLS_Longswap
#define INTSWAP TLS_Intswap
/* This macro specifies the required byte alignment for Nucleus NET packet
buffers. Generally this value is dictated by the DMA requirements. For
Example the DMA may only work to/from addresses on 8 byte boundaries. A
value less than 4 should not be specified. */
#define REQ_ALIGNMENT 16
/********************* End Nucleus NET Porting Section **********************/
/************************ Protocol Configuration ****************************
The following macros control which network protocols will be included
in the build of the Nucleus NET stack. Keep in mind that some protocols
make use of other protocols, therefore it is not always possible to
remove certain protocols from the build. One example would be UDP. UDP is
used by DHCP and some other protocols, so if you want to remove UDP you
must also remove all the protocols that use UDP. You can look at the
#error macros below to see which protocols are dependant on other
protocols.
*/
/* Should support for UDP be included. */
#define INCLUDE_UDP NU_TRUE
/* Should support for TCP be included. */
#define INCLUDE_TCP NU_TRUE
/* Should support for RAW IP be included. */
#define INCLUDE_IP_RAW NU_FALSE
/* Should the loopback device be included and initialized in the
build of NET. This is NU_TRUE by default. */
#define INCLUDE_LOOPBACK_DEVICE NU_TRUE
/* This macro controls whether the code to forward IP packets will be included
in the library.
*/
#define INCLUDE_IP_FORWARDING NU_TRUE
/* By default RARP is not included in the Nucleus NET build. To include RARP
change the NU_FALSE to a NU_TRUE. See the Nucleus NET reference manual
for more information on RARP.
*/
#define INCLUDE_RARP NU_FALSE
/* By default DNS is included in the Nucleus NET build. To exclude it change
the NU_TRUE below to a NU_FALSE. See the Nucleus NET reference Manual
for more information on DNS.
*/
#define INCLUDE_DNS NU_TRUE
/* Is this possible? */
#if ((INCLUDE_UDP == NU_FALSE) && (INCLUDE_DNS == NU_TRUE))
#error UDP must be included in order to use DNS
#endif
/* By default DHCP client is included in the Nucleus NET build. To exclude
it change the NU_TRUE below to a NU_FALSE. DHCP validate callback and
vendor options callback can be enabled in a like manner. See the
Nucleus NET reference Manual for more information on DHCP.
*/
#define INCLUDE_DHCP NU_TRUE
#define DHCP_VALIDATE_CALLBACK NU_FALSE
/* Is it ok for DHCP? */
#if ((INCLUDE_UDP == NU_FALSE) && (INCLUDE_DHCP == NU_TRUE))
#error UDP must be included in order to use DHCP
#endif
/* By default BOOTP client is not included in the Nucleus Net Build. To include
it change the NU_FALSE below to a NU_TRUE. See the Nucleus Net
reference Manual for more information on BOOTP.
*/
#define INCLUDE_BOOTP NU_FALSE
/* Is this possible? */
#if ((INCLUDE_UDP == NU_FALSE) && (INCLUDE_BOOTP == NU_TRUE))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -