#include <time.h>
#include <isc/eventlib.h>
#include <jnx/aux_types.h>
#include <jnx/bits.h>
#include <jnx/patricia.h>
#include <netinet/in.h>
Go to the source code of this file.
Data Structures | |
struct | pfd_auth_user_t |
Functions | |
status_t | init_config (evContext ctx) |
void | clear_config (void) |
void | add_auth_user_addr (in_addr_t addr) |
void | delete_auth_user_addr (in_addr_t addr) |
boolean | is_auth_user (in_addr_t addr) |
in_addr_t | get_pfd_address (void) |
void | set_pfd_address (in_addr_t addr) |
in_addr_t | get_cpd_address (void) |
void | set_cpd_address (in_addr_t addr) |
time_t | get_current_time (void) |
These functions will store and provide access to the configuration data which is the set of authorized users.
Definition in file pfd_config.h.
void add_auth_user_addr | ( | in_addr_t | addr | ) |
Add an authorized user from the configured set
[in] | addr | The user's IP address in network byte order |
Definition at line 184 of file pfd_config.c.
References pfd_auth_user_t::address, config_lock, first_byte, fourth_byte, LOG, pfd_auth_user_t::node, root, second_byte, and third_byte.
Referenced by cpd_client_message().
void clear_config | ( | void | ) |
Clear the configuration data
Definition at line 148 of file pfd_config.c.
References config_lock, first_byte, fourth_byte, LOG, root, second_byte, and third_byte.
Referenced by cpd_client_connection(), pfd_quit(), and pfd_shutdown().
void delete_auth_user_addr | ( | in_addr_t | addr | ) |
Delete an authorized user from the configured set
[in] | addr | The user's IP address in network byte order |
Definition at line 221 of file pfd_config.c.
References config_lock, first_byte, fourth_byte, LOG, root, second_byte, and third_byte.
Referenced by cpd_client_message().
in_addr_t get_cpd_address | ( | void | ) |
Get the CPD address
Definition at line 322 of file pfd_config.c.
References cpd_address.
Referenced by cpd_client_connection().
time_t get_current_time | ( | void | ) |
Get the currently cached time
Definition at line 348 of file pfd_config.c.
References current_time.
Referenced by nat_packet(), and reverse_nat_packet().
in_addr_t get_pfd_address | ( | void | ) |
Get the PFD address
Definition at line 296 of file pfd_config.c.
References pfd_address.
Referenced by cpd_client_connection().
status_t init_config | ( | evContext | ctx | ) |
Init the data structure that will store configuration info, or in other words, the set of authorized users
[in] | ctx | event context |
Definition at line 115 of file pfd_config.c.
References config_lock, cpd_address, current_time, first_byte, fourth_byte, LOG, pfd_address, root, second_byte, third_byte, and update_time().
Referenced by pfd_init().
boolean is_auth_user | ( | in_addr_t | addr | ) |
Is a user authorized
[in] | addr | The user's IP address in network byte order |
Definition at line 269 of file pfd_config.c.
References config_lock, first_byte, fourth_byte, root, second_byte, and third_byte.
Referenced by pfd_process_packet().
void set_cpd_address | ( | in_addr_t | addr | ) |
Set the CPD address
[in] | addr | The new CPD address in network-byte order |
Definition at line 335 of file pfd_config.c.
References cpd_address.
Referenced by ped_client_message().
void set_pfd_address | ( | in_addr_t | addr | ) |
Set the PFD address
[in] | addr | The new PFD address in network-byte order |
Definition at line 309 of file pfd_config.c.
References pfd_address.
Referenced by ped_client_message().