# Configuration options for uIP

## Files
file | uipopt.h
file | uip-conf.h
## Defines
#define | UIP_LITTLE_ENDIAN 3412
#define | UIP_BIG_ENDIAN 1234

## Detailed Description

uIP is configured using the per-project configuration file uipopt.h. This file contains all compile-time options for uIP and should be tweaked to match each specific project. The uIP distribution contains a documented example "uipopt.h" that can be copied and modified for each project.

Note:
  Most of the configuration options in the uipopt.h should not be changed, but rather the per-project uip-conf.h file.

## Define Documentation

#define UIP_ACTIVE_OPEN

Determines if support for opening connections from uIP should be compiled in.

If the applications that are running on top of uIP for this project do not need to open outgoing TCP connections, this configration option can be turned off to reduce the code size of uIP.

define UIP_APPCALL hello_world_appcall

The name of the application function that uIP should call in response to TCP/IP events.

#define UIP_ARP_MAXAGE 120

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_ARPTAB_SIZE

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.

#define UIP_BIG_ENDIAN 1234

#define UIP_BROADCAST

Broadcast support.

This flag configures IP broadcast support. This is useful only together with UDP.

#define UIP_BUFSIZE

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.

#define UIP_BYTE_ORDER

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).

#define UIP_CONF_BUFFER_SIZE

uIP buffer size.

#define UIP_CONF_BYTE_ORDER

CPU byte order.

#define UIP_CONF_LOGGING

Logging on or off

#define UIP_CONF_MAX_CONNECTIONS

Maximum number of TCP connections.

#define UIP_CONF_MAX_LISTENPORTS

Maximum number of listening TCP ports.

#define UIP_CONF_STATISTICS

uIP statistics on or off

#define UIP_CONF_UDP

UDP support on or off

#define UIP_CONF_UDP_CHECKSUMS

UDP checksums on or off

#define UIP_CONNS

The maximum number of simultaneously open TCP connections.

Since the TCP connections are statically allocated, turning this configuration knob down results in less RAM used. Each TCP connection requires approximatly 30 bytes of memory.

#define UIP_FIXEDADDR

Determines if uIP should use a fixed IP address or not.

If uIP should use a fixed IP address, the settings are set in the uipopt.h file. If not, the macros uip_sethostaddr(), uip_setdraddr() and uip_setnetmask() should be used instead.

#define UIP_FIXEDETHADDR

Specifies if the uIP ARP module should be compiled with a fixed Ethernet MAC address or not.

If this configuration option is 0, the macro uip_setethaddr() can be used to specify the Ethernet address at run-time.

#define UIP_LISTENPORTS

The maximum number of simultaneously listening TCP ports.

Each listening TCP port requires 2 bytes of memory.

#define UIP_LITTLE_ENDIAN 3412

#define 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_LOGGING

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.

#define UIP_MAXRTX 8

The maximum number of times a segment should be retransmitted before the connection should be aborted.

This should not be changed.

#define UIP_MAXSYNRTX 5

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_PINGADDRCONF

Ping IP address asignment.

uIP uses a "ping" packets for setting its own IP address if this option is set. If so, uIP will start with an empty IP address and the destination IP address of the first incoming "ping" (ICMP echo) packet will be used for setting the hosts IP address.

Note:
  This works only if UIP_FIXEDADDR is 0.

#define UIP_REASS_MAXAGE 40

The maximum time an IP fragment should wait in the reassembly buffer before it is dropped.

#define UIP_REASSEMBLY

Turn on support for IP packet reassembly.

uIP supports reassembly of fragmented IP packets. This features requires an additonal amount of RAM to hold the reassembly buffer and the reassembly code size is approximately 700 bytes. The reassembly buffer is of the same size as the uip_buf buffer (configured by UIP_BUFSIZE).

Note:
  IP packet reassembly is not heavily tested.

#define UIP_RECEIVE_WINDOW

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.

#define UIP_RTO 3

The initial retransmission timeout counted in timer pulses.

This should not be changed.

#define UIP_STATISTICS

Determines if statistics support should be compiled in.

The statistics is useful for debugging and to show the user.

#define UIP_TCP_MSS (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)

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_TIME_WAIT_TIMEOUT 120

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_TTL 64

The IP TTL (time to live) of IP packets sent by uIP.

This should normally not be changed.

#define UIP_UDP

Toggles wether UDP support should be compiled in or not.

#define UIP_UDP_CHECKSUMS

Toggles if UDP checksums should be used or not.

Note:
  Support for UDP checksums is currently not included in uIP, so this option has no function.

#define UIP_UDP_CONNS

The maximum amount of concurrent UDP connections.

#define UIP_URGDATA

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.

## Typedef Documentation

typedef uint16_t u16_t

16 bit datatype

This typedef defines the 16-bit type used throughout uIP.

typedef uint8_t u8_t

8 bit datatype

This typedef defines the 8-bit type used throughout uIP.

typedef unsigned short uip_stats_t

Statistics datatype

This typedef defines the dataype used for keeping statistics in uIP.

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.

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.

## Function Documentation

void uip_log | ( | char * | msg | ) |

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.

Here is the call graph for this function: