Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Uip

{@

Modules

 Serial Line IP (SLIP) protocol
 The SLIP protocol is a very simple way to transmit IP packets over a serial line.
 
 uIP hostname resolver functions
 The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address.
 
 Protosockets library
 The protosocket library provides an interface to the uIP stack that is similar to the traditional BSD socket interface.
 
 uIP configuration functions
 The uIP configuration functions are used for setting run-time parameters in uIP such as IP addresses.
 
 uIP initialization functions
 The uIP initialization functions are used for booting uIP.
 
 uIP device driver functions
 These functions are used by a network device driver for interacting with uIP.
 
 uIP application functions
 Functions used by an application running of top of uIP.
 
 uIP conversion functions
 These functions can be used for converting between different data formats used by uIP.
 
 Variables used in uIP device drivers
 uIP has a few global variables that are used in device drivers for uIP.
 
 Configuration options for uIP
 uIP is configured using the per-project configuration file "uipopt.h".
 
 The Contiki/uIP interface
 TCP/IP support in Contiki is implemented using the uIP TCP/IP stack.
 
 uIP TCP throughput booster hack
 The basic uIP TCP implementation only allows each TCP connection to have a single TCP segment in flight at any given time.
 
 Simple-udp
 The default Contiki UDP API is difficult to use.
 
 uIP packet forwarding
 
 uIP Address Resolution Protocol
 The Address Resolution Protocol ARP is used for mapping between IP addresses and link level addresses such as the Ethernet MAC addresses.
 
 Architecture specific uIP functions
 The functions in the architecture specific module implement the IP check sum and 32-bit additions.
 

Data Structures

struct  uip_80211_addr
 802.11 address More...
 
struct  uip_802154_longaddr
 64 bit 802.15.4 address More...
 
struct  uip_802154_shortaddr
 16 bit 802.15.4 address More...
 
struct  uip_conn
 Representation of a uIP TCP connection. More...
 
struct  uip_desto_hdr
 
struct  uip_eth_addr
 802.3 address More...
 
struct  uip_ext_hdr
 
struct  uip_ext_hdr_opt
 
struct  uip_ext_hdr_opt_padn
 
struct  uip_ext_hdr_opt_rpl
 
struct  uip_fallback_interface
 
struct  uip_frag_hdr
 
struct  uip_hbho_hdr
 
struct  uip_icmp_hdr
 
struct  uip_icmpip_hdr
 
union  uip_ip4addr_t
 Representation of an IP address. More...
 
union  uip_ip6addr_t
 
struct  uip_ip_hdr
 
struct  uip_routing_hdr
 
struct  uip_stats
 The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1. More...
 
struct  uip_tcp_hdr
 
struct  uip_tcpip_hdr
 
struct  uip_udp_conn
 Representation of a uIP UDP connection. More...
 
struct  uip_udp_hdr
 
struct  uip_udpip_hdr
 

Files

file  uip.c
 The uIP TCP/IP stack code.
 
file  uip.h
 Header file for the uIP TCP/IP stack.
 

Macros

#define UIP_ABORT
 
#define UIP_ACKDATA
 
#define UIP_APPDATA_PTR   (void *)&uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN]
 
#define UIP_APPDATA_SIZE
 The buffer size available for user data in the uip_buf buffer. More...
 
#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 More...
 
#define UIP_CLOSE
 
#define UIP_CLOSED   0
 
#define UIP_CLOSING   6
 
#define UIP_CONNECTED
 
#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 More...
 
#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 More...
 
#define uip_create_linklocal_prefix(addr)
 
#define uip_create_solicited_node(a, b)
 in b the solicited node address corresponding to address a both a and b are of type uip_ipaddr_t* More...
 
#define uip_create_unspecified(a)   uip_ip6addr(a, 0, 0, 0, 0, 0, 0, 0, 0)
 set IP address a to unspecified More...
 
#define UIP_DATA
 
#define UIP_ESTABLISHED   3
 
#define UIP_FIN_WAIT_1   4
 
#define UIP_FIN_WAIT_2   5
 
#define UIP_FRAGH_LEN   8
 
#define UIP_ICMPH_LEN   4 /* Size of ICMP header */
 
#define UIP_IPH_LEN   40
 
#define UIP_IPICMPH_LEN
 
#define UIP_IPTCPH_LEN
 
#define UIP_IPUDPH_LEN
 
#define uip_is_addr_link_local(a)
 is addr (a) a link local unicast address, see RFC3513 i.e. More...
 
#define uip_is_addr_linklocal(a)
 Checks whether the address a is link local. More...
 
#define uip_is_addr_linklocal_allnodes_mcast(a)
 Is IPv6 address a the link local all-nodes multicast address. More...
 
#define uip_is_addr_linklocal_allrouters_mcast(a)
 Is IPv6 address a the link local all-routers multicast address. More...
 
#define uip_is_addr_loopback(a)
 Is IPv6 address a the unspecified address a is of type uip_ipaddr_t. More...
 
#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 More...
 
#define uip_is_addr_mcast(a)   (((a)->u8[0]) == 0xFF)
 is address a multicast address, see RFC 3513 a is of type uip_ipaddr_t* More...
 
#define uip_is_addr_mcast_global(a)
 is address a global multicast address (FFxE::/16), a is of type uip_ip6addr_t* More...
 
#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_addr_solicited_node(a)
 is addr (a) a solicited node multicast address, see RFC3513 a is of type uip_ipaddr_t* More...
 
#define uip_is_addr_unspecified(a)
 Is IPv6 address a the unspecified address a is of type uip_ipaddr_t. More...
 
#define uip_is_mcast_group_id_all_nodes(a)
 is group-id of multicast address a the all nodes group-id More...
 
#define uip_is_mcast_group_id_all_routers(a)
 is group-id of multicast address a the all routers group-id More...
 
#define uip_l2_l3_hdr_len   (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len)
 The sums below are quite used in ND. More...
 
#define uip_l2_l3_icmp_hdr_len   (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
 
#define uip_l3_hdr_len   (UIP_IPH_LEN + uip_ext_len)
 
#define uip_l3_icmp_hdr_len   (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
 
#define UIP_LAST_ACK   8
 
#define UIP_LLADDR_LEN   6
 
#define UIP_LLIPH_LEN
 
#define UIP_LLPREF_LEN   10
 Length of the link local prefix. More...
 
#define UIP_NEWDATA
 
#define UIP_POLL
 
#define UIP_POLL_REQUEST
 
#define UIP_PROTO_ICMP   1
 
#define UIP_PROTO_ICMP6   58
 
#define UIP_PROTO_TCP   6
 
#define UIP_PROTO_UDP   17
 
#define UIP_REXMIT
 
#define UIP_STAT(s)
 The uIP TCP/IP statistics. More...
 
#define UIP_STOPPED   16
 
#define UIP_SYN_RCVD   1
 
#define UIP_SYN_SENT   2
 
#define UIP_TCPH_LEN   20 /* Size of TCP header */
 
#define UIP_TCPIP_HLEN   UIP_IPTCPH_LEN
 
#define UIP_TIME_WAIT   7
 
#define UIP_TIMEDOUT
 
#define UIP_TIMER
 
#define UIP_TS_MASK   15
 
#define UIP_UDP_SEND_CONN
 
#define UIP_UDPH_LEN   8 /* Size of UDP header */
 

Typedefs

typedef struct uip_80211_addr uip_80211_addr
 802.11 address More...
 
typedef struct uip_802154_longaddr uip_802154_longaddr
 64 bit 802.15.4 address More...
 
typedef struct uip_802154_shortaddr uip_802154_shortaddr
 16 bit 802.15.4 address More...
 
typedef struct uip_desto_hdr uip_desto_hdr
 
typedef struct uip_eth_addr uip_eth_addr
 802.3 address More...
 
typedef struct uip_ext_hdr uip_ext_hdr
 
typedef struct uip_ext_hdr_opt uip_ext_hdr_opt
 
typedef struct uip_ext_hdr_opt_padn uip_ext_hdr_opt_padn
 
typedef struct uip_ext_hdr_opt_rpl uip_ext_hdr_opt_rpl
 
typedef struct uip_frag_hdr uip_frag_hdr
 
typedef struct uip_hbho_hdr uip_hbho_hdr
 
typedef union uip_ip4addr_t uip_ip4addr_t
 Representation of an IP address. More...
 
typedef union uip_ip6addr_t uip_ip6addr_t
 
typedef uip_ip6addr_t uip_ipaddr_t
 
typedef uip_eth_addr uip_lladdr_t
 Ethernet address. More...
 
typedef struct uip_routing_hdr uip_routing_hdr
 

Functions

void remove_ext_hdr (void)
 
uint16_t uip_chksum (uint16_t *buf, uint16_t len)
 Calculate the Internet checksum over a buffer. More...
 
uint16_t uip_icmp6chksum (void)
 Calculate the ICMP checksum of the packet in uip_buf. More...
 
uint16_t uip_ipchksum (void)
 Calculate the IP header checksum of the packet header in uip_buf. More...
 
void uip_process (uint8_t flag)
 process the options within a hop by hop or destination option header 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...
 

Variables

CCIF const uip_ipaddr_t uip_all_zeroes_addr
 
CCIF void * uip_appdata
 Pointer to the application data in the packet buffer. More...
 
CCIF const uip_ipaddr_t uip_broadcast_addr
 
CCIF struct uip_connuip_conn
 Pointer to the current TCP connection. More...
 
CCIF uip_ipaddr_t uip_draddr
 
CCIF uint8_t uip_flags
 
CCIF uip_ipaddr_t uip_hostaddr
 
CCIF uip_lladdr_t uip_lladdr
 Host L2 address. More...
 
CCIF uip_ipaddr_t uip_netmask
 
struct uip_udp_connuip_udp_conn
 The current UDP connection. More...
 
struct uip_udp_conn uip_udp_conns [UIP_UDP_CONNS]
 
#define UIP_PROTO_HBHO   0
 extension headers types More...
 
#define UIP_PROTO_DESTO   60
 
#define UIP_PROTO_ROUTING   43
 
#define UIP_PROTO_FRAG   44
 
#define UIP_PROTO_NONE   59
 
#define UIP_EXT_HDR_OPT_PAD1   0
 Destination and Hop By Hop extension headers option types. More...
 
#define UIP_EXT_HDR_OPT_PADN   1
 
#define UIP_EXT_HDR_OPT_RPL   0x63
 
#define UIP_EXT_HDR_BITMAP_HBHO   0x01
 Bitmaps for extension header processing. More...
 
#define UIP_EXT_HDR_BITMAP_DESTO1   0x02
 
#define UIP_EXT_HDR_BITMAP_ROUTING   0x04
 
#define UIP_EXT_HDR_BITMAP_FRAG   0x08
 
#define UIP_EXT_HDR_BITMAP_AH   0x10
 
#define UIP_EXT_HDR_BITMAP_ESP   0x20
 
#define UIP_EXT_HDR_BITMAP_DESTO2   0x40
 

#define UIP_ABORT
Value:
32 /* The remote host has aborted the
connection, thus the connection has
gone away. Or the application signals
that it wants to abort the
connection. */

Referenced by uip_process().

#define UIP_ACKDATA
Value:
1 /* Signifies that the outstanding data was
acked and the application should send
out new data instead of retransmitting
the last data. */

Referenced by uip_process().

#define UIP_APPDATA_PTR   (void *)&uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN]
#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:

snprintf(uip_appdata, UIP_APPDATA_SIZE, "%u\n", i);
#define uip_are_solicited_bytes_equal (   a,
 
)
Value:
((((a)->u8[13]) == ((b)->u8[13])) && \
(((a)->u8[14]) == ((b)->u8[14])) && \
(((a)->u8[15]) == ((b)->u8[15])))

