56 #if NETSTACK_CONF_WITH_IPV6
57 #define UIP_IPH_LEN 40
58 #define UIP_FRAGH_LEN 8
60 #define UIP_IPH_LEN 20
63 #define UIP_UDPH_LEN 8
64 #define UIP_TCPH_LEN 20
65 #define UIP_ICMPH_LEN 4
67 #define UIP_IPUDPH_LEN (UIP_UDPH_LEN + UIP_IPH_LEN)
68 #define UIP_IPTCPH_LEN (UIP_TCPH_LEN + UIP_IPH_LEN)
69 #define UIP_TCPIP_HLEN UIP_IPTCPH_LEN
70 #define UIP_IPICMPH_LEN (UIP_IPH_LEN + UIP_ICMPH_LEN)
71 #define UIP_LLIPH_LEN (UIP_LLH_LEN + UIP_IPH_LEN)
72 #if NETSTACK_CONF_WITH_IPV6
79 #define uip_l2_l3_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len)
80 #define uip_l2_l3_icmp_hdr_len (UIP_LLH_LEN + UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
81 #define uip_l3_hdr_len (UIP_IPH_LEN + uip_ext_len)
82 #define uip_l3_icmp_hdr_len (UIP_IPH_LEN + uip_ext_len + UIP_ICMPH_LEN)
100 typedef union uip_ip6addr_t {
105 #if NETSTACK_CONF_WITH_IPV6
106 typedef uip_ip6addr_t uip_ipaddr_t;
134 #if UIP_CONF_LL_802154
137 #define UIP_802154_SHORTADDR_LEN 2
138 #define UIP_802154_LONGADDR_LEN 8
140 #define UIP_LLADDR_LEN UIP_802154_LONGADDR_LEN
142 #if UIP_CONF_LL_80211
146 #define UIP_LLADDR_LEN 6
151 #define UIP_LLADDR_LEN 6
192 #define uip_sethostaddr(addr) uip_ipaddr_copy(&uip_hostaddr, (addr))
212 #define uip_gethostaddr(addr) uip_ipaddr_copy((addr), &uip_hostaddr)
224 #define uip_setdraddr(addr) uip_ipaddr_copy(&uip_draddr, (addr))
236 #define uip_setnetmask(addr) uip_ipaddr_copy(&uip_netmask, (addr))
247 #define uip_getdraddr(addr) uip_ipaddr_copy((addr), &uip_draddr)
257 #define uip_getnetmask(addr) uip_ipaddr_copy((addr), &uip_netmask)
343 #define uip_input() uip_process(UIP_DATA)
389 #define uip_periodic(conn) do { uip_conn = &uip_conns[conn]; \
390 uip_process(UIP_TIMER); } while (0)
398 #define uip_conn_active(conn) (uip_conns[conn].tcpstateflags != UIP_CLOSED)
413 #define uip_periodic_conn(conn) do { uip_conn = conn; \
414 uip_process(UIP_TIMER); } while (0)
427 #define uip_poll_conn(conn) do { uip_conn = conn; \
428 uip_process(UIP_POLL_REQUEST); } while (0)
464 #define uip_udp_periodic(conn) do { uip_udp_conn = &uip_udp_conns[conn]; \
465 uip_process(UIP_UDP_TIMER); } while(0)
481 #define uip_udp_periodic_conn(conn) do { uip_udp_conn = conn; \
482 uip_process(UIP_UDP_TIMER); } while(0)
523 #define uip_buf (uip_aligned_buf.u8)
613 #define uip_outstanding(conn) ((conn)->len)
652 #define uip_datalen() uip_len
663 #define uip_urgdatalen() uip_urglen
672 #define uip_close() (uip_flags = UIP_CLOSE)
683 #define uip_abort() (uip_flags = UIP_ABORT)
693 #define uip_stop() (uip_conn->tcpstateflags |= UIP_STOPPED)
701 #define uip_stopped(conn) ((conn)->tcpstateflags & UIP_STOPPED)
712 #define uip_restart() do { uip_flags |= UIP_NEWDATA; \
713 uip_conn->tcpstateflags &= ~UIP_STOPPED; \
728 #define uip_udpconnection() (uip_conn == NULL)
739 #define uip_newdata() (uip_flags & UIP_NEWDATA)
750 #define uip_acked() (uip_flags & UIP_ACKDATA)
762 #define uip_connected() (uip_flags & UIP_CONNECTED)
772 #define uip_closed() (uip_flags & UIP_CLOSE)
782 #define uip_aborted() (uip_flags & UIP_ABORT)
792 #define uip_timedout() (uip_flags & UIP_TIMEDOUT)
804 #define uip_rexmit() (uip_flags & UIP_REXMIT)
818 #define uip_poll() (uip_flags & UIP_POLL)
826 #define uip_initialmss() (uip_conn->initialmss)
839 #define uip_mss() (uip_conn->mss)
877 #define uip_udp_remove(conn) (conn)->lport = 0
889 #define uip_udp_bind(conn, port) (conn)->lport = port
902 #define uip_udp_send(len) uip_send((char *)uip_appdata, len)
928 #define uip_ipaddr_to_quad(a) (a)->u8[0],(a)->u8[1],(a)->u8[2],(a)->u8[3]
956 #define uip_ipaddr(addr, addr0,addr1,addr2,addr3) do { \
957 (addr)->u8[0] = addr0; \
958 (addr)->u8[1] = addr1; \
959 (addr)->u8[2] = addr2; \
960 (addr)->u8[3] = addr3; \
970 #define uip_ip6addr(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7) do { \
971 (addr)->u16[0] = UIP_HTONS(addr0); \
972 (addr)->u16[1] = UIP_HTONS(addr1); \
973 (addr)->u16[2] = UIP_HTONS(addr2); \
974 (addr)->u16[3] = UIP_HTONS(addr3); \
975 (addr)->u16[4] = UIP_HTONS(addr4); \
976 (addr)->u16[5] = UIP_HTONS(addr5); \
977 (addr)->u16[6] = UIP_HTONS(addr6); \
978 (addr)->u16[7] = UIP_HTONS(addr7); \
988 #define uip_ip6addr_u8(addr, addr0,addr1,addr2,addr3,addr4,addr5,addr6,addr7,addr8,addr9,addr10,addr11,addr12,addr13,addr14,addr15) do { \
989 (addr)->u8[0] = addr0; \
990 (addr)->u8[1] = addr1; \
991 (addr)->u8[2] = addr2; \
992 (addr)->u8[3] = addr3; \
993 (addr)->u8[4] = addr4; \
994 (addr)->u8[5] = addr5; \
995 (addr)->u8[6] = addr6; \
996 (addr)->u8[7] = addr7; \
997 (addr)->u8[8] = addr8; \
998 (addr)->u8[9] = addr9; \
999 (addr)->u8[10] = addr10; \
1000 (addr)->u8[11] = addr11; \
1001 (addr)->u8[12] = addr12; \
1002 (addr)->u8[13] = addr13; \
1003 (addr)->u8[14] = addr14; \
1004 (addr)->u8[15] = addr15; \
1026 #ifndef uip_ipaddr_copy
1027 #define uip_ipaddr_copy(dest, src) (*(dest) = *(src))
1029 #ifndef uip_ip4addr_copy
1030 #define uip_ip4addr_copy(dest, src) (*((uip_ip4addr_t *)dest) = *((uip_ip4addr_t *)src))
1032 #ifndef uip_ip6addr_copy
1033 #define uip_ip6addr_copy(dest, src) (*((uip_ip6addr_t *)dest) = *((uip_ip6addr_t *)src))
1056 #define uip_ip4addr_cmp(addr1, addr2) ((addr1)->u16[0] == (addr2)->u16[0] && \
1057 (addr1)->u16[1] == (addr2)->u16[1])
1058 #define uip_ip6addr_cmp(addr1, addr2) (memcmp(addr1, addr2, sizeof(uip_ip6addr_t)) == 0)
1060 #if NETSTACK_CONF_WITH_IPV6
1061 #define uip_ipaddr_cmp(addr1, addr2) uip_ip6addr_cmp(addr1, addr2)
1063 #define uip_ipaddr_cmp(addr1, addr2) uip_ip4addr_cmp(addr1, addr2)
1091 #define uip_ipaddr_maskcmp(addr1, addr2, mask) \
1092 (((((uint16_t *)addr1)[0] & ((uint16_t *)mask)[0]) == \
1093 (((uint16_t *)addr2)[0] & ((uint16_t *)mask)[0])) && \
1094 ((((uint16_t *)addr1)[1] & ((uint16_t *)mask)[1]) == \
1095 (((uint16_t *)addr2)[1] & ((uint16_t *)mask)[1])))
1097 #define uip_ipaddr_prefixcmp(addr1, addr2, length) (memcmp(addr1, addr2, length>>3) == 0)
1143 #define uip_ipaddr_mask(dest, src, mask) do { \
1144 ((uint16_t *)dest)[0] = ((uint16_t *)src)[0] & ((uint16_t *)mask)[0]; \
1145 ((uint16_t *)dest)[1] = ((uint16_t *)src)[1] & ((uint16_t *)mask)[1]; \
1166 #define uip_ipaddr1(addr) ((addr)->u8[0])
1186 #define uip_ipaddr2(addr) ((addr)->u8[1])
1206 #define uip_ipaddr3(addr) ((addr)->u8[2])
1226 #define uip_ipaddr4(addr) ((addr)->u8[3])
1238 # if UIP_BYTE_ORDER == UIP_BIG_ENDIAN
1239 # define UIP_HTONS(n) (n)
1240 # define UIP_HTONL(n) (n)
1242 # define UIP_HTONS(n) (uint16_t)((((uint16_t) (n)) << 8) | (((uint16_t) (n)) >> 8))
1243 # define UIP_HTONL(n) (((uint32_t)UIP_HTONS(n) << 16) | UIP_HTONS((uint32_t)(n) >> 16))
1246 #error "UIP_HTONS already defined!"
1260 #define uip_ntohs uip_htons
1264 CCIF uint32_t uip_htonl(uint32_t val);
1267 #define uip_ntohl uip_htonl
1287 extern void *uip_urgdata;
1323 extern uint16_t uip_urglen, uip_surglen;
1332 #if NETSTACK_CONF_WITH_IPV6
1333 #define uip_clear_buf() { \
1338 #define uip_clear_buf() { \
1388 CCIF
extern struct uip_conn uip_conns[
UIP_CONNS];
1421 struct uip_fallback_interface {
1433 struct uip_icmp6_conn {
1434 uip_icmp6_appstate_t appstate;
1444 #if UIP_STATISTICS == 1
1446 #define UIP_STAT(s) s
1506 #if NETSTACK_CONF_WITH_IPV6
1530 CCIF
extern uint8_t uip_flags;
1539 #define UIP_ACKDATA 1
1543 #define UIP_NEWDATA 2
1545 #define UIP_REXMIT 4
1550 #define UIP_CLOSE 16
1555 #define UIP_ABORT 32
1560 #define UIP_CONNECTED 64
1565 #define UIP_TIMEDOUT 128
1597 #define UIP_POLL_REQUEST 3
1599 #define UIP_UDP_SEND_CONN 4
1603 #define UIP_UDP_TIMER 5
1607 #define UIP_CLOSED 0
1608 #define UIP_SYN_RCVD 1
1609 #define UIP_SYN_SENT 2
1610 #define UIP_ESTABLISHED 3
1611 #define UIP_FIN_WAIT_1 4
1612 #define UIP_FIN_WAIT_2 5
1613 #define UIP_CLOSING 6
1614 #define UIP_TIME_WAIT 7
1615 #define UIP_LAST_ACK 8
1616 #define UIP_TS_MASK 15
1618 #define UIP_STOPPED 16
1621 struct uip_tcpip_hdr {
1622 #if NETSTACK_CONF_WITH_IPV6
1629 uip_ip6addr_t srcipaddr, destipaddr;
1640 uip_ipaddr_t srcipaddr, destipaddr;
1657 struct uip_icmpip_hdr {
1658 #if NETSTACK_CONF_WITH_IPV6
1665 uip_ip6addr_t srcipaddr, destipaddr;
1676 uip_ipaddr_t srcipaddr, destipaddr;
1680 uint8_t type, icode;
1681 uint16_t icmpchksum;
1682 #if !NETSTACK_CONF_WITH_IPV6
1690 struct uip_udpip_hdr {
1691 #if NETSTACK_CONF_WITH_IPV6
1698 uip_ip6addr_t srcipaddr, destipaddr;
1709 uip_ipaddr_t srcipaddr, destipaddr;
1726 #if NETSTACK_CONF_WITH_IPV6
1733 uip_ip6addr_t srcipaddr, destipaddr;
1744 uip_ipaddr_t srcipaddr, destipaddr;
1770 typedef struct uip_ext_hdr {
1776 typedef struct uip_hbho_hdr {
1782 typedef struct uip_desto_hdr {
1797 typedef struct uip_routing_hdr {
1800 uint8_t routing_type;
1805 typedef struct uip_rpl_srh_hdr {
1808 uint8_t reserved[2];
1812 typedef struct uip_frag_hdr {
1815 uint16_t offsetresmore;
1823 typedef struct uip_ext_hdr_opt {
1829 typedef struct uip_ext_hdr_opt_padn {
1832 } uip_ext_hdr_opt_padn;
1835 typedef struct uip_ext_hdr_opt_rpl {
1840 uint16_t senderrank;
1841 } uip_ext_hdr_opt_rpl;
1844 struct uip_tcp_hdr {
1858 struct uip_icmp_hdr {
1859 uint8_t type, icode;
1860 uint16_t icmpchksum;
1861 #if !NETSTACK_CONF_WITH_IPV6
1868 struct uip_udp_hdr {
1890 #define UIP_APPDATA_SIZE (UIP_BUFSIZE - UIP_LLH_LEN - UIP_TCPIP_HLEN)
1891 #define UIP_APPDATA_PTR (void *)&uip_buf[UIP_LLH_LEN + UIP_TCPIP_HLEN]
1893 #define UIP_PROTO_ICMP 1
1894 #define UIP_PROTO_TCP 6
1895 #define UIP_PROTO_UDP 17
1896 #define UIP_PROTO_ICMP6 58
1899 #if NETSTACK_CONF_WITH_IPV6
1902 #define UIP_PROTO_HBHO 0
1903 #define UIP_PROTO_DESTO 60
1904 #define UIP_PROTO_ROUTING 43
1905 #define UIP_PROTO_FRAG 44
1906 #define UIP_PROTO_NONE 59
1911 #define UIP_EXT_HDR_OPT_PAD1 0
1912 #define UIP_EXT_HDR_OPT_PADN 1
1913 #define UIP_EXT_HDR_OPT_RPL 0x63
1926 #define UIP_EXT_HDR_BITMAP_HBHO 0x01
1927 #define UIP_EXT_HDR_BITMAP_DESTO1 0x02
1928 #define UIP_EXT_HDR_BITMAP_ROUTING 0x04
1929 #define UIP_EXT_HDR_BITMAP_FRAG 0x08
1930 #define UIP_EXT_HDR_BITMAP_AH 0x10
1931 #define UIP_EXT_HDR_BITMAP_ESP 0x20
1932 #define UIP_EXT_HDR_BITMAP_DESTO2 0x40
1940 CCIF
extern const uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
1942 CCIF
extern uip_ipaddr_t uip_hostaddr, uip_netmask, uip_draddr;
1944 CCIF
extern const uip_ipaddr_t uip_broadcast_addr;
1945 CCIF
extern const uip_ipaddr_t uip_all_zeroes_addr;
1947 #if UIP_FIXEDETHADDR
1956 #if NETSTACK_CONF_WITH_IPV6
1958 #define UIP_LLPREF_LEN 10
1964 #define uip_is_addr_loopback(a) \
1965 ((((a)->u16[0]) == 0) && \
1966 (((a)->u16[1]) == 0) && \
1967 (((a)->u16[2]) == 0) && \
1968 (((a)->u16[3]) == 0) && \
1969 (((a)->u16[4]) == 0) && \
1970 (((a)->u16[5]) == 0) && \
1971 (((a)->u16[6]) == 0) && \
1972 (((a)->u8[14]) == 0) && \
1973 (((a)->u8[15]) == 0x01))
1978 #define uip_is_addr_unspecified(a) \
1979 ((((a)->u16[0]) == 0) && \
1980 (((a)->u16[1]) == 0) && \
1981 (((a)->u16[2]) == 0) && \
1982 (((a)->u16[3]) == 0) && \
1983 (((a)->u16[4]) == 0) && \
1984 (((a)->u16[5]) == 0) && \
1985 (((a)->u16[6]) == 0) && \
1986 (((a)->u16[7]) == 0))
1989 #define uip_is_addr_linklocal_allnodes_mcast(a) \
1990 ((((a)->u8[0]) == 0xff) && \
1991 (((a)->u8[1]) == 0x02) && \
1992 (((a)->u16[1]) == 0) && \
1993 (((a)->u16[2]) == 0) && \
1994 (((a)->u16[3]) == 0) && \
1995 (((a)->u16[4]) == 0) && \
1996 (((a)->u16[5]) == 0) && \
1997 (((a)->u16[6]) == 0) && \
1998 (((a)->u8[14]) == 0) && \
1999 (((a)->u8[15]) == 0x01))
2002 #define uip_is_addr_linklocal_allrouters_mcast(a) \
2003 ((((a)->u8[0]) == 0xff) && \
2004 (((a)->u8[1]) == 0x02) && \
2005 (((a)->u16[1]) == 0) && \
2006 (((a)->u16[2]) == 0) && \
2007 (((a)->u16[3]) == 0) && \
2008 (((a)->u16[4]) == 0) && \
2009 (((a)->u16[5]) == 0) && \
2010 (((a)->u16[6]) == 0) && \
2011 (((a)->u8[14]) == 0) && \
2012 (((a)->u8[15]) == 0x02))
2019 #define uip_is_addr_linklocal(a) \
2020 ((a)->u8[0] == 0xfe && \
2024 #define uip_create_unspecified(a) uip_ip6addr(a, 0, 0, 0, 0, 0, 0, 0, 0)
2027 #define uip_create_linklocal_allnodes_mcast(a) uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0001)
2030 #define uip_create_linklocal_allrouters_mcast(a) uip_ip6addr(a, 0xff02, 0, 0, 0, 0, 0, 0, 0x0002)
2031 #define uip_create_linklocal_prefix(addr) do { \
2032 (addr)->u16[0] = UIP_HTONS(0xfe80); \
2033 (addr)->u16[1] = 0; \
2034 (addr)->u16[2] = 0; \
2035 (addr)->u16[3] = 0; \
2042 #define uip_is_addr_solicited_node(a) \
2043 ((((a)->u8[0]) == 0xFF) && \
2044 (((a)->u8[1]) == 0x02) && \
2045 (((a)->u16[1]) == 0x00) && \
2046 (((a)->u16[2]) == 0x00) && \
2047 (((a)->u16[3]) == 0x00) && \
2048 (((a)->u16[4]) == 0x00) && \
2049 (((a)->u8[10]) == 0x00) && \
2050 (((a)->u8[11]) == 0x01) && \
2051 (((a)->u8[12]) == 0xFF))
2057 #define uip_create_solicited_node(a, b) \
2058 (((b)->u8[0]) = 0xFF); \
2059 (((b)->u8[1]) = 0x02); \
2060 (((b)->u16[1]) = 0); \
2061 (((b)->u16[2]) = 0); \
2062 (((b)->u16[3]) = 0); \
2063 (((b)->u16[4]) = 0); \
2064 (((b)->u8[10]) = 0); \
2065 (((b)->u8[11]) = 0x01); \
2066 (((b)->u8[12]) = 0xFF); \
2067 (((b)->u8[13]) = ((a)->u8[13])); \
2068 (((b)->u16[7]) = ((a)->u16[7]))
2075 #if UIP_CONF_LL_802154
2076 #define uip_is_addr_mac_addr_based(a, m) \
2077 ((((a)->u8[8]) == (((m)->addr[0]) ^ 0x02)) && \
2078 (((a)->u8[9]) == (m)->addr[1]) && \
2079 (((a)->u8[10]) == (m)->addr[2]) && \
2080 (((a)->u8[11]) == (m)->addr[3]) && \
2081 (((a)->u8[12]) == (m)->addr[4]) && \
2082 (((a)->u8[13]) == (m)->addr[5]) && \
2083 (((a)->u8[14]) == (m)->addr[6]) && \
2084 (((a)->u8[15]) == (m)->addr[7]))
2087 #define uip_is_addr_mac_addr_based(a, m) \
2088 ((((a)->u8[8]) == (((m)->addr[0]) | 0x02)) && \
2089 (((a)->u8[9]) == (m)->addr[1]) && \
2090 (((a)->u8[10]) == (m)->addr[2]) && \
2091 (((a)->u8[11]) == 0xff) && \
2092 (((a)->u8[12]) == 0xfe) && \
2093 (((a)->u8[13]) == (m)->addr[3]) && \
2094 (((a)->u8[14]) == (m)->addr[4]) && \
2095 (((a)->u8[15]) == (m)->addr[5]))
2103 #define uip_is_addr_mcast(a) \
2104 (((a)->u8[0]) == 0xFF)
2110 #define uip_is_addr_mcast_global(a) \
2111 ((((a)->u8[0]) == 0xFF) && \
2112 (((a)->u8[1] & 0x0F) == 0x0E))
2120 #define uip_is_addr_mcast_non_routable(a) \
2121 ((((a)->u8[0]) == 0xFF) && \
2122 (((a)->u8[1] & 0x0F) <= 0x02))
2131 #define uip_is_addr_mcast_routable(a) \
2132 ((((a)->u8[0]) == 0xFF) && \
2133 (((a)->u8[1] & 0x0F) > 0x02))
2139 #define uip_is_mcast_group_id_all_nodes(a) \
2140 ((((a)->u16[1]) == 0) && \
2141 (((a)->u16[2]) == 0) && \
2142 (((a)->u16[3]) == 0) && \
2143 (((a)->u16[4]) == 0) && \
2144 (((a)->u16[5]) == 0) && \
2145 (((a)->u16[6]) == 0) && \
2146 (((a)->u8[14]) == 0) && \
2147 (((a)->u8[15]) == 1))
2153 #define uip_is_mcast_group_id_all_routers(a) \
2154 ((((a)->u16[1]) == 0) && \
2155 (((a)->u16[2]) == 0) && \
2156 (((a)->u16[3]) == 0) && \
2157 (((a)->u16[4]) == 0) && \
2158 (((a)->u16[5]) == 0) && \
2159 (((a)->u16[6]) == 0) && \
2160 (((a)->u8[14]) == 0) && \
2161 (((a)->u8[15]) == 2))
2168 #define uip_are_solicited_bytes_equal(a, b) \
2169 ((((a)->u8[13]) == ((b)->u8[13])) && \
2170 (((a)->u8[14]) == ((b)->u8[14])) && \
2171 (((a)->u8[15]) == ((b)->u8[15])))
2191 uint16_t
uip_chksum(uint16_t *data, uint16_t len);
uint16_t uip_ipchksum(void)
Calculate the IP header checksum of the packet header in uip_buf.
CCIF uint16_t uip_len
The length of the packet in the uip_buf buffer.
uint16_t initialmss
Initial maximum segment size for the connection.
uint8_t sa
Retransmission time-out calculation state variable.
uint8_t tcpstateflags
TCP state and flags.
The structure holding the TCP/IP statistics that are gathered if UIP_STATISTICS is set to 1...
uip_ipaddr_t ripaddr
The IP address of the remote peer.
Representation of a uIP TCP connection.
struct uip_udp_conn * uip_udp_conn
The current UDP connection.
uip_stats_t sent
Number of sent packets at the IP layer.
CCIF struct uip_conn * uip_conn
Pointer to the current TCP connection.
Configuration options for uIP.
uip_stats_t rexmit
Number of retransmitted TCP segments.
#define UIP_CONNS
The maximum number of simultaneously open TCP connections.
uint16_t uip_chksum(uint16_t *data, uint16_t len)
Calculate the Internet checksum over a buffer.
uip_udp_appstate_t appstate
The application state.
Representation of a uIP UDP connection.
uip_stats_t drop
Number of dropped packets at the IP layer.
uint16_t uip_icmp6chksum(void)
Calculate the ICMP checksum of the packet in uip_buf.
CCIF void * uip_appdata
Pointer to the application data in the packet buffer.
void uip_setipid(uint16_t id)
uIP initialization function.
uint8_t rcv_nxt[4]
The sequence number that we expect to receive next.
uint8_t snd_nxt[4]
The sequence number that was last sent by us.
struct uip_eth_addr uip_eth_addr
802.3 address
uip_ipaddr_t ripaddr
The IP address of the remote host.
uint8_t ttl
Default time-to-live.
uip_stats_t syndrop
Number of dropped SYNs because too few connections were available.
struct uip_802154_shortaddr uip_802154_shortaddr
16 bit 802.15.4 address
void uip_listen(uint16_t port)
Start listening to the specified port.
Representation of an IP address.
Header for the Contiki/uIP interface.
struct uip_udp_conn * uip_udp_new(const uip_ipaddr_t *ripaddr, uint16_t rport)
Set up a new UDP connection.
struct uip_stats::@46 icmp
ICMP statistics.
struct uip_stats::@47 tcp
TCP statistics.
void uip_reass_over(void)
Abandon the reassembly of the current packet.
uint8_t uip_ext_len
The length of the extension headers.
CCIF void uip_send(const void *data, int len)
Send data on the current connection.
union uip_ip4addr_t uip_ip4addr_t
Representation of an IP address.
struct uip_stats::@48 udp
UDP statistics.
struct uip_80211_addr uip_80211_addr
802.11 address
uint16_t rport
The local remote TCP port, in network byte order.
struct uip_stats::@45 ip
IP statistics.
uint8_t nrtx
The number of retransmissions for the last segment sent.
uip_stats_t ackerr
Number of TCP segments with a bad ACK number.
uint16_t lport
The local TCP port, in network byte order.
uip_stats_t hblenerr
Number of packets dropped due to wrong IP length, high byte.
uint16_t uip_tcpchksum(void)
Calculate the TCP checksum of the packet in uip_buf and uip_appdata.
uip_stats_t fragerr
Number of packets dropped because they were IP fragments.
uint8_t rto
Retransmission time-out.
uip_stats_t typeerr
Number of ICMP packets with a wrong type.
uint8_t uip_acc32[4]
4-byte array used for the 32-bit sequence number calculations.
uip_stats_t vhlerr
Number of packets dropped due to wrong IP version or header length.
struct tcpip_uipstate uip_udp_appstate_t
The type of the application state that is to be stored in the uip_conn structure. ...
#define UIP_UDP_CONNS
The maximum amount of concurrent UDP connections.
uint16_t rport
The remote port number in network byte order.
uint8_t timer
The retransmission timer.
struct uip_802154_longaddr uip_802154_longaddr
64 bit 802.15.4 address
struct uip_conn * uip_connect(const uip_ipaddr_t *ripaddr, uint16_t port)
Connect to a remote host using TCP.
uip_stats_t forwarded
Number of forwarded packets at the IP layer.
uint16_t uip_udpchksum(void)
Calculate the UDP checksum of the packet in uip_buf and uip_appdata.
uint16_t len
Length of the data that was previously sent.
uint16_t lport
The local port number in network byte order.
uint8_t sv
Retransmission time-out calculation state variable.
static uint8_t output(const uip_lladdr_t *localdest)
Take an IP packet and format it to be sent on an 802.15.4 network using 6lowpan.
CCIF uip_lladdr_t uip_lladdr
Host L2 address.
void uip_init(void)
uIP initialization function.
uip_stats_t lblenerr
Number of packets dropped due to wrong IP length, low byte.
uint16_t mss
Current maximum segment size for the connection.
uip_stats_t chkerr
Number of packets dropped due to IP checksum errors.
struct uip_icmp6_conn uip_icmp6_conns
single possible icmpv6 "connection"
void uip_unlisten(uint16_t port)
Stop listening to the specified port.
struct tcpip_uipstate uip_tcp_appstate_t
The type of the application state that is to be stored in the uip_conn structure. ...
uip_eth_addr uip_lladdr_t
Ethernet address.
uip_stats_t rst
Number of received TCP RST (reset) segments.
#define UIP_BUFSIZE
The size of the uIP packet buffer.
uip_stats_t recv
Number of received packets at the IP layer.
CCIF uip_buf_t uip_aligned_buf
Packet buffer for incoming and outgoing packets.
uip_stats_t protoerr
Number of packets dropped because they were neither ICMP, UDP nor TCP.
CCIF uint16_t uip_htons(uint16_t val)
Convert a 16-bit quantity from host byte order to network byte order.
uip_stats_t synrst
Number of SYNs for closed ports, triggering a RST.
void uip_process(uint8_t flag)
process the options within a hop by hop or destination option header