#include <sync/common.h>
#include <fnmatch.h>
#include <sync/psd_ipc.h>
#include <ddl/dax.h>
#include "ped_config.h"
#include "ped_conn.h"
#include "ped_filter.h"
#include "ped_schedule.h"
#include "ped_services.h"
#include "ped_service_route.h"
#include "ped_logging.h"
Go to the source code of this file.
Defines | |
#define | FULL_INET_ADDR_MASK 0xFFFFFFFF |
a /32 mask | |
#define | INT_NAME_STR_SIZE 64 |
string size for interface names | |
Functions | |
static void | delete_condition (ped_cond_t *data) |
char * | get_pfd_interface (void) |
char * | get_pfd_nat_interface (void) |
in_addr_t | get_pfd_address (void) |
in_addr_t | get_cpd_address (void) |
void | init_config (void) |
void | clear_config (void) |
ped_cond_t * | first_condition (void) |
ped_cond_t * | next_condition (ped_cond_t *data) |
boolean | find_matching_condition (char *ifname, uint8_t af) |
int | ped_config_read (int check) |
Variables | |
const char * | ped_top_config [] |
static patroot | root |
Patricia tree root. | |
static in_addr_t | pfd_address |
PFD's address (network-byte order). | |
static in_addr_t | cpd_address |
CPD's address (network-byte order). | |
static char | pfd_interface [INT_NAME_STR_SIZE] |
PFD's receiving interface. | |
static char | pfd_nat_interface [INT_NAME_STR_SIZE] |
PFD's NAT interface. |
These functions and variables will parse, load, hold, and return the configuration data.
Definition in file ped_config.c.
void clear_config | ( | void | ) |
Clear the configuration info completely from the patricia tree
Definition at line 162 of file ped_config.c.
References delete_condition(), and first_condition().
Referenced by ped_config_read().
static void delete_condition | ( | ped_cond_t * | data | ) | [static] |
Remove a condition from the configuration...used only internally when emptying the patricia tree (in clear_config)
[in] | data | Condition/Data to delete from the configuration data storage |
Definition at line 74 of file ped_config.c.
References root.
Referenced by clear_config().
boolean find_matching_condition | ( | char * | ifname, | |
uint8_t | af | |||
) |
Tells whether or not a condition matches this interface name/family pair
[in] | ifname | interface name to match |
[in] | af | address family to match |
Definition at line 219 of file ped_config.c.
References ped_cond_s::af, first_condition(), ped_cond_s::ifname, and next_condition().
Referenced by update_interface().
ped_cond_t* first_condition | ( | void | ) |
Get the first condition from configuration.
Definition at line 180 of file ped_config.c.
References root.
Referenced by clear_config(), and find_matching_condition().
in_addr_t get_cpd_address | ( | void | ) |
Get the CPD address
Definition at line 135 of file ped_config.c.
References cpd_address.
Referenced by send_addresses().
in_addr_t get_pfd_address | ( | void | ) |
Get the PFD address
Definition at line 122 of file ped_config.c.
References pfd_address.
Referenced by send_addresses().
char* get_pfd_interface | ( | void | ) |
Get the PFD interface
Definition at line 96 of file ped_config.c.
References pfd_interface.
char* get_pfd_nat_interface | ( | void | ) |
Get the PFD NAT interface
Definition at line 109 of file ped_config.c.
References pfd_nat_interface.
void init_config | ( | void | ) |
Init the data structure that will store configuration info, or in other words, the condition(s)
Definition at line 146 of file ped_config.c.
References cpd_address, MAX_COND_NAME_LEN, pfd_address, pfd_interface, pfd_nat_interface, and root.
Referenced by ped_init().
ped_cond_t* next_condition | ( | ped_cond_t * | data | ) |
Get (iterator-style) the next condition from configuration.
[in] | data | The previously returned data from this function or NULL for the first condition. |
Definition at line 197 of file ped_config.c.
References ped_cond_s::node, and root.
Referenced by find_matching_condition().
int ped_config_read | ( | int | check | ) |
Read configuration from the database.
[in] | check | SDK_CONFIG_READ_CHECK(1) if this function was called to check configuration, or SDK_CONFIG_READ_LOAD(0) if it's called to load configuration. |
< CPD's address
Definition at line 252 of file ped_config.c.
References add_pfd_service_route(), add_service_route(), ped_cond_s::af, clean_service_routes(), clear_config(), ped_cond_s::condition_name, cpd_address, delete_pfd_service_route(), delete_service_route(), FULL_INET_ADDR_MASK, get_serviceroute_ready(), ped_cond_s::ifname, init_pfd_filter(), INT_NAME_STR_SIZE, ped_cond_s::node, ped_top_config, pfd_address, pfd_interface, pfd_nat_interface, pfd_ri_created(), reconfigure_peers(), root, turn_off_pfd_filter(), turn_on_pfd_filter(), and update_policies().
Referenced by main().
const char* ped_top_config[] |
Initial value:
{ DDLNAME_SYNC, DDLNAME_SYNC_PE, NULL}
Definition at line 46 of file ped_config.c.
Referenced by main(), and ped_config_read().