56 #define UIP_IPH_LEN 40 57 #define UIP_FRAGH_LEN 8 59 #define UIP_UDPH_LEN 8 60 #define UIP_TCPH_LEN 20 61 #define UIP_ICMPH_LEN 4 63 #define UIP_IPUDPH_LEN (UIP_UDPH_LEN + UIP_IPH_LEN) 64 #define UIP_IPTCPH_LEN (UIP_TCPH_LEN + UIP_IPH_LEN) 65 #define UIP_TCPIP_HLEN UIP_IPTCPH_LEN 66 #define UIP_IPICMPH_LEN (UIP_IPH_LEN + UIP_ICMPH_LEN) 67 #define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN) 68 #if NETSTACK_CONF_WITH_IPV6 75 #define uip_l2_l3_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len) 76 #define uip_l2_l3_icmp_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN) 77 #define uip_l3_hdr_len (UIP_IPH_LEN + uip_ext_len) 78 #define uip_l3_icmp_hdr_len (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN) 83 #include "net/ipv6/uipbuf.h" 98 typedef union uip_ip6addr_t {
103 #if NETSTACK_CONF_WITH_IPV6 104 typedef uip_ip6addr_t uip_ipaddr_t;
111 #define UIP_802154_SHORTADDR_LEN 2 112 #define UIP_802154_LONGADDR_LEN 8 116 uint8_t
addr[UIP_802154_SHORTADDR_LEN];
120 uint8_t
addr[UIP_802154_LONGADDR_LEN];
134 #ifndef UIP_CONF_LL_802154 135 #define UIP_CONF_LL_802154 1 138 #if UIP_CONF_LL_802154 140 #if LINKADDR_SIZE == UIP_802154_LONGADDR_LEN 142 #elif LINKADDR_SIZE == UIP_802154_SHORTADDR_LEN 145 #error unsupported configuration of LINKADDR_SIZE 148 #define UIP_LLADDR_LEN LINKADDR_SIZE 150 #if UIP_CONF_LL_80211 154 #define UIP_LLADDR_LEN 6 159 #define UIP_LLADDR_LEN 6 200 #define uip_sethostaddr(addr) uip_ipaddr_copy(&uip_hostaddr, (addr)) 220 #define uip_gethostaddr(addr) uip_ipaddr_copy((addr), &uip_hostaddr) 232 #define uip_setdraddr(addr) uip_ipaddr_copy(&uip_draddr, (addr)) 244 #define uip_setnetmask(addr) uip_ipaddr_copy(&uip_netmask, (addr)) 255 #define uip_getdraddr(addr) uip_ipaddr_copy((addr), &uip_draddr) 265 #define uip_getnetmask(addr) uip_ipaddr_copy((addr), &uip_netmask) 351 #define uip_input() uip_process(UIP_DATA) 397 #define uip_periodic(conn) do { uip_conn = &uip_conns[conn]; \ 398 uip_process(UIP_TIMER); } while (0) 406 #define uip_conn_active(conn) (uip_conns[conn].tcpstateflags != UIP_CLOSED) 421 #define uip_periodic_conn(conn) do { uip_conn = conn; \ 422 uip_process(UIP_TIMER); } while (0) 435 #define uip_poll_conn(conn) do { uip_conn = conn; \ 436 uip_process(UIP_POLL_REQUEST); } while (0) 472 #define uip_udp_periodic(conn) do { uip_udp_conn = &uip_udp_conns[conn]; \ 473 uip_process(UIP_UDP_TIMER); } while(0) 489 #define uip_udp_periodic_conn(conn) do { uip_udp_conn = conn; \ 490 uip_process(UIP_UDP_TIMER); } while(0) 513 #define uip_buf (uip_aligned_buf.u8) 603 #define uip_outstanding(conn) ((conn)->len) 642 #define uip_datalen() uip_len 653 #define uip_urgdatalen() uip_urglen 662 #define uip_close() (uip_flags = UIP_CLOSE) 673 #define uip_abort() (uip_flags = UIP_ABORT) 683 #define uip_stop() (uip_conn->tcpstateflags |= UIP_STOPPED) 691 #define uip_stopped(conn) ((conn)->tcpstateflags & UIP_STOPPED) 702 #define uip_restart() do { uip_flags |= UIP_NEWDATA; \ 703 uip_conn->tcpstateflags &= ~UIP_STOPPED; \ 718 #define uip_udpconnection() (uip_conn == NULL) 729 #define uip_newdata() (uip_flags & UIP_NEWDATA) 740 #define uip_acked() (uip_flags & UIP_ACKDATA) 752 #define uip_connected() (uip_flags & UIP_CONNECTED) 762 #define uip_closed() (uip_flags & UIP_CLOSE) 772 #define uip_aborted() (uip_flags & UIP_ABORT) 782 #define uip_timedout() (uip_flags & UIP_TIMEDOUT) 794 #define uip_rexmit() (uip_flags & UIP_REXMIT) 808 #define uip_poll() (uip_flags & UIP_POLL) 816 #define uip_initialmss() (uip_conn->initialmss) 829 #define uip_mss() (uip_conn->mss) 867 #define uip_udp_remove(conn) (conn)->lport = 0 879 #define uip_udp_bind(conn, port) (conn)->lport = port 892 #define uip_udp_send(len) uip_send((char *)uip_appdata, len) 919 #define uip_ipaddr_to_quad(a) (a)->u8[0],(a)->u8[1],(a)->u8[2],(a)->u8[3] 947 #define uip_ipaddr(addr, addr0,addr1,addr2,addr3) do { \ 948 (addr)->u8[0] = addr0; \ 949 (addr)->u8[1] = addr1; \ 950 (addr)->u8[2] = addr2; \ 951 (addr)->u8[3] = addr3; \ 961 #define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) do { \ 962 (addr)->u16[0] = UIP_HTONS(addr0); \ 963 (addr)->u16[1] = UIP_HTONS(addr1); \ 964 (addr)->u16[2] = UIP_HTONS(addr2); \ 965 (addr)->u16[3] = UIP_HTONS(addr3); \ 966 (addr)->u16[4] = UIP_HTONS(addr4); \ 967 (addr)->u16[5] = UIP_HTONS(addr5); \ 968 (addr)->u16[6] = UIP_HTONS(addr6); \ 969 (addr)->u16[7] = UIP_HTONS(addr7); \ 979 #define uip_ip6addr_u8(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7,addr8,addr9,addr10,addr11,addr12,addr13,addr14,addr15) do { \ 980 (addr)->u8[0] = addr0; \ 981 (addr)->u8[1] = addr1; \ 982 (addr)->u8[2] = addr2; \ 983 (addr)->u8[3] = addr3; \ 984 (addr)->u8[4] = addr4; \ 985 (addr)->u8[5] = addr5; \ 986 (addr)->u8[6] = addr6; \ 987 (addr)->u8[7] = addr7; \ 988 (addr)->u8[8] = addr8; \ 989 (addr)->u8[9] = addr9; \ 990 (addr)->u8[10] = addr10; \ 991 (addr)->u8[11] = addr11; \ 992 (addr)->u8[12] = addr12; \ 993 (addr)->u8[13] = addr13; \ 994 (addr)->u8[14] = addr14; \ 995 (addr)->u8[15] = addr15; \ 1017 #ifndef uip_ipaddr_copy 1018 #define uip_ipaddr_copy(dest, src) (*(dest) = *(src)) 1020 #ifndef uip_ip4addr_copy 1021 #define uip_ip4addr_copy(dest, src) (*((uip_ip4addr_t *)dest) = *((uip_ip4addr_t *)src)) 1023 #ifndef uip_ip6addr_copy 1024 #define uip_ip6addr_copy(dest, src) (*((uip_ip6addr_t *)dest) = *((uip_ip6addr_t *)src)) 1047 #define uip_ip4addr_cmp(addr1, addr2) ((addr1)->u16[0] == (addr2)->u16[0] && \ 1048 (addr1)->u16[1] == (addr2)->u16[1]) 1049 #define uip_ip6addr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0) 1051 #if NETSTACK_CONF_WITH_IPV6 1052 #define uip_ipaddr_cmp(addr1, addr2) uip_ip6addr_cmp(addr1, addr2) 1054 #define uip_ipaddr_cmp(addr1, addr2) uip_ip4addr_cmp(addr1, addr2) 1082 #define uip_ipaddr_maskcmp(addr1, addr2, mask) \ 1083 (((((uint16_t *)addr1)[0] & ((uint16_t *)mask)[0]) == \ 1084 (((uint16_t *)addr2)[0] & ((uint16_t *)mask)[0])) && \ 1085 ((((uint16_t *)addr1)[1] & ((uint16_t *)mask)[1]) == \ 1086 (((uint16_t *)addr2)[1] & ((uint16_t *)mask)[1]))) 1088 #define uip_ipaddr_prefixcmp(addr1, addr2, length) (memcmp(addr1, addr2, length>>3) == 0) 1134 #define uip_ipaddr_mask(dest, src, mask) do { \ 1135 ((uint16_t *)dest)[0] = ((uint16_t *)src)[0] & ((uint16_t *)mask)[0]; \ 1136 ((uint16_t *)dest)[1] = ((uint16_t *)src)[1] & ((uint16_t *)mask)[1]; \ 1157 #define uip_ipaddr1(addr) ((addr)->u8[0]) 1177 #define uip_ipaddr2(addr) ((addr)->u8[1]) 1197 #define uip_ipaddr3(addr) ((addr)->u8[2]) 1217 #define uip_ipaddr4(addr) ((addr)->u8[3]) 1229 # if UIP_BYTE_ORDER == UIP_BIG_ENDIAN 1230 # define UIP_HTONS(n) (n) 1231 # define UIP_HTONL(n) (n) 1233 # define UIP_HTONS(n) (uint16_t)((((uint16_t) (n)) << 8) | (((uint16_t) (n)) >> 8)) 1234 # define UIP_HTONL(n) (((uint32_t)UIP_HTONS(n) << 16) | UIP_HTONS((uint32_t)(n) >> 16)) 1237 #error "UIP_HTONS already defined!" 1251 #define uip_ntohs uip_htons 1255 uint32_t uip_htonl(uint32_t val);
1258 #define uip_ntohl uip_htonl 1278 extern void *uip_urgdata;
1314 extern uint16_t uip_urglen, uip_surglen;
1323 #if NETSTACK_CONF_WITH_IPV6 1324 #define uip_clear_buf() { \ 1327 uipbuf_clear_attr();\ 1330 #define uip_clear_buf() { \ 1332 uipbuf_clear_attr();\ 1412 struct uip_fallback_interface {
1424 struct uip_icmp6_conn {
1425 uip_icmp6_appstate_t appstate;
1435 #if UIP_STATISTICS == 1 1437 #define UIP_STAT(s) s 1497 #if NETSTACK_CONF_WITH_IPV6 1522 #define UIP_ETHTYPE_ARP 0x0806 1523 #define UIP_ETHTYPE_IP 0x0800 1524 #define UIP_ETHTYPE_IPV6 0x86dd 1532 extern uint8_t uip_flags;
1541 #define UIP_ACKDATA 1 1545 #define UIP_NEWDATA 2 1547 #define UIP_REXMIT 4 1552 #define UIP_CLOSE 16 1557 #define UIP_ABORT 32 1562 #define UIP_CONNECTED 64 1567 #define UIP_TIMEDOUT 128 1599 #define UIP_POLL_REQUEST 3 1601 #define UIP_UDP_SEND_CONN 4 1605 #define UIP_UDP_TIMER 5 1609 #define UIP_CLOSED 0 1610 #define UIP_SYN_RCVD 1 1611 #define UIP_SYN_SENT 2 1612 #define UIP_ESTABLISHED 3 1613 #define UIP_FIN_WAIT_1 4 1614 #define UIP_FIN_WAIT_2 5 1615 #define UIP_CLOSING 6 1616 #define UIP_TIME_WAIT 7 1617 #define UIP_LAST_ACK 8 1618 #define UIP_TS_MASK 15 1620 #define UIP_STOPPED 16 1623 struct uip_tcpip_hdr {
1624 #if NETSTACK_CONF_WITH_IPV6 1631 uip_ip6addr_t srcipaddr, destipaddr;
1642 uip_ipaddr_t srcipaddr, destipaddr;
1659 struct uip_icmpip_hdr {
1660 #if NETSTACK_CONF_WITH_IPV6 1667 uip_ip6addr_t srcipaddr, destipaddr;
1678 uip_ipaddr_t srcipaddr, destipaddr;
1682 uint8_t type, icode;
1683 uint16_t icmpchksum;
1684 #if !NETSTACK_CONF_WITH_IPV6 1692 struct uip_udpip_hdr {
1693 #if NETSTACK_CONF_WITH_IPV6 1700 uip_ip6addr_t srcipaddr, destipaddr;
1711 uip_ipaddr_t srcipaddr, destipaddr;
1728 #if NETSTACK_CONF_WITH_IPV6 1735 uip_ip6addr_t srcipaddr, destipaddr;
1746 uip_ipaddr_t srcipaddr, destipaddr;
1772 typedef struct uip_ext_hdr {
1778 typedef struct uip_hbho_hdr {
1784 typedef struct uip_desto_hdr {
1799 typedef struct uip_routing_hdr {
1802 uint8_t routing_type;
1807 typedef struct uip_rpl_srh_hdr {
1810 uint8_t reserved[2];
1814 typedef struct uip_frag_hdr {
1817 uint16_t offsetresmore;
1825 typedef struct uip_ext_hdr_opt {
1831 typedef struct uip_ext_hdr_opt_padn {
1834 } uip_ext_hdr_opt_padn;
1837 typedef struct uip_ext_hdr_opt_rpl {
1842 uint16_t senderrank;
1843 } uip_ext_hdr_opt_rpl;
1846 struct uip_tcp_hdr {
1860 struct uip_icmp_hdr {
1861 uint8_t type, icode;
1862 uint16_t icmpchksum;
1863 #if !NETSTACK_CONF_WITH_IPV6 1870 struct uip_udp_hdr {
1892 #define UIP_APPDATA_SIZE (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN) 1893 #define UIP_APPDATA_PTR (void *)&uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN] 1895 #define UIP_PROTO_ICMP 1 1896 #define UIP_PROTO_TCP 6 1897 #define UIP_PROTO_UDP 17 1898 #define UIP_PROTO_ICMP6 58 1901 #if NETSTACK_CONF_WITH_IPV6 1904 #define UIP_PROTO_HBHO 0 1905 #define UIP_PROTO_DESTO 60 1906 #define UIP_PROTO_ROUTING 43 1907 #define UIP_PROTO_FRAG 44 1908 #define UIP_PROTO_NONE 59 1911 #define uip_is_proto_ext_hdr(proto) (proto == UIP_PROTO_HBHO || proto == UIP_PROTO_DESTO || proto == UIP_PROTO_ROUTING || proto == UIP_PROTO_FRAG || proto == UIP_PROTO_NONE) 1915 #define UIP_EXT_HDR_OPT_PAD1 0 1916 #define UIP_EXT_HDR_OPT_PADN 1 1917 #define UIP_EXT_HDR_OPT_RPL 0x63 1930 #define UIP_EXT_HDR_BITMAP_HBHO 0x01 1931 #define UIP_EXT_HDR_BITMAP_DESTO1 0x02 1932 #define UIP_EXT_HDR_BITMAP_ROUTING 0x04 1933 #define UIP_EXT_HDR_BITMAP_FRAG 0x08 1934 #define UIP_EXT_HDR_BITMAP_AH 0x10 1935 #define UIP_EXT_HDR_BITMAP_ESP 0x20 1936 #define UIP_EXT_HDR_BITMAP_DESTO2 0x40 1944 extern const uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
1946 extern uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
1948 extern const uip_ipaddr_t uip_broadcast_addr;
1949 extern const uip_ipaddr_t uip_all_zeroes_addr;
1951 #if UIP_FIXEDETHADDR 1960 #if NETSTACK_CONF_WITH_IPV6 1962 #define UIP_LLPREF_LEN 10 1968 #define uip_is_addr_loopback(a) \ 1969 ((((a)->u16[0]) == 0) && \ 1970 (((a)->u16[1]) == 0) && \ 1971 (((a)->u16[2]) == 0) && \ 1972 (((a)->u16[3]) == 0) && \ 1973 (((a)->u16[4]) == 0) && \ 1974 (((a)->u16[5]) == 0) && \ 1975 (((a)->u16[6]) == 0) && \ 1976 (((a)->u8[14]) == 0) && \ 1977 (((a)->u8[15]) == 0x01)) 1982 #define uip_is_addr_unspecified(a) \ 1983 ((((a)->u16[0]) == 0) && \ 1984 (((a)->u16[1]) == 0) && \ 1985 (((a)->u16[2]) == 0) && \ 1986 (((a)->u16[3]) == 0) && \ 1987 (((a)->u16[4]) == 0) && \ 1988 (((a)->u16[5]) == 0) && \ 1989 (((a)->u16[6]) == 0) && \ 1990 (((a)->u16[7]) == 0)) 1993 #define uip_is_addr_linklocal_allnodes_mcast(a) \ 1994 ((((a)->u8[0]) == 0xff) && \ 1995 (((a)->u8[1]) == 0x02) && \ 1996 (((a)->u16[1]) == 0) && \ 1997 (((a)->u16[2]) == 0) && \ 1998 (((a)->u16[3]) == 0) && \ 1999 (((a)->u16[4]) == 0) && \ 2000 (((a)->u16[5]) == 0) && \ 2001 (((a)->u16[6]) == 0) && \ 2002 (((a)->u8[14]) == 0) && \ 2003 (((a)->u8[15]) == 0x01)) 2006 #define uip_is_addr_linklocal_allrouters_mcast(a) \ 2007 ((((a)->u8[0]) == 0xff) && \ 2008 (((a)->u8[1]) == 0x02) && \ 2009 (((a)->u16[1]) == 0) && \ 2010 (((a)->u16[2]) == 0) && \ 2011 (((a)->u16[3]) == 0) && \ 2012 (((a)->u16[4]) == 0) && \ 2013 (((a)->u16[5]) == 0) && \ 2014 (((a)->u16[6]) == 0) && \ 2015 (((a)->u8[14]) == 0) && \ 2016 (((a)->u8[15]) == 0x02)) 2023 #define uip_is_addr_linklocal(a) \ 2024 ((a)->u8[0] == 0xfe && \ 2028 #define uip_create_unspecified(a) uip_ip6addr(a, 0, 0, 0, 0, 0, 0, 0, 0) 2031 #define uip_create_linklocal_allnodes_mcast(a) uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0001) 2034 #define uip_create_linklocal_allrouters_mcast(a) uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0002) 2035 #define uip_create_linklocal_prefix(addr) do { \ 2036 (addr)->u16[0] = UIP_HTONS(0xfe80); \ 2037 (addr)->u16[1] = 0; \ 2038 (addr)->u16[2] = 0; \ 2039 (addr)->u16[3] = 0; \ 2046 #define uip_is_addr_solicited_node(a) \ 2047 ((((a)->u8[0]) == 0xFF) && \ 2048 (((a)->u8[1]) == 0x02) && \ 2049 (((a)->u16[1]) == 0x00) && \ 2050 (((a)->u16[2]) == 0x00) && \ 2051 (((a)->u16[3]) == 0x00) && \ 2052 (((a)->u16[4]) == 0x00) && \ 2053 (((a)->u8[10]) == 0x00) && \ 2054 (((a)->u8[11]) == 0x01) && \ 2055 (((a)->u8[12]) == 0xFF)) 2061 #define uip_create_solicited_node(a, b) \ 2062 (((b)->u8[0]) = 0xFF); \ 2063 (((b)->u8[1]) = 0x02); \ 2064 (((b)->u16[1]) = 0); \ 2065 (((b)->u16[2]) = 0); \ 2066 (((b)->u16[3]) = 0); \ 2067 (((b)->u16[4]) = 0); \ 2068 (((b)->u8[10]) = 0); \ 2069 (((b)->u8[11]) = 0x01); \ 2070 (((b)->u8[12]) = 0xFF); \ 2071 (((b)->u8[13]) = ((a)->u8[13])); \ 2072 (((b)->u16[7]) = ((a)->u16[7])) 2079 #if UIP_CONF_LL_802154 2080 #define uip_is_addr_mac_addr_based(a, m) \ 2081 ((((a)->u8[8]) == (((m)->addr[0]) ^ 0x02)) && \ 2082 (((a)->u8[9]) == (m)->addr[1]) && \ 2083 (((a)->u8[10]) == (m)->addr[2]) && \ 2084 (((a)->u8[11]) == (m)->addr[3]) && \ 2085 (((a)->u8[12]) == (m)->addr[4]) && \ 2086 (((a)->u8[13]) == (m)->addr[5]) && \ 2087 (((a)->u8[14]) == (m)->addr[6]) && \ 2088 (((a)->u8[15]) == (m)->addr[7])) 2091 #define uip_is_addr_mac_addr_based(a, m) \ 2092 ((((a)->u8[8]) == (((m)->addr[0]) | 0x02)) && \ 2093 (((a)->u8[9]) == (m)->addr[1]) && \ 2094 (((a)->u8[10]) == (m)->addr[2]) && \ 2095 (((a)->u8[11]) == 0xff) && \ 2096 (((a)->u8[12]) == 0xfe) && \ 2097 (((a)->u8[13]) == (m)->addr[3]) && \ 2098 (((a)->u8[14]) == (m)->addr[4]) && \ 2099 (((a)->u8[15]) == (m)->addr[5])) 2107 #define uip_is_addr_mcast(a) \ 2108 (((a)->u8[0]) == 0xFF) 2114 #define uip_is_addr_mcast_global(a) \ 2115 ((((a)->u8[0]) == 0xFF) && \ 2116 (((a)->u8[1] & 0x0F) == 0x0E)) 2124 #define uip_is_addr_mcast_non_routable(a) \ 2125 ((((a)->u8[0]) == 0xFF) && \ 2126 (((a)->u8[1] & 0x0F) <= 0x02)) 2135 #define uip_is_addr_mcast_routable(a) \ 2136 ((((a)->u8[0]) == 0xFF) && \ 2137 (((a)->u8[1] & 0x0F) > 0x02)) 2143 #define uip_is_mcast_group_id_all_nodes(a) \ 2144 ((((a)->u16[1]) == 0) && \ 2145 (((a)->u16[2]) == 0) && \ 2146 (((a)->u16[3]) == 0) && \ 2147 (((a)->u16[4]) == 0) && \ 2148 (((a)->u16[5]) == 0) && \ 2149 (((a)->u16[6]) == 0) && \ 2150 (((a)->u8[14]) == 0) && \ 2151 (((a)->u8[15]) == 1)) 2157 #define uip_is_mcast_group_id_all_routers(a) \ 2158 ((((a)->u16[1]) == 0) && \ 2159 (((a)->u16[2]) == 0) && \ 2160 (((a)->u16[3]) == 0) && \ 2161 (((a)->u16[4]) == 0) && \ 2162 (((a)->u16[5]) == 0) && \ 2163 (((a)->u16[6]) == 0) && \ 2164 (((a)->u8[14]) == 0) && \ 2165 (((a)->u8[15]) == 2)) 2172 #define uip_are_solicited_bytes_equal(a, b) \ 2173 ((((a)->u8[13]) == ((b)->u8[13])) && \ 2174 (((a)->u8[14]) == ((b)->u8[14])) && \ 2175 (((a)->u8[15]) == ((b)->u8[15]))) 2185 #define UIP_FW_LOCAL 0 2199 #define UIP_FW_FORWARDED 1 2207 #define UIP_FW_ZEROLEN 2 2215 #define UIP_FW_TOOLARGE 3 2223 #define UIP_FW_NOROUTE 4 2231 #define UIP_FW_DROPPED 5 2249 uint16_t
uip_chksum(uint16_t *data, uint16_t len);
uip_lladdr_t uip_lladdr
Host L2 address.
struct uip_udp_conn * uip_udp_new(const uip_ipaddr_t *ripaddr, uint16_t rport)
Set up a new UDP connection.
void uip_reass_over(void)
Abandon the reassembly of the current packet.
Header for the Contiki/uIP interface.
uip_stats_t drop
Number of dropped packets at the IP layer.
Representation of a uIP TCP connection.
uint16_t uip_len
The length of the packet in the uip_buf buffer.
static uip_ds6_addr_t * addr
Pointer to a nbr cache entry.
void uip_process(uint8_t flag)
process the options within a hop by hop or destination option header
#define UIP_TCP_CONNS
The maximum number of simultaneously open TCP connections.
Header file for the link-layer address representation
uip_stats_t sent
Number of sent packets at the IP layer.
#define UIP_BUFSIZE
The size of the uIP packet buffer.
#define UIP_UDP_CONNS
The maximum amount of concurrent UDP connections.
uint16_t uip_chksum(uint16_t *data, uint16_t len)
Calculate the Internet checksum over a buffer.
uip_ipaddr_t ripaddr
The IP address of the remote host.
struct uip_icmp6_conn uip_icmp6_conns
single possible icmpv6 "connection"
uip_stats_t recv
Number of received packets at the IP layer.
uip_stats_t forwarded
Number of forwarded packets at the IP layer.
void uip_unlisten(uint16_t port)
Stop listening to the specified port.
Representation of an IP address.
uint8_t sa
Retransmission time-out calculation state variable.
static uint8_t output(const linkaddr_t *localdest)
Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
void uip_setipid(uint16_t id)
uIP initialization function.
uip_stats_t protoerr
Number of packets dropped because they were neither ICMP, UDP nor TCP.
uip_stats_t rst
Number of received TCP RST (reset) segments.
uint16_t uip_htons(uint16_t val)
Convert a 16-bit quantity from host byte order to network byte order.
uint16_t lport
The local port number in network byte order.
uint16_t rport
The local remote TCP port, in network byte order.
Configuration options for uIP.
uint8_t rto
Retransmission time-out.
uint16_t uip_ipchksum(void)
Calculate the IP header checksum of the packet header in uip_buf.
void uip_init(void)
uIP initialization function.
uint8_t uip_acc32[4]
4-byte array used for the 32-bit sequence number calculations.
uip_stats_t ackerr
Number of TCP segments with a bad ACK number.
The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1...
struct tcpip_uipstate uip_udp_appstate_t
The type of the application state that is to be stored in the uip_conn structure. ...
uint8_t tcpstateflags
TCP state and flags.
uip_stats_t rexmit
Number of retransmitted TCP segments.
uint16_t lport
The local TCP port, in network byte order.
uip_stats_t synrst
Number of SYNs for closed ports, triggering a RST.
uip_stats_t syndrop
Number of dropped SYNs because too few connections were available.
void uip_listen(uint16_t port)
Start listening to the specified port.
struct uip_eth_addr uip_eth_addr
802.3 address
union uip_ip4addr_t uip_ip4addr_t
Representation of an IP address.
uip_stats_t typeerr
Number of ICMP packets with a wrong type.
struct uip_802154_shortaddr uip_802154_shortaddr
16 bit 802.15.4 address
uint8_t nrtx
The number of retransmissions for the last segment sent.
uint16_t mss
Current maximum segment size for the connection.
uint16_t initialmss
Initial maximum segment size for the connection.
void uip_send(const void *data, int len)
Send data on the current connection.
uip_stats_t chkerr
Number of packets dropped due to IP checksum errors.
uint8_t uip_ext_len
The length of the extension headers.
uip_stats_t lblenerr
Number of packets dropped due to wrong IP length, low byte.
uint8_t timer
The retransmission timer.
uint16_t uip_icmp6chksum(void)
Calculate the ICMP checksum of the packet in uip_buf.
struct uip_802154_longaddr uip_802154_longaddr
64 bit 802.15.4 address
uip_ipaddr_t ripaddr
The IP address of the remote peer.
uint16_t uip_tcpchksum(void)
Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
struct uip_80211_addr uip_80211_addr
802.11 address
uip_buf_t uip_aligned_buf
Packet buffer for incoming and outgoing packets.
uip_stats_t hblenerr
Number of packets dropped due to wrong IP length, high byte.
struct uip_conn * uip_conn
Pointer to the current TCP connection.
uip_stats_t fragerr
Number of packets dropped because they were IP fragments.
struct uip_conn * uip_connect(const uip_ipaddr_t *ripaddr, uint16_t port)
Connect to a remote host using TCP.
uint8_t sv
Retransmission time-out calculation state variable.
uint8_t ttl
Default time-to-live.
uint16_t len
Length of the data that was previously sent.
uint16_t uip_udpchksum(void)
Calculate the UDP checksum of the packet in uip_buf and uip_appdata.
struct tcpip_uipstate uip_tcp_appstate_t
The type of the application state that is to be stored in the uip_conn structure. ...
void * uip_appdata
Pointer to the application data in the packet buffer.
uint16_t rport
The remote port number in network byte order.
struct uip_udp_conn * uip_udp_conn
The current UDP connection.
uip_stats_t vhlerr
Number of packets dropped due to wrong IP version or header length.
Representation of a uIP UDP connection.
uip_udp_appstate_t appstate
The application state.