The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
rlm_isc_dhcp.c File Reference

Read ISC DHCP configuration files. More...

#include <freeradius-devel/server/base.h>
#include <freeradius-devel/server/module_rlm.h>
#include <freeradius-devel/dhcpv4/dhcpv4.h>
#include <freeradius-devel/util/debug.h>
#include <freeradius-devel/server/map_proc.h>
+ Include dependency graph for rlm_isc_dhcp.c:

Go to the source code of this file.

Data Structures

struct  isc_host_ether_t
 
struct  isc_host_uid_t
 
struct  rlm_isc_dhcp_cmd_t
 Describes the commands that we accept, including it's syntax (i.e. More...
 
struct  rlm_isc_dhcp_info_s
 Holds information about the thing we parsed. More...
 
struct  rlm_isc_dhcp_t
 
struct  rlm_isc_dhcp_tokenizer_t
 Holds the state of the current tokenizer. More...
 

Macros

#define DDEBUG(...)
 
#define IDEBUG   if (state->debug) DEBUG
 
#define isc_ignore   ISC_IGNORE, NULL, NULL
 
#define isc_invalid   ISC_INVALID, NULL, NULL
 
#define isc_not_done   ISC_NOOP, NULL, NULL
 
#define MAYBE_SEMICOLON   (2)
 
#define member_size(type, member)   sizeof(((type *)0)->member)
 
#define NO_SEMICOLON   (0)
 
#define TYPE_CHECK(name, type)   if ((state->token_len == (sizeof(name) - 1)) && (memcmp(state->token, name, sizeof(name) - 1) == 0)) return type
 Parse one type string. More...
 
#define vb_ipv4addr   vb_ip.addr.v4.s_addr
 
#define YES_SEMICOLON   (1)
 

Typedefs

typedef int(* rlm_isc_dhcp_apply_t) (rlm_isc_dhcp_t const *inst, request_t *request, rlm_isc_dhcp_info_t *info)
 
typedef struct rlm_isc_dhcp_info_s rlm_isc_dhcp_info_t
 
