ISC DHCP  4.3.3
A reference DHCPv4 and DHCPv6 implementation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mdb.c File Reference
#include "dhcpd.h"
#include "omapip/hash.h"

Go to the source code of this file.

Data Structures

struct  host_id_info
 

Macros

#define SS_NOSYNC   1
 
#define SS_QFOLLOW   2
 
#define FREE_LEASES   0
 
#define ACTIVE_LEASES   1
 
#define EXPIRED_LEASES   2
 
#define ABANDONED_LEASES   3
 
#define BACKUP_LEASES   4
 
#define RESERVED_LEASES   5
 

Typedefs

typedef struct host_id_info host_id_info_t
 

Functions

isc_result_t enter_class (struct class *cd, int dynamicp, int commit)
 
void change_host_uid (struct host_decl *host, const char *uid, int len)
 
isc_result_t enter_host (struct host_decl *hd, int dynamicp, int commit)
 
isc_result_t delete_class (struct class *cp, int commit)
 
isc_result_t delete_host (struct host_decl *hd, int commit)
 
int find_hosts_by_haddr (struct host_decl **hp, int htype, const unsigned char *haddr, unsigned hlen, const char *file, int line)
 
int find_hosts_by_uid (struct host_decl **hp, const unsigned char *data, unsigned len, const char *file, int line)
 
int find_hosts_by_option (struct host_decl **hp, struct packet *packet, struct option_state *opt_state, const char *file, int line)
 
int find_host_for_network (struct subnet **sp, struct host_decl **host, struct iaddr *addr, struct shared_network *share)
 
void new_address_range (struct parse *cfile, struct iaddr low, struct iaddr high, struct subnet *subnet, struct pool *pool, struct lease **lpchain)
 
int find_subnet (struct subnet **sp, struct iaddr addr, const char *file, int line)
 
int find_grouped_subnet (struct subnet **sp, struct shared_network *share, struct iaddr addr, const char *file, int line)
 
int subnet_inner_than (const struct subnet *subnet, const struct subnet *scan, int warnp)
 
void enter_subnet (struct subnet *subnet)
 
void enter_shared_network (struct shared_network *share)
 
void new_shared_network_interface (struct parse *cfile, struct shared_network *share, const char *name)
 
void enter_lease (struct lease *lease)
 
int supersede_lease (struct lease *comp, struct lease *lease, int commit, int propogate, int pimmediate, int from_pool)
 
void make_binding_state_transition (struct lease *lease)
 
int lease_copy (struct lease **lp, struct lease *lease, const char *file, int line)
 
void release_lease (struct lease *lease, struct packet *packet)
 
void abandon_lease (struct lease *lease, const char *message)
 
void pool_timer (void *vpool)
 
int find_lease_by_ip_addr (struct lease **lp, struct iaddr addr, const char *file, int line)
 
int find_lease_by_uid (struct lease **lp, const unsigned char *uid, unsigned len, const char *file, int line)
 
int find_lease_by_hw_addr (struct lease **lp, const unsigned char *hwaddr, unsigned hwlen, const char *file, int line)
 
void uid_hash_add (struct lease *lease)
 
void uid_hash_delete (struct lease *lease)
 
void hw_hash_add (struct lease *lease)
 
void hw_hash_delete (struct lease *lease)
 
int write_leases4 (void)
 
int write_leases ()
 
void lease_remove (struct lease **lq, struct lease *comp)
 
void lease_insert (struct lease **lq, struct lease *comp)
 
int lease_enqueue (struct lease *comp)
 
isc_result_t lease_instantiate (const void *key, unsigned len, void *object)
 
void expire_all_pools ()
 
void dump_subnets ()
 

Variables

struct subnetsubnets
 
struct shared_networkshared_networks
 
host_hash_thost_hw_addr_hash
 
host_hash_thost_uid_hash
 
host_hash_thost_name_hash
 
lease_id_hash_tlease_uid_hash
 
lease_ip_hash_tlease_ip_addr_hash
 
lease_id_hash_tlease_hw_addr_hash
 
int numclasseswritten
 
omapi_object_type_tdhcp_type_host
 

Macro Definition Documentation

#define ABANDONED_LEASES   3
#define ACTIVE_LEASES   1
#define BACKUP_LEASES   4
#define EXPIRED_LEASES   2
#define FREE_LEASES   0
#define RESERVED_LEASES   5
#define SS_NOSYNC   1

Definition at line 120 of file mdb.c.

#define SS_QFOLLOW   2

Definition at line 121 of file mdb.c.

Typedef Documentation

typedef struct host_id_info host_id_info_t

Function Documentation

void abandon_lease ( struct lease lease,
const char *  message 
)

Definition at line 1792 of file mdb.c.

void change_host_uid ( struct host_decl host,
const char *  uid,
int  len 
)

Definition at line 185 of file mdb.c.

isc_result_t delete_class ( struct class cp,
int  commit 
)

Definition at line 437 of file mdb.c.

isc_result_t delete_host ( struct host_decl hd,
int  commit 
)

Definition at line 469 of file mdb.c.

void dump_subnets ( void  )

Definition at line 2889 of file mdb.c.

isc_result_t enter_class ( struct class cd,
int  dynamicp,
int  commit 
)

