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

📄 uipopt.h

📁 串口服务器KEIL C51原代码,单片机采用STC89C58RD+,网络控制器采用RTL8019,经过三层交换机测试,可以直接应用在产品,串口波特率576
💻 H
字号:

#ifndef __UIPOPT_H__
#define __UIPOPT_H__

/* This file is used for tweaking various configuration options for
   uIP. You should make a copy of this file into one of your project's
   directories instead of editing this example "uipopt.h" file that
   comes with the uIP distribution. */

/*-----------------------------------------------------------------------------------*/
/* First, two typedefs that may have to be tweaked for your particular
   compiler. The uX_t types are unsigned integer types, where the X is
   the number of bits in the integer type. Most compilers use
   "unsigned char" and "unsigned short" for those two,
   respectively. */
typedef unsigned char u8_t;
typedef unsigned int u16_t;

typedef unsigned char UBYTE;
typedef unsigned int UWORD;
typedef unsigned long UDWORD;

/*-----------------------------------------------------------------------------------*/
/* The configuration options for a specific node. This includes IP
 * address, netmask and default router as well as the Ethernet
 * address. The netmask, default router and Ethernet address are
 * appliciable only if uIP should be run over Ethernet.
 *
 * All of these should be changed to suit your project.
*/
/*
// UIP_IPADDR: The IP address of this uIP node. 
#define UIP_IPADDR0     10//192
#define UIP_IPADDR1     0//168
#define UIP_IPADDR2     0
#define UIP_IPADDR3     2

// UIP_NETMASK: The netmask. 
#define UIP_NETMASK0    255
#define UIP_NETMASK1    255
#define UIP_NETMASK2    255
#define UIP_NETMASK3    0

// UIP_DRIPADDR: IP address of the default router. 
#define UIP_DRIPADDR0   10//192
#define UIP_DRIPADDR1   0//168
#define UIP_DRIPADDR2   0
#define UIP_DRIPADDR3   10//1

// UIP_ETHADDR: The Ethernet address. 
#define UIP_ETHADDR0    0x00 //'O'
#define UIP_ETHADDR1    0xe0 //'F'
#define UIP_ETHADDR2    0x4c //'F'
#define UIP_ETHADDR3    0x03 //'I'
#define UIP_ETHADDR4    0x1d //'C'
#define UIP_ETHADDR5    0x8e //'E'
*/
//------------parameters-----------------
// UIP_IPADDR: The IP address of this uIP node. 
extern UBYTE data UIP_IPADDR0 ;
extern UBYTE data UIP_IPADDR1 ;
extern UBYTE data UIP_IPADDR2 ;
extern UBYTE data UIP_IPADDR3 ;

// UIP_NETMASK: The netmask. 
extern UBYTE data UIP_NETMASK0 ;
extern UBYTE data UIP_NETMASK1 ;
extern UBYTE data UIP_NETMASK2 ;
extern UBYTE data UIP_NETMASK3 ;

// UIP_DRIPADDR: IP address of the default router. 
extern UBYTE data UIP_DRIPADDR0 ;
extern UBYTE data UIP_DRIPADDR1 ;
extern UBYTE data UIP_DRIPADDR2 ;
extern UBYTE data UIP_DRIPADDR3 ;

// UIP_ETHADDR: The Ethernet address. 
extern UBYTE data UIP_ETHADDR0  ; //'O'
extern UBYTE data UIP_ETHADDR1  ; //'F'
extern UBYTE data UIP_ETHADDR2  ; //'F'
extern UBYTE data UIP_ETHADDR3  ; //'I'
extern UBYTE data UIP_ETHADDR4  ; //'C'
extern UBYTE data UIP_ETHADDR5  ; //'E'

extern UWORD idata APPport;

//#if UIP_ACTIVE_OPEN
extern UWORD data REMOTE_IP[2];
extern UWORD data REMOTE_PORT;
//#endif

extern UBYTE data BaudRate;
//-------------------------------------


