📄 uipopt.h
字号:
*/#ifndef UIP_CONF_MAX_CONNECTIONS#define UIP_CONNS 5/* 10 gateway*/#else /* UIP_CONF_MAX_CONNECTIONS */#define UIP_CONNS UIP_CONF_MAX_CONNECTIONS#endif /* UIP_CONF_MAX_CONNECTIONS *//** * The maximum number of simultaneously listening TCP ports. * * Each listening TCP port requires 2 bytes of memory. * * \hideinitializer */#ifndef UIP_CONF_MAX_LISTENPORTS#define UIP_LISTENPORTS 20#else /* UIP_CONF_MAX_LISTENPORTS */#define UIP_LISTENPORTS UIP_CONF_MAX_LISTENPORTS#endif /* UIP_CONF_MAX_LISTENPORTS *//** * Determines if support for TCP urgent data notification should be * compiled in. * * Urgent data (out-of-band data) is a rarely used TCP feature that * very seldom would be required. * * \hideinitializer */#define UIP_URGDATA 1/* 0 gateway *//** * The initial retransmission timeout counted in timer pulses. * * This should not be changed. */#define UIP_RTO 3/** * The maximum number of times a segment should be retransmitted * before the connection should be aborted. * * This should not be changed. */#define UIP_MAXRTX 8/** * The maximum number of times a SYN segment should be retransmitted * before a connection request should be deemed to have been * unsuccessful. * * This should not need to be changed. */#define UIP_MAXSYNRTX 5/** * The TCP maximum segment size. * * This is should not be to set to more than * UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN. */#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)/** * The size of the advertised receiver's window. * * Should be set low (i.e., to the size of the uip_buf buffer) is the * application is slow to process incoming data, or high (32768 bytes) * if the application processes data quickly. * * \hideinitializer */#ifndef UIP_CONF_RECEIVE_WINDOW#define UIP_RECEIVE_WINDOW UIP_TCP_MSS#else#define UIP_RECEIVE_WINDOW UIP_CONF_RECEIVE_WINDOW#endif/** * 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/** @} *//*------------------------------------------------------------------------------*//** * \name 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 */#ifdef UIP_CONF_ARPTAB_SIZE#define UIP_ARPTAB_SIZE UIP_CONF_ARPTAB_SIZE#else#define UIP_ARPTAB_SIZE 8#endif/** * 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/** @} *//*------------------------------------------------------------------------------*//** * \name 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 */#ifndef UIP_CONF_BUFFER_SIZE#define UIP_BUFSIZE 400#else /* UIP_CONF_BUFFER_SIZE */#define UIP_BUFSIZE UIP_CONF_BUFFER_SIZE#endif /* UIP_CONF_BUFFER_SIZE *//** * Determines if statistics support should be compiled in. * * The statistics is useful for debugging and to show the user. * * \hideinitializer */#ifndef UIP_CONF_STATISTICS#define UIP_STATISTICS 0#else /* UIP_CONF_STATISTICS */#define UIP_STATISTICS UIP_CONF_STATISTICS#endif /* UIP_CONF_STATISTICS *//** * 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 */#ifndef UIP_CONF_LOGGING#define UIP_LOGGING 0#else /* UIP_CONF_LOGGING */#define UIP_LOGGING UIP_CONF_LOGGING#endif /* UIP_CONF_LOGGING *//** * Broadcast support. * * This flag configures IP broadcast support. This is useful only * together with UDP. * * \hideinitializer * */#ifndef UIP_CONF_BROADCAST#define UIP_BROADCAST 0#else /* UIP_CONF_BROADCAST */#define UIP_BROADCAST UIP_CONF_BROADCAST#endif /* UIP_CONF_BROADCAST *//** * 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 */#ifdef UIP_CONF_LLH_LEN#define UIP_LLH_LEN UIP_CONF_LLH_LEN#else /* UIP_CONF_LLH_LEN */#define UIP_LLH_LEN 14#endif /* UIP_CONF_LLH_LEN *//** @} *//*------------------------------------------------------------------------------*//** * \name 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. *//** * The byte order of the CPU architecture on which uIP is to be run. * * This option can be either BIG_ENDIAN (Motorola byte order) or * LITTLE_ENDIAN (Intel byte order). * * \hideinitializer */#ifdef UIP_CONF_BYTE_ORDER#define UIP_BYTE_ORDER UIP_CONF_BYTE_ORDER#else /* UIP_CONF_BYTE_ORDER */#define UIP_BYTE_ORDER UIP_LITTLE_ENDIAN#endif /* UIP_CONF_BYTE_ORDER *//** @} *//*------------------------------------------------------------------------------*//** * \name Appication specific configurations * @{ * * An uIP application is implemented using a single application * function that is called by uIP whenever a TCP/IP event occurs. The * name of this function must be registered with uIP at compile time * using the UIP_APPCALL definition. * * uIP applications can store the application state within the * uip_conn structure by specifying the type of the application * structure by typedef:ing the type uip_tcp_appstate_t and uip_udp_appstate_t. * * The file containing the definitions must be included in the * uipopt.h file. * * The following example illustrates how this can look. \codevoid httpd_appcall(void);#define UIP_APPCALL httpd_appcallstruct httpd_state { u8_t state; u16_t count; char *dataptr; char *script;};typedef struct httpd_state uip_tcp_appstate_t \endcode */typedef struct httpd_state uip_tcp_appstate_t; /*gateway*//** * \var #define UIP_APPCALL * * The name of the application function that uIP should call in * response to TCP/IP events. * *//** * \var typedef uip_tcp_appstate_t * * The type of the application state that is to be stored in the * uip_conn structure. This usually is typedef:ed to a struct holding * application state information. *//** * \var typedef uip_udp_appstate_t * * The type of the application state that is to be stored in the * uip_conn structure. This usually is typedef:ed to a struct holding * application state information. *//** @} *//** @} */#endif /* __UIPOPT_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -