class Configuration

Class that contains all configuration and generated code state. More...

 
LOGO
 Annotated List  Files  Globals  Hierarchy  Index  Top

Public Types

Public Methods


Detailed Description

This class contains all user policy configuration. It updates the relevant configuration portions based on user changes. Also, it does some sanity checking by (dis)allowing the user to do certain actions [such as delete sets which are referenced in policies].

typedef map<string,Code*> CodeMap

CodeMap

typedef set<uint32_t> TagSet

TagSet

typedef map<string,TagSet*> TagMap

TagMap

ConfError (class)

ConfError

 Configuration (ProcessWatchBase& pw)

Configuration

Parameters:

aprocess watcher used to initialize the VarMap.
 ~Configuration ()

~Configuration

void  delete_term (const string& policy, const string& term)

delete_term

Throws an exception on failure. Checks for non-existant policy/term conditions.

Parameters:

policypolicy in which term should be deleted.
termterm to delete.
void  update_term_source (const string& policy, const string& term, const string& source)

update_term_source

Throws an exception on failure. Checks for non-existant policy/term conditions. Also tries to parse the configuration. No compilation / semantic check is performed now.

Parameters:

policypolicy in which term should be updated.
termterm which should be updated.
sourceun-parsed user configuration of the source {} block.
void  update_term_dest (const string& policy, const string& term, const string& dest)

update_term_dest

Throws an exception on failure. Checks for non-existant policy/term conditions. Also tries to parse the configuration. No compilation / semantic check is performed now.

Parameters:

policypolicy in which term should be updated.
termterm which should be updated.
destun-parsed user configuration of the dest {} block.
void  update_term_action (const string& policy, const string& term, const string& action)

update_term_action

Throws an exception on failure. Checks for non-existant policy/term conditions. Also tries to parse the configuration. No compilation / semantic check is performed now.

Parameters:

policypolicy in which term should be updated.
termterm which should be updated.
actionun-parsed user configuration of the action {} block.
void  create_term (const string& policy, const string& term)

create_term

Append a term to a policy.

Throws an exception on failure. Checks if term already exists.

Parameters:

policypolicy in which term should be created.
termterm name which should be created.
void  create_policy (const string& policy)

create_policy

Throws an exception on failure. Checks if policy already exists.

Parameters:

policypolicy which should be created.
void  delete_policy (const string& policy)

delete_policy

Throws an exception on failure. Checks if policy is in use [instantiated by an export/import directive.]

Parameters:

policypolicy which should be deleted.
void  create_set (const string& set)

create_set

Throws an exception on failure. Checks if set already exists.

Parameters:

setname of the set to be created.
void  update_set (const string& set, const string& elements)

update_set

Throws an exception on failure. Checks if set exists.

Parameters:

setname of the set to be updated.
elementscomma separated elements to be replaced in set.
void  delete_set (const string& set)

delete_set

Throws an exception on failure. Checks if set is in use.

Parameters:

setname of set to delete.
void  update_imports (const string& protocol, const list<string>& imports)

update_imports

Throws an exception on failure. Checks if policies exist.

Parameters:

protocolname of protocol which should have imports updated.
importslist of policy-names.
void  update_exports (const string& protocol, const list<string>& exports)

update_exports

Throws an exception on failure. Checks if policies exist.

Parameters:

protocolname of protocol which should have exports updated.
exportslist of policy-names.
string  str ()

str

Returns: string representation of configuration

void  commit (uint32_t msec)

commit

Commit all configuration changes. This will compile all needed policies and link them. It will then commit changes to the actual policy filters. Commits are optionally delayed in order to aggregate configuration changes. For example, at boot-up many small changes are done in small time intervals. It would be more efficient to configure the filters only after all changes have been made. Thus delaying a commit will help.

The delay will only be imposed on sending the configuration to the filters -- all semantic checks and compile is done immediately.

Parameters:

msecmilliseconds after which code should be sent to filters.
void  configure_varmap (const string& conf)

configure_varmap

Initialize the VarMap needed for semantic checking.

Parameters:

confun-parsed user configuration of varmap.
void  set_filter_manager (FilterManagerBase&)

set_filter_manager

This method should be called once at initialization to set the FilterManager. It should not be deleted by the Configuration class -- it does not own it.

CodeMap&  import_filters ()

import_filters

A CodeMap is a map relating protocols to code. All the code for a protocol will be found in its entry. The code however will normally be for a specific filter.

Returns: the CodeMap for import filters.

CodeMap&  sourcematch_filters ()

sourcematch_filters

Returns: the CodeMap for source match filters.

CodeMap&  export_filters ()

export_filters

Returns: the CodeMap for export filters.

SetMap&  sets ()

sets

Returns: the SetMap relating set-name to the actual set.

TagMap&  tagmap ()

tagmap

Returns: the policy tag map relating policytags to destination protocols.


Generated by: pavlin on possum.icir.org on Wed Apr 13 21:53:13 2005, using kdoc $.