typedef int(* rlm_isc_dhcp_parse_t) (rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 
typedef enum rlm_isc_dhcp_type_t rlm_isc_dhcp_type_t
 

Enumerations

enum  rlm_isc_dhcp_type_t {
  ISC_INVALID = 0 ,
  ISC_NOOP ,
  ISC_IGNORE ,
  ISC_GROUP ,
  ISC_HOST ,
  ISC_SUBNET ,
  ISC_OPTION ,
  ISC_HARDWARE_ETHERNET ,
  ISC_FIXED_ADDRESS
}
 

Functions

static int add_option_by_da (rlm_isc_dhcp_info_t *info, fr_dict_attr_t const *da)
 
static int apply (rlm_isc_dhcp_t const *inst, request_t *request, rlm_isc_dhcp_info_t *head)
 Apply all rules except fixed IP. More...
 
static int apply_fixed_ip (rlm_isc_dhcp_t const *inst, request_t *request)
 Apply fixed IPs. More...
 
static rlm_isc_dhcp_info_tget_host (request_t *request, fr_hash_table_t *hosts_by_ether, fr_hash_table_t *hosts_by_uid)
 
static int8_t host_ether_cmp (void const *one, void const *two)
 
static uint32_t host_ether_hash (void const *data)
 
static int8_t host_uid_cmp (void const *one, void const *two)
 
static uint32_t host_uid_hash (void const *data)
 
static fr_type_t isc2fr_type (rlm_isc_dhcp_tokenizer_t *state)
 
static int match_keyword (rlm_isc_dhcp_info_t *parent, rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_cmd_t const *tokens, int num_tokens)
 
static int match_subword (rlm_isc_dhcp_tokenizer_t *state, char const *cmd, rlm_isc_dhcp_info_t *info)
 Recursively match subwords inside of a command string. More...
 
static unlang_action_t mod_authorize (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static int mod_instantiate (module_inst_ctx_t const *mctx)
 
static unlang_action_t mod_post_auth (rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
 
static int parse_filename (UNUSED rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 filename STRING More...
 
static int parse_host (rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 host NAME { ... More...
 
static int parse_include (rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 
static int parse_next_server (UNUSED rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 next-server IPADDR More...
 
static int parse_option (rlm_isc_dhcp_info_t *parent, rlm_isc_dhcp_tokenizer_t *state, fr_dict_attr_t const *da, char *value)
 
static int parse_option_definition (rlm_isc_dhcp_info_t *parent, rlm_isc_dhcp_tokenizer_t *state, char *name)
 option new-name code new-code = definition ; More...
 
static int parse_option_space (UNUSED rlm_isc_dhcp_info_t *parent, UNUSED rlm_isc_dhcp_tokenizer_t *state, UNUSED char *name)
 option space name [ [ code width number ] [ length width number ] [ hash size number ] ] ; More...
 
static int parse_options (rlm_isc_dhcp_info_t *parent, rlm_isc_dhcp_tokenizer_t *state)
 Parse "option" command. More...
 
static int parse_section (rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 Parse a section { ... More...
 
static int parse_server_identifier (UNUSED rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 server-identifier IPADDR More...
 
static int parse_server_name (UNUSED rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 server-name STRING More...
 
static int parse_subnet (rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)
 subnet IPADDR netmask MASK { ... More...
 
static int read_file (rlm_isc_dhcp_t *inst, rlm_isc_dhcp_info_t *parent, char const *filename)
 Open a file and read it into a parent. More...
 
static int read_string (rlm_isc_dhcp_tokenizer_t *state)
 
static int read_token (rlm_isc_dhcp_tokenizer_t *state, fr_token_t hint, int semicolon, bool allow_rcbrace)
 Reads one token into state->token. More...
 
static int refill (rlm_isc_dhcp_tokenizer_t *state)
 Refills the read buffer with one line from the file. More...
 
static int skip_spaces (rlm_isc_dhcp_tokenizer_t *state, char *p)
 

Variables

static fr_dict_attr_t const * attr_boot_filename
 
static fr_dict_attr_t const * attr_client_hardware_address
 
static fr_dict_attr_t const * attr_client_identifier
 
static fr_dict_attr_t const * attr_server_identifier
 
static fr_dict_attr_t const * attr_server_ip_address
 
static fr_dict_attr_t const * attr_server_name
 
static fr_dict_attr_t const * attr_your_ip_address
 
static const rlm_isc_dhcp_cmd_t commands []
 Table of commands that we allow. More...
 
static fr_dict_t const * dict_dhcpv4
 
static const conf_parser_t module_config []
 
module_rlm_t rlm_isc_dhcp
 
fr_dict_autoload_t rlm_isc_dhcp_dict []
 
fr_dict_attr_autoload_t rlm_isc_dhcp_dict_attr []
 
static char const * spaces = " "
 

Detailed Description

Read ISC DHCP configuration files.

Id
a4c1b2f978de7e23354e90a25bcf0c3a2bcd9c9e

Definition in file rlm_isc_dhcp.c.


Data Structure Documentation

◆ isc_host_ether_t

struct isc_host_ether_t

Definition at line 761 of file rlm_isc_dhcp.c.

+ Collaboration diagram for isc_host_ether_t:
Data Fields
uint8_t ether[6]
rlm_isc_dhcp_info_t * host

◆ isc_host_uid_t

struct isc_host_uid_t

Definition at line 783 of file rlm_isc_dhcp.c.

+ Collaboration diagram for isc_host_uid_t:
Data Fields
fr_value_box_t * client
rlm_isc_dhcp_info_t * host

◆ rlm_isc_dhcp_cmd_t

struct rlm_isc_dhcp_cmd_t

Describes the commands that we accept, including it's syntax (i.e.

name), etc.

Definition at line 166 of file rlm_isc_dhcp.c.

+ Collaboration diagram for rlm_isc_dhcp_cmd_t:
Data Fields
rlm_isc_dhcp_apply_t apply
int max_argc
char const * name
rlm_isc_dhcp_parse_t parse
rlm_isc_dhcp_type_t type

◆ rlm_isc_dhcp_info_s

struct rlm_isc_dhcp_info_s

Holds information about the thing we parsed.

Note that this parser is forgiving.  We would rather accept
things ISC DHCP doesn't accept, than reject things it accepts.

Since we only implement a tiny portion of it's configuration,
we tend to accept all kinds of things, and then just ignore them.

Definition at line 182 of file rlm_isc_dhcp.c.

+ Collaboration diagram for rlm_isc_dhcp_info_s:
Data Fields
int argc
fr_value_box_t ** argv
rlm_isc_dhcp_info_t * child
rlm_isc_dhcp_cmd_t const * cmd
void * data per-thing parsed data.
fr_hash_table_t * hosts_by_ether by MAC address
fr_hash_table_t * hosts_by_uid by client identifier
rlm_isc_dhcp_info_t ** last pointer to last child
rlm_isc_dhcp_info_t * next
fr_pair_list_t options DHCP options.
rlm_isc_dhcp_info_t * parent
fr_trie_t * subnets

◆ rlm_isc_dhcp_t

struct rlm_isc_dhcp_t

Definition at line 76 of file rlm_isc_dhcp.c.

+ Collaboration diagram for rlm_isc_dhcp_t:
Data Fields
bool debug
char const * filename
rlm_isc_dhcp_info_t * head
fr_hash_table_t * hosts_by_ether by MAC address
fr_hash_table_t * hosts_by_uid by client identifier
bool pedantic

◆ rlm_isc_dhcp_tokenizer_t

struct rlm_isc_dhcp_tokenizer_t

Holds the state of the current tokenizer.

Definition at line 124 of file rlm_isc_dhcp.c.

+ Collaboration diagram for rlm_isc_dhcp_tokenizer_t:
Data Fields
bool allow_eof do we allow EOF? (i.e. braces == 0)
int braces how many levels deep we are in a { ... }
char * buffer read buffer
size_t bufsize size of read buffer
bool debug internal developer debugging
bool eof are we at EOF?
char const * filename
FILE * fp
rlm_isc_dhcp_t * inst module instance
char * line where the current line started
int lineno
char * ptr pointer into read buffer
bool saw_semicolon whether we saw a semicolon
char string[256] double quoted strings go here, so we don't mangle the input buffer
char * token current token that we parsed
size_t token_len length of the token

Macro Definition Documentation

◆ DDEBUG

#define DDEBUG (   ...)

Definition at line 109 of file rlm_isc_dhcp.c.

◆ IDEBUG

#define IDEBUG   if (state->debug) DEBUG

Definition at line 104 of file rlm_isc_dhcp.c.

◆ isc_ignore

#define isc_ignore   ISC_IGNORE, NULL, NULL

Definition at line 1909 of file rlm_isc_dhcp.c.

◆ isc_invalid

#define isc_invalid   ISC_INVALID, NULL, NULL

Definition at line 1910 of file rlm_isc_dhcp.c.

◆ isc_not_done

#define isc_not_done   ISC_NOOP, NULL, NULL

Definition at line 1908 of file rlm_isc_dhcp.c.

◆ MAYBE_SEMICOLON

#define MAYBE_SEMICOLON   (2)

Definition at line 67 of file rlm_isc_dhcp.c.

◆ member_size

#define member_size (   type,
  member 
)    sizeof(((type *)0)->member)

Definition at line 1672 of file rlm_isc_dhcp.c.

◆ NO_SEMICOLON

#define NO_SEMICOLON   (0)

Definition at line 65 of file rlm_isc_dhcp.c.

◆ TYPE_CHECK

#define TYPE_CHECK (   name,
  type 
)    if ((state->token_len == (sizeof(name) - 1)) && (memcmp(state->token, name, sizeof(name) - 1) == 0)) return type

Parse one type string.

boolean
[signed|unsigned] integer [width]
    width is 8, 16, or 32
ip-address
ip6-address
text
string
domain-list [compressed]
encapsulate _identifier_

Definition at line 832 of file rlm_isc_dhcp.c.

◆ vb_ipv4addr

#define vb_ipv4addr   vb_ip.addr.v4.s_addr

Definition at line 1521 of file rlm_isc_dhcp.c.

◆ YES_SEMICOLON

#define YES_SEMICOLON   (1)

Definition at line 66 of file rlm_isc_dhcp.c.

Typedef Documentation

◆ rlm_isc_dhcp_apply_t

typedef int(* rlm_isc_dhcp_apply_t) (rlm_isc_dhcp_t const *inst, request_t *request, rlm_isc_dhcp_info_t *info)

Definition at line 149 of file rlm_isc_dhcp.c.

◆ rlm_isc_dhcp_info_t

Definition at line 51 of file rlm_isc_dhcp.c.

◆ rlm_isc_dhcp_parse_t

typedef int(* rlm_isc_dhcp_parse_t) (rlm_isc_dhcp_tokenizer_t *state, rlm_isc_dhcp_info_t *info)

Definition at line 148 of file rlm_isc_dhcp.c.

◆ rlm_isc_dhcp_type_t

Enumeration Type Documentation

◆ rlm_isc_dhcp_type_t

Enumerator
ISC_INVALID 

we recognize it, but don't implement it

ISC_NOOP 

we don't do anything with it

ISC_IGNORE 

we deliberately ignore it

ISC_GROUP 
ISC_HOST 
ISC_SUBNET 
ISC_OPTION 
ISC_HARDWARE_ETHERNET 
ISC_FIXED_ADDRESS 

Definition at line 151 of file rlm_isc_dhcp.c.

Function Documentation

◆ add_option_by_da()

static int add_option_by_da ( rlm_isc_dhcp_info_t info,
fr_dict_attr_t const *  da 
)
static

Definition at line 1654 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply()

static int apply ( rlm_isc_dhcp_t const *  inst,
request_t request,
rlm_isc_dhcp_info_t head 
)
static

Apply all rules except fixed IP.

Definition at line 1792 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ apply_fixed_ip()

static int apply_fixed_ip ( rlm_isc_dhcp_t const *  inst,
request_t request 
)
static

Apply fixed IPs.

Definition at line 1742 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get_host()

static rlm_isc_dhcp_info_t* get_host ( request_t request,
fr_hash_table_t hosts_by_ether,
fr_hash_table_t hosts_by_uid 
)
static

Definition at line 1606 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ host_ether_cmp()

static int8_t host_ether_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 773 of file rlm_isc_dhcp.c.

+ Here is the caller graph for this function:

◆ host_ether_hash()

static uint32_t host_ether_hash ( void const *  data)
static

Definition at line 766 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ host_uid_cmp()

static int8_t host_uid_cmp ( void const *  one,
void const *  two 
)
static

Definition at line 795 of file rlm_isc_dhcp.c.

+ Here is the caller graph for this function:

◆ host_uid_hash()

static uint32_t host_uid_hash ( void const *  data)
static

Definition at line 788 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isc2fr_type()

static fr_type_t isc2fr_type ( rlm_isc_dhcp_tokenizer_t state)
static

Definition at line 833 of file rlm_isc_dhcp.c.

+ Here is the caller graph for this function:

◆ match_keyword()

static int match_keyword ( rlm_isc_dhcp_info_t parent,
rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_cmd_t const *  tokens,
int  num_tokens 
)
static

Definition at line 1150 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ match_subword()

static int match_subword ( rlm_isc_dhcp_tokenizer_t state,
char const *  cmd,
rlm_isc_dhcp_info_t info 
)
static

Recursively match subwords inside of a command string.

Definition at line 532 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ mod_authorize()

static unlang_action_t mod_authorize ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
request_t request 
)
static

Definition at line 2206 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ mod_instantiate()

static int mod_instantiate ( module_inst_ctx_t const *  mctx)
static

Definition at line 2175 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ mod_post_auth()

static unlang_action_t mod_post_auth ( rlm_rcode_t p_result,
module_ctx_t const *  mctx,
request_t request 
)
static

Definition at line 2220 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ parse_filename()

static int parse_filename ( UNUSED rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

filename STRING

Definition at line 1677 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ parse_host()

static int parse_host ( rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

host NAME { ...

}

Hosts are global, and are keyed by MAC `hardware ethernet`, and by
`client-identifier`.

Definition at line 1374 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ parse_include()

static int parse_include ( rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

Definition at line 728 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ parse_next_server()

static int parse_next_server ( UNUSED rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

next-server IPADDR

Definition at line 1714 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ parse_option()

static int parse_option ( rlm_isc_dhcp_info_t parent,
rlm_isc_dhcp_tokenizer_t state,
fr_dict_attr_t const *  da,
char *  value 
)
static

Definition at line 997 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_option_definition()

static int parse_option_definition ( rlm_isc_dhcp_info_t parent,
rlm_isc_dhcp_tokenizer_t state,
char *  name 
)
static

option new-name code new-code = definition ;

"new-name" can also be SPACE.NAME

Definition at line 852 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_option_space()

static int parse_option_space ( UNUSED rlm_isc_dhcp_info_t parent,
UNUSED rlm_isc_dhcp_tokenizer_t state,
UNUSED char *  name 
)
static

option space name [ [ code width number ] [ length width number ] [ hash size number ] ] ;

Definition at line 808 of file rlm_isc_dhcp.c.

+ Here is the caller graph for this function:

◆ parse_options()

static int parse_options ( rlm_isc_dhcp_info_t parent,
rlm_isc_dhcp_tokenizer_t state 
)
static

Parse "option" command.

In any sane system, commands which do different things should
have different names.  In this syntax, it's all miracles and
unicorns.

option NAME VALUE ;
option new-name code new-code = definition ;

option space name [ [ code width number ] [ length width number ] [ hash size number ] ] ;

Definition at line 1071 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_section()

static int parse_section ( rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

Parse a section { ...

}

Definition at line 2042 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ parse_server_identifier()

static int parse_server_identifier ( UNUSED rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

server-identifier IPADDR

This is really "option dhcp-server-identifier IPADDR"
But whatever

Definition at line 1706 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ parse_server_name()

static int parse_server_name ( UNUSED rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

server-name STRING

Definition at line 1690 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ parse_subnet()

static int parse_subnet ( rlm_isc_dhcp_tokenizer_t state,
rlm_isc_dhcp_info_t info 
)
static

subnet IPADDR netmask MASK { ...

}

Definition at line 1526 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:

◆ read_file()

static int read_file ( rlm_isc_dhcp_t inst,
rlm_isc_dhcp_info_t parent,
char const *  filename 
)
static

Open a file and read it into a parent.

Definition at line 2103 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_string()

static int read_string ( rlm_isc_dhcp_tokenizer_t state)
static

Definition at line 296 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ read_token()

static int read_token ( rlm_isc_dhcp_tokenizer_t state,
fr_token_t  hint,
int  semicolon,
bool  allow_rcbrace 
)
static

Reads one token into state->token.

Note that this function *destroys* the input buffer.  So if
you need to read two tokens, you have to save the first one
somewhere *outside* of the input buffer.

Definition at line 342 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ refill()

static int refill ( rlm_isc_dhcp_tokenizer_t state)
static

Refills the read buffer with one line from the file.

This function also takes care of suppressing blank lines, and
lines which only contain comments.

Definition at line 212 of file rlm_isc_dhcp.c.

+ Here is the caller graph for this function:

◆ skip_spaces()

static int skip_spaces ( rlm_isc_dhcp_tokenizer_t state,
char *  p 
)
static

Definition at line 257 of file rlm_isc_dhcp.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ attr_boot_filename

fr_dict_attr_t const* attr_boot_filename
static

Definition at line 46 of file rlm_isc_dhcp.c.

◆ attr_client_hardware_address

fr_dict_attr_t const* attr_client_hardware_address
static

Definition at line 42 of file rlm_isc_dhcp.c.

◆ attr_client_identifier

fr_dict_attr_t const* attr_client_identifier
static

Definition at line 44 of file rlm_isc_dhcp.c.

◆ attr_server_identifier

fr_dict_attr_t const* attr_server_identifier
static

Definition at line 48 of file rlm_isc_dhcp.c.

◆ attr_server_ip_address

fr_dict_attr_t const* attr_server_ip_address
static

Definition at line 47 of file rlm_isc_dhcp.c.

◆ attr_server_name

fr_dict_attr_t const* attr_server_name
static

Definition at line 45 of file rlm_isc_dhcp.c.

◆ attr_your_ip_address

fr_dict_attr_t const* attr_your_ip_address
static

Definition at line 43 of file rlm_isc_dhcp.c.

◆ commands

const rlm_isc_dhcp_cmd_t commands[]
static

Table of commands that we allow.

Definition at line 1916 of file rlm_isc_dhcp.c.

◆ dict_dhcpv4

fr_dict_t const* dict_dhcpv4
static

Definition at line 34 of file rlm_isc_dhcp.c.

◆ module_config

const conf_parser_t module_config[]
static
Initial value:
= {
{ FR_CONF_OFFSET("debug", rlm_isc_dhcp_t, debug) },
{ FR_CONF_OFFSET("pedantic", rlm_isc_dhcp_t, pedantic) },
}
#define CONF_PARSER_TERMINATOR
Definition: cf_parse.h:626
#define FR_CONF_OFFSET(_name, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:268
#define FR_CONF_OFFSET_FLAGS(_name, _flags, _struct, _field)
conf_parser_t which parses a single CONF_PAIR, writing the result to a field in a struct
Definition: cf_parse.h:256
@ CONF_FLAG_REQUIRED
Error out if no matching CONF_PAIR is found, and no dflt value is set.
Definition: cf_parse.h:406
@ CONF_FLAG_FILE_INPUT
File matching value must exist, and must be readable.
Definition: cf_parse.h:412
@ CONF_FLAG_NOT_EMPTY
CONF_PAIR is required to have a non zero length value.
Definition: cf_parse.h:421

Definition at line 97 of file rlm_isc_dhcp.c.

◆ rlm_isc_dhcp

module_rlm_t rlm_isc_dhcp
Initial value:
= {
.common = {
.name = "isc_dhcp",
.inst_size = sizeof(rlm_isc_dhcp_t),
},
.method_names = (module_method_name_t[]){
{ .name1 = "recv", .name2 = CF_IDENT_ANY, .method = mod_authorize },
{ .name1 = "send", .name2 = CF_IDENT_ANY, .method = mod_post_auth },
}
}
#define CF_IDENT_ANY
Definition: cf_util.h:78
#define MODULE_MAGIC_INIT
Stop people using different module/library/server versions together.
Definition: dl_module.h:65
Specifies a module method identifier.
Definition: module_method.c:36
static const conf_parser_t config[]
Definition: base.c:188
static unlang_action_t mod_authorize(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static const conf_parser_t module_config[]
Definition: rlm_isc_dhcp.c:97
static int mod_instantiate(module_inst_ctx_t const *mctx)
static unlang_action_t mod_post_auth(rlm_rcode_t *p_result, module_ctx_t const *mctx, request_t *request)
static int instantiate(module_inst_ctx_t const *mctx)
Definition: rlm_rest.c:1312
#define MODULE_NAME_TERMINATOR
Definition: module.h:135

Definition at line 2235 of file rlm_isc_dhcp.c.

◆ rlm_isc_dhcp_dict

fr_dict_autoload_t rlm_isc_dhcp_dict
Initial value:
= {
{ .out = &dict_dhcpv4, .proto = "dhcpv4" },
{ NULL }
}
static fr_dict_t const * dict_dhcpv4
Definition: rlm_isc_dhcp.c:34

Definition at line 37 of file rlm_isc_dhcp.c.

◆ rlm_isc_dhcp_dict_attr

fr_dict_attr_autoload_t rlm_isc_dhcp_dict_attr
Initial value:
= {
{ .out = &attr_client_hardware_address, .name = "Client-Hardware-Address", .type = FR_TYPE_ETHERNET, .dict = &dict_dhcpv4},
{ .out = &attr_your_ip_address, .name = "Your-IP-Address", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_dhcpv4},
{ .out = &attr_client_identifier, .name = "Client-Identifier", .type = FR_TYPE_OCTETS, .dict = &dict_dhcpv4},
{ .out = &attr_server_name, .name = "Server-Host-Name", .type = FR_TYPE_STRING, .dict = &dict_dhcpv4},
{ .out = &attr_boot_filename, .name = "Boot-Filename", .type = FR_TYPE_STRING, .dict = &dict_dhcpv4},
{ .out = &attr_server_ip_address, .name = "Server-IP-Address", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_dhcpv4},
{ .out = &attr_server_identifier, .name = "Server-Identifier", .type = FR_TYPE_IPV4_ADDR, .dict = &dict_dhcpv4},
{ NULL }
}
@ FR_TYPE_IPV4_ADDR
32 Bit IPv4 Address.
Definition: merged_model.c:86
@ FR_TYPE_ETHERNET
48 Bit Mac-Address.
Definition: merged_model.c:93
@ FR_TYPE_STRING
String of printable characters.
Definition: merged_model.c:83
@ FR_TYPE_OCTETS
Raw octets.
Definition: merged_model.c:84
static fr_dict_attr_t const * attr_server_identifier
Definition: rlm_isc_dhcp.c:48
static fr_dict_attr_t const * attr_boot_filename
Definition: rlm_isc_dhcp.c:46
static fr_dict_attr_t const * attr_client_hardware_address
Definition: rlm_isc_dhcp.c:42
static fr_dict_attr_t const * attr_your_ip_address
Definition: rlm_isc_dhcp.c:43
static fr_dict_attr_t const * attr_server_name
Definition: rlm_isc_dhcp.c:45
static fr_dict_attr_t const * attr_client_identifier
Definition: rlm_isc_dhcp.c:44
static fr_dict_attr_t const * attr_server_ip_address
Definition: rlm_isc_dhcp.c:47

Definition at line 51 of file rlm_isc_dhcp.c.

◆ spaces

char const* spaces = " "
static

Definition at line 205 of file rlm_isc_dhcp.c.