EVE 1.0
Collaboration diagram for Uip stack:

Modules

 uIP hostname resolver functions
 
 Simplified UDP API
 
 Serial Line IP (SLIP) protocol
 
 The Contiki/uIP interface
 
 uIP packet forwarding
 
 uIP configuration functions
 
 uIP initialization functions
 
 uIP device driver functions
 
 uIP application functions
 
 uIP conversion functions
 
 Variables used in uIP device drivers
 
 Architecture specific uIP functions
 
 uIP Address Resolution Protocol
 
 Configuration options for uIP
 

Files

file  uip.c
 
file  uip.h
 

Data Structures

union  uip_ip4addr_t
 
struct  uip_802154_shortaddr
 16 bit 802.15.4 address More...
 
struct  uip_802154_longaddr
 64 bit 802.15.4 address More...
 
struct  uip_80211_addr
 802.11 address More...
 
struct  uip_eth_addr
 802.3 address More...
 
struct  uip_conn
 
struct  uip_udp_conn
 
struct  uip_stats
 

Macros

#define PRINTD(FORMAT, args...)   do {} while (0)
 
#define UIP_STAT(s)
 
#define UIP_APPDATA_SIZE
 

Typedefs

typedef union uip_ip4addr_t uip_ip4addr_t
 
typedef struct uip_802154_shortaddr uip_802154_shortaddr
 16 bit 802.15.4 address
 
typedef struct uip_802154_longaddr uip_802154_longaddr
 64 bit 802.15.4 address
 
typedef struct uip_80211_addr uip_80211_addr
 802.11 address
 
typedef struct uip_eth_addr uip_eth_addr
 802.3 address
 
typedef uip_eth_addr uip_lladdr_t
 Ethernet address.
 

Functions

void uip_setipid (uint16_t id)
 
void uip_add32 (uint8_t *op32, uint16_t op16)
 
uint16_t uip_chksum (uint16_t *data, uint16_t len)
 
uint16_t uip_ipchksum (void)
 
uint16_t uip_tcpchksum (void)
 
void uip_init (void)
 
void uip_unlisten (uint16_t port)
 
void uip_listen (uint16_t port)
 
void uip_process (uint8_t flag)
 process the options within a hop by hop or destination option header More...
 
uint16_t uip_htons (uint16_t val)
 
void uip_send (const void *data, int len)
 
uint16_t uip_udpchksum (void)
 
uint16_t uip_icmp6chksum (void)
 

Variables

void * uip_appdata
 
uint16_t uip_len
 
struct uip_connuip_conn
 
uint8_t uip_acc32 [4]
 
CCIF void * uip_appdata
 
CCIF struct uip_connuip_conn
 
struct uip_udp_connuip_udp_conn
 

Detailed Description

Macro Definition Documentation

#define PRINTD (   FORMAT,
  args... 
)    do {} while (0)

The macro provides debug print functionality

Definition at line 100 of file uip.c.

Referenced by uip_process(), and uip_send().

#define UIP_STAT (   s)

The uIP TCP/IP statistics.

This is the variable in which the uIP TCP/IP statistics are gathered.

Definition at line 1450 of file uip.h.

Referenced by uip_process().

#define UIP_APPDATA_SIZE

The buffer size available for user data in the uip_buf buffer.

This macro holds the available size for user data in the uip_buf buffer. The macro is intended to be used for checking bounds of available user data.

Example:

1 snprintf(uip_appdata, UIP_APPDATA_SIZE, "%u\n", i);

Definition at line 1897 of file uip.h.

Typedef Documentation

Representation of an IP address.

Function Documentation

void uip_setipid ( uint16_t  id)

uIP initialization function.

This function may be used at boot time to set the initial ip_id.

Definition at line 195 of file uip.c.

void uip_add32 ( uint8_t *  op32,
uint16_t  op16 
)

Carry out a 32-bit addition.

Because not all architectures for which uIP is intended has native 32-bit arithmetic, uIP uses an external C function for doing the required 32-bit additions in the TCP protocol processing. This function should add the two arguments and place the result in the global variable uip_acc32.

Note
The 32-bit integer pointed to by the op32 parameter and the result in the uip_acc32 variable are in network byte order (big endian).
Parameters
op32A pointer to a 4-byte array representing a 32-bit integer in network byte order (big endian).
op16A 16-bit integer in host byte order.

Definition at line 266 of file uip.c.

References data, and uip_acc32.

Referenced by uip_listen(), and uip_process().

uint16_t uip_chksum ( uint16_t *  buf,
uint16_t  len 
)

Calculate the Internet checksum over a buffer.

The Internet checksum is the one's complement of the one's complement sum of all 16-bit words in the buffer.

See RFC1071.

Parameters
bufA pointer to the buffer over which the checksum is to be computed.
lenThe length of the buffer over which the checksum is to be computed.
Returns
The Internet checksum of the buffer.

Definition at line 328 of file uip.c.

References uip_htons().

Referenced by uip_fw_init(), and uip_process().

uint16_t uip_ipchksum ( void  )

Calculate the IP header checksum of the packet header in uip_buf.

The IP header checksum is the Internet checksum of the 20 bytes of the IP header.

Returns
The IP header checksum of the IP header in the uip_buf buffer.

Definition at line 335 of file uip.c.

References uip_htons(), uip_icmp6chksum(), and UIP_LLH_LEN.