are last three bytes of both addresses equal? This is used to compare solicited node multicast addresses

#define UIP_CLOSE
Value:
16 /* The remote host has closed the
connection, thus the connection has
gone away. Or the application signals
that it wants to close the
connection. */

Referenced by uip_process().

#define UIP_CLOSED   0
#define UIP_CLOSING   6

Referenced by uip_process().

#define UIP_CONNECTED
Value:
64 /* We have got a connection from a remote
host and have set up a new connection
for it, or an active connection has
been successfully established. */

Referenced by uip_process().

#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

Referenced by ip64_4to6(), ns_input(), PROCESS_THREAD(), send_msg(), and uip_ds6_init().

#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

Referenced by uip_ds6_init(), and uip_nd6_rs_output().

#define uip_create_linklocal_prefix (   addr)
Value:
do { \
(addr)->u16[0] = UIP_HTONS(0xfe80); \
(addr)->u16[1] = 0; \
(addr)->u16[2] = 0; \
(addr)->u16[3] = 0; \
} while(0)
struct sockaddr_in addr
Definition: iot_cloud_demo/demo.c:226
#define UIP_HTONS(n)
Convert 16-bit quantity from host byte order to network byte order.
Definition: uip.h:1237

Referenced by uip_ds6_init().

#define uip_create_solicited_node (   a,
 
)
Value:
(((b)->u8[0]) = 0xFF); \
(((b)->u8[1]) = 0x02); \
(((b)->u16[1]) = 0); \
(((b)->u16[2]) = 0); \
(((b)->u16[3]) = 0); \
(((b)->u16[4]) = 0); \
(((b)->u8[10]) = 0); \
(((b)->u8[11]) = 0x01); \
(((b)->u8[12]) = 0xFF); \
(((b)->u8[13]) = ((a)->u8[13])); \
(((b)->u16[7]) = ((a)->u16[7]))

