The yp-system library provides easy vendor integration with the netconfd-pro server.
Use the yp-system library functions, found in the YumaPro yp-system API Guide.
There are examples of these initialization callbacks in the source example file libsystem/src/example-system.c
There are 4 external functions that can be implemented in the yp-system library
Step 1) Initialize the server profile
This step allows the vendor to pick all the server defaults.
The YANG defaults in netconfd-pro.yang to be overridden.
It also allows access to all server profile defaults not exposed as CLI parameters.
/* system init server profile callback * * Initialize the server profile if needed * * INPUTS: * profile == server profile to change if needed */ extern void yp_system_init_profile (agt_profile_t *profile);
Step 2a and 2b) Phase 1 initialization before and after CLI parameter processing
Typically used to register system-wide callbacks not specific to one YANG module, such
as the various server callbacks that allow customization and integration with the database transaction mode.
/* system init1 callback * init1 system call * this callback is invoked twice; before and after CLI processing * INPUTS: * pre_cli == TRUE if this call is before the CLI parameters * have been read * FALSE if this call is after the CLI parameters * have been read * RETURNS: * status; error will abort startup */ extern status_t yp_system_init1 (boolean pre_cli);
Step 3a and 3b) Phase 2 initialization before and after the running datastore is loaded
Typically used to customize the database implementation or add system-created default nodes to the running datastore
/* system init2 callback * init2 system call * this callback is invoked twice; before and after * load_running_config processing * * INPUTS: * pre_load == TRUE if this call is before the running config * has been loaded * FALSE if this call is after the running config * has been loaded * RETURNS: * status; error will abort startup */ extern status_t yp_system_init2 (boolean pre_load);
Step 4) Server Cleanup
Used to handle any shutdown code needed when the netconfd-pro server is terminating.
/* system cleanup callback * this callback is invoked once during agt_cleanup */ extern void yp_system_cleanup (void);