posix-next API 0.1.0
Out-of-tree Zephyr POSIX module
Loading...
Searching...
No Matches
in.h File Reference

Internet address types and constants (<netinet/in.h>) More...

#include <stdint.h>
#include <zephyr/net/net_ip.h>
#include <zephyr/net/socket.h>
Include dependency graph for in.h:

Go to the source code of this file.

Data Structures

struct  in_addr
 IPv4 address. More...
 
struct  sockaddr_in
 Socket address for IPv4. More...
 
struct  in6_addr
 IPv6 address. More...
 
struct  sockaddr_in6
 Socket address for IPv6. More...
 
struct  ipv6_mreq
 IPv6 multicast group request. More...
 

Macros

#define IN6ADDR_ANY_INIT   { { 0 } }
 IPv6 wildcard address initializer.
 
#define IN6ADDR_LOOPBACK_INIT
 IPv6 loopback address initializer.
 
#define IPPROTO_IP   NET_IPPROTO_IP
 Dummy protocol for IP.
 
#define IPPROTO_IPV6   NET_IPPROTO_IPV6
 IPv6 header.
 
#define IPPROTO_ICMP   NET_IPPROTO_ICMP
 Internet Control Message Protocol.
 
#define IPPROTO_RAW   NET_IPPROTO_RAW
 Raw IP packets.
 
#define IPPROTO_TCP   NET_IPPROTO_TCP
 Transmission Control Protocol.
 
#define IPPROTO_UDP   NET_IPPROTO_UDP
 User Datagram Protocol.
 
#define INADDR_ANY   ((in_addr_t)NET_INADDR_ANY)
 IPv4 wildcard address (0.0.0.0).
 
#define INADDR_BROADCAST   ((in_addr_t)NET_INADDR_BROADCAST)
 IPv4 broadcast address.
 
#define INET_ADDRSTRLEN   NET_INET_ADDRSTRLEN
 Maximum length of an IPv4 address string.
 
#define htonl(x)   net_htonl(x)
 Convert a 32-bit value from host to network byte order.
 
#define htons(x)   net_htons(x)
 Convert a 16-bit value from host to network byte order.
 
#define ntohl(x)   net_ntohl(x)
 Convert a 32-bit value from network to host byte order.
 
#define ntohs(x)   net_ntohs(x)
 Convert a 16-bit value from network to host byte order.
 
#define INET6_ADDRSTRLEN   NET_INET6_ADDRSTRLEN
 Maximum length of an IPv6 address string.
 
#define IPV6_JOIN_GROUP   ZSOCK_IPV6_JOIN_GROUP
 Join an IPv6 multicast group.
 
#define IPV6_LEAVE_GROUP   ZSOCK_IPV6_LEAVE_GROUP
 Leave an IPv6 multicast group.
 
#define IPV6_MULTICAST_HOPS   ZSOCK_IPV6_MULTICAST_HOPS
 Hop limit for multicast packets.
 
#define IPV6_MULTICAST_IF   ZSOCK_IPV6_MULTICAST_IF
 Outgoing interface for multicast packets.
 
#define IPV6_MULTICAST_LOOP   ZSOCK_IPV6_MULTICAST_LOOP
 Loopback of outgoing multicast packets.
 
#define IPV6_UNICAST_HOPS   ZSOCK_IPV6_UNICAST_HOPS
 Hop limit for unicast packets.
 
#define IPV6_V6ONLY   ZSOCK_IPV6_V6ONLY
 Restrict the socket to IPv6 communication only.
 
#define IN6_IS_ADDR_UNSPECIFIED(addr)   ZSOCK_IN6_IS_ADDR_UNSPECIFIED(addr)
 Test whether an IPv6 address is the unspecified address (::).
 
#define IN6_IS_ADDR_LOOPBACK(addr)   ZSOCK_IN6_IS_ADDR_LOOPBACK(addr)
 Test whether an IPv6 address is the loopback address (::1).
 
#define IN6_IS_ADDR_MULTICAST(addr)   ZSOCK_IN6_IS_ADDR_MULTICAST(addr)
 Test whether an IPv6 address is a multicast address (ff00::/8).
 
#define IN6_IS_ADDR_LINKLOCAL(addr)   ZSOCK_IN6_IS_ADDR_LINKLOCAL(addr)
 Test whether an IPv6 address is link-local unicast (fe80::/10).
 
#define IN6_IS_ADDR_SITELOCAL(addr)   ZSOCK_IN6_IS_ADDR_SITELOCAL(addr)
 Test whether an IPv6 address is site-local unicast (fec0::/10).
 
#define IN6_IS_ADDR_V4MAPPED(addr)   ZSOCK_IN6_IS_ADDR_V4MAPPED(addr)
 Test whether an IPv6 address is an IPv4-mapped IPv6 address.
 
#define IN6_IS_ADDR_MC_NODELOCAL(addr)   ZSOCK_IN6_IS_ADDR_MC_NODELOCAL(addr)
 Test whether an IPv6 multicast address has node-local scope (ff01::/8).
 
