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

Internet address conversion functions (<arpa/inet.h>) More...

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

Go to the source code of this file.

Data Structures

struct  in_addr
 IPv4 address. More...
 

Macros

#define INET_ADDRSTRLEN   NET_INET_ADDRSTRLEN
 
#define INET6_ADDRSTRLEN   NET_INET6_ADDRSTRLEN
 
#define htonl(x)   net_htonl(x)
 Convert 32-bit value from host to network byte order.
 
#define htons(x)   net_htons(x)
 Convert 16-bit value from host to network byte order.
 
#define ntohl(x)   net_ntohl(x)
 Convert 32-bit value from network to host byte order.
 
#define ntohs(x)   net_ntohs(x)
 Convert 16-bit value from network to host byte order.
 

Typedefs

typedef net_sa_family_t sa_family_t
 
typedef uint16_t in_port_t
 
typedef uint32_t in_addr_t
 

Functions

in_addr_t inet_addr (const char *cp)
 Convert an IPv4 address from dotted-decimal text to binary.
 
char * inet_ntoa (struct in_addr in)
 Convert an IPv4 address from binary to dotted-decimal text.
 
char * inet_ntop (sa_family_t family, const void *src, char *dst, size_t size)
 Convert an IPv4 or IPv6 address from binary to text form.
 
int inet_pton (sa_family_t family, const char *src, void *dst)
 Convert an IPv4 or IPv6 address from text form to binary.
 

Detailed Description

Internet address conversion functions (<arpa/inet.h>)

See also
POSIX.1-2017 <arpa/inet.h>

Definition in file inet.h.

Macro Definition Documentation

◆ htonl

#define htonl (   x)    net_htonl(x)

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

Definition at line 58 of file inet.h.

◆ htons

#define htons (   x)    net_htons(x)

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

Definition at line 60 of file inet.h.

◆ INET6_ADDRSTRLEN

#define INET6_ADDRSTRLEN   NET_INET6_ADDRSTRLEN

Definition at line 55 of file inet.h.

◆ INET_ADDRSTRLEN

#define INET_ADDRSTRLEN   NET_INET_ADDRSTRLEN

Definition at line 54 of file inet.h.

◆ ntohl

#define ntohl (   x)    net_ntohl(x)

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

Definition at line 62 of file inet.h.

◆ ntohs

#define ntohs (   x)    net_ntohs(x)

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

Definition at line 64 of file inet.h.

Typedef Documentation

◆ in_addr_t

typedef uint32_t in_addr_t

Definition at line 41 of file inet.h.

◆ in_port_t

typedef uint16_t in_port_t

Definition at line 35 of file inet.h.

◆ sa_family_t

typedef net_sa_family_t sa_family_t

Definition at line 29 of file inet.h.