dpm-mgmt_config.c File Reference

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

#include <sync/common.h>
#include <fnmatch.h>
#include <ddl/dax.h>
#include "dpm-mgmt_config.h"
#include "dpm-mgmt_conn.h"
#include "dpm-mgmt_logging.h"

Go to the source code of this file.

Functions

static TAILQ_HEAD (int_def_s)
static int parse_int_default (dax_walk_data_t *dwd __unused, ddl_handle_t *dop, int action __unused, void *data)
static int parse_policer (dax_walk_data_t *dwd __unused, ddl_handle_t *dop, int action __unused, void *data)
static int match_ifl (kcom_ifl_t *ifl, void *cookie __unused)
void init_config (void)
void clear_config (void)
void clear_logins (void)
void send_configuration (void)
void subscriber_login (char *s_name, char *c_name)
void subscriber_logout (char *s_name, char *c_name)
int dpm_config_read (int check)

Variables

const char * dpm_config [] = {DDLNAME_SYNC, DDLNAME_SYNC_DPM, NULL}
static boolean classic_filters
 Using classic filters.
static patroot pol_conf
 Pat. root for policers.
static patroot sub_conf
 Pat. root for subscribers.


Detailed Description

Relating to loading and storing the configuration data.

These functions will parse and load the configuration data.

Definition in file dpm-mgmt_config.c.


Function Documentation

void clear_config ( void   ) 

Clear and reset the entire configuration, freeing all memory.

Definition at line 424 of file dpm-mgmt_config.c.

References classic_filters, clear_logins(), LOG, policer_s::node, subscriber_s::node, pol_conf, and sub_conf.

Referenced by dpm_config_read(), dpm_init(), and dpm_shutdown().

void clear_logins ( void   ) 

Clear status of all logins

Definition at line 465 of file dpm-mgmt_config.c.

Referenced by clear_config(), and mspic_offline().

int dpm_config_read ( int  check  ) 

Read daemon configuration from the database

Parameters:
[in] check 1 if this function being invoked because of a commit check
Returns:
SUCCESS (0) successfully loaded, EFAIL if not
Note:
Do not use ERRMSG/LOG during config check normally.

Definition at line 618 of file dpm-mgmt_config.c.

References classic_filters, clear_config(), dpm_config, parse_int_default(), parse_policer(), and send_configuration().

Referenced by main().

void init_config ( void   ) 

Init the data structures that will store configuration info

Definition at line 409 of file dpm-mgmt_config.c.

References classic_filters, MAX_POL_NAME, MAX_SUB_NAME, pol_conf, and sub_conf.

Referenced by dpm_init().

static int match_ifl ( kcom_ifl_t *  ifl,
void *cookie  __unused 
) [static]

Find a default policy for the given IFL if one exists

Parameters:
[in] ifl An IFL that exists in the system
[in] cookie User data passed to handler
Returns:
KCOM_OK upon success

Definition at line 377 of file dpm-mgmt_config.c.

References MAX_INT_NAME, int_def_s::name_pattern, and notify_interface_add().

Referenced by send_configuration().

static int parse_int_default ( dax_walk_data_t *dwd  __unused,
ddl_handle_t *  dop,
int action  __unused,
void *  data 
) [static]

Handler for dax_walk_list to parse each configured IFL pattern item

Parameters:
[in] dwd Opaque dax data
[in] dop DAX Object Pointer for application object
[in] action The action on the given application object
[in] data User data passed to handler (check flag)
Returns:
DAX_WALK_OK upon success or DAX_WALK_ABORT upon failure

Definition at line 190 of file dpm-mgmt_config.c.

References int_def_s::input_pol, int_def_s::name_pattern, and int_def_s::output_pol.

Referenced by dpm_config_read().

static int parse_policer ( dax_walk_data_t *dwd  __unused,
ddl_handle_t *  dop,
int action  __unused,
void *  data 
) [static]

Handler for dax_walk_list to parse each configured policer item

Parameters:
[in] dwd Opaque dax data
[in] dop DAX Object Pointer for application object
[in] action The action on the given application object
[in] data User data passed to handler (check flag)
Returns:
DAX_WALK_OK upon success or DAX_WALK_ABORT upon failure

Definition at line 261 of file dpm-mgmt_config.c.

References policer_info_s::action, pol_conf_s::bandwidth_limit, pol_conf_s::bandwidth_percent, pol_conf_s::burst_size_limit, pol_conf_s::bw_in_percent, pol_conf_s::bw_u, pol_action_s::discard, pol_action_s::forwarding_class, policer_info_s::if_exceeding, LOG, pol_action_s::loss_priority, policer_info_s::name, policer_s::node, pol_conf, and policer_s::policer.

Referenced by dpm_config_read().

void send_configuration ( void   ) 

Send the entire configuration to the ctrl component

Definition at line 487 of file dpm-mgmt_config.c.

References classic_filters, LOG, match_ifl(), policer_s::node, subscriber_s::node, notify_configuration_complete(), notify_configuration_reset(), notify_policy_add(), notify_subscriber_add(), pol_conf, policer_s::policer, sub_conf, and subscriber_s::subscriber.

Referenced by dpm_config_read(), and receive_connection().

void subscriber_login ( char *  s_name,
char *  c_name 
)

Record the subscriber login

Parameters:
[in] s_name subscriber name
[in] c_name subscriber's class name

Definition at line 526 of file dpm-mgmt_config.c.

References login_class_s::class, and login_sub_s::name.

Referenced by receive_message().

void subscriber_logout ( char *  s_name,
char *  c_name 
)

Remove the record of the previous subscriber login

Parameters:
[in] s_name subscriber name
[in] c_name subscriber's class name

Definition at line 572 of file dpm-mgmt_config.c.

References login_class_s::class, and login_sub_s::name.

Referenced by receive_message().


Variable Documentation

const char* dpm_config[] = {DDLNAME_SYNC, DDLNAME_SYNC_DPM, NULL}

Path in configuration DB to DPM configuration

Definition at line 38 of file dpm-mgmt_config.c.

Referenced by dpm_config_read(), and main().


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:26:55 2010 for SDK Your Net Corporation Dynamic Policy Manager Example: dpm-mgmt 1.0 by Doxygen 1.5.1