#define IN6_IS_ADDR_MC_LINKLOCAL(addr)   ZSOCK_IN6_IS_ADDR_MC_LINKLOCAL(addr)
 Test whether an IPv6 multicast address has link-local scope (ff02::/8).
 
#define IN6_IS_ADDR_MC_SITELOCAL(addr)   ZSOCK_IN6_IS_ADDR_MC_SITELOCAL(addr)
 Test whether an IPv6 multicast address has site-local scope (ff03::/8).
 
#define IN6_IS_ADDR_MC_ORGLOCAL(addr)   ZSOCK_IN6_IS_ADDR_MC_ORGLOCAL(addr)
 Test whether an IPv6 multicast address has organization-local scope (ff04::/8).
 
#define IN6_IS_ADDR_MC_GLOBAL(addr)   ZSOCK_IN6_IS_ADDR_MC_GLOBAL(addr)
 Test whether an IPv6 multicast address has global scope (ff00::/8).
 

Typedefs

typedef net_sa_family_t sa_family_t
 
typedef uint16_t in_port_t
 Unsigned 16-bit Internet port number.
 
typedef uint32_t in_addr_t
 Unsigned 32-bit IPv4 address.
 

Variables

const struct in6_addr in6addr_any
 IPv6 wildcard address.
 
const struct in6_addr in6addr_loopback
 IPv6 loopback address.
 

Detailed Description

Internet address types and constants (<netinet/in.h>)

See also
POSIX.1-2017 <netinet/in.h>

Definition in file in.h.

Macro Definition Documentation

◆ htonl

#define htonl (   x)    net_htonl(x)

Convert a 32-bit value from host to network byte order.

Definition at line 129 of file in.h.

◆ htons

#define htons (   x)    net_htons(x)

Convert a 16-bit value from host to network byte order.

Definition at line 131 of file in.h.

◆ IN6_IS_ADDR_LINKLOCAL

#define IN6_IS_ADDR_LINKLOCAL (   addr)    ZSOCK_IN6_IS_ADDR_LINKLOCAL(addr)

Test whether an IPv6 address is link-local unicast (fe80::/10).

Definition at line 164 of file in.h.

◆ IN6_IS_ADDR_LOOPBACK

#define IN6_IS_ADDR_LOOPBACK (   addr)    ZSOCK_IN6_IS_ADDR_LOOPBACK(addr)

Test whether an IPv6 address is the loopback address (::1).

Definition at line 160 of file in.h.

◆ IN6_IS_ADDR_MC_GLOBAL

#define IN6_IS_ADDR_MC_GLOBAL (   addr)    ZSOCK_IN6_IS_ADDR_MC_GLOBAL(addr)

Test whether an IPv6 multicast address has global scope (ff00::/8).

Definition at line 178 of file in.h.

◆ IN6_IS_ADDR_MC_LINKLOCAL

#define IN6_IS_ADDR_MC_LINKLOCAL (   addr)    ZSOCK_IN6_IS_ADDR_MC_LINKLOCAL(addr)

Test whether an IPv6 multicast address has link-local scope (ff02::/8).

Definition at line 172 of file in.h.

◆ IN6_IS_ADDR_MC_NODELOCAL

#define IN6_IS_ADDR_MC_NODELOCAL (   addr)    ZSOCK_IN6_IS_ADDR_MC_NODELOCAL(addr)

Test whether an IPv6 multicast address has node-local scope (ff01::/8).

Definition at line 170 of file in.h.

◆ IN6_IS_ADDR_MC_ORGLOCAL

#define IN6_IS_ADDR_MC_ORGLOCAL (   addr)    ZSOCK_IN6_IS_ADDR_MC_ORGLOCAL(addr)

Test whether an IPv6 multicast address has organization-local scope (ff04::/8).

Definition at line 176 of file in.h.

◆ IN6_IS_ADDR_MC_SITELOCAL

#define IN6_IS_ADDR_MC_SITELOCAL (   addr)    ZSOCK_IN6_IS_ADDR_MC_SITELOCAL(addr)

Test whether an IPv6 multicast address has site-local scope (ff03::/8).

Definition at line 174 of file in.h.

◆ IN6_IS_ADDR_MULTICAST

#define IN6_IS_ADDR_MULTICAST (   addr)    ZSOCK_IN6_IS_ADDR_MULTICAST(addr)

Test whether an IPv6 address is a multicast address (ff00::/8).

Definition at line 162 of file in.h.

◆ IN6_IS_ADDR_SITELOCAL

#define IN6_IS_ADDR_SITELOCAL (   addr)    ZSOCK_IN6_IS_ADDR_SITELOCAL(addr)

Test whether an IPv6 address is site-local unicast (fec0::/10).

Definition at line 166 of file in.h.

◆ IN6_IS_ADDR_UNSPECIFIED

#define IN6_IS_ADDR_UNSPECIFIED (   addr)    ZSOCK_IN6_IS_ADDR_UNSPECIFIED(addr)

Test whether an IPv6 address is the unspecified address (::).

Definition at line 158 of file in.h.

