OpenVPN
|
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_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) |
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_persist * | ifconfig_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) |
typedef int ifconfig_pool_handle |
enum pool_type |
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 | ||
) |
Definition at line 306 of file pool.c.
References add_in6_addr(), ASSERT, ifconfig_pool::base, ifconfig_pool_entry::common_name, ifconfig_pool::enabled, IFCONFIG_POOL_30NET, ifconfig_pool_entry_free(), ifconfig_pool_find(), IFCONFIG_POOL_INDIV, ifconfig_pool_entry::in_use, ifconfig_pool::ipv4, ifconfig_pool::ipv6, ifconfig_pool::list, string_alloc(), and ifconfig_pool::type.
Referenced by multi_select_virtual_addr().
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().
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 | ||
) |
Definition at line 146 of file pool.c.
References ALLOC_ARRAY_CLEAR, ALLOC_OBJ_CLEAR, ASSERT, ifconfig_pool::base, D_IFCONFIG_POOL, ifconfig_pool::duplicate_cn, ifconfig_pool::enabled, gc_free(), gc_new(), IFCONFIG_POOL_30NET, IFCONFIG_POOL_INDIV, IFCONFIG_POOL_MAX, ifconfig_pool::ipv4, ifconfig_pool::ipv6, ifconfig_pool::list, M_FATAL, M_INFO, M_WARN, msg, print_in6_addr(), print_in_addr_t(), ifconfig_pool::size, and ifconfig_pool::type.
Referenced by multi_init().
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().
struct ifconfig_pool_persist* ifconfig_pool_persist_init | ( | const char * | filename, |
int | refresh_freq | ||
) |
Definition at line 551 of file pool.c.
References ALLOC_OBJ_CLEAR, ASSERT, ifconfig_pool_persist::file, ifconfig_pool_persist::fixed, status_open(), STATUS_OUTPUT_READ, and STATUS_OUTPUT_WRITE.
Referenced by do_open_ifconfig_pool_persist().
void ifconfig_pool_read | ( | struct ifconfig_pool_persist * | persist, |
struct ifconfig_pool * | pool | ||
) |
Definition at line 598 of file pool.c.
References ALLOC_ARRAY_CLEAR_GC, alloc_buf_gc(), ASSERT, BLEN, BSTR, buf_init, buf_parse(), D_IFCONFIG_POOL, ifconfig_pool_persist::file, ifconfig_pool_persist::fixed, gc_free(), gc_new(), get_ipv6_addr(), getaddr(), GETADDR_HOST_ORDER, ifconfig_pool_ip_base_to_handle(), ifconfig_pool_ipv6_base_to_handle(), ifconfig_pool_msg(), ifconfig_pool_set(), M_INFO, M_WARN, msg, status_read(), and update_time().
Referenced by multi_init().
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().
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().
void ifconfig_pool_write | ( | struct ifconfig_pool_persist * | persist, |
const struct ifconfig_pool * | pool | ||
) |
Definition at line 733 of file pool.c.
References ifconfig_pool_persist::file, ifconfig_pool_list(), status_flush(), STATUS_OUTPUT_WRITE, status_reset(), and status_rw_flags().
Referenced by multi_ifconfig_pool_persist().
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().