yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
Data Structures

YControl data structures are used to manage communications state with the main server, and higher level service layers that register as a YControl service. More...

Collaboration diagram for Data Structures:

Data Structures

struct  ycontrol_service_t
 callback functions for a service that registers with ycontrol More...
 
struct  ycontrol_profile_t
 control block for 1 ycontrol manager (only 1 used) More...
 

Macros

#define YCONTROL_DEF_RETRY_INTERVAL   5000
 number of milli-seconds to wait between re-connect retries More...
 
#define YCONTROL_DEF_MAX_RETRIES   5000
 max number of reconnect retries before giving up
 
#define SHUTDOWN_STATE(ST)
 Check if in shutdown state.
 
#define YCONTROL_MAX_SERVICES   2
 this constant needs to be updated as more service types are implemented; currently only sil-sa, database planned
 
#define YCONTROL_MOD   (const xmlChar *)"yumaworks-ycontrol"
 YANG module for YControl protocol.
 
#define YCONTROL_OBJ   (const xmlChar *)"ycontrol"
 container name for YControl protocol
 

Typedefs

typedef status_t(* ycontrol_service_start_t) (void)
 YControl Service Layer Start Callback Function. More...
 
typedef status_t(* ycontrol_service_stop_t) (ses_cb_t *scb)
 YControl Service Layer Stop Callback Function. More...
 
typedef status_t(* ycontrol_service_msg_rcvr_t) (ses_cb_t *scb, ycontrol_msgtype_t msgtype, uint32 msgid, const xmlChar *server_id, ycontrol_msgbody_t msgbody_type, val_value_t *msgbody, boolean *response_sent)
 YControl Service Layer Message Receiver Callback Function. More...
 
typedef void(* ycontrol_service_shutdown_t) (void)
 YControl Service Layer Shutdown Callback Function. More...
 
typedef void(* ycontrol_timer_handler_t) (void)
 YControl Service Layer Timer Handler Function. More...
 
typedef void(* ycontrol_service_reconnect_t) (void)
 YControl Service Layer Reconnect Callback Function. More...
 

Enumerations

enum  ycontrol_state_t {
  YCONTROL_ST_NONE ,
  YCONTROL_ST_INIT ,
  YCONTROL_ST_CONNECT ,
  YCONTROL_ST_CONNECTING ,
  YCONTROL_ST_WAIT_CONNECT_RETRY ,
  YCONTROL_ST_CONNECTED ,
  YCONTROL_ST_SHUTDOWN_REQ ,
  YCONTROL_ST_DISCONNECTING ,
  YCONTROL_ST_SHUTDOWN ,
  YCONTROL_ST_SHUTDOWN_DONE
}
 ycontrol manager connection state enumerations More...
 
enum  ycontrol_msgtype_t {
  YCONTROL_MSG_NONE ,
  YCONTROL_MSG_SERVER_EVENT ,
  YCONTROL_MSG_SERVER_REQUEST ,
  YCONTROL_MSG_SERVER_RESPONSE ,
  YCONTROL_MSG_SUBSYS_EVENT ,
  YCONTROL_MSG_SUBSYS_REQUEST ,
  YCONTROL_MSG_SUBSYS_RESPONSE
}
 ycontrol message type More...
 
enum  ycontrol_msgbody_t {
  YCONTROL_MSGBODY_NONE ,
  YCONTROL_MSGBODY_OK ,
  YCONTROL_MSGBODY_PAYLOAD ,
  YCONTROL_MSGBODY_ERROR
}
 YControl message body types. More...
 

Detailed Description

YControl data structures are used to manage communications state with the main server, and higher level service layers that register as a YControl service.

Each subsystem needs a unique service name. Multiple services per subsystem can be registered.

All functions in this module are system APIs for subsystem use only!

Macro Definition Documentation

◆ YCONTROL_DEF_RETRY_INTERVAL

#define YCONTROL_DEF_RETRY_INTERVAL   5000

number of milli-seconds to wait between re-connect retries

5 seconds

Typedef Documentation

