|
Zephyr API Documentation
2.7.0-rc2
A Scalable Open Source RTOS
|
IPv4/IPv6 primitives and helpers. More...
Data Structures | |
| struct | in6_addr |
| struct | in_addr |
| struct | sockaddr_in6 |
| struct | sockaddr_in6_ptr |
| struct | sockaddr_in |
| struct | sockaddr_in_ptr |
| struct | sockaddr_ll |
| struct | sockaddr_ll_ptr |
| struct | sockaddr_can_ptr |
| struct | iovec |
| struct | msghdr |
| struct | cmsghdr |
| struct | sockaddr |
| struct | net_tuple |
Macros | |
| #define | PF_UNSPEC 0 |
| #define | PF_INET 1 |
| #define | PF_INET6 2 |
| #define | PF_PACKET 3 |
| #define | PF_CAN 4 |
| #define | PF_NET_MGMT 5 |
| #define | PF_LOCAL 6 |
| #define | PF_UNIX PF_LOCAL |
| #define | AF_UNSPEC PF_UNSPEC |
| #define | AF_INET PF_INET |
| #define | AF_INET6 PF_INET6 |
| #define | AF_PACKET PF_PACKET |
| #define | AF_CAN PF_CAN |
| #define | AF_NET_MGMT PF_NET_MGMT |
| #define | AF_LOCAL PF_LOCAL |
| #define | AF_UNIX PF_UNIX |
| #define | ntohs(x) sys_be16_to_cpu(x) |
| Convert 16-bit value from network to host byte order. More... | |
| #define | ntohl(x) sys_be32_to_cpu(x) |
| Convert 32-bit value from network to host byte order. More... | |
| #define | ntohll(x) sys_be64_to_cpu(x) |
| Convert 64-bit value from network to host byte order. More... | |
| #define | htons(x) sys_cpu_to_be16(x) |
| Convert 16-bit value from host to network byte order. More... | |
| #define | htonl(x) sys_cpu_to_be32(x) |
| Convert 32-bit value from host to network byte order. More... | |
| #define | htonll(x) sys_cpu_to_be64(x) |
| Convert 64-bit value from host to network byte order. More... | |
| #define | ALIGN_H(x) ROUND_UP(x, __alignof__(struct cmsghdr)) |
| #define | ALIGN_D(x) ROUND_UP(x, __alignof__(z_max_align_t)) |
| #define | CMSG_FIRSTHDR(msghdr) |
| #define | CMSG_NXTHDR(msghdr, cmsg) |
| #define | CMSG_DATA(cmsg) ((uint8_t *)(cmsg) + ALIGN_D(sizeof(struct cmsghdr))) |
| #define | CMSG_SPACE(length) (ALIGN_D(sizeof(struct cmsghdr)) + ALIGN_H(length)) |
| #define | CMSG_LEN(length) (ALIGN_D(sizeof(struct cmsghdr)) + length) |
| #define | INET_ADDRSTRLEN 16 |
| #define | INET6_ADDRSTRLEN 46 |
| #define | NET_MAX_PRIORITIES 8 /* How many priority values there are */ |
| #define | net_ipaddr_copy(dest, src) UNALIGNED_PUT(UNALIGNED_GET(src), dest) |
| Copy an IPv4 or IPv6 address. More... | |
Typedefs | |
| typedef unsigned short int | sa_family_t |
| typedef size_t | socklen_t |
Enumerations | |
| enum | net_ip_protocol { IPPROTO_IP = 0 , IPPROTO_ICMP = 1 , IPPROTO_IGMP = 2 , IPPROTO_IPIP = 4 , IPPROTO_TCP = 6 , IPPROTO_UDP = 17 , IPPROTO_IPV6 = 41 , IPPROTO_ICMPV6 = 58 , IPPROTO_RAW = 255 } |
| enum | net_ip_protocol_secure { IPPROTO_TLS_1_0 = 256 , IPPROTO_TLS_1_1 = 257 , IPPROTO_TLS_1_2 = 258 , IPPROTO_DTLS_1_0 = 272 , IPPROTO_DTLS_1_2 = 273 } |
| enum | net_sock_type { SOCK_STREAM = 1 , SOCK_DGRAM , SOCK_RAW } |
| enum | net_ip_mtu { NET_IPV6_MTU = 1280 , NET_IPV4_MTU = 576 } |
| enum | net_priority { NET_PRIORITY_BK = 1 , NET_PRIORITY_BE = 0 , NET_PRIORITY_EE = 2 , NET_PRIORITY_CA = 3 , NET_PRIORITY_VI = 4 , NET_PRIORITY_VO = 5 , NET_PRIORITY_IC = 6 , NET_PRIORITY_NC = 7 } |
| enum | net_addr_state { NET_ADDR_ANY_STATE = -1 , NET_ADDR_TENTATIVE = 0 , NET_ADDR_PREFERRED , NET_ADDR_DEPRECATED } |
| enum | net_addr_type { NET_ADDR_ANY = 0 , NET_ADDR_AUTOCONF , NET_ADDR_DHCP , NET_ADDR_MANUAL , NET_ADDR_OVERRIDABLE } |
Functions | |
| static bool | net_ipv6_is_addr_loopback (struct in6_addr *addr) |
| Check if the IPv6 address is a loopback address (::1). More... | |
| static bool | net_ipv6_is_addr_mcast (const struct in6_addr *addr) |
| Check if the IPv6 address is a multicast address. More... | |
| struct net_if_addr * | net_if_ipv6_addr_lookup (const struct in6_addr *addr, struct net_if **iface) |
| static bool | net_ipv6_is_my_addr (struct in6_addr *addr) |
| Check if IPv6 address is found in one of the network interfaces. More... | |
| struct net_if_mcast_addr * | net_if_ipv6_maddr_lookup (const struct in6_addr *addr, struct net_if **iface) |
| static bool | net_ipv6_is_my_maddr (struct in6_addr *maddr) |
| Check if IPv6 multicast address is found in one of the network interfaces. More... | |
| static bool | net_ipv6_is_prefix (const uint8_t *addr1, const uint8_t *addr2, uint8_t length) |
| Check if two IPv6 addresses are same when compared after prefix mask. More... | |
| static bool | net_ipv4_is_addr_loopback (struct in_addr *addr) |
| Check if the IPv4 address is a loopback address (127.0.0.0/8). More... | |
| static bool | net_ipv4_is_addr_unspecified (const struct in_addr *addr) |
| Check if the IPv4 address is unspecified (all bits zero) More... | |
| static bool | net_ipv4_is_addr_mcast (const struct in_addr *addr) |
| Check if the IPv4 address is a multicast address. More... | |
| static bool | net_ipv4_is_ll_addr (const struct in_addr *addr) |
| Check if the given IPv4 address is a link local address. More... | |
| static bool | net_ipv4_addr_cmp (const struct in_addr *addr1, const struct in_addr *addr2) |
| Compare two IPv4 addresses. More... | |
| static bool | net_ipv6_addr_cmp (const struct in6_addr *addr1, const struct in6_addr *addr2) |
| Compare two IPv6 addresses. More... | |
| static bool | net_ipv6_is_ll_addr (const struct in6_addr *addr) |
| Check if the given IPv6 address is a link local address. More... | |
| static bool | net_ipv6_is_ula_addr (const struct in6_addr *addr) |
| Check if the given IPv6 address is a unique local address. More... | |
| const struct in6_addr * | net_ipv6_unspecified_address (void) |
| Return pointer to any (all bits zeros) IPv6 address. More... | |
| const struct in_addr * | net_ipv4_unspecified_address (void) |
| Return pointer to any (all bits zeros) IPv4 address. More... | |
| const struct in_addr * | net_ipv4_broadcast_address (void) |
| Return pointer to broadcast (all bits ones) IPv4 address. More... | |
| bool | net_if_ipv4_addr_mask_cmp (struct net_if *iface, const struct in_addr *addr) |
| static bool | net_ipv4_addr_mask_cmp (struct net_if *iface, const struct in_addr *addr) |
| Check if the given address belongs to same subnet that has been configured for the interface. More... | |
| bool | net_if_ipv4_is_addr_bcast (struct net_if *iface, const struct in_addr *addr) |
| static bool | net_ipv4_is_addr_bcast (struct net_if *iface, const struct in_addr *addr) |
| Check if the given IPv4 address is a broadcast address. More... | |
| struct net_if_addr * | net_if_ipv4_addr_lookup (const struct in_addr *addr, struct net_if **iface) |
| static bool | net_ipv4_is_my_addr (const struct in_addr *addr) |
| Check if the IPv4 address is assigned to any network interface in the system. More... | |
| static bool | net_ipv6_is_addr_unspecified (const struct in6_addr *addr) |
| Check if the IPv6 address is unspecified (all bits zero) More... | |
| static bool | net_ipv6_is_addr_solicited_node (const struct in6_addr *addr) |
| Check if the IPv6 address is solicited node multicast address FF02:0:0:0:0:1:FFXX:XXXX defined in RFC 3513. More... | |
| static bool | net_ipv6_is_addr_mcast_scope (const struct in6_addr *addr, int scope) |
| Check if the IPv6 address is a given scope multicast address (FFyx::). More... | |
| static bool | net_ipv6_is_same_mcast_scope (const struct in6_addr *addr_1, const struct in6_addr *addr_2) |
| Check if the IPv6 addresses have the same multicast scope (FFyx::). More... | |
| static bool | net_ipv6_is_addr_mcast_global (const struct in6_addr *addr) |
| Check if the IPv6 address is a global multicast address (FFxE::/16). More... | |
| static bool | net_ipv6_is_addr_mcast_iface (const struct in6_addr *addr) |
| Check if the IPv6 address is a interface scope multicast address (FFx1::). More... | |
| static bool | net_ipv6_is_addr_mcast_link (const struct in6_addr *addr) |
| Check if the IPv6 address is a link local scope multicast address (FFx2::). More... | |
| static bool | net_ipv6_is_addr_mcast_mesh (const struct in6_addr *addr) |
| Check if the IPv6 address is a mesh-local scope multicast address (FFx3::). More... | |
| static bool | net_ipv6_is_addr_mcast_site (const struct in6_addr *addr) |
| Check if the IPv6 address is a site scope multicast address (FFx5::). More... | |
| static bool | net_ipv6_is_addr_mcast_org (const struct in6_addr *addr) |
| Check if the IPv6 address is an organization scope multicast address (FFx8::). More... | |
| static bool | net_ipv6_is_addr_mcast_group (const struct in6_addr *addr, const struct in6_addr *group) |
| Check if the IPv6 address belongs to certain multicast group. More... | |
| static bool | net_ipv6_is_addr_mcast_all_nodes_group (const struct in6_addr *addr) |
| Check if the IPv6 address belongs to the all nodes multicast group. More... | |
| static bool | net_ipv6_is_addr_mcast_iface_all_nodes (const struct in6_addr *addr) |
| Check if the IPv6 address is a interface scope all nodes multicast address (FF01::1). More... | |
| static bool | net_ipv6_is_addr_mcast_link_all_nodes (const struct in6_addr *addr) |
| Check if the IPv6 address is a link local scope all nodes multicast address (FF02::1). More... | |
| static void | net_ipv6_addr_create_solicited_node (const struct in6_addr *src, struct in6_addr *dst) |
| Create solicited node IPv6 multicast address FF02:0:0:0:0:1:FFXX:XXXX defined in RFC 3513. More... | |
| static void | net_ipv6_addr_create (struct in6_addr *addr, uint16_t addr0, uint16_t addr1, uint16_t addr2, uint16_t addr3, uint16_t addr4, uint16_t addr5, uint16_t addr6, uint16_t addr7) |
| Construct an IPv6 address from eight 16-bit words. More... | |
| static void | net_ipv6_addr_create_ll_allnodes_mcast (struct in6_addr *addr) |
| Create link local allnodes multicast IPv6 address. More... | |
| static void | net_ipv6_addr_create_ll_allrouters_mcast (struct in6_addr *addr) |
| Create link local allrouters multicast IPv6 address. More... | |
| static void | net_ipv6_addr_create_iid (struct in6_addr *addr, struct net_linkaddr *lladdr) |
| Create IPv6 address interface identifier. More... | |
| static bool | net_ipv6_addr_based_on_ll (const struct in6_addr *addr, const struct net_linkaddr *lladdr) |
| Check if given address is based on link layer address. More... | |
| static struct sockaddr_in6 * | net_sin6 (const struct sockaddr *addr) |
| Get sockaddr_in6 from sockaddr. This is a helper so that the code calling this function can be made shorter. More... | |
| static struct sockaddr_in * | net_sin (const struct sockaddr *addr) |
| Get sockaddr_in from sockaddr. This is a helper so that the code calling this function can be made shorter. More... | |
| static struct sockaddr_in6_ptr * | net_sin6_ptr (const struct sockaddr_ptr *addr) |
| Get sockaddr_in6_ptr from sockaddr_ptr. This is a helper so that the code calling this function can be made shorter. More... | |
| static struct sockaddr_in_ptr * | net_sin_ptr (const struct sockaddr_ptr *addr) |
| Get sockaddr_in_ptr from sockaddr_ptr. This is a helper so that the code calling this function can be made shorter. More... | |
| static struct sockaddr_ll_ptr * | net_sll_ptr (const struct sockaddr_ptr *addr) |
| Get sockaddr_ll_ptr from sockaddr_ptr. This is a helper so that the code calling this function can be made shorter. More... | |
| static struct sockaddr_can_ptr * | net_can_ptr (const struct sockaddr_ptr *addr) |
| Get sockaddr_can_ptr from sockaddr_ptr. This is a helper so that the code needing this functionality can be made shorter. More... | |
| int | net_addr_pton (sa_family_t family, const char *src, void *dst) |
| Convert a string to IP address. More... | |
| char * | net_addr_ntop (sa_family_t family, const void *src, char *dst, size_t size) |
| Convert IP address to string form. More... | |
| bool | net_ipaddr_parse (const char *str, size_t str_len, struct sockaddr *addr) |
| Parse a string that contains either IPv4 or IPv6 address and optional port, and store the information in user supplied sockaddr struct. More... | |
| static int32_t | net_tcp_seq_cmp (uint32_t seq1, uint32_t seq2) |
| Compare TCP sequence numbers. More... | |
| static bool | net_tcp_seq_greater (uint32_t seq1, uint32_t seq2) |
| Check that one TCP sequence number is greater. More... | |
| int | net_bytes_from_str (uint8_t *buf, int buf_len, const char *src) |
| Convert a string of hex values to array of bytes. More... | |
| int | net_tx_priority2tc (enum net_priority prio) |
| Convert Tx network packet priority to traffic class so we can place the packet into correct Tx queue. More... | |
| int | net_rx_priority2tc (enum net_priority prio) |
| Convert Rx network packet priority to traffic class so we can place the packet into correct Rx queue. More... | |
| static enum net_priority | net_vlan2priority (uint8_t priority) |
| Convert network packet VLAN priority to network packet priority so we can place the packet into correct queue. More... | |
| static uint8_t | net_priority2vlan (enum net_priority priority) |
| Convert network packet priority to network packet VLAN priority. More... | |
| const char * | net_family2str (sa_family_t family) |
| Return network address family value as a string. This is only usable for debugging. More... | |
IPv4/IPv6 primitives and helpers.
| #define AF_CAN PF_CAN |
#include <include/net/net_ip.h>
Controller Area Network.
| #define AF_INET PF_INET |
#include <include/net/net_ip.h>
IP protocol family version 4.
| #define AF_INET6 PF_INET6 |
#include <include/net/net_ip.h>
IP protocol family version 6.
| #define AF_LOCAL PF_LOCAL |
#include <include/net/net_ip.h>
Inter-process communication
| #define AF_NET_MGMT PF_NET_MGMT |
#include <include/net/net_ip.h>
Network management info.
| #define AF_PACKET PF_PACKET |
#include <include/net/net_ip.h>
Packet family.
| #define AF_UNIX PF_UNIX |
#include <include/net/net_ip.h>
Inter-process communication
| #define AF_UNSPEC PF_UNSPEC |
#include <include/net/net_ip.h>
Unspecified address family.
| #define ALIGN_D | ( | x | ) | ROUND_UP(x, __alignof__(z_max_align_t)) |
#include <include/net/net_ip.h>
#include <include/net/net_ip.h>
#include <include/net/net_ip.h>
| #define CMSG_FIRSTHDR | ( | msghdr | ) |
#include <include/net/net_ip.h>
| #define CMSG_NXTHDR | ( | msghdr, | |
| cmsg | |||
| ) |
#include <include/net/net_ip.h>
#include <include/net/net_ip.h>
| #define htonl | ( | x | ) | sys_cpu_to_be32(x) |
#include <include/net/net_ip.h>
Convert 32-bit value from host to network byte order.
| x | The host byte order value to convert. |
| #define htonll | ( | x | ) | sys_cpu_to_be64(x) |
#include <include/net/net_ip.h>
Convert 64-bit value from host to network byte order.
| x | The host byte order value to convert. |
| #define htons | ( | x | ) | sys_cpu_to_be16(x) |
#include <include/net/net_ip.h>
Convert 16-bit value from host to network byte order.
| x | The host byte order value to convert. |
| #define INET6_ADDRSTRLEN 46 |
#include <include/net/net_ip.h>
Max length of the IPv6 address as a string. Takes into account possible mapped IPv4 addresses.
| #define INET_ADDRSTRLEN 16 |
#include <include/net/net_ip.h>
Max length of the IPv4 address as a string. Defined by POSIX.
| #define net_ipaddr_copy | ( | dest, | |
| src | |||
| ) | UNALIGNED_PUT(UNALIGNED_GET(src), dest) |
#include <include/net/net_ip.h>
Copy an IPv4 or IPv6 address.
| dest | Destination IP address. |
| src | Source IP address. |
| #define NET_MAX_PRIORITIES 8 /* How many priority values there are */ |
#include <include/net/net_ip.h>
| #define ntohl | ( | x | ) | sys_be32_to_cpu(x) |
#include <include/net/net_ip.h>
Convert 32-bit value from network to host byte order.
| x | The network byte order value to convert. |
| #define ntohll | ( | x | ) | sys_be64_to_cpu(x) |
#include <include/net/net_ip.h>
Convert 64-bit value from network to host byte order.
| x | The network byte order value to convert. |
| #define ntohs | ( | x | ) | sys_be16_to_cpu(x) |
#include <include/net/net_ip.h>
Convert 16-bit value from network to host byte order.
| x | The network byte order value to convert. |
| #define PF_CAN 4 |
#include <include/net/net_ip.h>
Controller Area Network.
| #define PF_INET 1 |
#include <include/net/net_ip.h>
IP protocol family version 4.
| #define PF_INET6 2 |
#include <include/net/net_ip.h>
IP protocol family version 6.
| #define PF_LOCAL 6 |
#include <include/net/net_ip.h>
Inter-process communication
| #define PF_NET_MGMT 5 |
#include <include/net/net_ip.h>
Network management info.
| #define PF_PACKET 3 |
#include <include/net/net_ip.h>
Packet family.
| #define PF_UNIX PF_LOCAL |
#include <include/net/net_ip.h>
Inter-process communication
| #define PF_UNSPEC 0 |
#include <include/net/net_ip.h>
Unspecified protocol family.
| typedef unsigned short int sa_family_t |
#include <include/net/net_ip.h>
Socket address family type
| typedef size_t socklen_t |
#include <include/net/net_ip.h>
Length of a socket address
| enum net_addr_state |
#include <include/net/net_ip.h>
What is the current state of the network address
| Enumerator | |
|---|---|
| NET_ADDR_ANY_STATE | Default (invalid) address type |
| NET_ADDR_TENTATIVE | Tentative address |
| NET_ADDR_PREFERRED | Preferred address |
| NET_ADDR_DEPRECATED | Deprecated address |
| enum net_addr_type |
#include <include/net/net_ip.h>
How the network address is assigned to network interface
| enum net_ip_mtu |
#include <include/net/net_ip.h>
| enum net_ip_protocol |
#include <include/net/net_ip.h>
Protocol numbers from IANA/BSD
| Enumerator | |
|---|---|
| IPPROTO_IP | IP protocol (pseudo-val for setsockopt() |
| IPPROTO_ICMP | ICMP protocol |
| IPPROTO_IGMP | IGMP protocol |
| IPPROTO_IPIP | IPIP tunnels |
| IPPROTO_TCP | TCP protocol |
| IPPROTO_UDP | UDP protocol |
| IPPROTO_IPV6 | IPv6 protocol |
| IPPROTO_ICMPV6 | ICMPv6 protocol |
| IPPROTO_RAW | RAW IP packets |
#include <include/net/net_ip.h>
Protocol numbers for TLS protocols
| Enumerator | |
|---|---|
| IPPROTO_TLS_1_0 | TLS 1.0 protocol |
| IPPROTO_TLS_1_1 | TLS 1.1 protocol |
| IPPROTO_TLS_1_2 | TLS 1.2 protocol |
| IPPROTO_DTLS_1_0 | DTLS 1.0 protocol |
| IPPROTO_DTLS_1_2 | DTLS 1.2 protocol |
| enum net_priority |
#include <include/net/net_ip.h>
Network packet priority settings described in IEEE 802.1Q Annex I.1
| enum net_sock_type |
#include <include/net/net_ip.h>
Socket type
| Enumerator | |
|---|---|
| SOCK_STREAM | Stream socket type |
| SOCK_DGRAM | Datagram socket type |
| SOCK_RAW | RAW socket type |
| char * net_addr_ntop | ( | sa_family_t | family, |
| const void * | src, | ||
| char * | dst, | ||
| size_t | size | ||
| ) |
#include <include/net/net_ip.h>
Convert IP address to string form.
| family | IP address family (AF_INET or AF_INET6) |
| src | Pointer to struct in_addr if family is AF_INET or pointer to struct in6_addr if family is AF_INET6 |
| dst | Buffer for IP address as a null terminated string |
| size | Number of bytes available in the buffer |
| int net_addr_pton | ( | sa_family_t | family, |
| const char * | src, | ||
| void * | dst | ||
| ) |
#include <include/net/net_ip.h>
Convert a string to IP address.
| family | IP address family (AF_INET or AF_INET6) |
| src | IP address in a null terminated string |
| dst | Pointer to struct in_addr if family is AF_INET or pointer to struct in6_addr if family is AF_INET6 |
| int net_bytes_from_str | ( | uint8_t * | buf, |
| int | buf_len, | ||
| const char * | src | ||
| ) |
#include <include/net/net_ip.h>
Convert a string of hex values to array of bytes.
The syntax of the string is "ab:02:98:fa:42:01"
| buf | Pointer to memory where the bytes are written. |
| buf_len | Length of the memory area. |
| src | String of bytes. |
|
inlinestatic |
#include <include/net/net_ip.h>
Get sockaddr_can_ptr from sockaddr_ptr. This is a helper so that the code needing this functionality can be made shorter.
| addr | Socket address |
| const char * net_family2str | ( | sa_family_t | family | ) |
#include <include/net/net_ip.h>
Return network address family value as a string. This is only usable for debugging.
| family | Network address family code |
| struct net_if_addr * net_if_ipv4_addr_lookup | ( | const struct in_addr * | addr, |
| struct net_if ** | iface | ||
| ) |
#include <include/net/net_ip.h>
#include <include/net/net_ip.h>
#include <include/net/net_ip.h>
| struct net_if_addr * net_if_ipv6_addr_lookup | ( | const struct in6_addr * | addr, |
| struct net_if ** | iface | ||
| ) |
#include <include/net/net_ip.h>
| struct net_if_mcast_addr * net_if_ipv6_maddr_lookup | ( | const struct in6_addr * | addr, |
| struct net_if ** | iface | ||
| ) |
#include <include/net/net_ip.h>
#include <include/net/net_ip.h>
Parse a string that contains either IPv4 or IPv6 address and optional port, and store the information in user supplied sockaddr struct.
Syntax of the IP address string: 192.0.2.1:80 192.0.2.42
[2001:db8::2] 2001:db::42 Note that the str_len parameter is used to restrict the amount of characters that are checked. If the string does not contain port number, then the port number in sockaddr is not modified.
| str | String that contains the IP address. |
| str_len | Length of the string to be parsed. |
| addr | Pointer to user supplied struct sockaddr. |
|
inlinestatic |
#include <include/net/net_ip.h>
Compare two IPv4 addresses.
| addr1 | Pointer to IPv4 address. |
| addr2 | Pointer to IPv4 address. |
|
inlinestatic |
#include <include/net/net_ip.h>
Check if the given address belongs to same subnet that has been configured for the interface.
| iface | A valid pointer on an interface |
| addr | IPv4 address |
#include <include/net/net_ip.h>
Return pointer to broadcast (all bits ones) IPv4 address.
|
inlinestatic |
#include <include/net/net_ip.h>
Check if the given IPv4 address is a broadcast address.
| iface | Interface to use. Must be a valid pointer to an interface. |
| addr | IPv4 address |
#include <include/net/net_ip.h>
Check if the IPv4 address is a loopback address (127.0.0.0/8).
| addr | IPv4 address |
#include <include/net/net_ip.h>
Check if the IPv4 address is a multicast address.
| addr | IPv4 address |
#include <include/net/net_ip.h>
Check if the IPv4 address is unspecified (all bits zero)
| addr | IPv4 address. |
#include <include/net/net_ip.h>
Check if the given IPv4 address is a link local address.
| addr | A valid pointer on an IPv4 address |
#include <include/net/net_ip.h>
Check if the IPv4 address is assigned to any network interface in the system.
| addr | A valid pointer on an IPv4 address |
#include <include/net/net_ip.h>
Return pointer to any (all bits zeros) IPv4 address.
|
inlinestatic |
#include <include/net/net_ip.h>
Check if given address is based on link layer address.
|
inlinestatic |
#include <include/net/net_ip.h>
Compare two IPv6 addresses.
| addr1 | Pointer to IPv6 address. |
| addr2 | Pointer to IPv6 address. |
|
inlinestatic |
#include <include/net/net_ip.h>
Construct an IPv6 address from eight 16-bit words.
| addr | IPv6 address |
| addr0 | 16-bit word which is part of the address |
| addr1 | 16-bit word which is part of the address |
| addr2 | 16-bit word which is part of the address |
| addr3 | 16-bit word which is part of the address |
| addr4 | 16-bit word which is part of the address |
| addr5 | 16-bit word which is part of the address |
| addr6 | 16-bit word which is part of the address |
| addr7 | 16-bit word which is part of the address |
|
inlinestatic |
#include <include/net/net_ip.h>
Create IPv6 address interface identifier.
| addr | IPv6 address |
| lladdr | Link local address |
#include <include/net/net_ip.h>
Create link local allnodes multicast IPv6 address.
| addr | IPv6 address |
#include <include/net/net_ip.h>
Create link local allrouters multicast IPv6 address.
| addr | IPv6 address |
|
inlinestatic |
#include <include/net/net_ip.h>
Create solicited node IPv6 multicast address FF02:0:0:0:0:1:FFXX:XXXX defined in RFC 3513.
| src | IPv6 address. |
| dst | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is a loopback address (::1).
| addr | IPv6 address |
#include <include/net/net_ip.h>
Check if the IPv6 address is a multicast address.
| addr | IPv6 address |
#include <include/net/net_ip.h>
Check if the IPv6 address belongs to the all nodes multicast group.
| addr | IPv6 address |
#include <include/net/net_ip.h>
Check if the IPv6 address is a global multicast address (FFxE::/16).
| addr | IPv6 address. |
|
inlinestatic |
#include <include/net/net_ip.h>
Check if the IPv6 address belongs to certain multicast group.
| addr | IPv6 address. |
| group | Group id IPv6 address, the values must be in network byte order |
#include <include/net/net_ip.h>
Check if the IPv6 address is a interface scope multicast address (FFx1::).
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is a interface scope all nodes multicast address (FF01::1).
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is a link local scope multicast address (FFx2::).
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is a link local scope all nodes multicast address (FF02::1).
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is a mesh-local scope multicast address (FFx3::).
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is an organization scope multicast address (FFx8::).
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is a given scope multicast address (FFyx::).
| addr | IPv6 address |
| scope | Scope to check |
#include <include/net/net_ip.h>
Check if the IPv6 address is a site scope multicast address (FFx5::).
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is solicited node multicast address FF02:0:0:0:0:1:FFXX:XXXX defined in RFC 3513.
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the IPv6 address is unspecified (all bits zero)
| addr | IPv6 address. |
#include <include/net/net_ip.h>
Check if the given IPv6 address is a link local address.
| addr | A valid pointer on an IPv6 address |
#include <include/net/net_ip.h>
Check if IPv6 address is found in one of the network interfaces.
| addr | IPv6 address |
#include <include/net/net_ip.h>
Check if IPv6 multicast address is found in one of the network interfaces.
| maddr | Multicast IPv6 address |
|
inlinestatic |
#include <include/net/net_ip.h>
Check if two IPv6 addresses are same when compared after prefix mask.
| addr1 | First IPv6 address. |
| addr2 | Second IPv6 address. |
| length | Prefix length (max length is 128). |
|
inlinestatic |
#include <include/net/net_ip.h>
Check if the IPv6 addresses have the same multicast scope (FFyx::).
| addr_1 | IPv6 address 1 |
| addr_2 | IPv6 address 2 |
#include <include/net/net_ip.h>
Check if the given IPv6 address is a unique local address.
| addr | A valid pointer on an IPv6 address |
#include <include/net/net_ip.h>
Return pointer to any (all bits zeros) IPv6 address.
|
inlinestatic |
#include <include/net/net_ip.h>
Convert network packet priority to network packet VLAN priority.
| priority | Packet priority |
| int net_rx_priority2tc | ( | enum net_priority | prio | ) |
#include <include/net/net_ip.h>
Convert Rx network packet priority to traffic class so we can place the packet into correct Rx queue.
| prio | Network priority |
|
inlinestatic |
#include <include/net/net_ip.h>
Get sockaddr_in from sockaddr. This is a helper so that the code calling this function can be made shorter.
| addr | Socket address |
|
inlinestatic |
#include <include/net/net_ip.h>
Get sockaddr_in6 from sockaddr. This is a helper so that the code calling this function can be made shorter.
| addr | Socket address |
|
inlinestatic |
#include <include/net/net_ip.h>
Get sockaddr_in6_ptr from sockaddr_ptr. This is a helper so that the code calling this function can be made shorter.
| addr | Socket address |
|
inlinestatic |
#include <include/net/net_ip.h>
Get sockaddr_in_ptr from sockaddr_ptr. This is a helper so that the code calling this function can be made shorter.
| addr | Socket address |
|
inlinestatic |
#include <include/net/net_ip.h>
Get sockaddr_ll_ptr from sockaddr_ptr. This is a helper so that the code calling this function can be made shorter.
| addr | Socket address |
#include <include/net/net_ip.h>
Compare TCP sequence numbers.
This function compares TCP sequence numbers, accounting for wraparound effects.
| seq1 | First sequence number |
| seq2 | Seconds sequence number |
#include <include/net/net_ip.h>
Check that one TCP sequence number is greater.
This is convenience function on top of net_tcp_seq_cmp().
| seq1 | First sequence number |
| seq2 | Seconds sequence number |
| int net_tx_priority2tc | ( | enum net_priority | prio | ) |
#include <include/net/net_ip.h>
Convert Tx network packet priority to traffic class so we can place the packet into correct Tx queue.
| prio | Network priority |
|
inlinestatic |
#include <include/net/net_ip.h>
Convert network packet VLAN priority to network packet priority so we can place the packet into correct queue.
| priority | VLAN priority |