◆ IN6_IS_ADDR_V4MAPPED

#define IN6_IS_ADDR_V4MAPPED (   addr)    ZSOCK_IN6_IS_ADDR_V4MAPPED(addr)

Test whether an IPv6 address is an IPv4-mapped IPv6 address.

Definition at line 168 of file in.h.

◆ IN6ADDR_ANY_INIT

#define IN6ADDR_ANY_INIT   { { 0 } }

IPv6 wildcard address initializer.

Definition at line 97 of file in.h.

◆ IN6ADDR_LOOPBACK_INIT

#define IN6ADDR_LOOPBACK_INIT
Value:
{ { 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 1 } }

IPv6 loopback address initializer.

Definition at line 99 of file in.h.

◆ INADDR_ANY

#define INADDR_ANY   ((in_addr_t)NET_INADDR_ANY)

IPv4 wildcard address (0.0.0.0).

Definition at line 121 of file in.h.

◆ INADDR_BROADCAST

#define INADDR_BROADCAST   ((in_addr_t)NET_INADDR_BROADCAST)

IPv4 broadcast address.

Definition at line 123 of file in.h.

◆ INET6_ADDRSTRLEN

#define INET6_ADDRSTRLEN   NET_INET6_ADDRSTRLEN

Maximum length of an IPv6 address string.

Definition at line 138 of file in.h.

◆ INET_ADDRSTRLEN

#define INET_ADDRSTRLEN   NET_INET_ADDRSTRLEN

Maximum length of an IPv4 address string.

Definition at line 126 of file in.h.

◆ IPPROTO_ICMP

#define IPPROTO_ICMP   NET_IPPROTO_ICMP

Internet Control Message Protocol.

Definition at line 115 of file in.h.

◆ IPPROTO_IP

#define IPPROTO_IP   NET_IPPROTO_IP

Dummy protocol for IP.

Definition at line 113 of file in.h.

◆ IPPROTO_IPV6

#define IPPROTO_IPV6   NET_IPPROTO_IPV6

IPv6 header.

Definition at line 114 of file in.h.

◆ IPPROTO_RAW

#define IPPROTO_RAW   NET_IPPROTO_RAW

Raw IP packets.

Definition at line 116 of file in.h.

◆ IPPROTO_TCP

#define IPPROTO_TCP   NET_IPPROTO_TCP

Transmission Control Protocol.

Definition at line 117 of file in.h.

◆ IPPROTO_UDP

#define IPPROTO_UDP   NET_IPPROTO_UDP

User Datagram Protocol.

Definition at line 118 of file in.h.

◆ IPV6_JOIN_GROUP

#define IPV6_JOIN_GROUP   ZSOCK_IPV6_JOIN_GROUP

Join an IPv6 multicast group.

Definition at line 142 of file in.h.

◆ IPV6_LEAVE_GROUP

#define IPV6_LEAVE_GROUP   ZSOCK_IPV6_LEAVE_GROUP

Leave an IPv6 multicast group.

Definition at line 144 of file in.h.

◆ IPV6_MULTICAST_HOPS

#define IPV6_MULTICAST_HOPS   ZSOCK_IPV6_MULTICAST_HOPS

Hop limit for multicast packets.

Definition at line 146 of file in.h.

◆ IPV6_MULTICAST_IF

#define IPV6_MULTICAST_IF   ZSOCK_IPV6_MULTICAST_IF

Outgoing interface for multicast packets.

Definition at line 148 of file in.h.

◆ IPV6_MULTICAST_LOOP

#define IPV6_MULTICAST_LOOP   ZSOCK_IPV6_MULTICAST_LOOP

Loopback of outgoing multicast packets.

Definition at line 150 of file in.h.

◆ IPV6_UNICAST_HOPS

#define IPV6_UNICAST_HOPS   ZSOCK_IPV6_UNICAST_HOPS

Hop limit for unicast packets.

Definition at line 152 of file in.h.

◆ IPV6_V6ONLY

#define IPV6_V6ONLY   ZSOCK_IPV6_V6ONLY

Restrict the socket to IPv6 communication only.

Definition at line 154 of file in.h.

◆ ntohl

#define ntohl (   x)    net_ntohl(x)

Convert a 32-bit value from network to host byte order.

Definition at line 133 of file in.h.

◆ ntohs

#define ntohs (   x)    net_ntohs(x)

Convert a 16-bit value from network to host byte order.

Definition at line 135 of file in.h.

Typedef Documentation

◆ in_addr_t

typedef uint32_t in_addr_t

Unsigned 32-bit IPv4 address.

Definition at line 43 of file in.h.

◆ in_port_t

typedef uint16_t in_port_t

Unsigned 16-bit Internet port number.

Definition at line 36 of file in.h.

◆ sa_family_t

typedef net_sa_family_t sa_family_t

Definition at line 29 of file in.h.

Variable Documentation

◆ in6addr_any

const struct in6_addr in6addr_any
extern

IPv6 wildcard address.

◆ in6addr_loopback

const struct in6_addr in6addr_loopback
extern

IPv6 loopback address.