Contiki-NG
Data Structures | Macros | Typedefs | Functions | Variables

Header file for the uIP TCP/IP stack. More...

#include "net/ipv6/uipopt.h"
#include "net/ipv6/uipbuf.h"
#include "net/linkaddr.h"
#include <string.h>
#include "net/ipv6/tcpip.h"

Go to the source code of this file.

Data Structures

union  uip_ip4addr_t
 Representation of an IP address. More...
 
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...
 
union  uip_buf_t
 The uIP packet buffer. More...
 
struct  uip_conn
 Representation of a uIP TCP connection. More...
 
struct  uip_udp_conn
 Representation of a uIP UDP 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_eth_hdr
 The Ethernet header. More...
 

Macros

#define UIP_IP_BUF   ((struct uip_ip_hdr *)uip_buf)
 Direct access to IPv6 header.
 
#define UIP_ICMP_BUF   ((struct uip_icmp_hdr *)UIP_IP_PAYLOAD(uip_ext_len))
 Direct access to ICMP, UDP, and TCP headers and payload, with implicit ext header offset (global uip_ext_len)
 
#define UIP_LLADDR_LEN   LINKADDR_SIZE
 802.15.4 address More...
 
#define uip_sethostaddr(addr)
 Set the IP address of this host. More...
 
#define uip_gethostaddr(addr)
 Get the IP address of this host. More...
 
#define uip_setdraddr(addr)
 Set the default router's IP address. More...
 
#define uip_setnetmask(addr)
 Set the netmask. More...
 
#define uip_getdraddr(addr)
 Get the default router's IP address. More...
 
#define uip_getnetmask(addr)
 Get the netmask. More...
 
#define uip_input()
 Process an incoming packet. More...
 
#define uip_periodic(conn)
 Periodic processing for a connection identified by its number. More...
 
#define uip_conn_active(conn)   (uip_conns[conn].tcpstateflags != UIP_CLOSED)
 Macro to determine whether a specific uIP connection is active. More...
 
#define uip_periodic_conn(conn)
 Perform periodic processing for a connection identified by a pointer to its structure. More...
 
#define uip_poll_conn(conn)
 Request that a particular connection should be polled. More...
 
#define uip_udp_periodic(conn)
 Periodic processing for a UDP connection identified by its number. More...
 
#define uip_udp_periodic_conn(conn)
 Periodic processing for a UDP connection identified by a pointer to its structure. More...
 
#define uip_buf   (uip_aligned_buf.u8)
 Macro to access uip_aligned_buf as an array of bytes.
 
#define uip_datalen()
 The length of any incoming data that is currently available (if available) in the uip_appdata buffer. More...
 
#define uip_urgdatalen()
 The length of any out-of-band data (urgent data) that has arrived on the connection. More...
 
#define uip_close()
 Close the current connection. More...
 
#define uip_abort()
 Abort the current connection. More...
 
#define uip_stop()
 Tell the sending host to stop sending data. More...
 
#define uip_stopped(conn)
 Find out if the current connection has been previously stopped with uip_stop().
 
#define uip_restart()
 Restart the current connection, if is has previously been stopped with uip_stop(). More...
 
#define uip_udpconnection()
 Is the current connection a UDP connection? More...
 
#define uip_newdata()
 Is new incoming data available? More...
 
#define uip_acked()
 Has previously sent data been acknowledged? More...
 
#define uip_connected()
 Has the connection just been connected? More...
 
#define uip_closed()
 Has the connection been closed by the other end? More...
 
#define uip_aborted()
 Has the connection been aborted by the other end? More...
 
#define uip_timedout()
 Has the connection timed out? More...
 
#define uip_rexmit()
 Do we need to retransmit previously data? More...
 
#define uip_poll()
 Is the connection being polled by uIP? More...
 
#define uip_initialmss()
 Get the initial maximum segment size (MSS) of the current connection.
 
#define uip_mss()
 Get the current maximum segment size that can be sent on the current connection. More...
 
#define uip_udp_remove(conn)
 Remove a UDP connection. More...
 
#define uip_udp_bind(conn, port)
 Bind a UDP connection to a local port. More...
 
#define uip_udp_send(len)
 Send a UDP datagram of length len on the current connection. More...
 