/*-----------------------------------------------------------------------------------*/
/* The following options are used to configure application specific
 * setting such as how many TCP ports that should be avaliable and if
 * the uIP should be configured to support active opens.
 *
 * These should probably be tweaked to suite your project.
 */

/* Include the header file for the application program that should be
   used. If you don't use the example web server, you should change
   this. */
#include "myapp\myapp.h"   //LEON.Z.

/* UIP_ACTIVE_OPEN: Determines if support for opening connections from
   uIP should be compiled in. If this isn't needed for your
   application, don't turn it on. (A web server doesn't need this, for
   instance.) */
#define UIP_ACTIVE_OPEN  0

/* UIP_CONNS: The maximum number of simultaneously active
   connections. */
#define UIP_CONNS       1//10

/* UIP_LISTENPORTS: The maximum number of simultaneously listening TCP
   ports. For a web server, 1 is enough here. */
#define UIP_LISTENPORTS 1//10

/* UIP_BUFSIZE: The size of the buffer that holds incoming and
   outgoing packets. */
#define UIP_BUFSIZE     200//160//1800//180 (54 + app data length)

/* UIP_STATISTICS: Determines if statistics support should be compiled
   in. The statistics is useful for debugging and to show the user. */
#define UIP_STATISTICS  1//0

/* UIP_LOGGING: Determines if logging of certain events should be
   compiled in. Useful mostly for debugging. The function uip_log(char
   *msg) must be implemented to suit your architecture if logging is
   turned on. */
#define UIP_LOGGING     0

/* UIP_LLH_LEN: The link level header length; this is the offset into
   the uip_buf where the IP header can be found. For Ethernet, this
   should be set to 14. For SLIP, this should be set to 0. */
#define UIP_LLH_LEN     14

/*-----------------------------------------------------------------------------------*/
/* The following configuration options can be tweaked for your
 * project, but you are probably safe to use the default values. The
 * options are listed in order of tweakability.
 */

/* UIP_ARPTAB_SIZE: The size of the ARP table - use a larger value if
   this uIP node will have many connections from the local network. */
#define UIP_ARPTAB_SIZE 2//8

/* The maxium age of ARP table entries measured in 10ths of
   seconds. An UIP_ARP_MAXAGE of 120 corresponds to 20 minutes (BSD
   default). */
#define UIP_ARP_MAXAGE 120

/* UIP_RTO: The retransmission timeout counted in timer pulses (i.e.,
   the speed of the periodic timer, usually one second). */
#define UIP_RTO         3

/* UIP_MAXRTX: The maximum number of times a segment should be
   retransmitted before the connection should be aborted. */
#define UIP_MAXRTX      2//8

/* UIP_TCP_MSS: The TCP maximum segment size. This should be set to
   at most UIP_BUFSIZE - UIP_LLH_LEN - 40. */
#define UIP_TCP_MSS     (UIP_BUFSIZE - UIP_LLH_LEN - 40)

/* UIP_TTL: The IP TTL (time to live) of IP packets sent by uIP. */
#define UIP_TTL         255

/* UIP_TIME_WAIT_TIMEOUT: How long a connection should stay in the
   TIME_WAIT state. Has no real implication, so it should be left
   untouched. */
#define UIP_TIME_WAIT_TIMEOUT 120
/*-----------------------------------------------------------------------------------*/
/* This is where you configure if your CPU architecture is big or
 * little endian. Most CPUs today are little endian. The most notable
 * exception are the Motorolas which are big endian. Tweak the
 * definition of the BYTE_ORDER macro to configure uIP for your
 * project.
 */
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN  3412
#endif /* LITTLE_ENDIAN */
#ifndef BIG_ENDIAN
#define BIG_ENDIAN     1234
#endif /* BIGE_ENDIAN */

#ifndef BYTE_ORDER
#define BYTE_ORDER     BIG_ENDIAN//LITTLE_ENDIAN  for keil;
#endif /* BYTE_ORDER */

#endif /* __UIPOPT_H__ */

⌨️ 快捷键说明

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