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 (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)
 
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 ifconfig_pool_handle ifconfig_pool_ipv6_base_to_handle (const struct ifconfig_pool *pool, const struct in6_addr *in_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, ifconfig_pool_handle h, 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)

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_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 475 of file pool.c.

References add_in6_addr().

Referenced by ifconfig_pool_list().

◆ 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_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_ipv6_base_to_handle()

static ifconfig_pool_handle ifconfig_pool_ipv6_base_to_handle ( const struct ifconfig_pool pool,
const struct in6_addr *  in_addr 
)
static

Definition at line 406 of file pool.c.

References ifconfig_pool::base, ifconfig_pool::ipv6, and ifconfig_pool::size.

Referenced by ifconfig_pool_read().

◆ 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

◆ 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_set()

static void ifconfig_pool_set ( struct ifconfig_pool pool,
const char *  cn,
ifconfig_pool_handle  h,
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 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().