ISC DHCP 4.4.3-P1
A reference DHCPv4 and DHCPv6 implementation
 
Loading...
Searching...
No Matches
confparse.c File Reference
#include "keama.h"
#include <sys/errno.h>
#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
#include <fcntl.h>
#include <time.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Data Structures

struct  subnet
 

Functions

 TAILQ_HEAD (subnets, subnet)
 
 TAILQ_HEAD (ranges, range)
 
void read_conf_file (struct parse *parent, const char *filename, int group_type)
 
size_t conf_file_subparse (struct parse *cfile, int type)
 
isc_boolean_t parse_statement (struct parse *cfile, int type, isc_boolean_t declaration)
 
void get_permit (struct parse *cfile, struct element *permit_head)
 Parse allow and deny statements.
 
void parse_pool_statement (struct parse *cfile, int type)
 Parse a pool statement.
 
void parse_lbrace (struct parse *cfile)
 
void parse_host_declaration (struct parse *cfile)
 
void parse_class_declaration (struct parse *cfile, int type)
 
void parse_shared_net_declaration (struct parse *cfile)
 
void parse_subnet_declaration (struct parse *cfile)
 
void parse_subnet6_declaration (struct parse *cfile)
 
void parse_group_declaration (struct parse *cfile)
 
void close_group (struct parse *cfile, struct element *group)
 
struct elementparse_fixed_addr_param (struct parse *cfile, enum dhcp_token type)
 
void parse_address_range (struct parse *cfile, int type, size_t where)
 
void parse_address_range6 (struct parse *cfile, int type, size_t where)
 
void parse_prefix6 (struct parse *cfile, int type, size_t where)
 
void parse_fixed_prefix6 (struct parse *cfile, size_t host_decl)
 
void parse_pool6_statement (struct parse *cfile, int type)
 Parse a pool6 statement.
 
struct elementparse_allow_deny (struct parse *cfile, int flag)
 
void parse_server_duid_conf (struct parse *cfile)
 
void parse_directive (struct parse *cfile)
 Parse (and execute) a directive (extension)
 
void parse_option_space_dir (struct parse *cfile)
 
void parse_option_code_dir (struct parse *cfile, struct option *option)
 
void parse_option_status_dir (struct parse *cfile, struct option *option, enum dhcp_token token)
 
void parse_option_local_dir (struct parse *cfile, struct option *option)
 
void parse_option_define_dir (struct parse *cfile, struct option *option)
 

Variables

isc_boolean_t failover_once = ISC_TRUE
 
isc_boolean_t use_client_id = ISC_FALSE
 
isc_boolean_t use_flex_id = ISC_FALSE
 
isc_boolean_t use_hw_address = ISC_FALSE
 
const struct optionhost_id_option = NULL
 
int host_id_relays = 0
 
unsigned subnet_counter = 0
 
unsigned subclass_counter = 0
 

Function Documentation

◆ close_group()

void close_group ( struct parse * cfile,
struct element * group )

Definition at line 2589 of file confparse.c.

◆ conf_file_subparse()

size_t conf_file_subparse ( struct parse * cfile,
int type )

Definition at line 535 of file confparse.c.

◆ get_permit()

void get_permit ( struct parse * cfile,
struct element * permit_head )

Parse allow and deny statements.

This function handles the common processing code for permit and deny statements in the parse_pool_statement and parse_pool6_statement functions.

The allow or deny token should already be consumed, this function expects one of the following: known-clients; unknown-clients; known clients; unknown clients; authenticated clients; unauthenticated clients; all clients; dynamic bootp clients; members of <class name>; after <date>;

Parameters
[in]cfile= the configuration file being parsed
[in]permit_head= the head of the permit list (permit or prohibit) to which to attach the newly created permit structure

Definition at line 1004 of file confparse.c.

◆ parse_address_range()

void parse_address_range ( struct parse * cfile,
int type,
size_t where )

Definition at line 3097 of file confparse.c.

◆ parse_address_range6()

void parse_address_range6 ( struct parse * cfile,
int type,
size_t where )

Definition at line 3212 of file confparse.c.

◆ parse_allow_deny()

struct element * parse_allow_deny ( struct parse * cfile,
int flag )

Definition at line 3703 of file confparse.c.

◆ parse_class_declaration()

void parse_class_declaration ( struct parse * cfile,
int type )

Definition at line 1584 of file confparse.c.

◆ parse_directive()

void parse_directive ( struct parse * cfile)

Parse (and execute) a directive (extension)

OPTION SPACE <name> [ALIAS <kea-name>] [KNOWN*2|UNKNOWN*2|DYNAMIC] OPTION <universe>.<name> [CHECK] [ALIAS <name>] [CODE = "<format>"] [KNOWN*2|UNKNOWN*2|DYNAMIC] [LOCAL|DEFINE]

Definition at line 4001 of file confparse.c.

◆ parse_fixed_addr_param()

struct element * parse_fixed_addr_param ( struct parse * cfile,
enum dhcp_token type )

