Contiki-NG
|
Macros | |
#define | uip_ipaddr_to_quad(a) |
Convert an IP address to four bytes separated by commas. | |
#define | uip_ipaddr(addr, addr0, addr1, addr2, addr3) |
Construct an IP address from four bytes. | |
#define | uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7) |
Construct an IPv6 address from eight 16-bit words. | |
#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. | |
#define | uip_ipaddr_copy(dest, src) |
Copy an IP address from one place to another. | |
#define | uip_ip4addr_cmp(addr1, addr2) |
Compare two IP addresses. | |
#define | uip_ipaddr_maskcmp(addr1, addr2, mask) |
Compare two IP addresses with netmasks. | |
#define | uip_ipaddr_mask(dest, src, mask) |
Mask out the network part of an IP address. | |
#define | uip_ipaddr1(addr) |
Pick the first octet of an IP address. | |
#define | uip_ipaddr2(addr) |
Pick the second octet of an IP address. | |
#define | uip_ipaddr3(addr) |
Pick the third octet of an IP address. | |
#define | uip_ipaddr4(addr) |
Pick the fourth octet of an IP address. | |
#define | UIP_HTONS(n) |
Convert 16-bit quantity from host byte order to network byte order. | |
Functions | |
uint16_t | uip_htons (uint16_t val) |
Convert a 16-bit quantity from host byte order to network byte order. | |
These functions can be used for converting between different data formats used by uIP.
#define UIP_HTONS | ( | n | ) |
Convert 16-bit quantity from host byte order to network byte order.
This macro is primarily used for converting constants from host byte order to network byte order. For converting variables to network byte order, use the uip_htons() function instead.
Definition at line 1157 of file uip.h.
Referenced by coap_endpoint_parse(), compress_hdr_iphc(), log_6addr_compact_snprint(), log_lladdr_compact(), newdata(), rpl_ext_header_hbh_update(), rpl_ext_header_hbh_update(), simple_udp_register(), simple_udp_send(), simple_udp_sendto(), simple_udp_sendto_port(), uip_htons(), uip_udp_new(), and uncompress_hdr_iphc().
#define uip_ip4addr_cmp | ( | addr1, | |
addr2 ) |
Compare two IP addresses.
Compares two IP addresses.
Example:
addr1 | The first IP address. |
addr2 | The second IP address. |
#define uip_ip6addr | ( | addr, | |
addr0, | |||
addr1, | |||
addr2, | |||
addr3, | |||
addr4, | |||
addr5, | |||
addr6, | |||
addr7 ) |
Construct an IPv6 address from eight 16-bit words.
This function constructs an IPv6 address.
Definition at line 912 of file uip.h.
Referenced by rpl_link_callback(), and uip_ds6_init().
#define uip_ip6addr_u8 | ( | addr, | |
addr0, | |||
addr1, | |||
addr2, | |||
addr3, | |||
addr4, | |||
addr5, | |||
addr6, | |||
addr7, | |||
addr8, | |||
addr9, | |||
addr10, | |||
addr11, | |||
addr12, | |||
addr13, | |||
addr14, | |||
addr15 ) |
#define uip_ipaddr | ( | addr, | |
addr0, | |||
addr1, | |||
addr2, | |||
addr3 ) |
Construct an IP address from four bytes.
This function constructs an IP address of the type that uIP handles internally from four bytes. The function is handy for specifying IP addresses to use with e.g. the uip_connect() function.
Example:
addr | A pointer to a uip_ipaddr_t variable that will be filled in with the IP address. |
addr0 | The first octet of the IP address. |
addr1 | The second octet of the IP address. |
addr2 | The third octet of the IP address. |
addr3 | The forth octet of the IP address. |
#define uip_ipaddr1 | ( | addr | ) |
Pick the first octet of an IP address.
Picks out the first octet of an IP address.
Example:
In the example above, the variable "octet" will contain the value 1.
#define uip_ipaddr2 | ( | addr | ) |
Pick the second octet of an IP address.
Picks out the second octet of an IP address.
Example:
In the example above, the variable "octet" will contain the value 2.
#define uip_ipaddr3 | ( | addr | ) |
Pick the third octet of an IP address.
Picks out the third octet of an IP address.
Example:
In the example above, the variable "octet" will contain the value 3.
#define uip_ipaddr4 | ( | addr | ) |
Pick the fourth octet of an IP address.
Picks out the fourth octet of an IP address.
Example:
In the example above, the variable "octet" will contain the value 4.
#define uip_ipaddr_copy | ( | dest, | |
src ) |
Copy an IP address from one place to another.
Copies an IP address from one place to another.
Example:
dest | The destination for the copy. |
src | The source from where to copy. |
Definition at line 969 of file uip.h.
Referenced by coap_endpoint_copy(), mqtt_connect(), newdata(), ra_input(), rpl_dag_get_root_ipaddr(), rpl_ext_header_srh_get_next_hop(), rpl_ext_header_srh_update(), simple_udp_register(), uip_ds6_addr_add(), uip_ds6_nbr_add(), uip_ds6_select_src(), uip_icmp6_error_output(), uip_mcast6_route_add(), uip_nameserver_update(), and uip_udp_new().
#define uip_ipaddr_mask | ( | dest, | |
src, | |||
mask ) |
Mask out the network part of an IP address.
Masks out the network part of an IP address, given the address and the netmask.
Example:
In the example above, the variable "ipaddr2" will contain the IP address 192.168.1.0.
dest | Where the result is to be placed. |
src | The IP address. |
mask | The netmask. |
#define uip_ipaddr_maskcmp | ( | addr1, | |
addr2, | |||
mask ) |
Compare two IP addresses with netmasks.
Compares two IP addresses with netmasks. The masks are used to mask out the bits that are to be compared.
Example:
addr1 | The first IP address. |
addr2 | The second IP address. |
mask | The netmask. |
#define uip_ipaddr_to_quad | ( | a | ) |
uint16_t uip_htons | ( | uint16_t | val | ) |
Convert a 16-bit quantity from host byte order to network byte order.
This function is primarily used for converting variables from host byte order to network byte order. For converting constants to network byte order, use the UIP_HTONS() macro instead.
Definition at line 2341 of file uip6.c.
References UIP_HTONS.
Referenced by newdata(), uip_chksum(), uip_ipchksum(), and uip_udp_new().