in b the solicited node address corresponding to address a both a and b are of type uip_ipaddr_t*

Referenced by uip_ds6_addr_add(), uip_ds6_addr_rm(), and uip_nd6_ns_output().

#define uip_create_unspecified (   a)    uip_ip6addr(a, 0, 0, 0, 0, 0, 0, 0, 0)

set IP address a to unspecified

Referenced by uip_ds6_defrt_add(), uip_ds6_defrt_choose(), uip_ds6_select_src(), and uip_nd6_ns_output().

#define UIP_DATA
Value:
1 /* Tells uIP that there is incoming
data in the uip_buf buffer. The
length of the data is stored in the
global variable uip_len. */
#define UIP_ESTABLISHED   3

Referenced by uip_process().

#define UIP_EXT_HDR_BITMAP_AH   0x10
#define UIP_EXT_HDR_BITMAP_DESTO1   0x02

Referenced by uip_process().

#define UIP_EXT_HDR_BITMAP_DESTO2   0x40

Referenced by uip_process().

#define UIP_EXT_HDR_BITMAP_ESP   0x20
#define UIP_EXT_HDR_BITMAP_FRAG   0x08
#define UIP_EXT_HDR_BITMAP_HBHO   0x01

Bitmaps for extension header processing.

When processing extension headers, we should record somehow which one we see, because you cannot have twice the same header, except for destination We store all this in one uint8_t bitmap one bit for each header expected. The order in the bitmap is the order recommended in RFC2460

