dhcpd-pools  2.28
ISC dhcpd lease usage analyser
Functions | Variables
dhcpd-pools.c File Reference

The main(), and core initialization. More...

#include <config.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include <stdio.h>
#include <limits.h>
#include "close-stream.h"
#include "closeout.h"
#include "error.h"
#include "progname.h"
#include "quote.h"
#include "xalloc.h"
#include "dhcpd-pools.h"
#include "defaults.h"
Include dependency graph for dhcpd-pools.c:

Functions

static int return_limit (const char c)
 
int main (int argc, char **argv)
 Start of execution. More...
 
void prepare_memory (void)
 Run time initialization. More...
 

Variables

int prefix_length [2][NUM_OF_PREFIX]
 
struct configuration_t config
 
struct shared_network_tshared_networks
 
unsigned int num_shared_networks
 
struct range_tranges
 
unsigned int num_ranges
 
struct leases_tleases
 
unsigned int RANGES
 
int(* parse_ipaddr )(const char *restrict src, union ipaddr_t *restrict dst)
 
void(* copy_ipaddr )(union ipaddr_t *restrict dst, const union ipaddr_t *restrict src)
 
const char *(* ntop_ipaddr )(const union ipaddr_t *ip)
 
double(* get_range_size )(const struct range_t *r)
 
int(* xstrstr )(const char *__restrict str)
 
int(* ipcomp )(const union ipaddr_t *restrict a, const union ipaddr_t *restrict b)
 
int(* leasecomp )(const struct leases_t *restrict a, const struct leases_t *restrict b)
 
int(* output_analysis )(void)
 
void(* add_lease )(union ipaddr_t *ip, enum ltype type)
 
struct leases_t *(* find_lease )(union ipaddr_t *ip)
 

Detailed Description

The main(), and core initialization.

Function Documentation

int main ( int  argc,
char **  argv 
)

Start of execution.

Parse options, and call other other functions one after another. At the moment adding threading support would be difficult, but there does not seem to be valid reason to consider that. Overall the analysis already quick enough even without making it parallel.

Returns
Return value indicates success or fail or analysis, unless either –warning or –critical options are in use, which makes the return value in some cases to match with Nagios expectations about alarming.

Here is the call graph for this function:

void prepare_memory ( void  )

Run time initialization.

Global allocations, counter initializations, etc are here.

Referenced by main().

Here is the call graph for this function:

static int return_limit ( const char  c)
static

Referenced by main().

Here is the call graph for this function:

Variable Documentation

void(* add_lease) (union ipaddr_t *ip, enum ltype type)

Referenced by parse_leases(), and set_ipv_functions().

struct configuration_t config
void(* copy_ipaddr) (union ipaddr_t *restrict dst, const union ipaddr_t *restrict src)
struct leases_t*(* find_lease) (union ipaddr_t *ip)

Referenced by parse_leases(), and set_ipv_functions().

double(* get_range_size) (const struct range_t *r)
int(* ipcomp) (const union ipaddr_t *restrict a, const union ipaddr_t *restrict b)
int(* leasecomp) (const struct leases_t *restrict a, const struct leases_t *restrict b)

Referenced by prepare_data(), and set_ipv_functions().

struct leases_t* leases
const char*(* ntop_ipaddr) (const union ipaddr_t *ip)
unsigned int num_ranges
unsigned int num_shared_networks
int(* output_analysis) (void)

Referenced by main().

int(* parse_ipaddr) (const char *restrict src, union ipaddr_t *restrict dst)
int prefix_length[2][NUM_OF_PREFIX]
struct range_t* ranges
unsigned int RANGES

Referenced by parse_config(), and prepare_memory().

struct shared_network_t* shared_networks
int(* xstrstr) (const char *__restrict str)

Referenced by parse_leases(), and set_ipv_functions().