yumapro
24.10-2
YumaPro SDK
|
Supports original notifications (RFC 5277) using the <create-subscription> operation. More...
Functions | |
status_t | agt_not_init (void) |
INIT 1: Initialize the server notification module data structures. More... | |
status_t | agt_not_init_sil_sa (void) |
INIT 1: Initialize the server notification module data structures. More... | |
status_t | agt_not_init2 (void) |
INIT 2: Initialize the monitoring data structures This must be done after the <running> config is loaded. More... | |
void | agt_not_cleanup (void) |
Cleanup the module data structures. More... | |
void | agt_not_cleanup_sil_sa (void) |
Cleanup the module data structures. More... | |
uint32 | agt_not_send_notifications (thd_tcb_t *tcb) |
Send notifications (PTHREADS VERSION) More... | |
void | agt_not_remove_subscription (ses_id_t sid) |
Remove and expire a subscription with the specified session ID. More... | |
agt_not_msg_t * | agt_not_new_notification (obj_template_t *eventType) |
Malloc and initialize the fields in an agt_not_msg_t. More... | |
agt_not_msg_t * | agt_not_new_notification_ex (obj_template_t *eventType, const xmlChar *eventTime) |
@ brief Malloc and initialize the fields in an agt_not_msg_t Use provided eventTime (extended) More... | |
void | agt_not_free_notification (agt_not_msg_t *notif) |
Scrub the memory in an agt_not_template_t by freeing all the sub-fields and then freeing the entire struct itself. More... | |
void | agt_not_add_to_payload (agt_not_msg_t *notif, val_value_t *val) |
Queue the specified value node into the payloadQ for the specified notification. More... | |
void | agt_not_add_key (agt_not_msg_t *notif, val_value_t *val) |
Queue the specified value node into the keyQ for the specified notification. More... | |
void | agt_not_queue_notification (agt_not_msg_t *notif) |
Queue the specified notification in the replay log. More... | |
void | agt_not_queue_notification_stream (const xmlChar *stream_name, agt_not_msg_t *notif) |
Queue the specified notification in the replay log. More... | |
boolean | agt_not_is_replay_event (const obj_template_t *notifobj) |
Check if the specified notfication is the replayComplete or notificationComplete notification events. More... | |
void | agt_not_cancel_subscription (ses_id_t sid) |
Cancel any notification subscription for the specified session. More... | |
status_t | agt_not_start_subscription (ses_cb_t *scb, const xmlChar *stream, xmlChar *startTime, xmlChar *stopTime, boolean futurestop, op_filtertyp_t filtertype, val_value_t *filterval, val_value_t *selectval) |
Malloc and fill in a new subscription control block. More... | |
void | agt_not_go_active (void) |
Enable active notification subscriptions. More... | |
void | agt_not_go_standby (void) |
Exit active notification subscription mode and disable notifications. More... | |
status_t | agt_not_init_yangpush (obj_template_t *streams_obj) |
Init the yang-push related streams and data structures. More... | |
status_t | agt_not_set_filter (const xmlChar *name, ncx_nmda_filtyp_t nmda_filtyp, agt_not_filtertyp_t filtyp, const val_value_t *filval) |
Add or Modify a filter entry. More... | |
status_t | agt_not_clone_filter (ncx_nmda_filtyp_t nmda_filtyp, const xmlChar *name, agt_not_filtertyp_t *filtyp, val_value_t **filval) |
Find a filter entry and clone it. More... | |
status_t | agt_not_delete_filter (const xmlChar *name, ncx_nmda_filtyp_t nmda_filtyp) |
Delete an existing filter entry. More... | |
status_t | agt_not_delete_all_filters (boolean force) |
Delete all existing filter entries. More... | |
status_t | agt_not_establish_subscription (ses_cb_t *scb, const xmlChar *stream_filter_name, const val_value_t *stream_subtree_filter, const val_value_t *stream_xpath_filter, const xmlChar *stream, const xmlChar *replay_start_time, const xmlChar *stop_time, const val_value_t *encoding, agt_not_subid_t *subid, agt_not_sterr_t *errnum) |
Create a RFC 8639 stream subscription. More... | |
status_t | agt_not_modify_subscription (ses_cb_t *scb, agt_not_subid_t subid, const xmlChar *stream_filter_name, const val_value_t *stream_subtree_filter, const val_value_t *stream_xpath_filter, const xmlChar *stop_time, agt_not_sterr_t *errnum) |
Modify a RFC 8639 stream subscription. More... | |
status_t | agt_not_delete_dynamic_subscription (ses_id_t sid, agt_not_subid_t subid) |
Terminate your own RFC 8639 subscription. More... | |
status_t | agt_not_kill_dynamic_subscription (agt_not_subid_t subid) |
Terminate any session's RFC 8639 subscription. More... | |
status_t | agt_not_setup_push_subscription (ses_cb_t *scb, const xmlChar *selection_filter_ref, const xmlChar *stop_time, const val_value_t *encoding, agt_not_modify_filter_cbfn_t modify_cbfn, agt_not_delete_subscription_cbfn_t delete_cbfn, agt_not_subid_t *subid, agt_not_sterr_t *errnum, boolean *isbinary) |
Create a RFC 8641 YANG Push subscription. More... | |
status_t | agt_not_modify_push_subscription (ses_id_t sid, agt_not_subid_t cur_subid, const xmlChar *selection_filter_ref, const xmlChar *stop_time, agt_not_sterr_t *errnum) |
Modify a RFC 8641 YANG Push subscription. More... | |
status_t | agt_not_register_yang_push (agt_not_check_push_cbfn_t cbfn, agt_not_module_removed_cbfn_t mod_cbfn) |
Used by YANG Push to check periodic and simulated operational. More... | |
status_t | agt_not_register_notif_objs (obj_template_t *replay_completed, obj_template_t *subscription_completed, obj_template_t *subscription_modified, obj_template_t *subscription_resumed, obj_template_t *subscription_started, obj_template_t *subscription_suspended, obj_template_t *subscription_terminated) |
Register Notification Objects. More... | |
status_t | agt_not_send_periodic_update (agt_not_subid_t subid, ses_id_t sid, obj_template_t *notif_obj, rpc_msg_t *msg, boolean *subscription_deleted) |
Used by YANG Push to send a periodic update to 1 session. More... | |
status_t | agt_not_get_simop_update (agt_not_subid_t subid, ses_id_t sid, const xmlChar *filespec, rpc_msg_t *msg, boolean *subscription_deleted, uint32 *checksum, uint32 *bytecnt) |
Used by YANG Push to get the candidate Simuated Operational On-Change subscription. More... | |
status_t | agt_not_send_simop_update (agt_not_subid_t subid, ses_id_t sid, const xmlChar *filespec, rpc_msg_t *msg, obj_template_t *notif_obj, boolean *subscription_deleted) |
Use the file contents to send an Simulated Operational on-change update to the client session. More... | |
void | agt_not_suspend_push_subscription (agt_not_subid_t subid, agt_not_suspend_reason_t reason) |
Suspend a subscription and stop sending notifications to it. More... | |
void | agt_not_resume_push_subscription (agt_not_subid_t subid) |
Resume a YANG Push Subscription. More... | |
void | agt_not_kill_push_subscription (agt_not_subid_t subid, agt_not_term_reason_t term_reason) |
Kill a YANG Push Subscription. More... | |
status_t | agt_not_send_onchange_update (agt_not_subid_t subid, ses_id_t sid, obj_template_t *notif_obj, yang_patch_cb_t *pcb, boolean *subscription_deleted) |
Used by YANG Push to send an on-change update to 1 session. More... | |
void | agt_not_remove_module_filters (const ncx_module_t *mod) |
Invoke Module Removed Callback. More... | |
obj_template_t * | agt_not_get_modified_obj (void) |
Get subscription-modified object. More... | |
status_t | agt_not_send_push_notif (agt_not_subid_t subid, agt_not_msg_t *notif) |
Send the notification directly to the specified push subscription ID. More... | |
status_t | agt_not_create_event_stream (const xmlChar *name, uint32 eventlog_size, const xmlChar *description) |
Create an event-stream from a YANG module interface. More... | |
status_t | agt_not_delete_event_stream (ses_cb_t *scb, const xmlChar *name) |
Delete an event-stream from a YANG module interface. More... | |
status_t | agt_not_edit_module_map (const xmlChar *modname, const xmlChar *stream_name, boolean is_create) |
Create or modify a module map from a YANG module interface. More... | |
status_t | agt_not_delete_module_map (const xmlChar *modname) |
Delete a module map from a YANG module interface. More... | |
boolean | agt_not_event_stream_exists (const xmlChar *stream_name) |
Check if the specified event stream is configured. More... | |
status_t | agt_not_clear_event_stream_log (const xmlChar *stream_name) |
Remove all the stored notifications in the eventlog for the specified event stream. More... | |
status_t | agt_not_register_stream_cbfn (const xmlChar *modname, const xmlChar *stream_name, boolean all_streams, agt_not_stream_cbfn_t cbfn, void *cookie) |
Register a SIL event-stream callback function. More... | |
void | agt_not_unregister_stream_cbfn (const xmlChar *modname, agt_not_stream_cbfn_t cbfn) |
Unregister a SIL event-stream callback function. More... | |
status_t | agt_not_register_stream_cbfn_subsys (const xmlChar *subsys_id, const xmlChar *modname, const xmlChar *stream_name, boolean all_streams) |
Register a SIL event-stream callback function. More... | |
void | agt_not_unregister_stream_cbfn_subsys (const xmlChar *subsys_id, const xmlChar *modname) |
Unregister a SIL event-stream callback function. More... | |
status_t | agt_not_check_register_add (const xmlChar *modname, val_value_t *request_val) |
Check if a "<stream-callback>" container needs to be added to the "<register>" list entry. More... | |
boolean | agt_not_any_unregistered (const xmlChar *modname) |
Check if any entries are still unregistered for a subsystem building a register-request. More... | |
void | agt_not_subsys_gone (const xmlChar *subsys_id) |
Unload any remote stream callbacks when a subsystem session is lost and subsys-gone event handled. More... | |
status_t | agt_not_stream_callback_subsys (const xmlChar *stream_name, agt_not_subevent_t subevent, const xmlChar *modname, boolean all_streams) |
Invoke a stream callback function on the SIL-SA subsystem. More... | |
void | agt_not_unload_module (const xmlChar *modname) |
Unload any remote stream callbacks when a module is unloaded. More... | |
status_t | agt_not_set_notif_mpid (agt_not_msg_t *msg, const ncx_sm_mpid_t *mpid) |
Set the MPID to use for sending the schema-mounted notification. More... | |
status_t | agt_not_init_restconf_streams (val_value_t *streamsval, obj_template_t *streamobj) |
Initialize the monitoring data structures for restconf This must be done after the <running> config is loaded. More... | |
Supports original notifications (RFC 5277) using the <create-subscription> operation.
Supports new notifications (RFC 8639) using the <establish-subscription> operation.
agt_not_msg_t *msg = agt_not_new_notification(eventType); if (msg) { agt_not_add_to_payload(msg, payload_val); agt_not_queue_notification(msg); }
void agt_not_add_key | ( | agt_not_msg_t * | notif, |
val_value_t * | val | ||
) |
Queue the specified value node into the keyQ for the specified notification.
This is the only API used by SIL or SIL-SA code to add the ancestor key nodes for a nested notification
notif | notification to send |
val | value to add to keyQ !!! THIS IS LIVE MALLOCED MEMORY PASSED OFF !!! TO THIS FUNCTION. IT WILL BE FREED LATER !!! DO NOT CALL val_free_value !!! AFTER THIS CALL |
val will added to the notif->keyQ
void agt_not_add_to_payload | ( | agt_not_msg_t * | notif, |
val_value_t * | val | ||
) |
Queue the specified value node into the payloadQ for the specified notification.
This is the main API used by SIL or SIL-SA code to add the data nodes defined in the notification-stmt
notif | notification to send |
val | value to add to payloadQ !!! THIS IS LIVE MALLOCED MEMORY PASSED OFF !!! TO THIS FUNCTION. IT WILL BE FREED LATER !!! DO NOT CALL val_free_value !!! AFTER THIS CALL |
val will added to the notif->payloadQ
boolean agt_not_any_unregistered | ( | const xmlChar * | modname | ) |
Check if any entries are still unregistered for a subsystem building a register-request.
YPW-1816.
modname | module name registering callbacks |
void agt_not_cancel_subscription | ( | ses_id_t | sid | ) |
Cancel any notification subscription for the specified session.
sid | session ID to use |
status_t agt_not_check_register_add | ( | const xmlChar * | modname, |
val_value_t * | request_val | ||
) |
Check if a "<stream-callback>" container needs to be added to the "<register>" list entry.
YPW-1816.
modname | module name used in the register request |
request_val | value node to add P-container if needed |
void agt_not_cleanup | ( | void | ) |
Cleanup the module data structures.
Called by the server during shutdown
void agt_not_cleanup_sil_sa | ( | void | ) |
Cleanup the module data structures.
Called by the server during shutdown CALLED BY SIL-SA SUBSYSTEM ONLY
status_t agt_not_clear_event_stream_log | ( | const xmlChar * | stream_name | ) |
Remove all the stored notifications in the eventlog for the specified event stream.
It is an error if stream does not exist
It is not an error if there are not events to clear This will affect the subscriptions (if any) that might be getting these notifications sent to them right now
stream_name | event stream name to clear |
status_t agt_not_clone_filter | ( | ncx_nmda_filtyp_t | nmda_filtyp, |
const xmlChar * | name, | ||
agt_not_filtertyp_t * | filtyp, | ||
val_value_t ** | filval | ||
) |
Find a filter entry and clone it.
Clone the val_value contents
nmda_filtyp | NMDA filter type (stream or selection) | |
name | name or id of entry to add or modify | |
[out] | filtyp | address ot return found filter type *filtyp found filter type |
[out] | filval | address ot return value *filval cloned filter value (MUST FREE WITH val_free_value) |
status_t agt_not_create_event_stream | ( | const xmlChar * | name, |
uint32 | eventlog_size, | ||
const xmlChar * | description | ||
) |
Create an event-stream from a YANG module interface.
name | stream name (mandatory) |
eventlog_size | replay buffer size (mandatory) |
description | event stream administrative description
|
status_t agt_not_delete_all_filters | ( | boolean | force | ) |
Delete all existing filter entries.
The /filters container was deleted
force | true to force deletion of filters in use |
status_t agt_not_delete_dynamic_subscription | ( | ses_id_t | sid, |
agt_not_subid_t | subid | ||
) |
Terminate your own RFC 8639 subscription.
Remove and expire a subscription with the specified session ID and subscription ID Called from u_ietf-subscribed-notifications.c
sid | session ID to use |
subid | subscription ID to use |
Delete an event-stream from a YANG module interface.
scb | session deleting this entry |
name | stream name |
status_t agt_not_delete_filter | ( | const xmlChar * | name, |
ncx_nmda_filtyp_t | nmda_filtyp | ||
) |
Delete an existing filter entry.
name | name or id of entry to modify |
nmda_filtyp | NMDA filter type (stream or selection) |
status_t agt_not_delete_module_map | ( | const xmlChar * | modname | ) |
Delete a module map from a YANG module interface.
modname | module name |
status_t agt_not_edit_module_map | ( | const xmlChar * | modname, |
const xmlChar * | stream_name, | ||
boolean | is_create | ||
) |
Create or modify a module map from a YANG module interface.
modname | module name of entry |
stream_name | name to use in mapping |
is_create | TRUE if create; FALSE if modify |
status_t agt_not_establish_subscription | ( | ses_cb_t * | scb, |
const xmlChar * | stream_filter_name, | ||
const val_value_t * | stream_subtree_filter, | ||
const val_value_t * | stream_xpath_filter, | ||
const xmlChar * | stream, | ||
const xmlChar * | replay_start_time, | ||
const xmlChar * | stop_time, | ||
const val_value_t * | encoding, | ||
agt_not_subid_t * | subid, | ||
agt_not_sterr_t * | errnum | ||
) |
Create a RFC 8639 stream subscription.
Start an event stream subscription. This is used for a plain subscription to a stream, NOT YANG-PUSH. These parameters are copied by value so the values passed do not need to persist after this call.
1 of 3 filters expected. Only 1 can be set
scb | session control block starting the subscription | |
stream_filter_name | filter by reference: option 1 of 3 for subscription filter | |
stream_subtree_filter | inline subtree filter: option 2 of 3 for subscription filter | |
stream_xpath_filter | inline XPath filter: option 3 of 3 for subscription filter | |
stream | stream name for subscription [MANDATORY] | |
replay_start_time | replay start if replay supported for stream | |
stop_time | stop time is a common parm if replay supported for stream | |
encoding | encoding is a common parm. Only XML is supported. | |
[out] | subid | address of return subscription ID assigned *subid subscription ID assigned (if NO_ERR) |
[out] | errnum | address of return parm number of error *errnum = parm number of error if returning error (if some error) |
boolean agt_not_event_stream_exists | ( | const xmlChar * | stream_name | ) |
Check if the specified event stream is configured.
stream_name | event stream name to check |
void agt_not_free_notification | ( | agt_not_msg_t * | notif | ) |
Scrub the memory in an agt_not_template_t by freeing all the sub-fields and then freeing the entire struct itself.
The struct must be removed from any queue it is in before this function is called.
notif | agt_not_template_t to delete |
obj_template_t * agt_not_get_modified_obj | ( | void | ) |
Get subscription-modified object.
Used by YANG Push to build its variant of the subscription-modified
status_t agt_not_get_simop_update | ( | agt_not_subid_t | subid, |
ses_id_t | sid, | ||
const xmlChar * | filespec, | ||
rpc_msg_t * | msg, | ||
boolean * | subscription_deleted, | ||
uint32 * | checksum, | ||
uint32 * | bytecnt | ||
) |
Used by YANG Push to get the candidate Simuated Operational On-Change subscription.
The data count and checksum are compared to the last one to see if a new update needs to be sent
subid | subscription ID | |
sid | session ID (to validate against subscription ID) | |
filespec | filename to use to save the update | |
msg | filled in rpc_msg to use to call agt_output_filter | |
[out] | subscription_deleted | address of return flag *subscription_deleted TRUE if subscription or session gone |
[out] | checksum | address of return checksum *checksum the checksum of written bytes |
[out] | bytecnt | address of return byte count *bytecnt number of bytes written by agt_output_filter |
void agt_not_go_active | ( | void | ) |
Enable active notification subscriptions.
Delayed init needed for HA standby going active
void agt_not_go_standby | ( | void | ) |
Exit active notification subscription mode and disable notifications.
Shutdown notification subscriptions when changing from active to standby
status_t agt_not_init | ( | void | ) |
INIT 1: Initialize the server notification module data structures.
status_t agt_not_init2 | ( | void | ) |
INIT 2: Initialize the monitoring data structures This must be done after the <running> config is loaded.
status_t agt_not_init_restconf_streams | ( | val_value_t * | streamsval, |
obj_template_t * | streamobj | ||
) |
Initialize the monitoring data structures for restconf This must be done after the <running> config is loaded.
streamsval | parent value to contain stream entries |
streamobj | object template for the stream list |
status_t agt_not_init_sil_sa | ( | void | ) |
INIT 1: Initialize the server notification module data structures.
CALLED BY SIL-SA SUBSYSTEM ONLY
status_t agt_not_init_yangpush | ( | obj_template_t * | streams_obj | ) |
Init the yang-push related streams and data structures.
streams_obj | object for streams to make stream values |
boolean agt_not_is_replay_event | ( | const obj_template_t * | notifobj | ) |
Check if the specified notfication is the replayComplete or notificationComplete notification events.
notifobj | notification object to check |
status_t agt_not_kill_dynamic_subscription | ( | agt_not_subid_t | subid | ) |
Terminate any session's RFC 8639 subscription.
Remove and expire a subscription with the specified subscription ID Called from u_ietf-subscribed-notifications.c
subid | subscription ID to use |
void agt_not_kill_push_subscription | ( | agt_not_subid_t | subid, |
agt_not_term_reason_t | term_reason | ||
) |
Kill a YANG Push Subscription.
Requested by YANG-PUSH Terminate a subscription and stop sending notifications to it
subid | subscription ID to kill |
term_reason | termination reason code |
status_t agt_not_modify_push_subscription | ( | ses_id_t | sid, |
agt_not_subid_t | cur_subid, | ||
const xmlChar * | selection_filter_ref, | ||
const xmlChar * | stop_time, | ||
agt_not_sterr_t * | errnum | ||
) |
Modify a RFC 8641 YANG Push subscription.
These parameters are copied by value so the values passed do not need to persist after this call
sid | session ID | |
cur_subid | subscription ID to modify [mandatory] | |
selection_filter_ref | filter reference | |
stop_time | stop time is a common parm if replay supported for stream | |
[out] | errnum | address of return parm number of error *errnum parm number of error if returning error (if some error) |
status_t agt_not_modify_subscription | ( | ses_cb_t * | scb, |
agt_not_subid_t | subid, | ||
const xmlChar * | stream_filter_name, | ||
const val_value_t * | stream_subtree_filter, | ||
const val_value_t * | stream_xpath_filter, | ||
const xmlChar * | stop_time, | ||
agt_not_sterr_t * | errnum | ||
) |
Modify a RFC 8639 stream subscription.
Modify an existing event stream subscription This is used for a plain subscription to a stream, NOT YANG-PUSH These parameters are copied by value so the values passed do not need to persist after this call
The client can provide only the parameters that should be changed The existing subscription will be used to fill in any parameters that are not provided. The client can also provide parameters that are not chaning.
The 'newsub' struct will be setup to take over the same state as before, except any suspended subscription is automatically made active if this RPC succeeds
The <subscription-modified> event will be setup for the rx_thread or send_notifications loop to generate as the first notification after the subscription is modified
scb | session control block starting the subscription [MANDATORY] | |
subid | subscription ID to modify [MANDATORY] | |
stream_filter_name | filter by reference: option 1 of 3 for subscription filter | |
stream_subtree_filter | inline subtree filter: option 2 of 3 for subscription filter | |
stream_xpath_filter | inline XPath filter: option 3 of 3 for subscription filter | |
stop_time | stop time is a common parm if replay supported for stream | |
[out] | errnum | address of return parm number of error *errnum = parm number of error if returning error (if some error) |
agt_not_msg_t * agt_not_new_notification | ( | obj_template_t * | eventType | ) |
Malloc and initialize the fields in an agt_not_msg_t.
eventType | object template of the event type |
agt_not_msg_t * agt_not_new_notification_ex | ( | obj_template_t * | eventType, |
const xmlChar * | eventTime | ||
) |
@ brief Malloc and initialize the fields in an agt_not_msg_t Use provided eventTime (extended)
eventType | object template of the event type |
eventTime | event timestamp string |
void agt_not_queue_notification | ( | agt_not_msg_t * | notif | ) |
Queue the specified notification in the replay log.
It will be sent to all the active subscriptions as needed.
notif | notification to send !!! THIS IS LIVE MALLOCED MEMORY PASSED OFF !!! TO THIS FUNCTION. IT WILL BE FREED LATER !!! DO NOT CALL agt_not_free_notification !!! AFTER THIS CALL |
message added to the notificationQ
void agt_not_queue_notification_stream | ( | const xmlChar * | stream_name, |
agt_not_msg_t * | notif | ||
) |
Queue the specified notification in the replay log.
It will be sent to all the active subscriptions as needed.
This API should not be used if the module to event stream mapping configuration is used instead.
Use this API if the event-stream configuration is hard-wired by the vendor. The module ot event stream mappings will be ignored if this API is ued
stream_name | stream name to use (NULL use NETCONF) |
notif | notification to send !!! THIS IS LIVE MALLOCED MEMORY PASSED OFF !!! TO THIS FUNCTION. IT WILL BE FREED LATER !!! DO NOT CALL agt_not_free_notification !!! AFTER THIS CALL; FREED EVEN IF ERROR |
message added to the notificationQ
status_t agt_not_register_notif_objs | ( | obj_template_t * | replay_completed, |
obj_template_t * | subscription_completed, | ||
obj_template_t * | subscription_modified, | ||
obj_template_t * | subscription_resumed, | ||
obj_template_t * | subscription_started, | ||
obj_template_t * | subscription_suspended, | ||
obj_template_t * | subscription_terminated | ||
) |
Register Notification Objects.
The notification objects are used for subscription mainenance. There are 7 subscription notification objects
replay_completed | replay completed event |
subscription_completed | subscription completed event |
subscription_modified | subscription modified event |
subscription_resumed | subscription resumed event |
subscription_started | subscription started event |
subscription_suspended | subscription suspended event |
subscription_terminated | subscription terminated event |
status_t agt_not_register_stream_cbfn | ( | const xmlChar * | modname, |
const xmlChar * | stream_name, | ||
boolean | all_streams, | ||
agt_not_stream_cbfn_t | cbfn, | ||
void * | cookie | ||
) |
Register a SIL event-stream callback function.
Used to help suppress event generation if nobody is listening
YPW-1816. For SIL code, there will be multiple callback registrations per module supported.
For SIL-SA code, there will be one callback registration per module supported. Only only registration for each value of the modname
parameter will be allowed.
A callback can choose 1 of 3 operational modes:
modname | module name that this callback is registering for.
|
stream_name | event stream name to register for.
|
all_streams | TRUE if this callback is registering for all event streams. FALSE for normal mode and registering for 1 module name of one event stream. |
cbfn | callback function to use |
cookie | pointer to pass to the callback function as a cookie |
status_t agt_not_register_stream_cbfn_subsys | ( | const xmlChar * | subsys_id, |
const xmlChar * | modname, | ||
const xmlChar * | stream_name, | ||
boolean | all_streams | ||
) |
Register a SIL event-stream callback function.
From agt_sil Used to help suppress event generation if nobody is listening
YPW-1816.
subsys_id | subsystem registering this callback |
modname | module name that this callback is registering for.
|
stream_name | event stream name to register for.
|
all_streams | TRUE if this callback is registering for all event streams. FALSE for normal mode and registering for 1 module name of one event stream. |
status_t agt_not_register_yang_push | ( | agt_not_check_push_cbfn_t | cbfn, |
agt_not_module_removed_cbfn_t | mod_cbfn | ||
) |
Used by YANG Push to check periodic and simulated operational.
cbfn | check push callback function to use |
mod_cbfn | module removed callback function to use |
void agt_not_remove_module_filters | ( | const ncx_module_t * | mod | ) |
Invoke Module Removed Callback.
Used by YANG Push to suspend subscriptions that filter for a target object that is being removed
mod | module being removed |
void agt_not_remove_subscription | ( | ses_id_t | sid | ) |
Remove and expire a subscription with the specified session ID.
The session is being removed.
sid | session ID to use |
void agt_not_resume_push_subscription | ( | agt_not_subid_t | subid | ) |
Resume a YANG Push Subscription.
Requested by YANG-PUSH Resume a subscription and start sending notifications to it
subid | subscription ID to resume |
uint32 agt_not_send_notifications | ( | thd_tcb_t * | tcb | ) |
Send notifications (PTHREADS VERSION)
Send out some notifications to the specified/configured subscription(s), if needed.
Simple design: go through all the subscriptions and send at most one notification to each one if needed. This will build in some throttling based on the ncxserver select loop timeout (or however this function is called).
notifications may be written to some active sessions
tcb | Thread control block for session |
status_t agt_not_send_onchange_update | ( | agt_not_subid_t | subid, |
ses_id_t | sid, | ||
obj_template_t * | notif_obj, | ||
yang_patch_cb_t * | pcb, | ||
boolean * | subscription_deleted | ||
) |
Used by YANG Push to send an on-change update to 1 session.
subid | subscription ID | |
sid | session ID (to validate against subscription ID) | |
notif_obj | push-change-update object | |
pcb | yang_patch_cb to send | |
[out] | subscription_deleted | address of return flag *subscription_deleted TRUE if subscription or session gone |
status_t agt_not_send_periodic_update | ( | agt_not_subid_t | subid, |
ses_id_t | sid, | ||
obj_template_t * | notif_obj, | ||
rpc_msg_t * | msg, | ||
boolean * | subscription_deleted | ||
) |
Used by YANG Push to send a periodic update to 1 session.
subid | subscription ID | |
sid | session ID (to validate against subscription ID) | |
notif_obj | push-update object | |
msg | dummy RPC message to use | |
[out] | subscription_deleted | address of return flag *subscription_deleted TRUE if subscription or session gone |
status_t agt_not_send_push_notif | ( | agt_not_subid_t | subid, |
agt_not_msg_t * | notif | ||
) |
Send the notification directly to the specified push subscription ID.
subid | push subscription ID |
notif | notification to send (THIS IS NOT FREED HERE) |
status_t agt_not_send_simop_update | ( | agt_not_subid_t | subid, |
ses_id_t | sid, | ||
const xmlChar * | filespec, | ||
rpc_msg_t * | msg, | ||
obj_template_t * | notif_obj, | ||
boolean * | subscription_deleted | ||
) |
Use the file contents to send an Simulated Operational on-change update to the client session.
Send a push-update instead of a push-change-update event
subid | subscription ID | |
sid | session ID (to validate against subscription ID) | |
filespec | filename to use to send as data | |
msg | filled in rpc_msg to use to call agt_output_filter | |
notif_obj | object to use, based on std_update | |
[out] | subscription_deleted | address of return flag *subscription_deleted TRUE if subscription or session gone |
status_t agt_not_set_filter | ( | const xmlChar * | name, |
ncx_nmda_filtyp_t | nmda_filtyp, | ||
agt_not_filtertyp_t | filtyp, | ||
const val_value_t * | filval | ||
) |
Add or Modify a filter entry.
name | name or id of entry to add or modify |
nmda_filtyp | NMDA filter type (stream or selection) |
filtyp | new filter type enumeration |
filval | new value node to clone (subtree or XPath) |
status_t agt_not_set_notif_mpid | ( | agt_not_msg_t * | msg, |
const ncx_sm_mpid_t * | mpid | ||
) |
Set the MPID to use for sending the schema-mounted notification.
The MPID is copied. It could be a real MPID from a valroot or a fake MPID constructed for this API
Not needed if there is only one instance of the mount point. Needed to provide the ancestor keys to use in the notification
msg | message to set the MPID for |
mpid | MPID structure to clone and save. A copy will be made so this mpid can be deleted after this call |
status_t agt_not_setup_push_subscription | ( | ses_cb_t * | scb, |
const xmlChar * | selection_filter_ref, | ||
const xmlChar * | stop_time, | ||
const val_value_t * | encoding, | ||
agt_not_modify_filter_cbfn_t | modify_cbfn, | ||
agt_not_delete_subscription_cbfn_t | delete_cbfn, | ||
agt_not_subid_t * | subid, | ||
agt_not_sterr_t * | errnum, | ||
boolean * | isbinary | ||
) |
Create a RFC 8641 YANG Push subscription.
These parameters are copied by value so the values passed do not need to persist after this call
scb | session control block starting the subscription | |
selection_filter_ref | filter reference | |
stop_time | stop time is a common parm if replay supported for stream | |
encoding | encoding is a common parm. Only XML is supported. | |
modify_cbfn | modify filter callback | |
delete_cbfn | delete subscription callback | |
[out] | subid | address of return subscription ID assigned *subid subscription ID assigned (if NO_ERR) |
[out] | errnum | address of return parm number of error *errnum parm number of error if returning error (if some error) |
[out] | isbinary | address of return is binary subscription flag *isbinary return is binary subscription flag |
status_t agt_not_start_subscription | ( | ses_cb_t * | scb, |
const xmlChar * | stream, | ||
xmlChar * | startTime, | ||
xmlChar * | stopTime, | ||
boolean | futurestop, | ||
op_filtertyp_t | filtertype, | ||
val_value_t * | filterval, | ||
val_value_t * | selectval | ||
) |
Malloc and fill in a new subscription control block.
Add it to the subscriptionQ. This is an internal API
scb | session this subscription is for |
stream | requested stream ID |
startTime | replay start time (may be NULL) !!! THIS MALLOCED NODE IS FREED LATER !!!! |
stopTime | replayStopTime (may be NULL) !!! THIS MALLOCED NODE IS FREED LATER !!!! |
futurestop | TRUE if stopTime in the future FALSE if not set or not in the future |
filtertype | internal filter type |
filterval | filter value node passed from PDU !!! THIS MALLOCED NODE IS FREED LATER !!!! |
selectval | back-ptr into filterval->select value node only used if filtertype OP_FILTER_XPATH |
status_t agt_not_stream_callback_subsys | ( | const xmlChar * | stream_name, |
agt_not_subevent_t | subevent, | ||
const xmlChar * | modname, | ||
boolean | all_streams | ||
) |
Invoke a stream callback function on the SIL-SA subsystem.
This function will invoke the callback function if it is found. The server will send the configuration parameters along with the stream state update so the correct registered callback can be found.
stream_name | Name of the stream that is having a state change |
subevent | Stream callback subevent type |
modname | Module name used in the registration (may be NULL) |
all_streams | TRUE if registered for all streams |
void agt_not_subsys_gone | ( | const xmlChar * | subsys_id | ) |
Unload any remote stream callbacks when a subsystem session is lost and subsys-gone event handled.
This function will remove the callback control blocks for any remote SIL-SA stream callback that is registered with this subsys_id.
subsys_id | subsystem ID being removed |
void agt_not_suspend_push_subscription | ( | agt_not_subid_t | subid, |
agt_not_suspend_reason_t | reason | ||
) |
Suspend a subscription and stop sending notifications to it.
Requested by YANG-PUSH
subid | subscription ID to suspend |
reason | suspend reason code |
void agt_not_unload_module | ( | const xmlChar * | modname | ) |
Unload any remote stream callbacks when a module is unloaded.
Leave the local callback_cb structs alone. The local unregister function is supposed to be called for these callbacks.
This function will remove the callback control blocks for any remote SIL-SA stream callback that is registered with this module name.
modname | == module name being unloaded |
void agt_not_unregister_stream_cbfn | ( | const xmlChar * | modname, |
agt_not_stream_cbfn_t | cbfn | ||
) |
Unregister a SIL event-stream callback function.
YPW-1816.
modname | module name used in the register request |
cbfn | callback function to unregister.
|
void agt_not_unregister_stream_cbfn_subsys | ( | const xmlChar * | subsys_id, |
const xmlChar * | modname | ||
) |
Unregister a SIL event-stream callback function.
Subsystem
YPW-1816.
subsys_id | subsystem registering this callback |
modname | module name used in the register request (could be NULL) |