yumapro  20.10-10
YumaPro SDK
Notification Control

Supports original notifications (RFC 5277) using the <create-subscription> operation. More...

Collaboration diagram for Notification Control:

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_clean_eventlog (void)
 Remove any delivered notifications when the replay buffer size is set to zero. More...
 
void agt_not_remove_subscription (ses_id_t sid)
 Remove and expire a subscription with the specified session ID. More...
 
agt_not_msg_tagt_not_new_notification (obj_template_t *eventType)
 Malloc and initialize the fields in an agt_not_msg_t. More...
 
agt_not_msg_tagt_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_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)
 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_tagt_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)
 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...
 

Detailed Description

Supports original notifications (RFC 5277) using the <create-subscription> operation.

Supports new notifications (RFC 8639) using the <establish-subscription> operation.

SIL Procedure for constructing a notification

The messaage and payload memory is transferred to the queue

     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);
     }

Function Documentation

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

Parameters
notifnotification to send
valvalue 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

Here is the call graph for this function:

Here is the caller graph for this function:

boolean agt_not_any_unregistered ( const xmlChar *  modname)

Check if any entries are still unregistered for a subsystem building a register-request.

YPW-1816.

Parameters
modnamemodule name registering callbacks
Returns
true if any nodes to add; false if not

Here is the call graph for this function:

Here is the caller graph for this function:

void agt_not_cancel_subscription ( ses_id_t  sid)

Cancel any notification subscription for the specified session.

Parameters
sidsession ID to use

Here is the call graph for this function:

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.

Parameters
modnamemodule name used in the register request
request_valvalue node to add P-container if needed
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

void agt_not_clean_eventlog ( void  )

Remove any delivered notifications when the replay buffer size is set to zero.

Called from periodic task or thread

Here is the caller graph for this function:

void agt_not_cleanup ( void  )

Cleanup the module data structures.

Called by the server during shutdown

Here is the call graph for this function:

void agt_not_cleanup_sil_sa ( void  )

Cleanup the module data structures.

Called by the server during shutdown CALLED BY SIL-SA SUBSYSTEM ONLY

Here is the call graph for this function:

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

Parameters
stream_nameevent stream name to clear
Returns
status
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

Parameters
nmda_filtypNMDA filter type (stream or selection)
namename or id of entry to add or modify
filtypaddress ot return found filter type
filvaladdress ot return value
Return values
*filtypfound filter type
*filvalcloned filter value (MUST FREE WITH val_free_value)
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_not_create_event_stream ( const xmlChar *  name,
uint32  eventlog_size 
)

Create an event-stream from a YANG module interface.

Parameters
namestream name
eventlog_sizereplay buffer size
Returns
status
status_t agt_not_delete_all_filters ( boolean  force)

Delete all existing filter entries.

The /filters container was deleted

Parameters
forcetrue to force deletion of filters in use
Returns
status

Here is the call graph for this function:

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

Parameters
sidsession ID to use
subidsubscription ID to use
Returns
status

Here is the caller graph for this function:

status_t agt_not_delete_event_stream ( ses_cb_t scb,
const xmlChar *  name 
)

Delete an event-stream from a YANG module interface.

Parameters
scbsession deleting this entry
namestream name
Returns
status

Here is the call graph for this function:

status_t agt_not_delete_filter ( const xmlChar *  name,
ncx_nmda_filtyp_t  nmda_filtyp 
)

Delete an existing filter entry.

Parameters
namename or id of entry to modify
nmda_filtypNMDA filter type (stream or selection)
Returns
status

Here is the call graph for this function:

status_t agt_not_delete_module_map ( const xmlChar *  modname)

Delete a module map from a YANG module interface.

Parameters
modnamemodule name
Returns
status

Here is the call graph for this function:

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.

Parameters
modnamemodule name of entry
stream_namename to use in mapping
is_createTRUE if create; FALSE if modify
Returns
status

Here is the call graph for this function:

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

Parameters
scbsession control block starting the subscription
stream_filter_namefilter by reference: option 1 of 3 for subscription filter
stream_subtree_filterinline subtree filter: option 2 of 3 for subscription filter
stream_xpath_filterinline XPath filter: option 3 of 3 for subscription filter
streamstream name for subscription [MANDATORY]
replay_start_timereplay start if replay supported for stream
stop_timestop time is a common parm if replay supported for stream
encodingencoding is a common parm. Only XML is supported.
subidaddress of return subscription ID assigned
errnumaddress of return parm number of error
Return values
*subidsubscription ID assigned (if NO_ERR)
*errnum= parm number of error if returning error (if some error)
Returns
status
boolean agt_not_event_stream_exists ( const xmlChar *  stream_name)

Check if the specified event stream is configured.

Parameters
stream_nameevent stream name to check
Returns
TRUE if stream exists; FALSE if not
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.

Parameters
notifagt_not_template_t to delete

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns
pointer to object template for <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

