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

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

#include <config.h>
#include <errno.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 dependency graph for dhcpd-pools.c:

Functions

static int return_limit (const char c)
 An option argument parser to populate state header_limit and number_limit values. More...
 
static void prepare_memory (struct conf_t *state)
 Run time initialization. More...
 
static void skip_arg_parse (struct conf_t *state, char *optarg)
 The –skip option argument parser. More...
 
static char parse_command_line_opts (struct conf_t *state, int argc, char **argv)
 Command line options parser. More...
 
int main (int argc, char **argv)
 Start of execution. More...
 

Variables

int(* parse_ipaddr )(struct conf_t *state, 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 )(struct conf_t *state, 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)
 
void(* add_lease )(struct conf_t *state, union ipaddr_t *ip, enum ltype type)
 
struct leases_t *(* find_lease )(struct conf_t *state, union ipaddr_t *ip)
 

Detailed Description

The main(), and core initialization.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Start of execution.

This will mostly call other functions one after another.

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.

Referenced by _getopt_long_only_r().

Here is the call graph for this function:

◆ parse_command_line_opts()

static char parse_command_line_opts ( struct conf_t state,
int  argc,
char **  argv 
)
static

Command line options parser.

Referenced by main().

Here is the call graph for this function:

◆ prepare_memory()

static void prepare_memory ( struct conf_t state)
static

Run time initialization.

Global allocations, counter initializations, etc are here.

Referenced by main().

Here is the call graph for this function:

◆ return_limit()

static int return_limit ( const char  c)
static

An option argument parser to populate state header_limit and number_limit values.

Referenced by parse_command_line_opts().

Here is the call graph for this function:

◆ skip_arg_parse()

static void skip_arg_parse ( struct conf_t state,
char *  optarg 
)
static

The –skip option argument parser.

Referenced by parse_command_line_opts().

Here is the call graph for this function:

Variable Documentation

◆ add_lease

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

Referenced by parse_leases(), and set_ipv_functions().

◆ copy_ipaddr

void(* copy_ipaddr) (union ipaddr_t *restrict dst, const union ipaddr_t *restrict src)

◆ find_lease

struct leases_t*(* find_lease) (struct conf_t *state, union ipaddr_t *ip)

Referenced by parse_leases(), and set_ipv_functions().

◆ get_range_size

double(* get_range_size) (const struct range_t *r)

◆ ipcomp

int(* ipcomp) (const union ipaddr_t *restrict a, const union ipaddr_t *restrict b)

◆ leasecomp

int(* leasecomp) (const struct leases_t *restrict a, const struct leases_t *restrict b)

Referenced by prepare_data(), and set_ipv_functions().

◆ ntop_ipaddr

const char*(* ntop_ipaddr) (const union ipaddr_t *ip)

◆ parse_ipaddr

int(* parse_ipaddr) (struct conf_t *state, const char *restrict src, union ipaddr_t *restrict dst)

◆ xstrstr

int(* xstrstr) (struct conf_t *state, const char *restrict str)

Referenced by parse_leases(), and set_ipv_functions().