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

The leases hash functions. More...

#include <config.h>
#include "xalloc.h"
#include "dhcpd-pools.h"
Include dependency graph for hash.c:

Macros

#define HASH_FIND_V6(head, findv6, out)   HASH_FIND(hh, head, findv6, 16, out)
 
#define HASH_ADD_V6(head, v6field, add)   HASH_ADD(hh, head, v6field, 16, add)
 

Functions

void add_lease_init (union ipaddr_t *addr __attribute__((unused)), enum ltype type __attribute__((unused)))
 Add a lease to hash array. More...
 
void add_lease_v4 (union ipaddr_t *addr, enum ltype type)
 
void add_lease_v6 (union ipaddr_t *addr, enum ltype type)
 
struct leases_tfind_lease_init (union ipaddr_t *addr __attribute__((unused)))
 Find pointer to lease from hash array. More...
 
struct leases_tfind_lease_v4 (union ipaddr_t *addr)
 
struct leases_tfind_lease_v6 (union ipaddr_t *addr)
 
void delete_lease (struct leases_t *lease)
 Delete a lease from hash array. More...
 
void delete_all_leases (void)
 Delete all leases from hash array. More...
 

Detailed Description

The leases hash functions.

The hash sorting is key to make analysis happen as quick as possible..

Macro Definition Documentation

#define HASH_ADD_V6 (   head,
  v6field,
  add 
)    HASH_ADD(hh, head, v6field, 16, add)

Referenced by add_lease_v6().

#define HASH_FIND_V6 (   head,
  findv6,
  out 
)    HASH_FIND(hh, head, findv6, 16, out)

Referenced by find_lease_v6().

Function Documentation

void add_lease_init ( union ipaddr_t *addr   __attribute__(unused),
enum ltype type   __attribute__(unused) 
)

Add a lease to hash array.

Parameters
addrBinary IP to be added in leases hash.
typeLease state of the IP.
void add_lease_v4 ( union ipaddr_t addr,
enum ltype  type 
)

Referenced by set_ipv_functions().

Here is the call graph for this function:

void add_lease_v6 ( union ipaddr_t addr,
enum ltype  type 
)

Referenced by set_ipv_functions().

Here is the call graph for this function:

void delete_all_leases ( void  )

Delete all leases from hash array.

Referenced by clean_up().

void delete_lease ( struct leases_t lease)

Delete a lease from hash array.

Parameters
leasePointer to lease hash.

Referenced by parse_leases().

struct leases_t* find_lease_init ( union ipaddr_t *addr   __attribute__(unused))

Find pointer to lease from hash array.

Parameters
addrBinary IP searched from leases hash.
Returns
A lease structure about requested IP, or NULL.
struct leases_t* find_lease_v4 ( union ipaddr_t addr)

Referenced by set_ipv_functions().

struct leases_t* find_lease_v6 ( union ipaddr_t addr)

Referenced by set_ipv_functions().