◆ ycontrol_service_msg_rcvr_t

typedef status_t(* ycontrol_service_msg_rcvr_t) (ses_cb_t *scb, ycontrol_msgtype_t msgtype, uint32 msgid, const xmlChar *server_id, ycontrol_msgbody_t msgbody_type, val_value_t *msgbody, boolean *response_sent)

YControl Service Layer Message Receiver Callback Function.

Most important message receiver callback. Handles server-request and server-event messages.

Parameters
scbsession receiving the message from the server. Used to send a reply for a server-request message.
msgtypetype of YControl message received
msgidInternal message ID assigned to this message
server_idname of server that sent this message
msgbody_typeenum identifying message body type
msgbodydata from the message
[out]response_sentaddress of return response sent flag
*response_sent return response sent flag
Returns
status

◆ ycontrol_service_reconnect_t

typedef void(* ycontrol_service_reconnect_t) (void)

YControl Service Layer Reconnect Callback Function.

Will be called when the main server connection is lost and the first reconnect is about to be setup.

◆ ycontrol_service_shutdown_t

typedef void(* ycontrol_service_shutdown_t) (void)

YControl Service Layer Shutdown Callback Function.

Called when a shutdown event received. This is sent to the YControl layer so the service ID will be set to an asterisk '*'. That means the message is for YControl itself.

A shutdown event causes this callback to be invoked so any resources can be cleaned up by the service layer.

◆ ycontrol_service_start_t

typedef status_t(* ycontrol_service_start_t) (void)

YControl Service Layer Start Callback Function.

Will be called when the service starts. A YControl session with the main server is required first.

Returns
status; error code causes the service startup to fail

◆ ycontrol_service_stop_t

typedef status_t(* ycontrol_service_stop_t) (ses_cb_t *scb)

YControl Service Layer Stop Callback Function.

Will be called when the service is shutting down.

Parameters
scbdummy session to use for AGT_CB_ROLLBACK calls in SIL-SA edit transactions
Returns
status; should not have an error shutting down.

◆ ycontrol_timer_handler_t

typedef void(* ycontrol_timer_handler_t) (void)

YControl Service Layer Timer Handler Function.

Timer service callback function.

Enumeration Type Documentation

◆ ycontrol_msgbody_t

YControl message body types.

Enumerator
YCONTROL_MSGBODY_NONE 

not set

YCONTROL_MSGBODY_OK 

OK message.

YCONTROL_MSGBODY_PAYLOAD 

payload message

YCONTROL_MSGBODY_ERROR 

error message

◆ ycontrol_msgtype_t

ycontrol message type

Enumerator
YCONTROL_MSG_NONE 

not set

YCONTROL_MSG_SERVER_EVENT 

server-event sent from server to subsystem

YCONTROL_MSG_SERVER_REQUEST 

server-request sent from server to subsystem

YCONTROL_MSG_SERVER_RESPONSE 

server-response sent from server to subsystem

YCONTROL_MSG_SUBSYS_EVENT 

subsystem-event sent from subsystem to server

YCONTROL_MSG_SUBSYS_REQUEST 

subsystem-request sent from subsystem to server

YCONTROL_MSG_SUBSYS_RESPONSE 

subsystem-response sent from subsystem to server

◆ ycontrol_state_t

ycontrol manager connection state enumerations

Enumerator
YCONTROL_ST_NONE 

not set

YCONTROL_ST_INIT 

YControl initializing.

YCONTROL_ST_CONNECT 

need a socket connection to server

YCONTROL_ST_CONNECTING 

connecting to the server

YCONTROL_ST_WAIT_CONNECT_RETRY 

connect failed and waiting for a retry

YCONTROL_ST_CONNECTED 

active state, ready to receive requests and start service layers

YCONTROL_ST_SHUTDOWN_REQ 

got an application shutdown request

YCONTROL_ST_DISCONNECTING 

disconnecting from the server

YCONTROL_ST_SHUTDOWN 

in the process of shutting down

YCONTROL_ST_SHUTDOWN_DONE 

shutdown complete