#define uip_ipaddr_to_quad(a)
 Convert an IP address to four bytes separated by commas. More...
 
#define uip_ipaddr(addr, addr0, addr1, addr2, addr3)
 Construct an IP address from four bytes. More...
 
#define uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7)
 Construct an IPv6 address from eight 16-bit words. More...
 
#define uip_ip6addr_u8(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7, addr8, addr9, addr10, addr11, addr12, addr13, addr14, addr15)
 Construct an IPv6 address from sixteen 8-bit words. More...
 
#define uip_ipaddr_copy(dest, src)
 Copy an IP address from one place to another. More...
 
#define uip_ip4addr_cmp(addr1, addr2)
 Compare two IP addresses. More...
 
#define uip_ipaddr_maskcmp(addr1, addr2, mask)
 Compare two IP addresses with netmasks. More...
 
#define uip_ipaddr_mask(dest, src, mask)
 Mask out the network part of an IP address. More...
 
#define uip_ipaddr1(addr)
 Pick the first octet of an IP address. More...
 
#define uip_ipaddr2(addr)
 Pick the second octet of an IP address. More...
 
#define uip_ipaddr3(addr)
 Pick the third octet of an IP address. More...
 
#define uip_ipaddr4(addr)
 Pick the fourth octet of an IP address. More...
 
#define UIP_HTONS(n)
 Convert 16-bit quantity from host byte order to network byte order. More...
 
#define UIP_STAT(s)
 The uIP TCP/IP statistics. More...
 
#define UIP_APPDATA_SIZE
 The buffer size available for user data in the uip_buf buffer. More...
 
#define UIP_LLPREF_LEN   10
 Length of the link local prefix.
 
#define uip_is_addr_loopback(a)
 Is IPv6 address a the unspecified address a is of type uip_ipaddr_t.
 
#define uip_is_addr_unspecified(a)
 Is IPv6 address a the unspecified address a is of type uip_ipaddr_t.
 
#define uip_is_addr_linklocal_allnodes_mcast(a)
 Is IPv6 address a the link local all-nodes multicast address.
 
#define uip_is_addr_linklocal_allrouters_mcast(a)
 Is IPv6 address a the link local all-routers multicast address.
 
#define uip_is_addr_linklocal(a)
 is addr (a) a link local unicast address, see RFC 4291 i.e. More...
 
#define uip_create_unspecified(a)   uip_ip6addr(a, 0, 0, 0, 0, 0, 0, 0, 0)
 set IP address a to unspecified
 
#define uip_create_linklocal_allnodes_mcast(a)   uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0001)
 set IP address a to the link local all-nodes multicast address
 
#define uip_create_linklocal_allrouters_mcast(a)   uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0002)
 set IP address a to the link local all-routers multicast address
 
#define uip_is_addr_solicited_node(a)
 is addr (a) a solicited node multicast address, see RFC 4291 a is of type uip_ipaddr_t*
 
#define uip_create_solicited_node(a, b)
 put in b the solicited node address corresponding to address a both a and b are of type uip_ipaddr_t*
 
#define uip_is_addr_mac_addr_based(a, m)
 was addr (a) forged based on the mac address m a type is uip_ipaddr_t m type is uiplladdr_t
 
#define uip_is_addr_mcast(a)   (((a)->u8[0]) == 0xFF)
 is address a multicast address, see RFC 4291 a is of type uip_ipaddr_t*
 
#define uip_is_addr_mcast_global(a)
 is address a global multicast address (FFxE::/16), a is of type uip_ip6addr_t*
 
#define uip_is_addr_mcast_non_routable(a)
 is address a non-routable multicast address. More...
 
#define uip_is_addr_mcast_routable(a)
 is address a routable multicast address. More...
 
#define uip_is_mcast_group_id_all_nodes(a)
 is group-id of multicast address a the all nodes group-id
 
#define uip_is_mcast_group_id_all_routers(a)
 is group-id of multicast address a the all routers group-id
 
#define uip_are_solicited_bytes_equal(a, b)
 are last three bytes of both addresses equal? This is used to compare solicited node multicast addresses
 
#define UIP_FW_LOCAL
 A non-error message that indicates that a packet should be processed locally.
 