Referenced by uip_fw_init(), uip_listen(), and uip_process().

uint16_t uip_tcpchksum ( void  )

Calculate the TCP checksum of the packet in uip_buf and uip_appdata.

The TCP checksum is the Internet checksum of data contents of the TCP segment, and a pseudo-header as defined in RFC793.

Returns
The TCP checksum of the TCP segment in uip_buf and pointed to by uip_appdata.

Definition at line 381 of file uip.c.

References uip_udpchksum().

Referenced by uip_process().

void uip_unlisten ( uint16_t  port)

Stop listening to the specified port.

Note
Since this function expects the port number in network byte order, a conversion using UIP_HTONS() or uip_htons() is necessary.
1 uip_unlisten(UIP_HTONS(80));
Parameters
portA 16-bit port number in network byte order.

Definition at line 542 of file uip.c.

References UIP_LISTENPORTS.

Referenced by tcpip_output().

void uip_listen ( uint16_t  port)

Start listening to the specified port.

Note
Since this function expects the port number in network byte order, a conversion using UIP_HTONS() or uip_htons() is necessary.
1 uip_listen(UIP_HTONS(80));
Parameters
portA 16-bit port number in network byte order.

Definition at line 553 of file uip.c.

References uip_conn::rcv_nxt, uip_acc32, uip_add32(), uip_ipchksum(), UIP_LISTENPORTS, and UIP_REASS_MAXAGE.

Referenced by tcpip_output().

uint16_t uip_htons ( uint16_t  val)

Convert a 16-bit quantity from host byte order to network byte order.

This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the UIP_HTONS() macro instead.

Definition at line 2076 of file uip.c.

References UIP_HTONS.

Referenced by uip_chksum(), uip_init(), and uip_ipchksum().

void uip_send ( const void *  data,
int  len 
)

Send data on the current connection.

This function is used to send out a single segment of TCP data. Only applications that have been invoked by uIP for event processing can send data.

The amount of data that actually is sent out after a call to this function is determined by the maximum amount of data TCP allows. uIP will automatically crop the data so that only the appropriate amount of data is sent. The function uip_mss() can be used to query uIP for the amount of data that actually will be sent.

Note
This function does not guarantee that the sent data will arrive at the destination. If the data is lost in the network, the application will be invoked with the uip_rexmit() event being set. The application will then have to resend the data using this function.
Parameters
dataA pointer to the data which is to be sent.
lenThe maximum amount of data bytes to be sent.

Definition at line 2088 of file uip.c.

References uip_conn::len, uip_conn::mss, PRINTD, uip_conn::ripaddr, uip_udp_conn::ripaddr, UIP_BUFSIZE, UIP_LLH_LEN, and uip_conn::window.

uint16_t uip_udpchksum ( void  )

Calculate the UDP checksum of the packet in uip_buf and uip_appdata.

The UDP checksum is the Internet checksum of data contents of the UDP segment, and a pseudo-header as defined in RFC768.

Returns
The UDP checksum of the UDP segment in uip_buf and pointed to by uip_appdata.

Referenced by uip_process(), and uip_tcpchksum().

uint16_t uip_icmp6chksum ( void  )

Calculate the ICMP checksum of the packet in uip_buf.

Returns
The ICMP checksum of the ICMP packet in uip_buf

Referenced by uip_ipchksum(), and uip_process().

Variable Documentation

void* uip_appdata

Pointer to the application data in the packet buffer.

This pointer points to the application data when the application is called. If the application wishes to send data, the application may use this space to write the data into before calling uip_send().

Definition at line 154 of file uip.c.

Referenced by simple_udp_deregister(), slipdev_send(), uip_arp_out(), uip_fw_forward(), and uip_process().

uint16_t uip_len

The length of the packet in the uip_buf buffer.

The global variable uip_len holds the length of the packet in the uip_buf buffer.

When the network device driver calls the uIP input function, uip_len should be set to the length of the packet in the uip_buf buffer.

When sending packets, the device driver should use the contents of the uip_len variable to determine the length of the outgoing packet.

Definition at line 166 of file uip.c.

Referenced by slipdev_send(), tcpip_input(), tcpip_output(), uip_arp_arpin(), uip_arp_out(), uip_arp_timer(), uip_fw_forward(), uip_fw_init(), uip_fw_output(), and uip_process().

struct uip_conn* uip_conn

Pointer to the current TCP connection.

The uip_conn pointer can be used to access the current TCP connection.

Definition at line 174 of file uip.c.

Referenced by uip_process().

uint8_t uip_acc32[4]

4-byte array used for the 32-bit sequence number calculations.

Definition at line 206 of file uip.c.

Referenced by uip_add32(), uip_listen(), and uip_process().

CCIF void* uip_appdata

Pointer to the application data in the packet buffer.

This pointer points to the application data when the application is called. If the application wishes to send data, the application may use this space to write the data into before calling uip_send().

Definition at line 154 of file uip.c.

Referenced by simple_udp_deregister(), slipdev_send(), uip_arp_out(), uip_fw_forward(), and uip_process().

CCIF struct uip_conn* uip_conn

Pointer to the current TCP connection.

The uip_conn pointer can be used to access the current TCP connection.

Definition at line 174 of file uip.c.

Referenced by uip_process().

The current UDP connection.

Referenced by uip_process().