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) 66 #define uip_l3_icmp_hdr_len (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN) 71 #define UIP_IP_BUF ((struct uip_ip_hdr *)uip_buf) 72 #define UIP_IP_PAYLOAD(ext) ((unsigned char *)uip_buf + UIP_IPH_LEN + (ext)) 77 #define UIP_ICMP_BUF ((struct uip_icmp_hdr *)UIP_IP_PAYLOAD(uip_ext_len)) 78 #define UIP_ICMP_PAYLOAD ((unsigned char *)UIP_IP_PAYLOAD(uip_ext_len) + UIP_ICMPH_LEN) 79 #define UIP_UDP_BUF ((struct uip_udp_hdr *)UIP_IP_PAYLOAD(uip_ext_len)) 80 #define UIP_UDP_PAYLOAD ((unsigned char *)UIP_IP_PAYLOAD(uip_ext_len) + UIP_UDPH_LEN) 81 #define UIP_TCP_BUF ((struct uip_tcp_hdr *)UIP_IP_PAYLOAD(uip_ext_len)) 82 #define UIP_TCP_PAYLOAD ((unsigned char *)UIP_IP_PAYLOAD(uip_ext_len) + UIP_TCPH_LEN) 85 #include "net/ipv6/uipbuf.h" 100 typedef union uip_ip6addr_t {
105 typedef uip_ip6addr_t uip_ipaddr_t;
108 #define UIP_802154_SHORTADDR_LEN 2 109 #define UIP_802154_LONGADDR_LEN 8 113 uint8_t
addr[UIP_802154_SHORTADDR_LEN];
117 uint8_t
addr[UIP_802154_LONGADDR_LEN];
131 #ifndef UIP_CONF_LL_802154 132 #define UIP_CONF_LL_802154 1 135 #if UIP_CONF_LL_802154 137 #if LINKADDR_SIZE == UIP_802154_LONGADDR_LEN 139 #elif LINKADDR_SIZE == UIP_802154_SHORTADDR_LEN 142 #error unsupported configuration of LINKADDR_SIZE 145 #define UIP_LLADDR_LEN LINKADDR_SIZE 147 #if UIP_CONF_LL_80211 151 #define UIP_LLADDR_LEN 6 156 #define UIP_LLADDR_LEN 6 197 #define uip_sethostaddr(addr) uip_ipaddr_copy(&uip_hostaddr, (addr)) 217 #define uip_gethostaddr(addr) uip_ipaddr_copy((addr), &uip_hostaddr) 229 #define uip_setdraddr(addr) uip_ipaddr_copy(&uip_draddr, (addr)) 241 #define uip_setnetmask(addr) uip_ipaddr_copy(&uip_netmask, (addr)) 252 #define uip_getdraddr(addr) uip_ipaddr_copy((addr), &uip_draddr) 262 #define uip_getnetmask(addr) uip_ipaddr_copy((addr), &uip_netmask) 348 #define uip_input() uip_process(UIP_DATA) 394 #define uip_periodic(conn) do { uip_conn = &uip_conns[conn]; \ 395 uip_process(UIP_TIMER); } while (0) 403 #define uip_conn_active(conn) (uip_conns[conn].tcpstateflags != UIP_CLOSED) 418 #define uip_periodic_conn(conn) do { uip_conn = conn; \ 419 uip_process(UIP_TIMER); } while (0) 432 #define uip_poll_conn(conn) do { uip_conn = conn; \ 433 uip_process(UIP_POLL_REQUEST); } while (0) 469 #define uip_udp_periodic(conn) do { uip_udp_conn = &uip_udp_conns[conn]; \ 470 uip_process(UIP_UDP_TIMER); } while(0) 486 #define uip_udp_periodic_conn(conn) do { uip_udp_conn = conn; \ 487 uip_process(UIP_UDP_TIMER); } while(0) 510 #define uip_buf (uip_aligned_buf.u8) 600 #define uip_outstanding(conn) ((conn)->len) 639 #define uip_datalen() uip_len 650 #define uip_urgdatalen() uip_urglen 659 #define uip_close() (uip_flags = UIP_CLOSE) 670 #define uip_abort() (uip_flags = UIP_ABORT) 680 #define uip_stop() (uip_conn->tcpstateflags |= UIP_STOPPED) 688 #define uip_stopped(conn) ((conn)->tcpstateflags & UIP_STOPPED) 699 #define uip_restart() do { uip_flags |= UIP_NEWDATA; \ 700 uip_conn->tcpstateflags &= ~UIP_STOPPED; \ 715 #define uip_udpconnection() (uip_conn == NULL) 726 #define uip_newdata() (uip_flags & UIP_NEWDATA) 737 #define uip_acked() (uip_flags & UIP_ACKDATA) 749 #define uip_connected() (uip_flags & UIP_CONNECTED) 759 #define uip_closed() (uip_flags & UIP_CLOSE) 769 #define uip_aborted() (uip_flags & UIP_ABORT) 779 #define uip_timedout() (uip_flags & UIP_TIMEDOUT) 791 #define uip_rexmit() (uip_flags & UIP_REXMIT) 805 #define uip_poll() (uip_flags & UIP_POLL) 813 #define uip_initialmss() (uip_conn->initialmss) 826 #define uip_mss() (uip_conn->mss) 864 #define uip_udp_remove(conn) (conn)->lport = 0 876 #define uip_udp_bind(conn, port) (conn)->lport = port 889 #define uip_udp_send(len) uip_send((char *)uip_appdata, len) 916 #define uip_ipaddr_to_quad(a) (a)->u8[0],(a)->u8[1],(a)->u8[2],(a)->u8[3] 944 #define uip_ipaddr(addr, addr0,addr1,addr2,addr3) do { \ 945 (addr)->u8[0] = addr0; \ 946 (addr)->u8[1] = addr1; \ 947 (addr)->u8[2] = addr2; \ 948 (addr)->u8[3] = addr3; \ 958 #define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) do { \ 959 (addr)->u16[0] = UIP_HTONS(addr0); \ 960 (addr)->u16[1] = UIP_HTONS(addr1); \ 961 (addr)->u16[2] = UIP_HTONS(addr2); \ 962 (addr)->u16[3] = UIP_HTONS(addr3); \ 963 (addr)->u16[4] = UIP_HTONS(addr4); \ 964 (addr)->u16[5] = UIP_HTONS(addr5); \ 965 (addr)->u16[6] = UIP_HTONS(addr6); \ 966 (addr)->u16[7] = UIP_HTONS(addr7); \ 976 #define uip_ip6addr_u8(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7,addr8,addr9,addr10,addr11,addr12,addr13,addr14,addr15) do { \ 977 (addr)->u8[0] = addr0; \ 978 (addr)->u8[1] = addr1; \ 979 (addr)->u8[2] = addr2; \ 980 (addr)->u8[3] = addr3; \ 981 (addr)->u8[4] = addr4; \ 982 (addr)->u8[5] = addr5; \ 983 (addr)->u8[6] = addr6; \ 984 (addr)->u8[7] = addr7; \ 985 (addr)->u8[8] = addr8; \ 986 (addr)->u8[9] = addr9; \ 987 (addr)->u8[10] = addr10; \ 988 (addr)->u8[11] = addr11; \ 989 (addr)->u8[12] = addr12; \ 990 (addr)->u8[13] = addr13; \ 991 (addr)->u8[14] = addr14; \ 992 (addr)->u8[15] = addr15; \ 1014 #ifndef uip_ipaddr_copy 1015 #define uip_ipaddr_copy(dest, src) (*(dest) = *(src)) 1017 #ifndef uip_ip4addr_copy 1018 #define uip_ip4addr_copy(dest, src) (*((uip_ip4addr_t *)dest) = *((uip_ip4addr_t *)src)) 1020 #ifndef uip_ip6addr_copy 1021 #define uip_ip6addr_copy(dest, src) (*((uip_ip6addr_t *)dest) = *((uip_ip6addr_t *)src)) 1044 #define uip_ip4addr_cmp(addr1, addr2) ((addr1)->u16[0] == (addr2)->u16[0] && \ 1045 (addr1)->u16[1] == (addr2)->u16[1]) 1046 #define uip_ip6addr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0) 1048 #define uip_ipaddr_cmp(addr1, addr2) uip_ip6addr_cmp(addr1, addr2) 1075 #define uip_ipaddr_maskcmp(addr1, addr2, mask) \ 1076 (((((uint16_t *)addr1)[0] & ((uint16_t *)mask)[0]) == \ 1077 (((uint16_t *)addr2)[0] & ((uint16_t *)mask)[0])) && \ 1078 ((((uint16_t *)addr1)[1] & ((uint16_t *)mask)[1]) == \ 1079 (((uint16_t *)addr2)[1] & ((uint16_t *)mask)[1]))) 1081 #define uip_ipaddr_prefixcmp(addr1, addr2, length) (memcmp(addr1, addr2, length>>3) == 0) 1127 #define uip_ipaddr_mask(dest, src, mask) do { \ 1128 ((uint16_t *)dest)[0] = ((uint16_t *)src)[0] & ((uint16_t *)mask)[0]; \ 1129 ((uint16_t *)dest)[1] = ((uint16_t *)src)[1] & ((uint16_t *)mask)[1]; \ 1150 #define uip_ipaddr1(addr) ((addr)->u8[0]) 1170 #define uip_ipaddr2(addr) ((addr)->u8[1]) 1190 #define uip_ipaddr3(addr) ((addr)->u8[2]) 1210 #define uip_ipaddr4(addr) ((addr)->u8[3]) 1222 # if UIP_BYTE_ORDER == UIP_BIG_ENDIAN 1223 # define UIP_HTONS(n) (n) 1224 # define UIP_HTONL(n) (n) 1226 # define UIP_HTONS(n) (uint16_t)((((uint16_t) (n)) << 8) | (((uint16_t) (n)) >> 8)) 1227 # define UIP_HTONL(n) (((uint32_t)UIP_HTONS(n) << 16) | UIP_HTONS((uint32_t)(n) >> 16)) 1230 #error "UIP_HTONS already defined!" 1244 #define uip_ntohs uip_htons 1248 uint32_t uip_htonl(uint32_t val);
1251 #define uip_ntohl uip_htonl 1271 extern void *uip_urgdata;
1311 extern uint16_t uip_urglen, uip_surglen;
1390 struct uip_fallback_interface {
1402 struct uip_icmp6_conn {
1403 uip_icmp6_appstate_t appstate;
1413 #if UIP_STATISTICS == 1 1415 #define UIP_STAT(s) s 1498 #define UIP_ETHTYPE_ARP 0x0806 1499 #define UIP_ETHTYPE_IP 0x0800 1500 #define UIP_ETHTYPE_IPV6 0x86dd 1508 extern uint8_t uip_flags;
1517 #define UIP_ACKDATA 1 1521 #define UIP_NEWDATA 2 1523 #define UIP_REXMIT 4 1528 #define UIP_CLOSE 16 1533 #define UIP_ABORT 32 1538 #define UIP_CONNECTED 64 1543 #define UIP_TIMEDOUT 128 1575 #define UIP_POLL_REQUEST 3 1577 #define UIP_UDP_SEND_CONN 4 1581 #define UIP_UDP_TIMER 5 1585 #define UIP_CLOSED 0 1586 #define UIP_SYN_RCVD 1 1587 #define UIP_SYN_SENT 2 1588 #define UIP_ESTABLISHED 3 1589 #define UIP_FIN_WAIT_1 4 1590 #define UIP_FIN_WAIT_2 5 1591 #define UIP_CLOSING 6 1592 #define UIP_TIME_WAIT 7 1593 #define UIP_LAST_ACK 8 1594 #define UIP_TS_MASK 15 1596 #define UIP_STOPPED 16 1612 uip_ip6addr_t srcipaddr, destipaddr;
1637 typedef struct uip_ext_hdr {
1643 typedef struct uip_hbho_hdr {
1649 typedef struct uip_desto_hdr {
1664 typedef struct uip_routing_hdr {
1667 uint8_t routing_type;
1672 typedef struct uip_rpl_srh_hdr {
1675 uint8_t reserved[2];
1679 typedef struct uip_frag_hdr {
1682 uint16_t offsetresmore;
1690 typedef struct uip_ext_hdr_opt {
1696 typedef struct uip_ext_hdr_opt_padn {
1699 } uip_ext_hdr_opt_padn;
1702 typedef struct uip_ext_hdr_opt_rpl {
1707 uint16_t senderrank;
1708 } uip_ext_hdr_opt_rpl;
1711 struct uip_tcp_hdr {
1725 struct uip_icmp_hdr {
1726 uint8_t type, icode;
1727 uint16_t icmpchksum;
1732 struct uip_udp_hdr {
1754 #define UIP_APPDATA_SIZE (UIP_BUFSIZE - UIP_IPTCPH_LEN) 1756 #define UIP_PROTO_ICMP 1 1757 #define UIP_PROTO_TCP 6 1758 #define UIP_PROTO_UDP 17 1759 #define UIP_PROTO_ICMP6 58 1764 #define UIP_PROTO_HBHO 0 1765 #define UIP_PROTO_DESTO 60 1766 #define UIP_PROTO_ROUTING 43 1767 #define UIP_PROTO_FRAG 44 1768 #define UIP_PROTO_NONE 59 1771 #define uip_is_proto_ext_hdr(proto) ((proto) != UIP_PROTO_TCP && (proto) != UIP_PROTO_UDP && (proto) != UIP_PROTO_ICMP6) 1775 #define UIP_EXT_HDR_OPT_PAD1 0 1776 #define UIP_EXT_HDR_OPT_PADN 1 1777 #define UIP_EXT_HDR_OPT_RPL 0x63 1778 #define UIP_EXT_HDR_OPT_MPL 0x6D 1791 #define UIP_EXT_HDR_BITMAP_HBHO 0x01 1792 #define UIP_EXT_HDR_BITMAP_DESTO1 0x02 1793 #define UIP_EXT_HDR_BITMAP_ROUTING 0x04 1794 #define UIP_EXT_HDR_BITMAP_FRAG 0x08 1795 #define UIP_EXT_HDR_BITMAP_AH 0x10 1796 #define UIP_EXT_HDR_BITMAP_ESP 0x20 1797 #define UIP_EXT_HDR_BITMAP_DESTO2 0x40 1802 extern const uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
1804 extern uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
1806 extern const uip_ipaddr_t uip_broadcast_addr;
1807 extern const uip_ipaddr_t uip_all_zeroes_addr;
1809 #if UIP_FIXEDETHADDR 1816 #define UIP_LLPREF_LEN 10 1822 #define uip_is_addr_loopback(a) \ 1823 ((((a)->u16[0]) == 0) && \ 1824 (((a)->u16[1]) == 0) && \ 1825 (((a)->u16[2]) == 0) && \ 1826 (((a)->u16[3]) == 0) && \ 1827 (((a)->u16[4]) == 0) && \ 1828 (((a)->u16[5]) == 0) && \ 1829 (((a)->u16[6]) == 0) && \ 1830 (((a)->u8[14]) == 0) && \ 1831 (((a)->u8[15]) == 0x01)) 1836 #define uip_is_addr_unspecified(a) \ 1837 ((((a)->u16[0]) == 0) && \ 1838 (((a)->u16[1]) == 0) && \ 1839 (((a)->u16[2]) == 0) && \ 1840 (((a)->u16[3]) == 0) && \ 1841 (((a)->u16[4]) == 0) && \ 1842 (((a)->u16[5]) == 0) && \ 1843 (((a)->u16[6]) == 0) && \ 1844 (((a)->u16[7]) == 0)) 1847 #define uip_is_addr_linklocal_allnodes_mcast(a) \ 1848 ((((a)->u8[0]) == 0xff) && \ 1849 (((a)->u8[1]) == 0x02) && \ 1850 (((a)->u16[1]) == 0) && \ 1851 (((a)->u16[2]) == 0) && \ 1852 (((a)->u16[3]) == 0) && \ 1853 (((a)->u16[4]) == 0) && \ 1854 (((a)->u16[5]) == 0) && \ 1855 (((a)->u16[6]) == 0) && \ 1856 (((a)->u8[14]) == 0) && \ 1857 (((a)->u8[15]) == 0x01)) 1860 #define uip_is_addr_linklocal_allrouters_mcast(a) \ 1861 ((((a)->u8[0]) == 0xff) && \ 1862 (((a)->u8[1]) == 0x02) && \ 1863 (((a)->u16[1]) == 0) && \ 1864 (((a)->u16[2]) == 0) && \ 1865 (((a)->u16[3]) == 0) && \ 1866 (((a)->u16[4]) == 0) && \ 1867 (((a)->u16[5]) == 0) && \ 1868 (((a)->u16[6]) == 0) && \ 1869 (((a)->u8[14]) == 0) && \ 1870 (((a)->u8[15]) == 0x02)) 1877 #define uip_is_addr_linklocal(a) \ 1878 ((a)->u8[0] == 0xfe && \ 1882 #define uip_create_unspecified(a) uip_ip6addr(a, 0, 0, 0, 0, 0, 0, 0, 0) 1885 #define uip_create_linklocal_allnodes_mcast(a) uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0001) 1888 #define uip_create_linklocal_allrouters_mcast(a) uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0002) 1889 #define uip_create_linklocal_prefix(addr) do { \ 1890 (addr)->u16[0] = UIP_HTONS(0xfe80); \ 1891 (addr)->u16[1] = 0; \ 1892 (addr)->u16[2] = 0; \ 1893 (addr)->u16[3] = 0; \ 1900 #define uip_is_addr_solicited_node(a) \ 1901 ((((a)->u8[0]) == 0xFF) && \ 1902 (((a)->u8[1]) == 0x02) && \ 1903 (((a)->u16[1]) == 0x00) && \ 1904 (((a)->u16[2]) == 0x00) && \ 1905 (((a)->u16[3]) == 0x00) && \ 1906 (((a)->u16[4]) == 0x00) && \ 1907 (((a)->u8[10]) == 0x00) && \ 1908 (((a)->u8[11]) == 0x01) && \ 1909 (((a)->u8[12]) == 0xFF)) 1915 #define uip_create_solicited_node(a, b) \ 1916 (((b)->u8[0]) = 0xFF); \ 1917 (((b)->u8[1]) = 0x02); \ 1918 (((b)->u16[1]) = 0); \ 1919 (((b)->u16[2]) = 0); \ 1920 (((b)->u16[3]) = 0); \ 1921 (((b)->u16[4]) = 0); \ 1922 (((b)->u8[10]) = 0); \ 1923 (((b)->u8[11]) = 0x01); \ 1924 (((b)->u8[12]) = 0xFF); \ 1925 (((b)->u8[13]) = ((a)->u8[13])); \ 1926 (((b)->u16[7]) = ((a)->u16[7])) 1933 #if UIP_CONF_LL_802154 1934 #define uip_is_addr_mac_addr_based(a, m) \ 1935 ((((a)->u8[8]) == (((m)->addr[0]) ^ 0x02)) && \ 1936 (((a)->u8[9]) == (m)->addr[1]) && \ 1937 (((a)->u8[10]) == (m)->addr[2]) && \ 1938 (((a)->u8[11]) == (m)->addr[3]) && \ 1939 (((a)->u8[12]) == (m)->addr[4]) && \ 1940 (((a)->u8[13]) == (m)->addr[5]) && \ 1941 (((a)->u8[14]) == (m)->addr[6]) && \ 1942 (((a)->u8[15]) == (m)->addr[7])) 1945 #define uip_is_addr_mac_addr_based(a, m) \ 1946 ((((a)->u8[8]) == (((m)->addr[0]) | 0x02)) && \ 1947 (((a)->u8[9]) == (m)->addr[1]) && \ 1948 (((a)->u8[10]) == (m)->addr[2]) && \ 1949 (((a)->u8[11]) == 0xff) && \ 1950 (((a)->u8[12]) == 0xfe) && \ 1951 (((a)->u8[13]) == (m)->addr[3]) && \ 1952 (((a)->u8[14]) == (m)->addr[4]) && \ 1953 (((a)->u8[15]) == (m)->addr[5])) 1961 #define uip_is_addr_mcast(a) \ 1962 (((a)->u8[0]) == 0xFF) 1968 #define uip_is_addr_mcast_global(a) \ 1969 ((((a)->u8[0]) == 0xFF) && \ 1970 (((a)->u8[1] & 0x0F) == 0x0E)) 1978 #define uip_is_addr_mcast_non_routable(a) \ 1979 ((((a)->u8[0]) == 0xFF) && \ 1980 (((a)->u8[1] & 0x0F) <= 0x02)) 1989 #define uip_is_addr_mcast_routable(a) \ 1990 ((((a)->u8[0]) == 0xFF) && \ 1991 (((a)->u8[1] & 0x0F) > 0x02)) 1997 #define uip_is_mcast_group_id_all_nodes(a) \ 1998 ((((a)->u16[1]) == 0) && \ 1999 (((a)->u16[2]) == 0) && \ 2000 (((a)->u16[3]) == 0) && \ 2001 (((a)->u16[4]) == 0) && \ 2002 (((a)->u16[5]) == 0) && \ 2003 (((a)->u16[6]) == 0) && \ 2004 (((a)->u8[14]) == 0) && \ 2005 (((a)->u8[15]) == 1)) 2011 #define uip_is_mcast_group_id_all_routers(a) \ 2012 ((((a)->u16[1]) == 0) && \ 2013 (((a)->u16[2]) == 0) && \ 2014 (((a)->u16[3]) == 0) && \ 2015 (((a)->u16[4]) == 0) && \ 2016 (((a)->u16[5]) == 0) && \ 2017 (((a)->u16[6]) == 0) && \ 2018 (((a)->u8[14]) == 0) && \ 2019 (((a)->u8[15]) == 2)) 2026 #define uip_are_solicited_bytes_equal(a, b) \ 2027 ((((a)->u8[13]) == ((b)->u8[13])) && \ 2028 (((a)->u8[14]) == ((b)->u8[14])) && \ 2029 (((a)->u8[15]) == ((b)->u8[15]))) 2037 #define UIP_FW_LOCAL 0 2051 #define UIP_FW_FORWARDED 1 2059 #define UIP_FW_ZEROLEN 2 2067 #define UIP_FW_TOOLARGE 3 2075 #define UIP_FW_NOROUTE 4 2083 #define UIP_FW_DROPPED 5 2101 uint16_t
uip_chksum(uint16_t *data, uint16_t len);
uint8_t uip_last_proto
The final protocol after IPv6 extension headers: UIP_PROTO_TCP, UIP_PROTO_UDP or UIP_PROTO_ICMP6.
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.
uint16_t uip_ext_len
The length of the extension headers.
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.
uip_stats_t lblenerr
Number of packets dropped due to wrong IP length, low byte.
uint8_t timer
The retransmission timer.
bool uip_remove_ext_hdr(void)
Removes all IPv6 extension headers from uip_buf, updates length fields (uip_len and uip_ext_len) ...
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.