OpenVPN
Data Structures | Macros | Typedefs | Enumerations | Functions
pool.h File Reference
#include "basic.h"
#include "status.h"
Include dependency graph for pool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ifconfig_pool_entry
 
struct  ifconfig_pool
 
struct  ifconfig_pool_persist
 

Macros

#define IFCONFIG_POOL_MAX   65536
 
#define IFCONFIG_POOL_MIN_NETBITS   16
 

Typedefs

typedef int ifconfig_pool_handle
 

Enumerations

enum  pool_type { IFCONFIG_POOL_30NET, IFCONFIG_POOL_INDIV }
 

Functions

struct ifconfig_poolifconfig_pool_init (const bool ipv4_pool, enum pool_type type, in_addr_t start, in_addr_t end, const bool duplicate_cn, const bool ipv6_pool, const struct in6_addr ipv6_base, const int ipv6_netbits)
 
void ifconfig_pool_free (struct ifconfig_pool *pool)
 
bool ifconfig_pool_verify_range (const int msglevel, const in_addr_t start, const in_addr_t end)
 
ifconfig_pool_handle ifconfig_pool_acquire (struct ifconfig_pool *pool, in_addr_t *local, in_addr_t *remote, struct in6_addr *remote_ipv6, const char *common_name)
 
bool ifconfig_pool_release (struct ifconfig_pool *pool, ifconfig_pool_handle hand, const bool hard)
 
struct ifconfig_pool_persistifconfig_pool_persist_init (const char *filename, int refresh_freq)
 
void ifconfig_pool_persist_close (struct ifconfig_pool_persist *persist)
 
bool ifconfig_pool_write_trigger (struct ifconfig_pool_persist *persist)
 
void ifconfig_pool_read (struct ifconfig_pool_persist *persist, struct ifconfig_pool *pool)
 
void ifconfig_pool_write (struct ifconfig_pool_persist *persist, const struct ifconfig_pool *pool)
 

Macro Definition Documentation

◆ IFCONFIG_POOL_MAX

#define IFCONFIG_POOL_MAX   65536

Definition at line 32 of file pool.h.

◆ IFCONFIG_POOL_MIN_NETBITS

#define IFCONFIG_POOL_MIN_NETBITS   16

Definition at line 33 of file pool.h.

Typedef Documentation

◆ ifconfig_pool_handle

typedef int ifconfig_pool_handle

Definition at line 71 of file pool.h.

Enumeration Type Documentation

◆ pool_type

enum pool_type
Enumerator
IFCONFIG_POOL_30NET 
IFCONFIG_POOL_INDIV 

Definition at line 35 of file pool.h.

Function Documentation

◆ ifconfig_pool_acquire()

ifconfig_pool_handle ifconfig_pool_acquire ( struct ifconfig_pool pool,
in_addr_t *  local,
in_addr_t *  remote,
struct in6_addr *  remote_ipv6,
const char *  common_name 
)

◆ ifconfig_pool_free()

void ifconfig_pool_free ( struct ifconfig_pool pool)

Definition at line 290 of file pool.c.

References ifconfig_pool_entry_free(), ifconfig_pool::list, and ifconfig_pool::size.

Referenced by multi_uninit().

◆ ifconfig_pool_init()

struct ifconfig_pool* ifconfig_pool_init ( const bool  ipv4_pool,
enum pool_type  type,
in_addr_t  start,
in_addr_t  end,
const bool  duplicate_cn,
const bool  ipv6_pool,
const struct in6_addr  ipv6_base,
const int  ipv6_netbits 
)

◆ ifconfig_pool_persist_close()

void ifconfig_pool_persist_close ( struct ifconfig_pool_persist persist)

Definition at line 572 of file pool.c.

References ifconfig_pool_persist::file, and status_close().

Referenced by do_close_ifconfig_pool_persist().

◆ ifconfig_pool_persist_init()

struct ifconfig_pool_persist* ifconfig_pool_persist_init ( const char *  filename,
int  refresh_freq 
)

◆ ifconfig_pool_read()

void ifconfig_pool_read ( struct ifconfig_pool_persist persist,
struct ifconfig_pool pool 
)

◆ ifconfig_pool_release()

bool ifconfig_pool_release ( struct ifconfig_pool pool,
ifconfig_pool_handle  hand,
const bool  hard 
)

Definition at line 357 of file pool.c.

References ifconfig_pool_entry_free(), and ifconfig_pool::list.

Referenced by multi_close_instance(), and multi_select_virtual_addr().

◆ ifconfig_pool_verify_range()

bool ifconfig_pool_verify_range ( const int  msglevel,
const in_addr_t  start,
const in_addr_t  end 
)

Definition at line 121 of file pool.c.

References gc_free(), gc_new(), IFCONFIG_POOL_MAX, msg, and print_in_addr_t().

Referenced by add_option(), and helper_client_server().

◆ ifconfig_pool_write()

void ifconfig_pool_write ( struct ifconfig_pool_persist persist,
const struct ifconfig_pool pool 
)

◆ ifconfig_pool_write_trigger()

bool ifconfig_pool_write_trigger ( struct ifconfig_pool_persist persist)

Definition at line 585 of file pool.c.

References ifconfig_pool_persist::file, and status_trigger().

Referenced by multi_ifconfig_pool_persist().