Referenced by uip_process().

#define UIP_EXT_HDR_BITMAP_ROUTING   0x04

Referenced by uip_process().

#define UIP_EXT_HDR_OPT_PAD1   0

Destination and Hop By Hop extension headers option types.

Referenced by ext_hdr_options_process().

#define UIP_EXT_HDR_OPT_PADN   1

Referenced by ext_hdr_options_process().

#define UIP_FIN_WAIT_1   4

Referenced by uip_process().

#define UIP_FIN_WAIT_2   5

Referenced by uip_process().

#define UIP_FRAGH_LEN   8
#define UIP_ICMPH_LEN   4 /* Size of ICMP header */
#define UIP_IPICMPH_LEN
Value:
(UIP_IPH_LEN + UIP_ICMPH_LEN) /* size of ICMP
+ IP header */
#define UIP_ICMPH_LEN
Definition: uip.h:66
#define UIP_IPH_LEN
Definition: uip.h:58

Referenced by uip_icmp6_error_output().

#define UIP_IPTCPH_LEN
Value:
(UIP_TCPH_LEN + UIP_IPH_LEN) /* Size of IP +
* TCP
* header */
#define UIP_TCPH_LEN
Definition: uip.h:65
#define UIP_IPH_LEN
Definition: uip.h:58

Referenced by uip_process().

