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,
130typedef struct agt_ycontrol_cb_t_ {
148typedef struct agt_ycontrol_subsys_t_ {
242 const xmlChar *service_id,
246 boolean with_ywattrs);
280 const xmlChar *service_id,
283 boolean with_ywattrs,
287 boolean need_filesave);
302 const xmlChar *service_id,
305 const xmlChar *errstr);
318 const xmlChar *service_id,
334 boolean with_ywattrs);
352 boolean with_ywattrs,
353 const xmlChar *subsys_id);
405 const xmlChar *subsys_id);
422 const xmlChar *subsys_id);
497extern const xmlChar *
NETCONF protocol remote procedure call server-side definitions.
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:177
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:2003
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, boolean need_filesave)
Send the subsystem <ycontrol> message to the sevice manager on the specified session,...
Definition: agt_ycontrol.c:1600
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:2241
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:1914
status_t agt_ycontrol_send_shutdown_event(void)
Send a <shutdown-event> message to all subsystems.
Definition: agt_ycontrol.c:2200
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:2160
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:1649
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,...
Definition: agt_ycontrol.c:1500
void agt_ycontrol_unregister_service(const xmlChar *service_name)
un-register a callback for 1 YControl service type
Definition: agt_ycontrol.c:1975
boolean agt_ycontrol_init_was_done(void)
Return TRUE if this module has been initialized.
Definition: agt_ycontrol.c:2281
boolean agt_ycontrol_dispatch(ses_cb_t *scb, xml_node_t *top)
Handle an incoming <ycontrol> message from a subsystem.
Definition: agt_ycontrol.c:1377
status_t agt_ycontrol_init2(void)
Initialize the agt_ycontrol module (phase 2)
Definition: agt_ycontrol.c:1309
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:2057
status_t agt_ycontrol_init1(void)
Initialize the agt_ycontrol module (phase 1)
Definition: agt_ycontrol.c:1243
boolean agt_ycontrol_any_subsys_active(void)
Check if there are any subsystems active.
Definition: agt_ycontrol.c:2183
void agt_ycontrol_cleanup(void)
Cleanup the agt_ycontrol module.
Definition: agt_ycontrol.c:1330
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:1711
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:1765
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 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:1794
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:2130
obj_template_t * agt_ycontrol_get_obj(void)
Get the ycontrol container object.
Definition: agt_ycontrol.c:2113
const xmlChar * agt_ycontrol_get_subsys_id(ses_id_t sid)
Get the subsystem-id for the session ID.
Definition: agt_ycontrol.c:2298
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:1938
#define AGT_YCONTROL_MAX_SERVICES
number of services hard-wired based on defined YumaPro features
Definition: agt_ycontrol.h:83
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
global error return code
Definition: status_enum.h:210
uint32 ses_id_t
Session ID.
Definition: ses.h:335
ycontrol_msgbody_t
YControl message body types.
Definition: ycontrol_types.h:85
ycontrol_msgtype_t
ycontrol message type
Definition: ycontrol_types.h:60
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
control block for 1 registered service handler
Definition: agt_ycontrol.h:130
agt_ycontrol_service_fn_t service_fn
received message callback function
Definition: agt_ycontrol.h:138
dlq_hdr_t qhdr
queue header
Definition: agt_ycontrol.h:132
agt_ycontrol_subsys_gone_fn_t subsys_gone_fn
subsystem gone callback function
Definition: agt_ycontrol.h:141
xmlChar * service_name
service name
Definition: agt_ycontrol.h:135
control block for connected 1 subsystem; used to send event messages to the subsystem
Definition: agt_ycontrol.h:148
ses_id_t dropped_sid
internal ID of dropped session ID
Definition: agt_ycontrol.h:162
dlq_hdr_t qhdr
queue header
Definition: agt_ycontrol.h:150
boolean session_dropped
session dropped flag
Definition: agt_ycontrol.h:165
ses_id_t subsys_sid
session ID of YControl session with this subsystem
Definition: agt_ycontrol.h:159
xmlChar * subsys_id
subsystem ID from registration
Definition: agt_ycontrol.h:153
One YANG data-def-stmt.
Definition: obj.h:1229
NETCONF Server and Client RPC Request/Reply Message Header.
Definition: rpc.h:185
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
gather node data into a simple struct.
Definition: xml_util.h:207
Some YControl data types.