13 #ifndef _H_agt_ycontrol 14 #define _H_agt_ycontrol 61 #ifndef _H_ycontrol_types 83 #define AGT_YCONTROL_MAX_SERVICES 4 112 const xmlChar *subsys_id,
130 typedef struct agt_ycontrol_cb_t_ {
148 typedef struct agt_ycontrol_subsys_t_ {
242 const xmlChar *service_id,
246 boolean with_ywattrs);
274 const xmlChar *service_id,
277 boolean with_ywattrs,
295 const xmlChar *service_id,
298 const xmlChar *errstr);
311 const xmlChar *service_id,
327 boolean with_ywattrs);
345 boolean with_ywattrs,
346 const xmlChar *subsys_id);
398 const xmlChar *subsys_id);
415 const xmlChar *subsys_id);
490 extern const xmlChar *
502 #endif // WITH_YCONTROL NETCONF protocol remote procedure call server-side definitions.
gather node data into a simple struct.
Definition: xml_util.h:204
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:181
void agt_ycontrol_cleanup(void)
Cleanup the agt_ycontrol module.
Definition: agt_ycontrol.c:1234
status_t agt_ycontrol_init2(void)
Initialize the agt_ycontrol module (phase 2)
Definition: agt_ycontrol.c:1213
boolean agt_ycontrol_any_subsys_active(void)
Check if there are any subsystems active.
Definition: agt_ycontrol.c:2085
status_t(* agt_rpc_data_cb_t)(ses_cb_t *scb, rpc_msg_t *msg, uint32 indent)
Callback template for RPCs that use an inline callback function instead of generating a malloced val_...
Definition: agt_rpc.h:178
status_t agt_ycontrol_register_service(const xmlChar *service_name, agt_ycontrol_service_fn_t service_fn)
Register a YControl service layer.
Definition: agt_ycontrol.c:1813
obj_template_t * agt_ycontrol_get_obj(void)
Get the ycontrol container object.
Definition: agt_ycontrol.c:2018
boolean agt_ycontrol_init_was_done(void)
Return TRUE if this module has been initialized.
Definition: agt_ycontrol.c:2183
One YANG data-def-stmt.
Definition: obj.h:1140
#define AGT_YCONTROL_MAX_SERVICES
number of services hard-wired based on defined YumaPro features
Definition: agt_ycontrol.h:83
status_t agt_ycontrol_add_subsys(ses_id_t subsys_sid, const xmlChar *subsys_id)
Add a subsystem connection to the ycontrol manager.
Definition: agt_ycontrol.c:1906
NETCONF Session Common definitions module.
const xmlChar * agt_ycontrol_get_subsys_id(ses_id_t sid)
Get the subsystem-id for the session ID.
Definition: agt_ycontrol.c:2200
status_t agt_ycontrol_send_error(ses_cb_t *scb, const xmlChar *service_id, uint32 msgid, status_t res, const xmlChar *errstr)
Send a ycontrol error message.
Definition: agt_ycontrol.c:1546
control block for connected 1 subsystem; used to send event messages to the subsystem ...
Definition: agt_ycontrol.h:148
ses_cb_t * agt_ycontrol_get_scb(const xmlChar *subsys_id)
Get the session control block for the specified subsys ID.
Definition: agt_ycontrol.c:2035
uint32 ses_id_t
Session ID.
Definition: ses.h:306
agt_ycontrol_subsys_gone_fn_t subsys_gone_fn
subsystem gone callback function
Definition: agt_ycontrol.h:141
ses_id_t dropped_sid
internal ID of dropped session ID
Definition: agt_ycontrol.h:162
status_t agt_ycontrol_send_shutdown_event_byservice(const xmlChar *service_id)
Send a <shutdown-event> message to a specific subsystems.
Definition: agt_ycontrol.c:2143
status_t agt_ycontrol_send_ok(ses_cb_t *scb, const xmlChar *service_id, uint32 msgid)
Send a ycontrol OK message.
Definition: agt_ycontrol.c:1609
void agt_ycontrol_unregister_service(const xmlChar *service_name)
un-register a callback for 1 YControl service type
Definition: agt_ycontrol.c:1876
status_t agt_ycontrol_send_shutdown_event(void)
Send a <shutdown-event> message to all subsystems.
Definition: agt_ycontrol.c:2102
ses_id_t subsys_sid
session ID of YControl session with this subsystem
Definition: agt_ycontrol.h:159
one value to match one type
Definition: val.h:870
xmlChar * subsys_id
subsystem ID from registration
Definition: agt_ycontrol.h:153
agt_ycontrol_service_fn_t service_fn
received message callback function
Definition: agt_ycontrol.h:138
Session Control Block.
Definition: ses.h:542
status_t(* agt_ycontrol_service_fn_t)(ses_cb_t *scb, ycontrol_msgtype_t msgtype, uint32 msgid, const xmlChar *subsys_id, ycontrol_msgbody_t msgbody_type, val_value_t *msgbody, boolean *scb_valid)
Callback template for YControl services: message handler.
Definition: agt_ycontrol.h:109
status_t
global error return code
Definition: status_enum.h:186
xmlChar * service_name
service name
Definition: agt_ycontrol.h:135
ycontrol_msgbody_t
YControl message body types.
Definition: ycontrol_types.h:85
control block for 1 registered service handler
Definition: agt_ycontrol.h:130
status_t agt_ycontrol_init1(void)
Initialize the agt_ycontrol module (phase 1)
Definition: agt_ycontrol.c:1147
status_t agt_ycontrol_send_payload(ses_cb_t *scb, const xmlChar *service_id, uint32 *msgid, ycontrol_msgtype_t msgtype, val_value_t *service_payload, boolean with_ywattrs)
Send the subsystem <ycontrol> message to the sevice manager on the specified session, using the <payload> variant.
Definition: agt_ycontrol.c:1403
Global error messages for status code enumerations.
void agt_ycontrol_drop_session(ses_id_t sid)
Notify the agt_ycontrol module that a YControl session has been closed and needs to be cleaned up...
Definition: agt_ycontrol.c:2062
status_t agt_ycontrol_send_callback(ses_cb_t *scb, const xmlChar *service_id, uint32 *msgid, ycontrol_msgtype_t msgtype, boolean with_ywattrs, obj_template_t *service_obj, agt_rpc_data_cb_t data_cbfn, rpc_msg_t *rpcmsg)
Send the subsystem <ycontrol> message to the sevice manager on the specified session, using the <payload> variant.
Definition: agt_ycontrol.c:1496
boolean agt_ycontrol_dispatch(ses_cb_t *scb, xml_node_t *top)
Handle an incoming <ycontrol> message from a subsystem.
Definition: agt_ycontrol.c:1281
status_t agt_ycontrol_register_service_ex(const xmlChar *service_name, agt_ycontrol_service_fn_t service_fn, agt_ycontrol_subsys_gone_fn_t subsys_gone_fn)
Register a YControl service layer (extended)
Definition: agt_ycontrol.c:1837
void(* agt_ycontrol_subsys_gone_fn_t)(const xmlChar *subsys_id)
brief Callback template for YControl services: subsys gone handler
Definition: agt_ycontrol.h:126
status_t agt_ycontrol_send_event_subsys(const xmlChar *service_id, val_value_t *service_payload, boolean with_ywattrs, const xmlChar *subsys_id)
Send a server event to a specific subsystem or all subsystems.
Definition: agt_ycontrol.c:1693
void agt_ycontrol_remove_subsys(ses_id_t sid, const xmlChar *subsys_id)
Remove a subsystem connection to the ycontrol manager because the connection was closed or shutting d...
Definition: agt_ycontrol.c:1962
status_t agt_ycontrol_send_event(const xmlChar *service_id, val_value_t *service_payload, boolean with_ywattrs)
Send a server event to all the active subsystems.
Definition: agt_ycontrol.c:1664
ycontrol_msgtype_t
ycontrol message type
Definition: ycontrol_types.h:60
boolean session_dropped
session dropped flag
Definition: agt_ycontrol.h:165
Some YControl data types.