#define UIP_IPUDPH_LEN
Value:
(UIP_UDPH_LEN + UIP_IPH_LEN) /* Size of IP +
* UDP
* header */
#define UIP_UDPH_LEN
Definition: uip.h:64
#define UIP_IPH_LEN
Definition: uip.h:58

Referenced by uip_process(), and uip_udp_packet_send().

#define uip_is_addr_link_local (   a)
Value:
((((a)->u8[0]) == 0xFE) && \
(((a)->u8[1]) == 0x80))

is addr (a) a link local unicast address, see RFC3513 i.e.

is (a) on prefix FE80::/10 a is of type uip_ipaddr_t*

Referenced by compress_hdr_hc06(), compress_hdr_hc1(), get_global_addr(), ra_input(), simple_rpl_global_address(), simple_rpl_init_dag_immediately(), uip_ds6_get_global(), uip_ds6_get_link_local(), uip_ds6_select_src(), and uip_process().

#define uip_is_addr_linklocal (   a)
Value:
((a)->u8[0] == 0xfe && \
(a)->u8[1] == 0x80)

Checks whether the address a is link local.

a is of type uip_ipaddr_t

#define uip_is_addr_linklocal_allnodes_mcast (   a)
Value:
((((a)->u8[0]) == 0xff) && \
(((a)->u8[1]) == 0x02) && \
(((a)->u16[1]) == 0) && \
(((a)->u16[2]) == 0) && \
(((a)->u16[3]) == 0) && \
(((a)->u16[4]) == 0) && \
(((a)->u16[5]) == 0) && \
(((a)->u16[6]) == 0) && \
(((a)->u8[14]) == 0) && \
(((a)->u8[15]) == 0x01))

Is IPv6 address a the link local all-nodes multicast address.

#define uip_is_addr_linklocal_allrouters_mcast (   a)
Value:
((((a)->u8[0]) == 0xff) && \
(((a)->u8[1]) == 0x02) && \
(((a)->u16[1]) == 0) && \
(((a)->u16[2]) == 0) && \
(((a)->u16[3]) == 0) && \
(((a)->u16[4]) == 0) && \
(((a)->u16[5]) == 0) && \
(((a)->u16[6]) == 0) && \
(((a)->u8[14]) == 0) && \
(((a)->u8[15]) == 0x02))

Is IPv6 address a the link local all-routers multicast address.

#define uip_is_addr_loopback (   a)
Value:
((((a)->u16[0]) == 0) && \
(((a)->u16[1]) == 0) && \
(((a)->u16[2]) == 0) && \
(((a)->u16[3]) == 0) && \
(((a)->u16[4]) == 0) && \
(((a)->u16[5]) == 0) && \
(((a)->u16[6]) == 0) && \
(((a)->u8[14]) == 0) && \
(((a)->u8[15]) == 0x01))

Is IPv6 address a the unspecified address a is of type uip_ipaddr_t.

Referenced by uip_process().

#define uip_is_addr_mac_addr_based (   a,
 
)
Value:
((((a)->u8[8]) == (((m)->addr[0]) | 0x02)) && \
(((a)->u8[9]) == (m)->addr[1]) && \
(((a)->u8[10]) == (m)->addr[2]) && \
(((a)->u8[11]) == 0xff) && \
(((a)->u8[12]) == 0xfe) && \
(((a)->u8[13]) == (m)->addr[3]) && \
(((a)->u8[14]) == (m)->addr[4]) && \
(((a)->u8[15]) == (m)->addr[5]))
struct sockaddr_in addr
Definition: iot_cloud_demo/demo.c:226

was addr (a) forged based on the mac address m a type is uip_ipaddr_t m type is uiplladdr_t

Referenced by compress_addr_64(), and compress_hdr_hc1().

#define uip_is_addr_mcast (   a)    (((a)->u8[0]) == 0xFF)
#define uip_is_addr_mcast_global (   a)
Value:
((((a)->u8[0]) == 0xFF) && \
(((a)->u8[1] & 0x0F) == 0x0E))

is address a global multicast address (FFxE::/16), a is of type uip_ip6addr_t*

Referenced by dao_input(), and handle_dao_timer().

#define uip_is_addr_mcast_non_routable (   a)
Value:
((((a)->u8[0]) == 0xFF) && \
(((a)->u8[1] & 0x0F) <= 0x02))

