![]() |
EVE 1.0
|
![]() |
Macros | |
#define | uip_ipaddr_to_quad(a) |
#define | uip_ipaddr(addr, addr0, addr1, addr2, addr3) |
#define | uip_ip6addr(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7) |
#define | uip_ip6addr_u8(addr, addr0, addr1, addr2, addr3, addr4, addr5, addr6, addr7, addr8, addr9, addr10, addr11, addr12, addr13, addr14, addr15) |
#define | uip_ipaddr_copy(dest, src) |
#define | uip_ip4addr_cmp(addr1, addr2) |
#define | uip_ipaddr_maskcmp(addr1, addr2, mask) |
#define | uip_ipaddr_mask(dest, src, mask) |
#define | uip_ipaddr1(addr) |
#define | uip_ipaddr2(addr) |
#define | uip_ipaddr3(addr) |
#define | uip_ipaddr4(addr) |
#define | UIP_HTONS(n) |
#define | uiplib_ipaddrconv uiplib_ip4addrconv |
Functions | |
CCIF uint16_t | uip_htons (uint16_t val) |
These functions can be used for converting between different data formats used by uIP.
#define uip_ipaddr_to_quad | ( | a | ) |
#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. |
Definition at line 965 of file uip.h.
Referenced by tcpip_output().
#define uip_ip6addr | ( | addr, | |
addr0, | |||
addr1, | |||
addr2, | |||
addr3, | |||
addr4, | |||
addr5, | |||
addr6, | |||
addr7 | |||
) |
#define uip_ip6addr_u8 | ( | addr, | |
addr0, | |||
addr1, | |||
addr2, | |||
addr3, | |||
addr4, | |||
addr5, | |||
addr6, | |||
addr7, | |||
addr8, | |||
addr9, | |||
addr10, | |||
addr11, | |||
addr12, | |||
addr13, | |||
addr14, | |||
addr15 | |||
) |
#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 1036 of file uip.h.
Referenced by simple_udp_register(), uip_arp_arpin(), uip_arp_out(), uip_arp_timer(), uip_fw_init(), uip_init(), and uip_process().
#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_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. |
Definition at line 1100 of file uip.h.
Referenced by uip_arp_out().
#define uip_ipaddr_mask | ( | dest, | |
src, | |||
mask | |||
) |
Check if an address is a broadcast address for a network.
Checks if an address is the broadcast address for a network. The network is defined by an IP address that is on the network and the network's netmask.
addr | The IP address. |
netaddr | The network's IP address. |
netmask | The network's netmask. 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_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_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 1248 of file uip.h.
Referenced by htons(), simple_udp_deregister(), simple_udp_register(), simple_udp_send(), simple_udp_sendto(), simple_udp_sendto_port(), uip_arp_arpin(), uip_arp_out(), uip_fw_forward(), uip_htons(), uip_init(), and uip_process().
#define uiplib_ipaddrconv uiplib_ip4addrconv |
Convert a textual representation of an IP address to a numerical representation.
This function takes a textual representation of an IP address in the form a.b.c.d for IPv4 or a:b:c:d:e:f:g:h for IPv6 and converts it into a numeric IP address representation that can be used by other uIP functions.
addrstr | A pointer to a string containing the IP address in textual form. |
addr | A pointer to a uip_ip4addr_t that will be filled in with the numerical representation of the address. |
0 | If the IP address could not be parsed. |
Non-zero | If the IP address was parsed. |
CCIF 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 2076 of file uip.c.
References UIP_HTONS.
Referenced by uip_chksum(), uip_init(), and uip_ipchksum().