All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
rlm_sqlhpwippool.c File Reference

Allocates an IPv4 address from pools defined in ASN Netvim. More...

#include <freeradius-devel/radiusd.h>
#include <freeradius-devel/modules.h>
#include <freeradius-devel/modpriv.h>
#include <ctype.h>
#include "rlm_sql.h"
+ Include dependency graph for rlm_sqlhpwippool.c:

Go to the source code of this file.

Data Structures

struct  rlm_sqlhpwippool_t
 

Macros

#define ASN_IP_POOL_NAME   1
 
#define MAX_QUERY_LEN   4096
 
#define RLM_NETVIM_MAX_ROWS   1000000
 
#define RLM_NETVIM_TMP_PREFIX   "auth-tmp-"
 
#define VENDORPEC_ASN   23782
 

Typedefs

typedef struct rlm_sqlhpwippool_t rlm_sqlhpwippool_t
 

Functions

static rlm_rcode_t CC_HINT (nonnull)
 
static int mod_instantiate (CONF_SECTION *conf, void *instance)
 
static int nvp_cleanup (rlm_sqlhpwippool_t *data)
 
static int nvp_finish (rlm_sqlhpwippool_t *data, rlm_sql_handle_t *sqlsock)
 
static int nvp_freeclosed (rlm_sqlhpwippool_t *data, rlm_sql_handle_t *sqlsock)
 
static int nvp_query (rlm_sqlhpwippool_t *data, rlm_sql_handle_t *sqlsock, char const *fmt,...)
 
static int nvp_select (rlm_sql_row_t *row, rlm_sqlhpwippool_t *data, rlm_sql_handle_t *sqlsock, char const *fmt,...)
 
static int nvp_select_finish (rlm_sqlhpwippool_t *data, rlm_sql_handle_t *sqlsock)
 
static int nvp_syncfree (rlm_sqlhpwippool_t *data, rlm_sql_handle_t *sqlsock)
 
static int nvp_vquery (rlm_sqlhpwippool_t *data, rlm_sql_handle_t *sqlsock, char const *fmt, va_list ap)
 

Variables

static CONF_PARSER module_config []
 
module_t rlm_sqlhpwippool
 

Detailed Description

Allocates an IPv4 address from pools defined in ASN Netvim.

Id:
e895213d9f998859d1143cc2b2d8e369c0541982

Current bugs/limits:

Definition in file rlm_sqlhpwippool.c.


Data Structure Documentation

struct rlm_sqlhpwippool_t

Definition at line 54 of file rlm_sqlhpwippool.c.

+ Collaboration diagram for rlm_sqlhpwippool_t:
Data Fields
rlm_sql_module_t * db
char const * db_name Netvim database.
uint32_t free_after How many seconds an IP should not be used after freeing.
char const * myname Name of this instance.
bool no_free_fail Fail if no free IP addresses found.
uint32_t sincesync req. done so far since last free IP sync.
rlm_sql_t * sql_inst
char const * sql_instance_name rlm_sql instance to use.
uint32_t sync_after How often to sync with radacct.

Macro Definition Documentation

#define ASN_IP_POOL_NAME   1

Definition at line 45 of file rlm_sqlhpwippool.c.

#define MAX_QUERY_LEN   4096

Definition at line 50 of file rlm_sqlhpwippool.c.

#define RLM_NETVIM_MAX_ROWS   1000000

Definition at line 47 of file rlm_sqlhpwippool.c.

#define RLM_NETVIM_TMP_PREFIX   "auth-tmp-"

Definition at line 48 of file rlm_sqlhpwippool.c.

#define VENDORPEC_ASN   23782

Definition at line 44 of file rlm_sqlhpwippool.c.

Typedef Documentation

Function Documentation

static rlm_rcode_t CC_HINT ( nonnull  )
static

Definition at line 299 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

static int mod_instantiate ( CONF_SECTION conf,
void *  instance 
)
static

Definition at line 262 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

static int nvp_cleanup ( rlm_sqlhpwippool_t data)
static

Definition at line 209 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int nvp_finish ( rlm_sqlhpwippool_t data,
rlm_sql_handle_t sqlsock 
)
static

Definition at line 115 of file rlm_sqlhpwippool.c.

+ Here is the caller graph for this function:

static int nvp_freeclosed ( rlm_sqlhpwippool_t data,
rlm_sql_handle_t sqlsock 
)
static

Definition at line 164 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int nvp_query ( rlm_sqlhpwippool_t data,
rlm_sql_handle_t sqlsock,
char const *  fmt,
  ... 
)
static

Definition at line 101 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int nvp_select ( rlm_sql_row_t row,
rlm_sqlhpwippool_t data,
rlm_sql_handle_t sqlsock,
char const *  fmt,
  ... 
)
static

Definition at line 124 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int nvp_select_finish ( rlm_sqlhpwippool_t data,
rlm_sql_handle_t sqlsock 
)
static

Definition at line 157 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int nvp_syncfree ( rlm_sqlhpwippool_t data,
rlm_sql_handle_t sqlsock 
)
static

Definition at line 186 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static int nvp_vquery ( rlm_sqlhpwippool_t data,
rlm_sql_handle_t sqlsock,
char const *  fmt,
va_list  ap 
)
static

Definition at line 84 of file rlm_sqlhpwippool.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

CONF_PARSER module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("sql_module_instance", PW_TYPE_STRING, rlm_sqlhpwippool_t, sql_instance_name), .dflt = "sql" },
{ FR_CONF_OFFSET("db_name", PW_TYPE_STRING, rlm_sqlhpwippool_t, db_name), .dflt = "netvim" },
{ FR_CONF_OFFSET("no_free_fail", PW_TYPE_BOOLEAN, rlm_sqlhpwippool_t, no_free_fail), .dflt = "yes" },
{ FR_CONF_OFFSET("free_after", PW_TYPE_INTEGER, rlm_sqlhpwippool_t, free_after), .dflt = "300" },
{ FR_CONF_OFFSET("sync_after", PW_TYPE_INTEGER, rlm_sqlhpwippool_t, sync_after), .dflt = "25" },
}
#define CONF_PARSER_TERMINATOR
Definition: conffile.h:289
A truth value.
Definition: radius.h:56
32 Bit unsigned integer.
Definition: radius.h:34
#define FR_CONF_OFFSET(_n, _t, _s, _f)
Definition: conffile.h:168
String of printable characters.
Definition: radius.h:33

Definition at line 73 of file rlm_sqlhpwippool.c.

module_t rlm_sqlhpwippool
Initial value:
= {
.magic = RLM_MODULE_INIT,
.name = "sqlhpwippool",
.inst_size = sizeof(rlm_sqlhpwippool_t),
.config = module_config,
.instantiate = mod_instantiate,
.methods = {
},
}
static rlm_rcode_t mod_accounting(void *instance, REQUEST *request)
Write accounting data to Couchbase documents.
static rlm_rcode_t mod_post_auth(void *instance, REQUEST *request) CC_HINT(nonnull)
7 methods index for postauth section.
Definition: modules.h:48
#define RLM_TYPE_THREAD_SAFE
Module is threadsafe.
Definition: modules.h:75
#define RLM_MODULE_INIT
Definition: modules.h:86
3 methods index for accounting section.
Definition: modules.h:44
static CONF_PARSER module_config[]
static int mod_instantiate(CONF_SECTION *conf, void *instance)
struct rlm_sqlhpwippool_t rlm_sqlhpwippool_t

Definition at line 746 of file rlm_sqlhpwippool.c.