is address a non-routable multicast address.

Scopes 1 (interface-local) and 2 (link-local) are non-routable See RFC4291 and draft-ietf-6man-multicast-scopes a is of type uip_ip6addr_t*

#define uip_is_addr_mcast_routable (   a)
Value:
((((a)->u8[0]) == 0xFF) && \
(((a)->u8[1] & 0x0F) > 0x02))

is address a routable multicast address.

Scope 3 (Realm-Local) or higher are routable Realm-Local scope is defined in draft-ietf-6man-multicast-scopes See RFC4291 and draft-ietf-6man-multicast-scopes a is of type uip_ip6addr_t*

Referenced by uip_ds6_select_src(), uip_process(), and uip_udp_packet_send().

#define uip_is_addr_solicited_node (   a)
Value:
((((a)->u8[0]) == 0xFF) && \
(((a)->u8[1]) == 0x02) && \
(((a)->u16[1]) == 0x00) && \
(((a)->u16[2]) == 0x00) && \
(((a)->u16[3]) == 0x00) && \
(((a)->u16[4]) == 0x00) && \
(((a)->u8[10]) == 0x00) && \
(((a)->u8[11]) == 0x01) && \
(((a)->u8[12]) == 0xFF))

is addr (a) a solicited node multicast address, see RFC3513 a is of type uip_ipaddr_t*

Referenced by ns_input().

#define uip_is_addr_unspecified (   a)
Value:
((((a)->u16[0]) == 0) && \
(((a)->u16[1]) == 0) && \
(((a)->u16[2]) == 0) && \
(((a)->u16[3]) == 0) && \
(((a)->u16[4]) == 0) && \
(((a)->u16[5]) == 0) && \
(((a)->u16[6]) == 0) && \
(((a)->u16[7]) == 0))

Is IPv6 address a the unspecified address a is of type uip_ipaddr_t.

Referenced by compress_hdr_hc06(), ns_input(), route_callback(), tcpip_ipv6_output(), uip_icmp6_error_output(), uip_nd6_ns_output(), uip_nd6_rs_output(), and uip_process().

#define uip_is_mcast_group_id_all_nodes (   a)
Value:
((((a)->u16[1]) == 0) && \
(((a)->u16[2]) == 0) && \
(((a)->u16[3]) == 0) && \
(((a)->u16[4]) == 0) && \
(((a)->u16[5]) == 0) && \
(((a)->u16[6]) == 0) && \
(((a)->u8[14]) == 0) && \
(((a)->u8[15]) == 1))

is group-id of multicast address a the all nodes group-id

#define uip_is_mcast_group_id_all_routers (   a)
Value:
((((a)->u16[1]) == 0) && \
(((a)->u16[2]) == 0) && \
(((a)->u16[3]) == 0) && \
(((a)->u16[4]) == 0) && \
(((a)->u16[5]) == 0) && \
(((a)->u16[6]) == 0) && \
(((a)->u8[14]) == 0) && \
(((a)->u8[15]) == 2))

is group-id of multicast address a the all routers group-id

#define uip_l2_l3_hdr_len   (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len)

The sums below are quite used in ND.

When used for uip_buf, we include link layer length when used for uip_len, we do not, hence we need values with and without LLH_LEN we do not use capital letters as these values are variable

#define uip_l2_l3_icmp_hdr_len   (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
#define uip_l3_hdr_len   (UIP_IPH_LEN + uip_ext_len)
#define UIP_LAST_ACK   8

Referenced by uip_process().

#define UIP_LLADDR_LEN   6
#define UIP_LLIPH_LEN
Value:
(UIP_LLH_LEN + UIP_IPH_LEN) /* size of L2
+ IP header */
#define UIP_LLH_LEN
The link level header length.
Definition: uipopt.h:160
#define UIP_IPH_LEN
Definition: uip.h:58

Referenced by uncompress_hdr_hc06(), and uncompress_hdr_hc1().

#define UIP_LLPREF_LEN   10

Length of the link local prefix.

#define UIP_NEWDATA
Value:
2 /* Flags the fact that the peer has sent
us new data. */

Referenced by uip_process().