Parameters
subidsubscription ID
sidsession ID (to validate against subscription ID)
filespecfilename to use to save the update
msgfilled in rpc_msg to use to call agt_output_filter
subscription_deletedaddress of return flag
checksumaddress of return checksum
bytecntaddress of return byte count
Return values
*subscription_deletedTRUE if subscription or session gone
*checksumthe checksum of written bytes
*bytecntnumber of bytes written by agt_output_filter
Returns
status

Here is the call graph for this function:

void agt_not_go_active ( void  )

Enable active notification subscriptions.

Delayed init needed for HA standby going active

Here is the caller graph for this function:

void agt_not_go_standby ( void  )

Exit active notification subscription mode and disable notifications.

Shutdown notification subscriptions when changing from active to standby

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_not_init ( void  )

INIT 1: Initialize the server notification module data structures.

Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_not_init2 ( void  )

INIT 2: Initialize the monitoring data structures This must be done after the <running> config is loaded.

Returns
status

Here is the call graph for this function:

status_t agt_not_init_sil_sa ( void  )

INIT 1: Initialize the server notification module data structures.

CALLED BY SIL-SA SUBSYSTEM ONLY

Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

status_t agt_not_init_yangpush ( obj_template_t streams_obj)

Init the yang-push related streams and data structures.

Parameters
streams_objobject for streams to make stream values
Returns
status

Here is the call graph for this function:

boolean agt_not_is_replay_event ( const obj_template_t notifobj)

Check if the specified notfication is the replayComplete or notificationComplete notification events.

Parameters
notifobjnotification object to check
Returns
TRUE if the notification object is one of the special replay buffer events
FALSE otherwise

Here is the caller graph for this function:

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

Parameters
subidsubscription ID to use
Returns
status
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

Parameters
subidsubscription ID to kill
term_reasontermination reason code

Here is the call graph for this function:

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

Parameters
sidsession ID
cur_subidsubscription ID to modify [mandatory]
selection_filter_reffilter reference
stop_timestop time is a common parm if replay supported for stream
errnumaddress of return parm number of error
Return values
*errnumparm number of error if returning error (if some error)
Returns
status
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

Parameters
scbsession control block starting the subscription [MANDATORY]
subidsubscription ID to modify [MANDATORY]
stream_filter_namefilter by reference: option 1 of 3 for subscription filter
stream_subtree_filterinline subtree filter: option 2 of 3 for subscription filter
stream_xpath_filterinline XPath filter: option 3 of 3 for subscription filter
stop_timestop time is a common parm if replay supported for stream
errnumaddress of return parm number of error
Return values
*errnum= parm number of error if returning error (if some error)
Returns
status

Here is the call graph for this function:

agt_not_msg_t* agt_not_new_notification ( obj_template_t eventType)

Malloc and initialize the fields in an agt_not_msg_t.

Parameters
eventTypeobject template of the event type
Returns
pointer to the malloced and initialized struct or NULL if an error

Here is the caller graph for this function:

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)

Parameters
eventTypeobject template of the event type
eventTimeevent timestamp string
Returns
pointer to the malloced and initialized struct or NULL if an error
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.

Parameters
notifnotification 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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters
stream_namestream name to use (NULL use NETCONF)
notifnotification 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

Here is the caller graph for this function:

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

Parameters
replay_completedreplay completed event
subscription_completedsubscription completed event
subscription_modifiedsubscription modified event
subscription_resumedsubscription resumed event
subscription_startedsubscription started event
subscription_suspendedsubscription suspended event
subscription_terminatedsubscription terminated event
Returns
status
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:

  • Mode 1: Module mapping
    Use the module to event stream mapping to determine the event stream of interest.
  • Mode 2: Hard-wired event-stream
    Use the provided event stream name to determine the event stream of interest.
  • Mode 3: All event streams
    Receive callbacks for all event streams.
Parameters
modnamemodule name that this callback is registering for.
  • The normal mode of operation is to set this to the module name that contains the notif 'send' functions.
  • The server will figure out which event-stream is being used for events from this module.
  • This parameter must be present, even if the stream_name or all_streams flag is present. It identifies the module SIL or SIL-SA code that is associated with this callback, if the module is removed.
stream_nameevent stream name to register for.
  • Normal mode of operation is set to NULL because the event-stream configuration is not known to the SIL code.
  • If set, then only register for this event-stream
  • If NULL and modname is NULL then register for all events for all event-streams.
all_streamsTRUE if this callback is registering for all event streams.
FALSE for normal mode and registering for 1 module name of one event stream.
cbfncallback function to use
cookiepointer to pass to the callback function as a cookie
Returns
status;
  • It is not an error to register for a non-existent module name or event stream name since they can be added and removed at run-time. Make sure parameters are spelled correctly!
  • The agt_not_unregister_event_stream_cbfn API MUST be called before the module containing the callback is removed.
  • It is not an error to register duplicates. These will not be checked.

Here is the call graph for this function:

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.

