|
dhcpd-pools
3.0
ISC dhcpd lease usage analyser
|
Functions to read data from dhcpd.conf and dhcdp.leases files. More...
#include <config.h>#include <arpa/inet.h>#include <ctype.h>#include <errno.h>#include <fcntl.h>#include <netinet/in.h>#include <stddef.h>#include <stdint.h>#include <stdio.h>#include <stdlib.h>#include <sys/stat.h>#include "error.h"#include "xalloc.h"#include "dhcpd-pools.h"
Enumerations | |
| enum | dhcpd_magic_numbers { MAXLEN = 1024 } |
| MAXLEN is maximum expected line length in dhcpd.conf and dhcpd.leases. More... | |
| enum | isc_conf_parser { ITS_NOTHING_INTERESTING, ITS_A_RANGE_FIRST_IP, ITS_A_RANGE_SECOND_IP, ITS_A_SHAREDNET, ITS_AN_INCLUDE, ITS_A_SUBNET, ITS_A_NETMASK } |
| Configuration file parsing state flags. More... | |
Functions | |
| int | parse_leases (struct conf_t *state, const int print_mac_addreses) |
| Lease file parser. More... | |
| static int | is_interesting_config_clause (struct conf_t *state, char const *restrict s) |
| Keyword search in dhcpd.conf file. More... | |
| static void | reorder_last_first (struct range_t *range_p) |
| Flip first and last IP in range if they are in unusual order. More... | |
| void | parse_config (struct conf_t *state, const int is_include, const char *restrict config_file, struct shared_network_t *restrict shared_p) |
| The dhcpd.conf file parser. More... | |
Functions to read data from dhcpd.conf and dhcdp.leases files.
| enum dhcpd_magic_numbers |
| enum isc_conf_parser |
Configuration file parsing state flags.
The is_interesting_config_clause() will return one of these to parse_config().
| Enumerator | |
|---|---|
| ITS_NOTHING_INTERESTING | |
| ITS_A_RANGE_FIRST_IP | |
| ITS_A_RANGE_SECOND_IP | |
| ITS_A_SHAREDNET | |
| ITS_AN_INCLUDE | |
| ITS_A_SUBNET | |
| ITS_A_NETMASK | |
Keyword search in dhcpd.conf file.
| s | A line from the dhcpd.conf file. |
Referenced by parse_config().

| void parse_config | ( | struct conf_t * | state, |
| const int | is_include, | ||
| const char *restrict | config_file, | ||
| struct shared_network_t *restrict | shared_p | ||
| ) |
The dhcpd.conf file parser.
FIXME: This spaghetti monster function needs to be rewrote at least ones more.
Referenced by main().

| int parse_leases | ( | struct conf_t * | state, |
| const int | print_mac_addreses | ||
| ) |
Lease file parser.
The parser can only read ISC DHCPD dhcpd.leases file format.
Referenced by main().

|
static |
Flip first and last IP in range if they are in unusual order.
Referenced by parse_config().
1.8.13