#define UIP_POLL
Value:
8 /* Used for polling the application, to
check if the application has data that
it wants to send. */

Referenced by uip_process().

#define UIP_POLL_REQUEST
Value:
3 /* Tells uIP that a connection should
be polled. */

Referenced by uip_process().

#define UIP_PROTO_DESTO   60

Referenced by uip_process().

#define UIP_PROTO_FRAG   44

Referenced by uip_process().

#define UIP_PROTO_HBHO   0
#define UIP_PROTO_ICMP   1

Referenced by time_exceeded(), and uip_fw_forward().

#define UIP_PROTO_NONE   59

Referenced by uip_process().

#define UIP_PROTO_ROUTING   43

Referenced by uip_process().

#define UIP_REXMIT
Value:
4 /* Tells the application to retransmit the
data that was last sent. */

Referenced by uip_process().

#define UIP_STAT (   s)

The uIP TCP/IP statistics.

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

Referenced by echo_request_input(), na_input(), ns_input(), ra_input(), uip_icmp6_error_output(), uip_nd6_ns_output(), uip_nd6_rs_output(), and uip_process().

#define UIP_STOPPED   16

Referenced by uip_process().

#define UIP_SYN_RCVD   1

Referenced by uip_process().

#define UIP_SYN_SENT   2

Referenced by uip_process().

#define UIP_TCPH_LEN   20 /* Size of TCP header */

Referenced by uip_process().

#define UIP_TIME_WAIT   7

Referenced by uip_process().

#define UIP_TIMEDOUT
Value:
128 /* The connection has been aborted due to
too many retransmissions. */

Referenced by uip_process().

#define UIP_TIMER
Value:
2 /* Tells uIP that the periodic timer
has fired. */

Referenced by uip_process().

#define UIP_TS_MASK   15

Referenced by for(), make_tcp_stats(), and uip_process().

#define UIP_UDP_SEND_CONN
Value:
4 /* Tells uIP that a UDP datagram
should be constructed in the
uip_buf buffer. */

Referenced by uip_process(), and uip_udp_packet_send().

#define UIP_UDPH_LEN   8 /* Size of UDP header */

802.11 address

64 bit 802.15.4 address

16 bit 802.15.4 address

typedef struct uip_desto_hdr uip_desto_hdr
typedef struct uip_eth_addr uip_eth_addr

802.3 address

typedef struct uip_ext_hdr uip_ext_hdr
typedef struct uip_frag_hdr uip_frag_hdr
typedef struct uip_hbho_hdr uip_hbho_hdr

Representation of an IP address.

Ethernet address.

void remove_ext_hdr ( void  )
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.

References chksum(), and uip_htons().

Referenced by time_exceeded().

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

References UIP_PROTO_ICMP6, and upper_layer_chksum().

Referenced by echo_request_input(), ns_input(), uip_icmp6_error_output(), uip_icmp6_send(), uip_nd6_ns_output(), uip_nd6_rs_output(), 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.

References chksum(), PRINTF, uip_buf, uip_htons(), UIP_IPH_LEN, and UIP_LLH_LEN.

Referenced by PROCESS_THREAD(), time_exceeded(), and uip_split_output().

void uip_process ( uint8_t  flag)

process the options within a hop by hop or destination option header

Return values
0,:nothing to send,
1,:drop pkt
2,:ICMP error message to send

