OpenVPN
Functions
pool.c File Reference
#include "syshead.h"
#include "pool.h"
#include "buffer.h"
#include "error.h"
#include "socket.h"
#include "otime.h"
#include "memdbg.h"
Include dependency graph for pool.c:

Go to the source code of this file.

Functions

static void ifconfig_pool_entry_free (struct ifconfig_pool_entry *ipe, bool hard)
 
static int ifconfig_pool_find (struct ifconfig_pool *pool, const char *common_name)
 
bool ifconfig_pool_verify_range (const int msglevel, const in_addr_t start, const in_addr_t end)
 
struct ifconfig_poolifconfig_pool_init (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)
 
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)
 
static ifconfig_pool_handle ifconfig_pool_ip_base_to_handle (const struct ifconfig_pool *pool, const in_addr_t addr)
 
static in_addr_t ifconfig_pool_handle_to_ip_base (const struct ifconfig_pool *pool, ifconfig_pool_handle hand)
 
static struct in6_addr ifconfig_pool_handle_to_ipv6_base (const struct ifconfig_pool *pool, ifconfig_pool_handle hand)
 
static void ifconfig_pool_set (struct ifconfig_pool *pool, const char *cn, const in_addr_t addr, const bool fixed)
 
static void ifconfig_pool_list (const struct ifconfig_pool *pool, struct status_output *out)
 
static void ifconfig_pool_msg (const struct ifconfig_pool *pool, int msglevel)
 
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)
 

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_entry_free()

static void ifconfig_pool_entry_free ( struct ifconfig_pool_entry ipe,
bool  hard 
)
static

◆ ifconfig_pool_find()

static int ifconfig_pool_find ( struct ifconfig_pool pool,
const char *  common_name 
)
static

◆ ifconfig_pool_free()

void ifconfig_pool_free ( struct ifconfig_pool pool)

◆ ifconfig_pool_handle_to_ip_base()

static in_addr_t ifconfig_pool_handle_to_ip_base ( const struct ifconfig_pool pool,
ifconfig_pool_handle  hand 
)
static

◆ ifconfig_pool_handle_to_ipv6_base()

static struct in6_addr ifconfig_pool_handle_to_ipv6_base ( const struct ifconfig_pool pool,
ifconfig_pool_handle  hand 
)
static

Definition at line 350 of file pool.c.

References add_in6_addr().

Referenced by ifconfig_pool_list().

◆ ifconfig_pool_init()

struct ifconfig_pool* ifconfig_pool_init ( 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_ip_base_to_handle()

static ifconfig_pool_handle ifconfig_pool_ip_base_to_handle ( const struct ifconfig_pool pool,
const in_addr_t  addr 
)
static

◆ ifconfig_pool_list()

static void ifconfig_pool_list ( const struct ifconfig_pool pool,
struct status_output out 
)
static

◆ ifconfig_pool_msg()

static void ifconfig_pool_msg ( const struct ifconfig_pool pool,
int  msglevel 
)
static

Definition at line 412 of file pool.c.

References ASSERT, ifconfig_pool_list(), status_close(), status_open(), and status_printf().

Referenced by ifconfig_pool_read().

◆ ifconfig_pool_persist_close()

void ifconfig_pool_persist_close ( struct ifconfig_pool_persist persist)

Definition at line 447 of file pool.c.

References ifconfig_pool_persist::file, free, 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 
)

◆ ifconfig_pool_set()

static void ifconfig_pool_set ( struct ifconfig_pool pool,
const char *  cn,
const in_addr_t  addr,
const bool  fixed 
)
static

◆ 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 125 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 460 of file pool.c.

References ifconfig_pool_persist::file, and status_trigger().

Referenced by multi_ifconfig_pool_persist().