#define UIP_FW_OK
 A non-error message that indicates that something went OK.
 
#define UIP_FW_FORWARDED
 A non-error message that indicates that a packet was forwarded.
 
#define UIP_FW_ZEROLEN
 A non-error message that indicates that a zero-length packet transmission was attempted, and that no packet was sent.
 
#define UIP_FW_TOOLARGE
 An error message that indicates that a packet that was too large for the outbound network interface was detected.
 
#define UIP_FW_NOROUTE
 An error message that indicates that no suitable interface could be found for an outbound packet.
 
#define UIP_FW_DROPPED
 An error message that indicates that a packet that should be forwarded or output was dropped.
 
#define UIP_PROTO_HBHO   0
 extension headers types
 
#define UIP_EXT_HDR_OPT_PAD1   0
 Destination and Hop By Hop extension headers option types.
 
#define UIP_EXT_HDR_BITMAP_HBHO   0x01
 Bitmaps for extension header processing. More...
 

Typedefs

typedef union uip_ip4addr_t uip_ip4addr_t
 Representation of an IP address.
 
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
 

Functions

void uip_init (void)
 uIP initialization function. More...
 
void uip_setipid (uint16_t id)
 uIP initialization function. More...
 
void uip_reass_over (void)
 Abandon the reassembly of the current packet. More...
 
void uip_listen (uint16_t port)
 Start listening to the specified port. More...
 
void uip_unlisten (uint16_t port)
 Stop listening to the specified port. More...
 
struct uip_connuip_connect (const uip_ipaddr_t *ripaddr, uint16_t port)
 Connect to a remote host using TCP. More...
 
void uip_send (const void *data, int len)
 Send data on the current connection. More...
 
struct uip_udp_connuip_udp_new (const uip_ipaddr_t *ripaddr, uint16_t rport)
 Set up a new UDP connection. More...
 
uint16_t uip_htons (uint16_t val)
 Convert a 16-bit quantity from host byte order to network byte order. More...
 
void uip_process (uint8_t flag)
 process the options within a hop by hop or destination option header More...
 
uint16_t uip_chksum (uint16_t *data, uint16_t len)
 Calculate the Internet checksum over a buffer. More...
 
uint16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf. More...
 
uint16_t uip_tcpchksum (void)
 Calculate the TCP checksum of the packet in uip_buf and uip_appdata. More...
 
uint16_t uip_udpchksum (void)
 Calculate the UDP checksum of the packet in uip_buf and uip_appdata. More...
 
uint16_t uip_icmp6chksum (void)
 Calculate the ICMP checksum of the packet in uip_buf. More...
 
bool uip_remove_ext_hdr (void)
 Removes all IPv6 extension headers from uip_buf, updates length fields (uip_len and uip_ext_len) More...
 

Variables

uip_buf_t uip_aligned_buf
 Packet buffer for incoming and outgoing packets.
 
void * uip_appdata
 Pointer to the application data in the packet buffer. More...
 
uint16_t uip_len
 The length of the packet in the uip_buf buffer. More...
 
uint16_t uip_ext_len
 The length of the extension headers. More...
 
uint8_t uip_last_proto
 The final protocol after IPv6 extension headers: UIP_PROTO_TCP, UIP_PROTO_UDP or UIP_PROTO_ICMP6.
 
struct uip_connuip_conn
 Pointer to the current TCP connection. More...
 
uint8_t uip_acc32 [4]
 4-byte array used for the 32-bit sequence number calculations.
 
struct uip_udp_connuip_udp_conn
 The current UDP connection.
 
struct uip_icmp6_conn uip_icmp6_conns
 single possible icmpv6 "connection"
 
uip_lladdr_t uip_lladdr
 Host L2 address.
 

Detailed Description

Header file for the uIP TCP/IP stack.

Author
Adam Dunkels adam@.nosp@m.dunk.nosp@m.els.c.nosp@m.om
Julien Abeille jabei.nosp@m.lle@.nosp@m.cisco.nosp@m..com (IPv6 related code)
Mathilde Durvy mdurv.nosp@m.y@ci.nosp@m.sco.c.nosp@m.om (IPv6 related code)

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.

Definition in file uip.h.