References c, uip_ds6_netif::cur_hop_limit, ext_hdr_options_process(), ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_NOPORT, ICMP6_DST_UNREACH_NOTNEIGHBOR, ICMP6_PACKET_TOO_BIG, ICMP6_PARAM_PROB, ICMP6_PARAMPROB_HEADER, ICMP6_PARAMPROB_NEXTHEADER, ICMP6_TIME_EXCEED_TRANSIT, ICMP6_TIME_EXCEEDED, uip_mcast6_driver::in, uip_conn::initialmss, uip_conn::len, uip_conn::lport, uip_udp_conn::lport, uip_conn::mss, uip_conn::nrtx, NULL, PRINT6ADDR, PRINTF, uip_conn::rcv_nxt, remove_ext_hdr(), reset(), uip_conn::ripaddr, uip_udp_conn::ripaddr, rpl_insert_header(), rpl_update_header_empty(), uip_conn::rport, uip_udp_conn::rport, uip_conn::rto, uip_conn::sa, send(), uip_conn::snd_nxt, uip_conn::sv, TCP_ACK, TCP_CTL, TCP_FIN, TCP_OPT_END, TCP_OPT_MSS, TCP_OPT_MSS_LEN, TCP_OPT_NOOP, TCP_PSH, TCP_RST, TCP_SYN, TCP_URG, uip_conn::tcpstateflags, uip_conn::timer, uip_udp_conn::ttl, UIP_ABORT, UIP_ACKDATA, uip_add32(), UIP_APPCALL, uip_appdata, uip_buf, UIP_CLOSE, UIP_CLOSED, UIP_CLOSING, uip_conn, UIP_CONNECTED, UIP_CONNS, uip_ds6_if, uip_ds6_is_addr_onlink(), uip_ds6_is_my_addr, uip_ds6_is_my_maddr, uip_ds6_select_src(), UIP_ESTABLISHED, uip_ext_bitmap, UIP_EXT_BUF, UIP_EXT_HDR_BITMAP_DESTO1, UIP_EXT_HDR_BITMAP_DESTO2, UIP_EXT_HDR_BITMAP_HBHO, UIP_EXT_HDR_BITMAP_ROUTING, uip_ext_len, UIP_FIN_WAIT_1, UIP_FIN_WAIT_2, uip_flags, UIP_HTONS, UIP_ICMP6_APPCALL, uip_icmp6_error_output(), uip_icmp6_input(), UIP_ICMP6_INPUT_ERROR, uip_icmp6chksum(), UIP_ICMP_BUF, UIP_IP_BUF, uip_ipaddr_cmp, uip_ipaddr_copy, UIP_IPH_LEN, UIP_IPTCPH_LEN, UIP_IPUDPH_LEN, uip_is_addr_link_local, uip_is_addr_loopback, uip_is_addr_mcast, uip_is_addr_mcast_routable, uip_is_addr_unspecified, UIP_LAST_ACK, uip_len, UIP_LINK_MTU, UIP_LISTENPORTS, UIP_LLH_LEN, UIP_LOG, UIP_MAXRTX, UIP_MAXSYNRTX, UIP_MCAST6, UIP_MCAST6_ACCEPT, UIP_NEWDATA, uip_next_hdr, uip_outstanding, UIP_POLL, UIP_POLL_REQUEST, UIP_PROTO_DESTO, UIP_PROTO_FRAG, UIP_PROTO_HBHO, UIP_PROTO_ICMP6, UIP_PROTO_NONE, UIP_PROTO_ROUTING, UIP_PROTO_TCP, UIP_PROTO_UDP, UIP_RECEIVE_WINDOW, UIP_REXMIT, UIP_ROUTING_BUF, UIP_RTO, uip_sappdata, uip_slen, UIP_STAT, UIP_STOPPED, UIP_SYN_RCVD, UIP_SYN_SENT, UIP_TCP_BUF, UIP_TCP_MSS, uip_tcpchksum(), UIP_TCPH_LEN, UIP_TCPIP_HLEN, UIP_TIME_WAIT, UIP_TIME_WAIT_TIMEOUT, UIP_TIMEDOUT, UIP_TIMER, UIP_TS_MASK, UIP_UDP_APPCALL, UIP_UDP_BUF, uip_udp_conn, UIP_UDP_CONNS, uip_udp_conns, UIP_UDP_SEND_CONN, uip_udpchksum(), and UIP_UDPH_LEN.

Referenced by uip_udp_packet_send().

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.

Referenced by uip_process(), and uip_split_output().

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

CCIF const uip_ipaddr_t uip_all_zeroes_addr
CCIF const uip_ipaddr_t uip_broadcast_addr
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.

Referenced by uip_process().

CCIF uip_ipaddr_t uip_draddr

Referenced by uip_arp_out().

CCIF uint8_t uip_flags

Referenced by uip_process().

CCIF uip_ipaddr_t uip_netmask

The current UDP connection.

Referenced by uip_process().

struct uip_udp_conn uip_udp_conns[UIP_UDP_CONNS]

Referenced by eventhandler(), uip_init(), and uip_process().