Constants

Defines constants used throughout the project.

#ifndef ch_libchirp_const_h
#define ch_libchirp_const_h

System includes

#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else // _WIN32
#include <arpa/inet.h>
#endif // _WIN32

Declarations

ch_ip_protocol_t

This definition is for documentation purposes only. The user should use AF_INET/AF_INET6.

IP protocol definition. This is either IPV4 or IPV6.

CH_IPV4

Defines the usage of IP protocol version 4.

CH_IPV6

Defines the usage of IP protocol version 6.

typedef enum { _CH_IPV4 = AF_INET, _CH_IPV6 = AF_INET6 } ch_ip_protocol_t;

The maximum size of an IP address

#define CH_IP_ADDR_SIZE 16

The size of an IP4 address

#define CH_IP4_ADDR_SIZE 4

The size of an id

#define CH_ID_SIZE 16

#endif // ch_libchirp_const_h