ISC DHCP 4.4.3-P1
A reference DHCPv4 and DHCPv6 implementation
 
Loading...
Searching...
No Matches
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_all (struct lease **lq)
 
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

◆ ABANDONED_LEASES

#define ABANDONED_LEASES   3

◆ ACTIVE_LEASES

#define ACTIVE_LEASES   1

◆ BACKUP_LEASES

#define BACKUP_LEASES   4

◆ EXPIRED_LEASES

#define EXPIRED_LEASES   2

◆ FREE_LEASES

#define FREE_LEASES   0

◆ RESERVED_LEASES

#define RESERVED_LEASES   5

◆ SS_NOSYNC

#define SS_NOSYNC   1

Definition at line 119 of file mdb.c.

◆ SS_QFOLLOW

#define SS_QFOLLOW   2

Definition at line 120 of file mdb.c.

Typedef Documentation

◆ host_id_info_t

typedef struct host_id_info host_id_info_t

Function Documentation

◆ abandon_lease()

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

Definition at line 1830 of file mdb.c.

◆ change_host_uid()

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

Definition at line 184 of file mdb.c.

◆ delete_class()

isc_result_t delete_class ( struct class * cp,
int commit )

Definition at line 458 of file mdb.c.

◆ delete_host()

isc_result_t delete_host ( struct host_decl * hd,
int commit )

Definition at line 490 of file mdb.c.

◆ dump_subnets()

void dump_subnets ( void )

Definition at line 2933 of file mdb.c.

◆ enter_class()

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

Definition at line 72 of file mdb.c.

◆ enter_host()

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

Definition at line 221 of file mdb.c.

◆ enter_lease()

void enter_lease ( struct lease * lease)

Definition at line 1112 of file mdb.c.

◆ enter_shared_network()

void enter_shared_network ( struct shared_network * share)

Definition at line 1055 of file mdb.c.

◆ enter_subnet()

void enter_subnet ( struct subnet * subnet)

Definition at line 1008 of file mdb.c.

◆ expire_all_pools()

void expire_all_pools ( void )

Definition at line 2835 of file mdb.c.

◆ find_grouped_subnet()

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

Definition at line 953 of file mdb.c.

◆ find_host_for_network()

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

Definition at line 736 of file mdb.c.

◆ find_hosts_by_haddr()

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 632 of file mdb.c.

◆ find_hosts_by_option()

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 660 of file mdb.c.

◆ find_hosts_by_uid()

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

Definition at line 652 of file mdb.c.

◆ find_lease_by_hw_addr()

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

Definition at line 2067 of file mdb.c.

◆ find_lease_by_ip_addr()

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

Definition at line 2052 of file mdb.c.

◆ find_lease_by_uid()

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

Definition at line 2059 of file mdb.c.

◆ find_subnet()

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

Definition at line 933 of file mdb.c.

◆ hw_hash_add()

void hw_hash_add ( struct lease * lease)

Definition at line 2251 of file mdb.c.

◆ hw_hash_delete()

void hw_hash_delete ( struct lease * lease)

Definition at line 2331 of file mdb.c.

◆ lease_copy()

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

Definition at line 1681 of file mdb.c.

◆ lease_enqueue()

int lease_enqueue ( struct lease * comp)

Definition at line 2679 of file mdb.c.

◆ lease_insert()

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

Definition at line 2619 of file mdb.c.

◆ lease_instantiate()

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

Definition at line 2765 of file mdb.c.

◆ lease_remove()

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

Definition at line 2581 of file mdb.c.

◆ lease_remove_all()

void lease_remove_all ( struct lease ** lq)

Definition at line 2542 of file mdb.c.

◆ make_binding_state_transition()

void make_binding_state_transition ( struct lease * lease)

Definition at line 1503 of file mdb.c.

◆ new_address_range()

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 782 of file mdb.c.

◆ new_shared_network_interface()

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

Definition at line 1066 of file mdb.c.

◆ pool_timer()

void pool_timer ( void * vpool)

Definition at line 1914 of file mdb.c.

◆ release_lease()

void release_lease ( struct lease * lease,
struct packet * packet )

Definition at line 1755 of file mdb.c.

◆ subnet_inner_than()

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

Definition at line 976 of file mdb.c.

◆ supersede_lease()

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

Definition at line 1155 of file mdb.c.

◆ uid_hash_add()

void uid_hash_add ( struct lease * lease)

Definition at line 2134 of file mdb.c.

◆ uid_hash_delete()

void uid_hash_delete ( struct lease * lease)

Definition at line 2201 of file mdb.c.

◆ write_leases()

int write_leases ( void )

Definition at line 2434 of file mdb.c.

◆ write_leases4()

int write_leases4 ( void )

Definition at line 2393 of file mdb.c.

Variable Documentation

◆ dhcp_type_host

omapi_object_type_t* dhcp_type_host
extern

Definition at line 50 of file omapi.c.

◆ host_hw_addr_hash

host_hash_t* host_hw_addr_hash

Definition at line 34 of file mdb.c.

◆ host_name_hash

host_hash_t* host_name_hash

Definition at line 36 of file mdb.c.

◆ host_uid_hash

host_hash_t* host_uid_hash

Definition at line 35 of file mdb.c.

◆ lease_hw_addr_hash

lease_id_hash_t* lease_hw_addr_hash

Definition at line 39 of file mdb.c.

◆ lease_ip_addr_hash

lease_ip_hash_t* lease_ip_addr_hash

Definition at line 38 of file mdb.c.

◆ lease_uid_hash

lease_id_hash_t* lease_uid_hash

Definition at line 37 of file mdb.c.

◆ numclasseswritten

int numclasseswritten

Definition at line 68 of file mdb.c.

◆ shared_networks

struct shared_network* shared_networks

Definition at line 33 of file mdb.c.

◆ subnets

struct subnet* subnets

Definition at line 32 of file mdb.c.