Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

# The uIP TCP/IP stack

## Files
file | uip.c
| The uIP TCP/IP stack code.

file | uip.h
| Header file for the uIP TCP/IP stack.

## Modules
uIP configuration functions
uIP initialization functions
uIP device driver functions
uIP application functions
uIP conversion functions
uIP Address Resolution Protocol
Serial Line IP (SLIP) protocol
uIP hostname resolver functions
Architecture specific uIP functions
## Data Structures
struct | uip_conn
| Representation of a uIP TCP connection. More...
struct | uip_stats
| The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1. More...
struct | uip_udp_conn
| Representation of a uIP UDP connection. More...
## Functions
void | uip_init (void)
| uIP initialization function.
uip_udp_conn * | uip_udp_new (u16_t *ripaddr, u16_t rport)
| Set up a new UDP connection.
void | uip_unlisten (u16_t port)
| Stop listening to the specified port.
void | uip_listen (u16_t port)
| Start listening to the specified port.
u16_t | htons (u16_t val)
| Convert 16-bit quantity from host byte order to network byte order.
## Variables
volatile u8_t * | uip_appdata
| Pointer to the application data in the packet buffer.
uip_stats | uip_stat
| The uIP TCP/IP statistics.
u8_t | uip_buf [UIP_BUFSIZE+2]
| The uIP packet buffer.
volatile u8_t | uip_acc32 [4]
| 4-byte array used for the 32-bit sequence number calculations.

## Function Documentation

u16_t htons | ( | u16_t | val | ) |

| Convert 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 HTONS() macro instead.

void uip_init | ( | void |  | ) |

| uIP initialization function. This function should be called at boot up to initilize the uIP TCP/IP stack.

void uip_listen | ( | u16_t | port | ) |

| Start listening to the specified port. Note: Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.
     uip_listen(HTONS(80));
  Parameters:
  port | A 16-bit port number in network byte order.

struct uip_udp_conn* uip_udp_new | ( | u16_t * | ripaddr,
|  | u16_t | rport
| ) |

  | Set up a new UDP connection. Parameters:
  ripaddr | A pointer to a 4-byte structure representing the IP address of the remote host.
  rport | The remote port number in network byte order.
Returns: The uip_udp_conn structure for the new connection or NULL if no connection could be allocated.

void uip_unlisten | ( | u16_t | port | ) |

| Stop listening to the specified port. Note: Since this function expects the port number in network byte order, a conversion using HTONS() or htons() is necessary.
     uip_unlisten(HTONS(80));
  Parameters:
  port | A 16-bit port number in network byte order.

## Variable Documentation

volatile u8_t* 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().

u8_t uip_buf[UIP_BUFSIZE+2]

  | The uIP packet buffer. The uip_buf array is used to hold incoming and outgoing packets. The device driver should place incoming data into this buffer. When sending data, the device driver should read the link level headers and the TCP/IP headers from this buffer. The size of the link level headers is configured by the UIP_LLH_LEN define. Note: The application data need not be placed in this buffer, so the device driver must read it from the place pointed to by the uip_appdata pointer as illustrated by the following example:
       void
       devicedriver_send(void)
       {
          hwsend(&uip_buf[0], UIP_LLH_LEN);
          hwsend(&uip_buf[UIP_LLH_LEN], 40);
          hwsend(uip_appdata, uip_len - 40 - UIP_LLH_LEN);
       }

struct uip_stats uip_stat

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