ped_config.c File Reference

Relating to loading and storing the configuration data. More...

#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_tfirst_condition (void)
ped_cond_tnext_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.


Detailed Description

Relating to loading and storing the configuration data.

These functions and variables will parse, load, hold, and return the configuration data.

Definition in file ped_config.c.


Function Documentation

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)

Parameters:
[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

Parameters:
[in] ifname interface name to match
[in] af address family to match
Returns:
TRUE if and only if this interface name matches a configured condition's matching expression for interface names AND if the family matches the configured family for that condition unless the family is marked as any (in which case just the name matters); otherwise FALSE

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.

Returns:
The first condition, or NULL if no conditions.

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

Returns:
The CPD address in network-byte order

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

Returns:
The PFD address in network-byte order

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

Returns:
The PFD interface (IFL)

Definition at line 96 of file ped_config.c.

References pfd_interface.

char* get_pfd_nat_interface ( void   ) 

Get the PFD NAT interface

Returns:
The PFD NAT interface (IFL)

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.

Parameters:
[in] data The previously returned data from this function or NULL for the first condition.
Returns:
The next condition, or NULL if no more conditions.

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.

Parameters:
[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.
Returns:
SUCCESS, or -1 on error.
Note:
Do not use ERRMSG during config check.

< 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().


Variable Documentation

const char* ped_top_config[]

Initial value:

 { DDLNAME_SYNC,
                                 DDLNAME_SYNC_PE,
                                 NULL}
Path to PED config

Definition at line 46 of file ped_config.c.

Referenced by main(), and ped_config_read().


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:27:06 2010 for SDK Your Net Corporation Policy Manager Example: Policy Enforcement Daemon 1.0 by Doxygen 1.5.1