Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

pdl_policy.c File Reference

Implementation of the pdl policies. More...

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "lcmaps_log.h"
#include "pdl_policy.h"

Go to the source code of this file.

Functions

BOOL _add_policy (const record_t *name, const rule_t *rules)
void allow_rules (BOOL allow)
void add_policy (record_t *policy, rule_t *rules)
void remove_policy (record_t *policy)
policy_tfind_policy (const char *name)
BOOL check_policies_for_recursion (void)
void reduce_policies (void)
policy_tget_policies (void)
void show_policies (void)
void free_policies (void)
BOOL policies_have_been_reduced (void)

Variables

BOOL policies_reduced = FALSE
 Tell if reduce_policy() has been called.


Detailed Description

Implementation of the pdl policies.

Author:
G.M. Venekamp (venekamp@nikhef.nl)
Version:
Revision:
1.15
Date:
Date:
2004/10/01 15:17:31

Definition in file pdl_policy.c.


Function Documentation

BOOL _add_policy const record_t   name,
const rule_t   rules
 

Add a policy with its rules to the list of policies.

Before the policy name is actually added to list of policies, a check is made to see weather or not a policy by the same name exists. if it does, the policy name will not be added and an error message is displayed, letting the user know that the configuration file contains multiple policy rules with the same name.

Parameters:
name  Name of the new policy.
rules  List of associated rules for the policy.
Returns:
TRUE, If the policy has been added successfully; FALSE otherwise.

Definition at line 107 of file pdl_policy.c.

References allow_rules, find_policy, record_s::lineno, policy_s::lineno, policy_s::name, policy_s::next, PDL_ERROR, policy_s::prev, policy_s::rule, record_s::string, TRUE, and warning.

Referenced by add_policy.

void add_policy record_t   policy,
rule_t   rules
 

Wrapper around the _add_policy(name) function.

When the _add_policy() call fails, this function cleans up the data structure allocated for holding information about the policy that was found. See _add_policy() for information about the kind of reasons it can fail.

Parameters:
name  Name of the policy.
rules  List of associated rules for the policy.

Definition at line 73 of file pdl_policy.c.

References _add_policy, add_policy, start_new_rules, and record_s::string.

Referenced by add_policy.

void allow_rules BOOL    allow
 

Allow or disallow the additions of rules depending on the argument. When for example a policy is defined for the second time, an error should be generated, but the parsing should still continue. However, no rules can be added to the policy as there is currently no policy defined.

Parameters:
allow  TRUE if addition of new rules is allowd, FALSE otherwise.

Definition at line 55 of file pdl_policy.c.

References allow_rules.

Referenced by _add_policy, and allow_rules.

BOOL check_policies_for_recursion void   
 

Check for recursions in the policy rules.

Returns:
TRUE if at least one recustion has been found, FALSE otherwise.

Definition at line 179 of file pdl_policy.c.

References get_policies, policy_s::name, policy_s::next, policy_s::rule, and TRUE.

Referenced by startEvaluationManager.

policy_t* find_policy const char *    name
 

Find a policy based.

Parameters:
name  Name of the policy to be found. \retrun The policy if a polict with name 'name' exists, 0 otherwise.

Definition at line 160 of file pdl_policy.c.

References find_policy, policy_s::name, and policy_s::next.

Referenced by _add_policy, and find_policy.

void free_policies void   
 

Free all policies and their allocated resources.

Definition at line 260 of file pdl_policy.c.

References policy_s::name, policy_s::next, and policy_s::rule.

Referenced by free_resources.

policy_t* get_policies void   
 

Get the list of policies.

Returns:
First policy in the list.

Definition at line 233 of file pdl_policy.c.

Referenced by check_policies_for_recursion, get_plugins, pdl_next_plugin, and reduce_policies.

BOOL policies_have_been_reduced void   
 

Tell if the reduce_policy() call has been called.

Returns:
TRUE if reduce_policy() has been called; FALSE otherwise.

Definition at line 282 of file pdl_policy.c.

References policies_reduced.

Referenced by get_plugins.

void reduce_policies void   
 

Reduce_policies to its elemantry form, i.e. each policy has a list of rules which need to be reduced.

Definition at line 206 of file pdl_policy.c.

References get_policies, policy_s::next, rule_s::next, policies_reduced, policy_s::rule, and TRUE.

void remove_policy record_t   policy
 

Remove a policy from the list of policies and free all associated resources of the policy.

Parameters:
name  Policy to be removed.

Definition at line 146 of file pdl_policy.c.

References remove_policy, and record_s::string.

Referenced by remove_policy.

void show_policies void   
 

Display the policies and the rules associated with the policy.

Definition at line 243 of file pdl_policy.c.

References policy_s::name, policy_s::next, and policy_s::rule.


Generated on Sat Oct 2 02:18:27 2004 for edg-lcmaps by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002