corosync 3.1.8
totemip.h File Reference
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdint.h>
#include <qb/qblist.h>
Include dependency graph for totemip.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  totem_ip_address
 The totem_ip_address struct. More...
 
struct  totem_ip_if_address
 

Macros

#define totemip_nosigpipe(s)
 
#define TOTEMIP_ADDRLEN   (sizeof(struct in6_addr))
 
#define TOTEM_IP_ADDRESS
 

Enumerations

enum  totem_ip_version_enum { TOTEM_IP_VERSION_4 , TOTEM_IP_VERSION_6 , TOTEM_IP_VERSION_4_6 , TOTEM_IP_VERSION_6_4 }
 

Functions

struct totem_ip_address __attribute__ ((packed))
 
int totemip_equal (const struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
 
int totemip_sa_equal (const struct totem_ip_address *totem_ip, const struct sockaddr *sa)
 
int totemip_compare (const void *a, const void *b)
 
int totemip_is_mcast (struct totem_ip_address *addr)
 
void totemip_copy (struct totem_ip_address *addr1, const struct totem_ip_address *addr2)
 
int totemip_localhost (int family, struct totem_ip_address *localhost)
 
int totemip_localhost_check (const struct totem_ip_address *addr)
 
const char * totemip_print (const struct totem_ip_address *addr)
 
const char * totemip_sa_print (const struct sockaddr *sa)
 
int totemip_sockaddr_to_totemip_convert (const struct sockaddr_storage *saddr, struct totem_ip_address *ip_addr)
 
int totemip_totemip_to_sockaddr_convert (struct totem_ip_address *ip_addr, uint16_t port, struct sockaddr_storage *saddr, int *addrlen)
 
int totemip_parse (struct totem_ip_address *totemip, const char *addr, enum totem_ip_version_enum ip_version)
 
int totemip_iface_check (struct totem_ip_address *bindnet, struct totem_ip_address *boundto, int *interface_up, int *interface_num, int mask_high_bit)
 
int totemip_getifaddrs (struct qb_list_head *addrs)
 
void totemip_freeifaddrs (struct qb_list_head *addrs)
 
size_t totemip_udpip_header_size (int family)
 

Variables

unsigned int nodeid
 
unsigned short family
 
unsigned char addr [TOTEMIP_ADDRLEN]
 
enum totem_ip_version_enum __attribute__
 

Macro Definition Documentation

◆ TOTEM_IP_ADDRESS

#define TOTEM_IP_ADDRESS

Definition at line 62 of file totemip.h.

◆ TOTEMIP_ADDRLEN

#define TOTEMIP_ADDRLEN   (sizeof(struct in6_addr))

Definition at line 59 of file totemip.h.

◆ totemip_nosigpipe

#define totemip_nosigpipe ( s)

Definition at line 56 of file totemip.h.

Enumeration Type Documentation

◆ totem_ip_version_enum

Enumerator
TOTEM_IP_VERSION_4 
TOTEM_IP_VERSION_6 
TOTEM_IP_VERSION_4_6 
TOTEM_IP_VERSION_6_4 

Definition at line 70 of file totemip.h.

Function Documentation

◆ __attribute__()

struct totem_ip_address __attribute__ ( (packed) )

◆ totemip_compare()

int totemip_compare ( const void * a,
const void * b )
extern

◆ totemip_copy()

void totemip_copy ( struct totem_ip_address * addr1,
const struct totem_ip_address * addr2 )
extern

◆ totemip_equal()

int totemip_equal ( const struct totem_ip_address * addr1,
const struct totem_ip_address * addr2 )
extern

Definition at line 72 of file totemip.c.

References totem_ip_address::addr, and totem_ip_address::family.

Referenced by totemip_iface_check(), and totemip_localhost_check().

◆ totemip_freeifaddrs()

void totemip_freeifaddrs ( struct qb_list_head * addrs)
extern

Definition at line 514 of file totemip.c.

References totem_ip_if_address::list, and totem_ip_if_address::name.

Referenced by totemip_getifaddrs(), and totemip_iface_check().

◆ totemip_getifaddrs()

◆ totemip_iface_check()

◆ totemip_is_mcast()

int totemip_is_mcast ( struct totem_ip_address * addr)
extern

Definition at line 134 of file totemip.c.

References addr, totem_ip_address::addr, and totem_ip_address::family.

Referenced by totem_config_validate().

◆ totemip_localhost()

int totemip_localhost ( int family,
struct totem_ip_address * localhost )

◆ totemip_localhost_check()

int totemip_localhost_check ( const struct totem_ip_address * addr)
extern

Definition at line 225 of file totemip.c.

References addr, totemip_equal(), and totemip_localhost().

◆ totemip_parse()

int totemip_parse ( struct totem_ip_address * totemip,
const char * addr,
enum totem_ip_version_enum ip_version )
extern

◆ totemip_print()

◆ totemip_sa_equal()

int totemip_sa_equal ( const struct totem_ip_address * totem_ip,
const struct sockaddr * sa )
extern

Definition at line 95 of file totemip.c.

References totem_ip_address::addr, and totem_ip_address::family.

◆ totemip_sa_print()

const char * totemip_sa_print ( const struct sockaddr * sa)
extern

Definition at line 234 of file totemip.c.

Referenced by main_deliver_fn().

◆ totemip_sockaddr_to_totemip_convert()

int totemip_sockaddr_to_totemip_convert ( const struct sockaddr_storage * saddr,
struct totem_ip_address * ip_addr )
extern

Definition at line 420 of file totemip.c.

References totem_ip_address::addr, totem_ip_address::family, and totem_ip_address::nodeid.

Referenced by totemip_getifaddrs().

◆ totemip_totemip_to_sockaddr_convert()

int totemip_totemip_to_sockaddr_convert ( struct totem_ip_address * ip_addr,
uint16_t port,
struct sockaddr_storage * saddr,
int * addrlen )
extern

Definition at line 264 of file totemip.c.

References totem_ip_address::addr, and totem_ip_address::family.

Referenced by totemknet_member_add().

◆ totemip_udpip_header_size()

size_t totemip_udpip_header_size ( int family)
extern

Variable Documentation

◆ __attribute__

enum totem_ip_version_enum __attribute__

◆ addr

unsigned char addr[TOTEMIP_ADDRLEN]

Definition at line 2 of file totemip.h.

◆ family

unsigned short family

Definition at line 1 of file totemip.h.

◆ nodeid

unsigned int nodeid

Definition at line 0 of file totemip.h.