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

📄 uipopt.h

📁 运行环境是keil.这是一个实现嵌入式TCP_IP的程序,运行在万邦的w78e516上面,网卡芯片采用的是rtl8019
💻 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;

/*-----------------------------------------------------------------------------------*/
/* 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     172//10//192
#define UIP_IPADDR1     18//0//168
#define UIP_IPADDR2     205//0
#define UIP_IPADDR3     33//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   172//10//192
#define UIP_DRIPADDR1   18//0//168
#define UIP_DRIPADDR2   205//0
#define UIP_DRIPADDR3   1//10//1

/* UIP_ETHADDR: The Ethernet address. */
/*
#define UIP_ETHADDR0    0x00
#define UIP_ETHADDR1    0xbd
#define UIP_ETHADDR2    0x3b
#define UIP_ETHADDR3    0x33
#define UIP_ETHADDR4    0x05
#define UIP_ETHADDR5    0x71
*/
#define UIP_ETHADDR0    'O'
#define UIP_ETHADDR1    'F'
#define UIP_ETHADDR2    'F'
#define UIP_ETHADDR3    'I'
#define UIP_ETHADDR4    'C'
#define UIP_ETHADDR5    'E'


/*-----------------------------------------------------------------------------------*/
/* 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       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//1800//180

/* 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 1//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      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 + -