psd_config.h File Reference

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

#include <sync/psd_ipc.h>
#include <jnx/patricia.h>

Go to the source code of this file.

Data Structures

struct  psd_policy_filter_s
struct  psd_policy_route_s
struct  psd_policy_s

Typedefs

typedef psd_policy_filter_s psd_policy_filter_t
typedef psd_policy_route_s psd_policy_route_t
typedef psd_policy_s psd_policy_t

Functions

void init_config (void)
psd_policy_tfirst_policy (void)
psd_policy_tnext_policy (psd_policy_t *data)
int psd_config_read (int check)


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 psd_config.h.


Typedef Documentation

typedef struct psd_policy_filter_s psd_policy_filter_t

Structure holds filter data. Using the same structure as the filter message to avoid memory copy when sending message, but it needs a little extra memory to store interface name and address family in each data structure. Considering system performance and memory space, the former has the priority.

typedef struct psd_policy_route_s psd_policy_route_t

Structure holds route data. Using the same structure as the route message to avoid memory copy when sending message, but it needs a little extra memory to store interface name and address family in each data structure. Considering system performance and memory space, the former has the priority.

typedef struct psd_policy_s psd_policy_t

The structure we use to store our configuration information in the patricia tree.


Function Documentation

psd_policy_t* first_policy ( void   ) 

Get the first policy from configuration.

Returns:
The first policy in configuration, or NULL if no policy is in configuration.

Definition at line 290 of file psd_config.c.

References root_policy.

Referenced by clear_config_policy(), and lookup_policy().

void init_config ( void   ) 

Init the data structure that will store configuration info, or in other words, the policies.

Definition at line 275 of file psd_config.c.

References MAX_POLICY_NAME_LEN, and root_policy.

Referenced by psd_init().

psd_policy_t* next_policy ( psd_policy_t policy  ) 

Get (iterator-style) the next policy from configuration.

Parameters:
[in] policy The previously returned policy from this function, or NULL for the first policy.
Returns:
The next policy in configuration, or NULL if data is the last one in configuration.

Definition at line 307 of file psd_config.c.

References psd_policy_s::node, and root_policy.

Referenced by lookup_policy().

int psd_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.

Definition at line 328 of file psd_config.c.

References psd_policy_s::af, clear_config_policy(), config_read_filter(), config_read_route(), EMPTY, psd_policy_s::filter, psd_policy_s::ifname, psd_policy_route_s::next, psd_policy_s::node, notify_all_clients(), psd_policy_s::policy_name, root_policy, and psd_policy_s::route.

Referenced by 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:27:07 2010 for SDK Your Net Corporation Policy Manager Example: Policy Server Daemon 1.0 by Doxygen 1.5.1