Parameters
subsys_idsubsystem registering this callback
modnamemodule name that this callback is registering for.
  • The normal mode of operation is to set this to the module name that contains the notif 'send' functions.
  • The server will figure out which event-stream is being used for events from this module.
  • This parameter must be present, even if the stream_name or all_streams flag is present. It identifies the module SIL or SIL-SA code that is associated with this callback, if the module is removed.
stream_nameevent stream name to register for.
  • Normal mode of operation is set to NULL because the event-stream configuration is not known to the SIL code.
  • If set, then only register for this event-stream
  • If NULL and modname is NULL then register for all events for all event-streams.
all_streamsTRUE if this callback is registering for all event streams.
FALSE for normal mode and registering for 1 module name of one event stream.
Returns
status;
  • It is not an error to register for a non-existent module name or event stream name since they can be added and removed at run-time. Make sure parameters are spelled correctly!
  • The agt_not_unregister_event_stream_cbfn API MUST be called before the module containing the callback is removed.
  • It is not an error to register duplicates. These will not be checked.

Here is the call graph for this function:

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.

Parameters
cbfncheck push callback function to use
mod_cbfnmodule removed callback function to use
Returns
status

Here is the caller graph for this function:

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

Parameters
modmodule being removed

Here is the call graph for this function:

void agt_not_remove_subscription ( ses_id_t  sid)

Remove and expire a subscription with the specified session ID.

The session is being removed.

Parameters
sidsession ID to use

Here is the caller graph for this function:

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

Parameters
subidsubscription ID to resume

Here is the call graph for this function:

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

Parameters
tcbThread control block for session
Returns
number of notifications sent
used for simple burst throttling

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
subidsubscription ID
sidsession ID (to validate against subscription ID)
notif_objpush-change-update object
pcbyang_patch_cb to send
subscription_deletedaddress of return flag
Return values
*subscription_deletedTRUE 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.

Parameters
subidsubscription ID
sidsession ID (to validate against subscription ID)
notif_objpush-update object
msgdummy RPC message to use
subscription_deletedaddress of return flag
Return values
*subscription_deletedTRUE if subscription or session gone
Returns
status
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.

Parameters
subidpush subscription ID
notifnotification to send (THIS IS NOT FREED HERE)
Returns
status
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

Parameters
subidsubscription ID
sidsession ID (to validate against subscription ID)
filespecfilename to use to send as data
msgfilled in rpc_msg to use to call agt_output_filter
notif_objobject to use, based on std_update
subscription_deletedaddress of return flag
Return values
*subscription_deletedTRUE if subscription or session gone
Returns
status
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.

Parameters
namename or id of entry to add or modify
nmda_filtypNMDA filter type (stream or selection)
filtypnew filter type enumeration
filvalnew value node to clone (subtree or XPath)
Returns
status
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 
)

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

Parameters
scbsession control block starting the subscription
selection_filter_reffilter reference
stop_timestop time is a common parm if replay supported for stream
encodingencoding is a common parm. Only XML is supported.
modify_cbfnmodify filter callback
delete_cbfndelete subscription callback
subidaddress of return subscription ID assigned
errnumaddress of return parm number of error
Return values
*subidsubscription ID assigned (if NO_ERR)
*errnumparm number of error if returning error (if some error)
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function:

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

Parameters
scbsession this subscription is for
streamrequested stream ID
startTimereplay start time (may be NULL)
!!! THIS MALLOCED NODE IS FREED LATER !!!!
stopTimereplayStopTime (may be NULL)
!!! THIS MALLOCED NODE IS FREED LATER !!!!
futurestopTRUE if stopTime in the future
FALSE if not set or not in the future
filtertypeinternal filter type
filtervalfilter value node passed from PDU
!!! THIS MALLOCED NODE IS FREED LATER !!!!
selectvalback-ptr into filterval->select value node
only used if filtertype OP_FILTER_XPATH
Returns
status

Here is the caller graph for this function:

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.

Parameters
stream_nameName of the stream that is having a state change
subeventStream callback subevent type
modnameModule name used in the registration (may be NULL)
all_streamsTRUE if registered for all streams
Returns
status

Here is the call graph for this function:

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.

Parameters
subsys_idsubsystem ID being removed

Here is the call graph for this function:

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

Parameters
subidsubscription ID to suspend
reasonsuspend reason code

Here is the call graph for this function:

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.

Parameters
modname== module name being unloaded

Here is the call graph for this function:

void agt_not_unregister_stream_cbfn ( const xmlChar *  modname,
agt_not_stream_cbfn_t  cbfn 
)

Unregister a SIL event-stream callback function.

YPW-1816.

Parameters
modnamemodule name used in the register request
cbfncallback function to unregister.
  • All entries with the same modname using this callback will be removed.
  • No errors are generated if the callback is not found

Here is the call graph for this function:

void agt_not_unregister_stream_cbfn_subsys ( const xmlChar *  subsys_id,
const xmlChar *  modname 
)

Unregister a SIL event-stream callback function.

Subsystem

YPW-1816.

Parameters
subsys_idsubsystem registering this callback
modnamemodule name used in the register request (could be NULL)

Here is the call graph for this function: