ARPA2 Common Libraries  2.6.2
Modules
Collaboration diagram for RuleDB underpinning Access Control, Groups, ...:

Modules

 Data Structures and Constants for Rules and RuleDB
 
 Management operations for the RuleDB
 
 Operations on Rulesets
 
 Database Key derivation and Privacy Control
 

Detailed Description

The database RuleDB stores records that each hold a Ruleset, consisting of NUL-terminated Rules with generic words:

#commentlabel =xvalue %FLAGS ^trigger ~selector

See documentation of Rules and Access Control for Communication for details.

Lookups are based on an LMDBkey which is a beginning of a secure hash of lookup data; the remainder of the secure hash is stored as a RESTkey in the beginning of the record, which is checked. This logic is concealed within the database.c implementation.

There is another useful prefix to the database values, and that is a trunk code. These are ignored by applications, but serve bulk treatment of database entries, usually related to a certain remote provider that originates or retrieves the data. The trunk code is provided during rules_dbopen() and defaults to 0.

The default location is "/var/lib/arpa2/rules/" but may be set in RULES_ENVIRONMENT_PATH and the strongest override is the envvar $ARPA2_RULES_DIR; the name of the database defaults to "RuleDB" byt may be set in RULES_DATABASE_NAME; the size of the database defaults to 1048576000L but may be overridden with RULES_DATABASE_SIZE; the number of databases is maximally 10 but this may be overridden with RULES_DATABASE_COUNT_MAX.