weAut_01 / weAutSys    R 2.2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines
Data Structures | Defines | Typedefs | Functions | Variables
include/uip/uip.h File Reference

Overview

Common definitions for the uIP TCP/IP stack.

Author:
Adam Dunkels adam@.nosp@m.dunk.nosp@m.els.c.nosp@m.om

The uIP TCP/IP stack header file contains definitions for a number of C macros that are used by uIP programs as well as internal uIP structures, TCP/IP header structures and function declarations.

Data Structures

struct  uip_eth_addr
 Representation of a 48-bit Ethernet address / MAC address. More...
struct  uip_icmpip_hdr
 The ICMP and IP headers. More...
struct  uip_tcpip_hdr
 The TCP and IP headers. More...
struct  uip_udpip_hdr
 The UDP and IP headers. More...
struct  uipConn_t
 Representation of a uIP TCP connection. More...

Defines

#define HTONS(n)
 Convert 16-bit quantity from host byte order to network byte order.
#define uip_abort()
 Abort the current connection.
#define uip_aborted()
 Has the connection been aborted by the other end.
#define uip_acked()
 Has previously sent data been acknowledged?
#define UIP_APPDATA_SIZE
 The buffer size available for user data in the buffer uip_buf.
#define uip_close()
 Close the current connection.
#define uip_closed()
 Has the connection been closed by the other end?
#define UIP_CLOSED
 state value in uip_conn->tcpstateflags
#define UIP_CLOSING
 state value in uip_conn->tcpstateflags
#define uip_conn_active(conn)
 Check if a connection identified by its number is active.
#define uip_connected()
 Has the connection just been connected?
#define UIP_DATA
 flag to uip_process(): incoming data in uip_buf
#define uip_datalen()
 The length of any incoming data that is currently available (if available) in the uip_appdata buffer.
#define UIP_ESTABLISHED
 state value in uip_conn->tcpstateflags
#define UIP_FIN_WAIT_1
 state value in uip_conn->tcpstateflags
#define UIP_FIN_WAIT_2
 state value in uip_conn->tcpstateflags
#define uip_getdraddr(addr)
 Get the default router's IP address.
#define uip_gethostaddr(addr)
 Get the IP address of this host.
#define uip_getnetmask(addr)
 Get the netmask.
#define uip_initialmss()
 Get the initial maximum segment size (MSS) of the current connection.
#define uip_input()
 Process an incoming packet.
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
 Construct an IPv6 address from eight 16-bit words.
#define uip_ipaddr(addr, addr0, addr1, addr2, addr3)
 Construct an IP address from four bytes.
#define uip_ipaddr1(addr)
 Pick the first octet of an IP address.
#define uip_ipaddr2(addr)
 Pick the second octet of an IP address.
#define uip_ipaddr3(addr)
 Pick the third octet of an IP address.
#define uip_ipaddr4(addr)
 Pick the fourth octet of an IP address.
#define uip_ipaddr_cmp(addr1, addr2)
 Compare two IP addresses.
#define uip_ipaddr_copy(dest, src)
 Copy an IP address to another IP address.
#define uip_ipaddr_mask(dest, src, mask)
 Mask out the network part of an IP address.
#define uip_ipaddr_maskcmp(addr1, addr2, mask)
 Compare two IP addresses with netmasks.
#define UIP_LAST_ACK
 state value in uip_conn->tcpstateflags
#define uip_mss()
 Current maximum segment size that can be sent on the current connection.
#define uip_newdata()
 Is new incoming data available?
#define uip_periodic(conn)
 Periodic processing for a connection identified by its number.
#define uip_periodic_conn(conn)
 Perform periodic processing for a connection identified by pointer.
#define uip_poll()
 Is the connection being polled by uIP?
#define uip_poll_conn(conn)
 Request that a particular connection should be polled.
#define UIP_POLL_REQUEST
 flag to uip_process(): poll a connection
#define uip_restart()
 Restart the current connection, if is has previously been stopped with uip_stop()
#define uip_rexmit()
 Do we need to retransmit previously data?
#define uip_setdraddr(addr)
 Set the default router's IP address.
#define uip_sethostaddr(addr)
 Set the IP address of this host.
#define uip_setnetmask(addr)
 Set the netmask.
#define uip_stop()
 Tell the sending host to stop sending data.
#define uip_stopped(conn)
 Find out if the current connection has been previously stopped with uip_stop()
#define UIP_STOPPED
 extra state bit in uip_conn->tcpstateflags
#define UIP_SYN_RCVD
 state value in uip_conn->tcpstateflags
#define UIP_SYN_SENT
 state value in uip_conn->tcpstateflags
#define UIP_TIME_WAIT
 state value in uip_conn->tcpstateflags
#define uip_timedout()
 Has the connection timed out?
#define UIP_TIMER
 flag to uip_process(): periodic timer has fired
#define UIP_TS_MASK
 mask for state values in uip_conn->tcpstateflags
#define uip_udp_bind(conn, port)
 Bind a UDP connection to a local port.
#define uip_udp_remove(conn)
 Remove / give up an UDP connection.
#define uip_udp_send(len)
 Send a UDP datagram of length len on the current connection.
#define UIP_UDP_SEND_CONN
 flag to uip_process(): construct UDP datagram in uip_buf
#define uip_udpconnection()
 Is the current connection a UDP connection?

Typedefs

typedef uint16_t uip_ip4addr_t [2]
 Representation of an IP V4 address.
typedef uint16_t uip_ip6addr_t [8]
 Representation of an IP (V6) address.
typedef uip_ip4addr_t uip_ipaddr_t
 IP address is of type IP V4.

Functions

uint16_t chksum (uint16_t sum, const uint8_t *data, uint16_t len)
 Calculate the Internet checksum over a buffer.
uint16_t uip_chksum (uint16_t *buf, uint16_t len)
 Calculate the Internet checksum over a buffer.
struct uipConn_tuip_connect (uip_ipaddr_t *ripaddr, uint16_t port)
 Connect to a remote host using TCP.
void uip_init (void)
 uIP initialisation function
uint16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf.
void uip_listen (uint16_t port)
 Start listening on the specified port.
void uip_process (uint8_t flag)
 The actual uIP function which does all the work.
void uip_send (const void *data, int len)
 Send data on the current connection.
void uip_setipid (uint16_t id)
 uIP initialisation function
uint16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
struct uip_udp_conn * uip_udp_new (uip_ipaddr_t *ripaddr, uint16_t rport)
 Set up a new UDP connection.
uint16_t uip_udpchksum (void)
 Calculate the UDP checksum of the packet in uip_buf and uip_appdata.
void uip_unlisten (uint16_t port)
 Stop listening on the specified port.
void uipSecTick (void)
 One second tick for the uiP stack.

Variables

struct uip_eth_addr actMACadd
 The (actual) MAC address.
void * uip_appdata
 Pointer to the application data in the packet buffer.
uint8_t uip_buf []
 The uIP packet buffer.
char * uip_buf_alias
 alias to uip_buf
struct uipConn_tuip_conn
 Pointer to the current TCP connection.
struct uipConn_t uip_conns []
 The array containing all uIP connections.
uint16_t uip_len
 The length of the packet in the uip_buf buffer.