Definition at line 73 of file mdb.c.

isc_result_t enter_host ( struct host_decl hd,
int  dynamicp,
int  commit 
)

Definition at line 222 of file mdb.c.

void enter_lease ( struct lease lease)

Definition at line 1079 of file mdb.c.

void enter_shared_network ( struct shared_network share)

Definition at line 1022 of file mdb.c.

void enter_subnet ( struct subnet subnet)

Definition at line 975 of file mdb.c.

void expire_all_pools ( void  )

Definition at line 2791 of file mdb.c.

int find_grouped_subnet ( struct subnet **  sp,
struct shared_network share,
struct iaddr  addr,
const char *  file,
int  line 
)

Definition at line 928 of file mdb.c.

int find_host_for_network ( struct subnet **  sp,
struct host_decl **  host,
struct iaddr addr,
struct shared_network share 
)

Definition at line 715 of file mdb.c.

int find_hosts_by_haddr ( struct host_decl **  hp,
int  htype,
const unsigned char *  haddr,
unsigned  hlen,
const char *  file,
int  line 
)

Definition at line 611 of file mdb.c.

int find_hosts_by_option ( struct host_decl **  hp,
struct packet packet,
struct option_state opt_state,
const char *  file,
int  line 
)

Definition at line 639 of file mdb.c.

int find_hosts_by_uid ( struct host_decl **  hp,
const unsigned char *  data,
unsigned  len,
const char *  file,
int  line 
)

Definition at line 631 of file mdb.c.

int find_lease_by_hw_addr ( struct lease **  lp,
const unsigned char *  hwaddr,
unsigned  hwlen,
const char *  file,
int  line 
)

Definition at line 2019 of file mdb.c.

int find_lease_by_ip_addr ( struct lease **  lp,
struct iaddr  addr,
const char *  file,
int  line 
)

Definition at line 2004 of file mdb.c.

int find_lease_by_uid ( struct lease **  lp,
const unsigned char *  uid,
unsigned  len,
const char *  file,
int  line 
)

Definition at line 2011 of file mdb.c.

int find_subnet ( struct subnet **  sp,
struct iaddr  addr,
const char *  file,
int  line 
)

Definition at line 912 of file mdb.c.

void hw_hash_add ( struct lease lease)

Definition at line 2203 of file mdb.c.

void hw_hash_delete ( struct lease lease)

Definition at line 2283 of file mdb.c.

int lease_copy ( struct lease **  lp,
struct lease lease,
const char *  file,
int  line 
)

Definition at line 1643 of file mdb.c.

int lease_enqueue ( struct lease comp)

Definition at line 2635 of file mdb.c.

void lease_insert ( struct lease **  lq,
struct lease comp 
)

Definition at line 2575 of file mdb.c.

isc_result_t lease_instantiate ( const void *  key,
unsigned  len,
void *  object 
)

Definition at line 2721 of file mdb.c.

void lease_remove ( struct lease **  lq,
struct lease comp 
)

Definition at line 2537 of file mdb.c.

void make_binding_state_transition ( struct lease lease)

Definition at line 1465 of file mdb.c.

void new_address_range ( struct parse cfile,
struct iaddr  low,
struct iaddr  high,
struct subnet subnet,
struct pool pool,
struct lease **  lpchain 
)

Definition at line 761 of file mdb.c.

void new_shared_network_interface ( struct parse cfile,
struct shared_network share,
const char *  name 
)

Definition at line 1033 of file mdb.c.

void pool_timer ( void *  vpool)

Definition at line 1866 of file mdb.c.

void release_lease ( struct lease lease,
struct packet packet 
)

Definition at line 1717 of file mdb.c.

int subnet_inner_than ( const struct subnet subnet,
const struct subnet scan,
int  warnp 
)

Definition at line 947 of file mdb.c.

int supersede_lease ( struct lease comp,
struct lease lease,
int  commit,
int  propogate,
int  pimmediate,
int  from_pool 
)

Definition at line 1122 of file mdb.c.

void uid_hash_add ( struct lease lease)

Definition at line 2086 of file mdb.c.

void uid_hash_delete ( struct lease lease)

Definition at line 2153 of file mdb.c.

int write_leases ( void  )

Definition at line 2386 of file mdb.c.

int write_leases4 ( void  )

Definition at line 2345 of file mdb.c.

Variable Documentation

omapi_object_type_t* dhcp_type_host

Definition at line 71 of file mdb.c.

host_hash_t* host_hw_addr_hash

Definition at line 35 of file mdb.c.

host_hash_t* host_name_hash

Definition at line 37 of file mdb.c.

host_hash_t* host_uid_hash

Definition at line 36 of file mdb.c.

lease_id_hash_t* lease_hw_addr_hash

Definition at line 40 of file mdb.c.

lease_ip_hash_t* lease_ip_addr_hash

Definition at line 39 of file mdb.c.

lease_id_hash_t* lease_uid_hash

Definition at line 38 of file mdb.c.

int numclasseswritten

Definition at line 69 of file mdb.c.

struct shared_network* shared_networks

Definition at line 34 of file mdb.c.

struct subnet* subnets

Definition at line 33 of file mdb.c.