open62541 1.4.19
Open source implementation of OPC UA
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
inet.h File Reference
#include <netinet/in.h>
#include <sys/socket.h>

Go to the source code of this file.

Macros

#define INET_ADDRSTR_LEN   INET6_ADDRSTRLEN /* fits AF_INET and AF_INET6 */
 

Typedefs

typedef struct sockaddr_storage inet_addr_t
 

Functions

sa_family_t inet_family (const inet_addr_t *ss)
 
socklen_t inet_len (const inet_addr_t *ss)
 
in_port_t inet_port (const inet_addr_t *ss)
 
void inet_set_port (inet_addr_t *ss, in_port_t port)
 
void inet_anyaddr (sa_family_t family, in_port_t port, inet_addr_t *ss)
 
const char * inet_ntop2 (const inet_addr_t *ss, char *buf, size_t len)
 

Macro Definition Documentation

◆ INET_ADDRSTR_LEN

#define INET_ADDRSTR_LEN   INET6_ADDRSTRLEN /* fits AF_INET and AF_INET6 */

IPv4/IPv6 address helpers, cf.

the inet.[ch] wrapper in SMCRoute

Definition at line 8 of file inet.h.

Typedef Documentation

◆ inet_addr_t

typedef struct sockaddr_storage inet_addr_t

Definition at line 15 of file inet.h.

Function Documentation

◆ inet_anyaddr()

void inet_anyaddr ( sa_family_t  family,
in_port_t  port,
inet_addr_t *  ss 
)

Initialize @ss to the wildcard address of @family with @port.

◆ inet_family()

sa_family_t inet_family ( const inet_addr_t *  ss)

Family of @ss, AF_INET or AF_INET6.

◆ inet_len()

socklen_t inet_len ( const inet_addr_t *  ss)

Length of the concrete sockaddr in @ss, for bind()/connect()/sendto()

◆ inet_ntop2()

const char * inet_ntop2 ( const inet_addr_t *  ss,
char *  buf,
size_t  len 
)

Presentation string of the address in @ss, e.g.

for logging

◆ inet_port()

in_port_t inet_port ( const inet_addr_t *  ss)

Port in host byte order, regardless of family.

◆ inet_set_port()

void inet_set_port ( inet_addr_t *  ss,
in_port_t  port 
)

Set the port (host byte order) in the correct family-specific field.