Definition at line 3008 of file confparse.c.

◆ parse_fixed_prefix6()

void parse_fixed_prefix6 ( struct parse * cfile,
size_t host_decl )

Definition at line 3409 of file confparse.c.

◆ parse_group_declaration()

void parse_group_declaration ( struct parse * cfile)

Definition at line 2520 of file confparse.c.

◆ parse_host_declaration()

void parse_host_declaration ( struct parse * cfile)

Definition at line 1282 of file confparse.c.

◆ parse_lbrace()

void parse_lbrace ( struct parse * cfile)

Definition at line 1269 of file confparse.c.

◆ parse_option_code_dir()

void parse_option_code_dir ( struct parse * cfile,
struct option * option )

Definition at line 4156 of file confparse.c.

◆ parse_option_define_dir()

void parse_option_define_dir ( struct parse * cfile,
struct option * option )

Definition at line 4316 of file confparse.c.

◆ parse_option_local_dir()

void parse_option_local_dir ( struct parse * cfile,
struct option * option )

Definition at line 4268 of file confparse.c.

◆ parse_option_space_dir()

void parse_option_space_dir ( struct parse * cfile)

Definition at line 4091 of file confparse.c.

◆ parse_option_status_dir()

void parse_option_status_dir ( struct parse * cfile,
struct option * option,
enum dhcp_token token )

Definition at line 4236 of file confparse.c.

◆ parse_pool6_statement()

void parse_pool6_statement ( struct parse * cfile,
int type )

Parse a pool6 statement.

Pool statements are used to group declarations and permit & deny information with a specific address range. They must be declared within a shared network or subnet and there may be multiple pools withing a shared network or subnet. Each pool may have a different set of permit or deny options.

Parameters
[in]cfile= the configuration file being parsed
[in]type= the type of the enclosing statement. This must be SUBNET_DECL for this function.
Returns
void - This function either parses the statement and updates the structures or it generates an error message and possible halts the program if it encounters a problem.

Definition at line 3472 of file confparse.c.

◆ parse_pool_statement()

void parse_pool_statement ( struct parse * cfile,
int type )

Parse a pool statement.

Pool statements are used to group declarations and permit & deny information with a specific address range. They must be declared within a shared network or subnet and there may be multiple pools withing a shared network or subnet. Each pool may have a different set of permit or deny options.

Parameters
[in]cfile= the configuration file being parsed
[in]type= the type of the enclosing statement. This must be SHARED_NET_DECL or SUBNET_DECL for this function.
Returns
void - This function either parses the statement and updates the structures or it generates an error message and possible halts the program if it encounters a problem.

Definition at line 1142 of file confparse.c.

◆ parse_prefix6()

void parse_prefix6 ( struct parse * cfile,
int type,
size_t where )

Definition at line 3333 of file confparse.c.

◆ parse_server_duid_conf()

void parse_server_duid_conf ( struct parse * cfile)

Definition at line 3790 of file confparse.c.

◆ parse_shared_net_declaration()

void parse_shared_net_declaration ( struct parse * cfile)

Definition at line 2105 of file confparse.c.

◆ parse_statement()

isc_boolean_t parse_statement ( struct parse * cfile,
int type,
isc_boolean_t declaration )

Definition at line 584 of file confparse.c.

◆ parse_subnet6_declaration()

void parse_subnet6_declaration ( struct parse * cfile)

Definition at line 2429 of file confparse.c.

◆ parse_subnet_declaration()

void parse_subnet_declaration ( struct parse * cfile)

Definition at line 2337 of file confparse.c.

◆ read_conf_file()

void read_conf_file ( struct parse * parent,
const char * filename,
int group_type )

Definition at line 480 of file confparse.c.

◆ TAILQ_HEAD() [1/2]

TAILQ_HEAD ( ranges ,
range  )

Definition at line 74 of file confparse.c.

◆ TAILQ_HEAD() [2/2]

TAILQ_HEAD ( subnets ,
subnet  )

Definition at line 64 of file confparse.c.

Variable Documentation

◆ failover_once

isc_boolean_t failover_once = ISC_TRUE

Definition at line 38 of file confparse.c.

◆ host_id_option

const struct option* host_id_option = NULL

Definition at line 46 of file confparse.c.

◆ host_id_relays

int host_id_relays = 0

Definition at line 47 of file confparse.c.

◆ subclass_counter

unsigned subclass_counter = 0

Definition at line 53 of file confparse.c.

◆ subnet_counter

unsigned subnet_counter = 0

Definition at line 50 of file confparse.c.

◆ use_client_id

isc_boolean_t use_client_id = ISC_FALSE

Definition at line 41 of file confparse.c.

◆ use_flex_id

isc_boolean_t use_flex_id = ISC_FALSE

Definition at line 42 of file confparse.c.

◆ use_hw_address

isc_boolean_t use_hw_address = ISC_FALSE

Definition at line 43 of file confparse.c.