TR181-XPON
1.4.0
TR-181 PON manager.
|
#include <stdbool.h>
#include <stdint.h>
Go to the source code of this file.
Functions | |
void | persistency_init (void) |
void | persistency_cleanup (void) |
const char * | persistency_get_folder (void) |
void | persistency_enable (const char *const object, bool enable) |
bool | persistency_is_enabled (const char *const object) |
Functionality related to saving and querying the reboot persistent settings. The only read-write parameters in the BBF XPON DM which need to be reboot persistent are:
Definition in file persistency.h.
void persistency_cleanup | ( | void | ) |
Clean up the persistency part.
The plugin must call this function once when stopping.
Definition at line 198 of file persistency.c.
void persistency_enable | ( | const char *const | object, |
bool | enable | ||
) |
Save whether object is enabled or disabled.
[in] | object | path to object in DM being enabled/disabled, e.g., "XPON.ONU.1" |
[in] | enable | true if object is enabled, else false |
Definition at line 248 of file persistency.c.
const char* persistency_get_folder | ( | void | ) |
Get the folder for reboot persistent settings for this plugin.
It typically returns "/etc/config/tr181-xpon/".
Definition at line 210 of file persistency.c.
void persistency_init | ( | void | ) |
Initialize the persistency part.
Ask the parser for the storage dir. If the parser returns NULL, take STORAGE_DIR as storage dir. Create the storage dir if it does not exist. Store the selected dir in s_storage_dir upon success, else set s_storage_dir to NULL.
Under normal circumstances the parser returns the storage dir, the dir exists, and this function sets s_storage_dir to that value.
The plugin must call this function once at startup.
mkdir() can not create all folders in a path at once. But we assume that all folders except for the last one in s_storage_dir exist. It's also unlikely we end up here. amxrt normally has already created the folder.
Definition at line 161 of file persistency.c.
bool persistency_is_enabled | ( | const char *const | object | ) |
Return true if object identified by 'object' is enabled.
[in] | object | path to object in DM being queried, e.g. "XPON.ONU.1". |
Definition at line 280 of file persistency.c.