Go to the source code of this file.
◆ get_ndn_rule_storage_instance()
There should be only one ndn_rule_storage_t.
Use this function to get the singleton instance. If the instance has not been initialized, call ndn_rule_storage_init first.
◆ ndn_rule_storage_add_rule()
Add a rule to the rule storage.
Will do a deep copy of the rule passed in.
- Parameters
-
rule_name. | Input. The string to associate with the rule added. The storage will not allow the adding of a rule with the same name as one already in storage. |
rule. | Input. The rule that will be deep copied into the rule storage. |
- Returns
- 0 if the rule is successfully added.
◆ ndn_rule_storage_get_rule()
Get a rule from the rule storage.
- Parameters
-
rule_name. | Input. The string representing the name of the rule to get from storage. |
- Returns
- A pointer to the rule if it is found in storage. NULL otherwise.
◆ ndn_rule_storage_init()
void ndn_rule_storage_init |
( |
void |
| ) |
|
Init the rule storage singleton.
This function will clear the rule storage.
◆ ndn_rule_storage_remove_rule()
int ndn_rule_storage_remove_rule |
( |
const char * |
rule_name | ) |
|
Remove a rule from the rule storage.
- Parameters
-
rule_name. | Input. The name of the rule to remove. |
- Returns
- 0 if the rule corresponding to rule_name is successfully removed.