yumapro
24.10-2
YumaPro SDK
|
SIL-SA core functions are used to manage the subagent role in the distributed server. More...
Macros | |
#define | SIL_SA (const xmlChar *)"sil-sa" |
YControl service name. | |
#define | SIL_SA_MOD (const xmlChar *)"yumaworks-sil-sa" |
SIL-SA YANG module. | |
#define | SIL_SA_OBJ (const xmlChar *)"sil-sa" |
sil-sa container | |
#define | SIL_REQ_OK(ST) ((ST) >= SIL_SA_ST_READY) |
Check if SIL-SA state is ready. | |
Functions | |
status_t | sil_sa_register_service (void) |
Register the SIL-SA service with the YControl layer. More... | |
val_value_t * | sil_sa_get_key (rpc_msg_t *msg, uint32 keynum) |
Get a key leaf from the sil_sa_cb backptr in the rpc_msg. More... | |
val_value_t * | sil_sa_get_action_key (rpc_msg_t *msg, uint32 keynum) |
Get the key value node for the specified key for ACTION ONLY. More... | |
void | sil_sa_queue_notification (agt_not_msg_t *notif) |
Send a notification-event to the main server for queing by the agt_not module. More... | |
void | sil_sa_queue_notification_stream (const xmlChar *stream_name, agt_not_msg_t *notif) |
Send a notification-event to a specific stream, to the main server for queing by the agt_not module. More... | |
void | sil_sa_notif_test (int8 N1, int16 N2, const xmlChar *N3) |
Send a y_get2_test_get2_notif notification. More... | |
status_t | sil_sa_add_library_parm (const xmlChar *libstr) |
Add a library parameter so the SIL-SA libraries will be restricted to just these libraries instead of what is found in the /usr/lib/yumapro directory (or –runpath or YUMAPRO_RUNPATH) More... | |
boolean | sil_sa_any_library_parms (void) |
Check if any library parms are set. More... | |
boolean | sil_sa_find_library_parm (const xmlChar *libstr) |
Find a library parm name in the library_parmQ. More... | |
const xmlChar * | sil_sa_get_username (void) |
Get the user_id value from the message header. More... | |
const xmlChar * | sil_sa_get_client_addr (void) |
Get the client address (client_addr value from the message header) More... | |
const xmlChar * | sil_sa_get_rpc_msg_id (rpc_msg_t *msg) |
Get the rpc transaction id (txid_str) from the rpc_sil_sa_cb. More... | |
void | sil_sa_term_msg_test (uint32 count) |
Send a <term-msg> test notification. More... | |
status_t | sil_sa_add_edit (const xmlChar *defpath, val_value_t *edit_value, const xmlChar *edit_operation, const xmlChar *insert_where, const xmlChar *insert_point, boolean skip_cb) |
Add an edit to the current transaction from SIL-SA. More... | |
val_value_t * | sil_sa_get_data (ncx_cfg_t cfg_id, const xmlChar *defpath, status_t *retres) |
Get some YANG data from the server. More... | |
sil_sa_child_edit_t * | sil_sa_first_child_edit (rpc_msg_t *msg) |
Get the first child edit from the transaction control block. More... | |
sil_sa_child_edit_t * | sil_sa_next_child_edit (sil_sa_child_edit_t *curedit) |
Get the next child edit from the transaction control block. More... | |
void | sil_sa_child_edit_fields (sil_sa_child_edit_t *child_edit, op_editop_t *editop, val_value_t **newval, val_value_t **curval) |
Get the child edit fields. More... | |
void | sil_sa_set_error_msg (rpc_msg_t *msg, const xmlChar *strval) |
Set Error Message string in case of error. More... | |
void | sil_sa_get_user_data_parms (void **data_ref, uint32 *data_index) |
Get the current GET2_USER_REF saved values. More... | |
void | sil_sa_set_user_data_parms (void *data_ref, uint32 data_index) |
Set the current GET2_USER_REF saved values. More... | |
SIL-SA core functions are used to manage the subagent role in the distributed server.
EDIT and GET2 transactions are initiated from the server. The subsystem also handled HOOK and other APIs available during edit transaction processsing.
All functions in this module are user APIs for subsystem use only!
status_t sil_sa_add_edit | ( | const xmlChar * | defpath, |
val_value_t * | edit_value, | ||
const xmlChar * | edit_operation, | ||
const xmlChar * | insert_where, | ||
const xmlChar * | insert_point, | ||
boolean | skip_cb | ||
) |
Add an edit to the current transaction from SIL-SA.
Save an added edit in the SIL-SA Control block for further hook-response processing
Move or insertion OP available. Skip callbacks for added edits option is available.
Only allowed for Set Hooks or Post Set Hook, the rest are ignored.
defpath | XPath path of object instance |
edit_value | val_value_t representing newnode in transaction only needed for create, merge, replace, not delete |
edit_operation | <operation string>
|
insert_where | <insert enum string> (NULL if not used)
|
insert_point | is a XPath encoded string like the defpath. Only for 'before' or 'after' insert_where paramter. The insert_where must be set to 'before' or 'after' if insert_point specified. Will be used only if the operations are "move" or "insert". Ignored otherwise. E.g: "/test3[string.1='entry2'][uint32.1='2']" |
skip_cb | TRUE if DO NOT invoke callbacks for an edded edit if any. FALSE if SKIP any callback for added edit including Transaction, EDIT1, EDIT2 callbacks Only when target=running |
status_t sil_sa_add_library_parm | ( | const xmlChar * | libstr | ) |
Add a library parameter so the SIL-SA libraries will be restricted to just these libraries instead of what is found in the /usr/lib/yumapro directory (or –runpath or YUMAPRO_RUNPATH)
libstr | library name (use foo for libfoo_sa.so) |
boolean sil_sa_any_library_parms | ( | void | ) |
Check if any library parms are set.
If any library params set AT ALL then ONLY those libraries will be checked. All other names will be skipped.
TRUE if any parms found; FALSE if not found
void sil_sa_child_edit_fields | ( | sil_sa_child_edit_t * | child_edit, |
op_editop_t * | editop, | ||
val_value_t ** | newval, | ||
val_value_t ** | curval | ||
) |
Get the child edit fields.
SIL-SA EDIT2 MODE
SIL-SA Analogue agt_cfg_child_edit_fields() API. Get the child edit fields from the child_edit record
child_edit | child_edit record that was returned from the server | |
[out] | editop | address of return editop |
[out] | newval | address of return new value |
[out] | curval | address of return current value |
boolean sil_sa_find_library_parm | ( | const xmlChar * | libstr | ) |
Find a library parm name in the library_parmQ.
libstr | library name (use foo for libfoo_sa.so) |
sil_sa_child_edit_t * sil_sa_first_child_edit | ( | rpc_msg_t * | msg | ) |
Get the first child edit from the transaction control block.
SIL-SA EDIT2 MODE
SIL-SA Analogue agt_cfg_first_child_edit() API. Get the first child node edit record
msg | rpc msg to use to find keys |
val_value_t * sil_sa_get_action_key | ( | rpc_msg_t * | msg, |
uint32 | keynum | ||
) |
Get the key value node for the specified key for ACTION ONLY.
msg | rpc msg to use to find keys FOR ACTION ONLY |
keynum | key index to get – 1 to N |
const xmlChar * sil_sa_get_client_addr | ( | void | ) |
Get the client address (client_addr value from the message header)
This is the external client address, not the SIL-SA peer address. Time-sensitive API. Each message received by a user will cause the saved state to be updated.
val_value_t * sil_sa_get_data | ( | ncx_cfg_t | cfg_id, |
const xmlChar * | defpath, | ||
status_t * | retres | ||
) |
Get some YANG data from the server.
Get the val_value based on Xpath of object instance This function will return value only if there is existing node in the datastore or there is defaults for the node.
cfg_id | configuration datastore ID to use | |
defpath | XPath path of object instance | |
[out] | retres | address of return status; *retres return status |
val_value_t * sil_sa_get_key | ( | rpc_msg_t * | msg, |
uint32 | keynum | ||
) |
Get a key leaf from the sil_sa_cb backptr in the rpc_msg.
msg | rpc msg to use to find keys |
keynum | key index to get – 1 to N |
const xmlChar * sil_sa_get_rpc_msg_id | ( | rpc_msg_t * | msg | ) |
Get the rpc transaction id (txid_str) from the rpc_sil_sa_cb.
This function is only available to EDIT callbacks! It is NULL for GET2 callbacks.
msg | rpc msg to retrive rpc msg id from |
void sil_sa_get_user_data_parms | ( | void ** | data_ref, |
uint32 * | data_index | ||
) |
Get the current GET2_USER_REF saved values.
User data tracking for GET2 support for SIL-SA Macros:
These macros can be set and retrieved outside of a GET2 callback. Each subsystem maintains saved values for each of these variables to use as the initial value to use for GET2 callbacks.
A GET2 callback may change the values during the callback.
[out] | data_ref | return the current USER_DATA_REF value |
[out] | data_index | return the current USER_DATA_INDEX value |
const xmlChar * sil_sa_get_username | ( | void | ) |
Get the user_id value from the message header.
Time-sensitive API. Each message received by a user will cause the saved state to be updated.
sil_sa_child_edit_t * sil_sa_next_child_edit | ( | sil_sa_child_edit_t * | curedit | ) |
Get the next child edit from the transaction control block.
SIL-SA EDIT2 MODE
SIL-SA Analogue agt_cfg_next_child_edit() API. Get the next child node edit
curedit | pointer to the current child edit |
void sil_sa_notif_test | ( | int8 | N1, |
int16 | N2, | ||
const xmlChar * | N3 | ||
) |
Send a y_get2_test_get2_notif notification.
FOR DEBUGGING ONLY!
Called by your code when notification event occurs. Used in regression testing. NOT A REAL API!
N1 | YANG parameter 1 |
N2 | YANG parameter 2 |
N3 | YANG parameter 3 |
void sil_sa_queue_notification | ( | agt_not_msg_t * | notif | ) |
Send a notification-event to the main server for queing by the agt_not module.
notif | notification struct to send Will be consumed and freed even if there is an error |
void sil_sa_queue_notification_stream | ( | const xmlChar * | stream_name, |
agt_not_msg_t * | notif | ||
) |
Send a notification-event to a specific stream, to the main server for queing by the agt_not module.
Use this API for hard-wired event streams only! If the module-to-stream mappings are used then DO NOT use this API because the mappings will be ignored.
stream_name | optional stream name (NULL = use NETCONF) |
notif | notification struct to send Will be consumed and freed even if there is an error |
status_t sil_sa_register_service | ( | void | ) |
Register the SIL-SA service with the YControl layer.
Must be called before any other SIL-SA function can be used.
void sil_sa_set_error_msg | ( | rpc_msg_t * | msg, |
const xmlChar * | strval | ||
) |
Set Error Message string in case of error.
msg | rpc msg to use to find keys |
strval | string value to use for error message |
void sil_sa_set_user_data_parms | ( | void * | data_ref, |
uint32 | data_index | ||
) |
Set the current GET2_USER_REF saved values.
User data tracking for GET2 support for SIL-SA Macros:
These macros can be set and retrieved outside of a GET2 callback. Each subsystem maintains saved values for each of these variables to use as the initial value to use for GET2 callbacks.
A GET2 callback may change the values during the callback.
data_ref | set the current USER_DATA_REF value
|
data_index | set the current USER_DATA_INDEX value
|
void sil_sa_term_msg_test | ( | uint32 | count | ) |
Send a <term-msg> test notification.
DEBUG ONLY.
Create a dummy message using the count variable. Used for regression testing only.
count | current loop count to add to data |