📄 uipopt.h
字号:
typedef unsigned char u8_t;
typedef unsigned short u16_t;
typedef unsigned short uip_stats_t;
#define UIP_FIXEDADDR 1
#define UIP_PINGADDRCONF 0
#define UIP_IPADDR0 192U /**< The first octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_IPADDR1 168U /**< The second octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_IPADDR2 0U /**< The third octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_IPADDR3 8U /**< The fourth octet of the IP address of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_TESTIPADDR0 192U
#define UIP_TESTIPADDR1 168U
#define UIP_TESTIPADDR2 0U
#define UIP_TESTIPADDR3 7U
#define UIP_NETMASK0 255 /**< The first octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_NETMASK1 255 /**< The second octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_NETMASK2 255 /**< The third octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_NETMASK3 0 /**< The fourth octet of the netmask of
this uIP node, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR0 192 /**< The first octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR1 168 /**< The second octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR2 0 /**< The third octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_DRIPADDR3 1 /**< The fourth octet of the IP address of
the default router, if UIP_FIXEDADDR is
1. \hideinitializer */
#define UIP_FIXEDETHADDR 1
#define UIP_ETHADDR0 0x00 /**< The first octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR1 0x02 /**< The second octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR2 0x04 /**< The third octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR3 0x08 /**< The fourth octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR4 0x0A /**< The fifth octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_ETHADDR5 0x0D /**< The sixth octet of the Ethernet
address if UIP_FIXEDETHADDR is
1. \hideinitializer */
#define UIP_TTL 255
#define UIP_REASSEMBLY 1
#define UIP_REASS_MAXAGE 40
#define UIP_UDP 1
#define UIP_UDP_CHECKSUMS 0
#define UIP_UDP_CONNS 2
#define UIP_UDP_APPCALL udp_appcall
#define UIP_ACTIVE_OPEN 1
#define UIP_CONNS 25
#define UIP_LISTENPORTS 10
#define UIP_RECEIVE_WINDOW 32768
#define UIP_URGDATA 1
#define UIP_RTO 3
#define UIP_MAXRTX 8
#define UIP_MAXSYNRTX 3
#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - 40)
/**
* How long a connection should stay in the TIME_WAIT state.
*
* This configiration option has no real implication, and it should be
* left untouched.
*/
#define UIP_TIME_WAIT_TIMEOUT 120
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptarp ARP configuration options
* @{
*/
/**
* The size of the ARP table.
*
* This option should be set to a larger value if this uIP node will
* have many connections from the local network.
*
* \hideinitializer
*/
#define UIP_ARPTAB_SIZE 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
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptgeneral General configuration options
* @{
*/
/**
* The size of the uIP packet buffer.
*
* The uIP packet buffer should not be smaller than 60 bytes, and does
* not need to be larger than 1500 bytes. Lower size results in lower
* TCP throughput, larger size results in higher TCP throughput.
*
* \hideinitializer
*/
#define UIP_BUFSIZE 1500
/**
* Determines if statistics support should be compiled in.
*
* The statistics is useful for debugging and to show the user.
*
* \hideinitializer
*/
#define UIP_STATISTICS 1
/**
* Determines if logging of certain events should be compiled in.
*
* This is useful mostly for debugging. The function uip_log()
* must be implemented to suit the architecture of the project, if
* logging is turned on.
*
* \hideinitializer
*/
#define UIP_LOGGING 0
/**
* Print out a uIP log message.
*
* This function must be implemented by the module that uses uIP, and
* is called by uIP whenever a log message is generated.
*/
void uip_log(char *msg);
/**
* 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.
*
* \hideinitializer
*/
#define UIP_LLH_LEN 14
/** @} */
/*------------------------------------------------------------------------------*/
/**
* \defgroup uipoptcpu CPU architecture configuration
* @{
*
* The CPU architecture configuration is where the endianess of the
* CPU on which uIP is to be run is specified. Most CPUs today are
* little endian, and the most notable exception are the Motorolas
* which are big endian. The BYTE_ORDER macro should be changed to
* reflect the CPU architecture on which uIP is to be run.
*/
#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 LITTLE_ENDIAN
#endif /* BYTE_ORDER */
#ifndef HTONS
# if BYTE_ORDER == BIG_ENDIAN
# define HTONS(n) (n)
# else /* BYTE_ORDER == BIG_ENDIAN */
# define HTONS(n) ((((u16_t)((n) & 0xff)) << 8) | (((n) & 0xff00) >> 8))
# endif /* BYTE_ORDER == BIG_ENDIAN */
#endif /* HTONS */
#ifndef htons
u16_t htons(u16_t val);
#endif /* htons */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -