yumapro  20.10-12
YumaPro SDK
sil_sa_types.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_sil_sa_types
13 #define _H_sil_sa_types
14 
15 /* FILE: sil_sa_types.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
28 /*********************************************************************
29 * *
30 * C H A N G E H I S T O R Y *
31 * *
32 *********************************************************************
33 
34 date init comment
35 ----------------------------------------------------------------------
36 15-mar-14 abb Begun
37 */
38 
39 #include <xmlstring.h>
40 
41 #ifndef _H_agt
42 #include "agt.h"
43 #endif
44 
45 #ifndef _H_dlq
46 #include "dlq.h"
47 #endif
48 
49 #ifndef _H_ncxtypes
50 #include "ncxtypes.h"
51 #endif
52 
53 #ifndef _H_obj
54 #include "obj.h"
55 #endif
56 
57 #ifndef _H_rpc
58 #include "rpc.h"
59 #endif
60 
61 #ifndef _H_status_enum
62 #include "status_enum.h"
63 #endif
64 
65 #ifndef _H_val
66 #include "val.h"
67 #endif
68 
69 
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 
75 
90 /********************************************************************
91 * *
92 * C O N S T A N T S *
93 * *
94 *********************************************************************/
95 
96 
97 /********************************************************************
98 * *
99 * T Y P E S *
100 * *
101 *********************************************************************/
102 
104 typedef enum sil_sa_state_t_ {
107 
110 
113 
116 
119 
122 
125 
128 
131 
136 } sil_sa_state_t;
137 
138 
140 typedef struct sil_sa_bundle_t_ {
142  dlq_hdr_t qhdr;
143 
147  xmlChar *bundle_name;
148 
156  dlq_hdr_t bundle_modQ;
157 
162 
163 } sil_sa_bundle_t;
164 
165 
167 typedef struct sil_sa_cb_t_ {
169  ncx_module_t *mod;
170 
172  obj_template_t *obj;
173 
175  val_value_t *payload;
176 
178  sil_sa_state_t state;
179 
181  boolean sil_load_done;
182 
184  boolean need_replay;
185 
187  boolean init2_done;
188 
190  uint32 msgid;
191 
195  val_value_t *config_response;
196 
198  val_value_t *start_request;
199 
202 
204  boolean is_validate;
205 
208 
210  boolean is_load_config;
211 
213  dlq_hdr_t editQ; /* Q of sil_sa_edit_t */
214 
217 
219  rpc_msg_t *rpc_msg;
220 
222  const xmlChar *user_id;
223 
225  const xmlChar *client_addr;
226 
228  const xmlChar *target;
229 
231  const xmlChar *txid_str;
232 
238 
240  status_t error_edit_res;
241 
243  const xmlChar *error_edit_str;
244 
246  dlq_hdr_t bundleQ;
247 
249  dlq_hdr_t library_parmQ;
250 
252  dlq_hdr_t bundle_unloadQ;
253 
255  val_value_t *keys_val;
256 
260  dlq_hdr_t added_editQ;
261 
263  boolean is_hook_load;
264 
270 
272  val_value_t *hook_get_value;
273 
274 } sil_sa_cb_t;
275 
276 
281 typedef struct sil_sa_child_edit_t_ {
283  dlq_hdr_t qhdr;
284 
286  op_editop_t editop;
287 
289  val_value_t *newval;
290 
292  val_value_t *curval;
293 } sil_sa_child_edit_t;
294 
295 
297 typedef struct sil_sa_edit_t_ {
299  dlq_hdr_t qhdr;
300 
302  uint32 edit_index;
303 
305  op_editop_t editop;
306 
308  const xmlChar *path;
309 
311  val_value_t *newval;
312 
314  val_value_t *curval;
315 
317  val_value_t *keysval;
318 
320  obj_template_t *cbobj;
321 
323  boolean apply_done;
324 
326  boolean hook_edit;
327 
329  agt_hook_type_t hook_type;
330 
334  dlq_hdr_t child_editQ;
335 
336 } sil_sa_edit_t;
337 
338 
342 typedef struct sil_sa_added_edit_t_ {
344  dlq_hdr_t qhdr;
345 
347  const xmlChar *path;
348 
350  val_value_t *editval;
351 
353  const xmlChar *editop;
354 
356  const xmlChar *where;
357 
359  const xmlChar *point;
360 
362  boolean skipcb;
363 
365  obj_template_t *cbobj;
366 } sil_sa_added_edit_t;
367 
368 
369 
373 #ifdef __cplusplus
374 } /* end extern 'C' */
375 #endif
376 
377 #endif /* _H_sil_sa_types */
sil_sa_cb_t_::error_edit_index
uint32 error_edit_index
saved by the sil_call_edit_phase code if an error occurs with a specific edit.
Definition: sil_sa_types.h:237
sil_sa_cb_t_::need_replay
boolean need_replay
SIL-SA library needs to trigger a config replay from the server.
Definition: sil_sa_types.h:184
sil_sa_child_edit_t_::newval
val_value_t * newval
child new value; backptr into start_request msg
Definition: sil_sa_types.h:289
sil_sa_cb_t_::error_edit_str
const xmlChar * error_edit_str
edit string for error
Definition: sil_sa_types.h:243
sil_sa_edit_t_::editop
op_editop_t editop
added edit operation
Definition: sil_sa_types.h:305
sil_sa_cb_t_::bundle_unloadQ
dlq_hdr_t bundle_unloadQ
queue of sil_sa_bundle_t struct
Definition: sil_sa_types.h:252
sil_sa_edit_t_::keysval
val_value_t * keysval
keys value for edit; backptr into start_request msg
Definition: sil_sa_types.h:317
sil_sa_cb_t_::cur_edit
struct sil_sa_edit_t_ * cur_edit
edit-id maintained during the callback
Definition: sil_sa_types.h:216
sil_sa_cb_t_::editQ
dlq_hdr_t editQ
parsed from start request msg
Definition: sil_sa_types.h:213
sil_sa_edit_t_::apply_done
boolean apply_done
apply phase done
Definition: sil_sa_types.h:323
SIL_SA_ST_ERROR
@ SIL_SA_ST_ERROR
SIL-SA service in some error state.
Definition: sil_sa_types.h:123
sil_sa_cb_t_::mod
ncx_module_t * mod
yumaworks-sil-sa YANG module
Definition: sil_sa_types.h:169
sil_sa_cb_t_::state
sil_sa_state_t state
SIL-SA module state.
Definition: sil_sa_types.h:178
sil_sa_cb_t_::is_validate
boolean is_validate
transaction is a <validate> operation
Definition: sil_sa_types.h:204
val.h
Value Node Basic Support.
sil_sa_edit_t_::edit_index
uint32 edit_index
key leaf for edit list
Definition: sil_sa_types.h:302
sil_sa_cb_t_::keys_val
val_value_t * keys_val
backptr to the <keys> container passed in an <action-request>
Definition: sil_sa_types.h:255
sil_sa_cb_t_::payload
val_value_t * payload
cached <payload> element for use in request messages
Definition: sil_sa_types.h:175
status_enum.h
global error status code enumerations
sil_sa_cb_t_::bundleQ
dlq_hdr_t bundleQ
queue of ncx_backptr to ncx_module_t
Definition: sil_sa_types.h:246
sil_sa_added_edit_t_::skipcb
boolean skipcb
edit operation skip_cb parameter
Definition: sil_sa_types.h:362
sil_sa_bundle_t_::load_event_done
boolean load_event_done
make sure the bundle-load-event is only sent once for this bundle
Definition: sil_sa_types.h:161
sil_sa_added_edit_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: sil_sa_types.h:344
sil_sa_cb_t_::config_response
val_value_t * config_response
cached <config-response> message body; list of modules/bundles to load
Definition: sil_sa_types.h:195
sil_sa_edit_t_::newval
val_value_t * newval
new value for edit; backptr into start_request msg
Definition: sil_sa_types.h:311
sil_sa_cb_t_::library_parmQ
dlq_hdr_t library_parmQ
queue of ncx_backptr to malloced string
Definition: sil_sa_types.h:249
sil_sa_cb_t_::start_request
val_value_t * start_request
cached <start-transaction> message body
Definition: sil_sa_types.h:198
sil_sa_bundle_t_::bundle_modQ
dlq_hdr_t bundle_modQ
queue of cloned backptrs to the loaded modules assigned to this bundle.
Definition: sil_sa_types.h:156
sil_sa_added_edit_t_
Hook added edits that will be used in the hook-respose msg Saved from the sil_sa_hook_add_edit functi...
Definition: sil_sa_types.h:342
sil_sa_cb_t_::target
const xmlChar * target
datastore target backptr from the transaction
Definition: sil_sa_types.h:228
sil_sa_edit_t_::hook_edit
boolean hook_edit
this is a hook edit flag
Definition: sil_sa_types.h:326
sil_sa_added_edit_t_::cbobj
obj_template_t * cbobj
callback object template
Definition: sil_sa_types.h:365
sil_sa_cb_t_::error_edit_res
status_t error_edit_res
edit entry failure status
Definition: sil_sa_types.h:240
SIL_SA_ST_NONE
@ SIL_SA_ST_NONE
not set
Definition: sil_sa_types.h:114
sil_sa_cb_t_::init2_done
boolean init2_done
init2 phase has been done.
Definition: sil_sa_types.h:187
SIL_SA_ST_WAIT_COMMIT
@ SIL_SA_ST_WAIT_COMMIT
edit transaction in progress and is waiting for commit phase
Definition: sil_sa_types.h:138
sil_sa_child_edit_t_
EDIT2 children Queue Supports EDIT2 callbacks where child edits for the same parent container or list...
Definition: sil_sa_types.h:281
sil_sa_cb_t_::rpc_msg
rpc_msg_t * rpc_msg
dummy msg used for SIL-SA callback functions
Definition: sil_sa_types.h:219
sil_sa_cb_t_::msgid
uint32 msgid
request msgid that is expected in the response
Definition: sil_sa_types.h:190
SIL_SA_ST_READY
@ SIL_SA_ST_READY
SIL-SA is idle ready for requests.
Definition: sil_sa_types.h:132
rpc.h
NETCONF protocol remote procedure call common definitions.
sil_sa_added_edit_t_::editval
val_value_t * editval
edit value
Definition: sil_sa_types.h:350
sil_sa_cb_t_::obj
obj_template_t * obj
<sil-sa> object within the /ycontrol/payload object
Definition: sil_sa_types.h:172
SIL_SA_ST_WAIT_HOOK_GETDATA
@ SIL_SA_ST_WAIT_HOOK_GETDATA
waiting for a Get-Data Hook response from the server, interrupting an edit transaction
Definition: sil_sa_types.h:143
sil_sa_edit_t_::curval
val_value_t * curval
current value for edit; backptr into start_request msg
Definition: sil_sa_types.h:314
agt.h
Multi-Protocol Network Management Server.
sil_sa_cb_t_::is_reverse_edit
boolean is_reverse_edit
transaction is a reverse-edit during rollback
Definition: sil_sa_types.h:207
sil_sa_cb_t_::hook_get_value
val_value_t * hook_get_value
<hook-get-response> return value
Definition: sil_sa_types.h:272
sil_sa_edit_t_::child_editQ
dlq_hdr_t child_editQ
Queue of EDIT2 children edits that will be used in the callback Q of sil_sa_child_edit_t.
Definition: sil_sa_types.h:334
sil_sa_added_edit_t_::where
const xmlChar * where
edit operation insert_where parameter
Definition: sil_sa_types.h:356
sil_sa_cb_t_::added_editQ
dlq_hdr_t added_editQ
Queue of Hook added edits that will be used in the hook-respose msg Q of sil_sa_added_edit_t.
Definition: sil_sa_types.h:260
sil_sa_edit_t_::path
const xmlChar * path
path string for added edit
Definition: sil_sa_types.h:308
sil_sa_cb_t_::client_addr
const xmlChar * client_addr
client address backptr from the transaction
Definition: sil_sa_types.h:225
sil_sa_cb_t_::sil_load_done
boolean sil_load_done
SIL-SA library load is done.
Definition: sil_sa_types.h:181
sil_sa_edit_t_::cbobj
obj_template_t * cbobj
child object for callback; backptr to callback object
Definition: sil_sa_types.h:320
sil_sa_edit_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: sil_sa_types.h:299
sil_sa_added_edit_t_::editop
const xmlChar * editop
edit operation string
Definition: sil_sa_types.h:353
sil_sa_cb_t_::is_load_config
boolean is_load_config
transaction is an internal <load-config>
Definition: sil_sa_types.h:210
sil_sa_added_edit_t_::path
const xmlChar * path
path for the edit
Definition: sil_sa_types.h:347
sil_sa_cb_t_::txid_str
const xmlChar * txid_str
transaction ID from the transaction
Definition: sil_sa_types.h:231
sil_sa_child_edit_t_::curval
val_value_t * curval
child current value; backptr into start_request msg
Definition: sil_sa_types.h:292
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
SIL_SA_ST_WAIT_CONFIG
@ SIL_SA_ST_WAIT_CONFIG
connection to server in progress, waiting for the configuration
Definition: sil_sa_types.h:126
sil_sa_bundle_t_::bundle_name
xmlChar * bundle_name
malloced copy of the bundle name This replaces the sil_sa_cb.bundle_nameQ
Definition: sil_sa_types.h:147
sil_sa_cb_t_::is_hook_load
boolean is_hook_load
SIL-SA Hook support.
Definition: sil_sa_types.h:263
sil_sa_child_edit_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: sil_sa_types.h:283
SIL_SA_ST_WAIT_APPLY
@ SIL_SA_ST_WAIT_APPLY
edit transaction started and is waiting for apply phase
Definition: sil_sa_types.h:135
sil_sa_child_edit_t_::editop
op_editop_t editop
child edit operation
Definition: sil_sa_types.h:286
sil_sa_state_t_
sil_sa_state_t_
SIL-SA state machine enumerations.
Definition: sil_sa_types.h:104
obj.h
Data Object Support.
sil_sa_cb_t_::txid
ncx_transaction_id_t txid
transaction ID derived from start_request
Definition: sil_sa_types.h:201
sil_sa_bundle_t_
one bundle unload record in case <unload-bundle> called
Definition: sil_sa_types.h:140
SIL_SA_ST_STOPPED
@ SIL_SA_ST_STOPPED
SIL-SA service is stopped.
Definition: sil_sa_types.h:120
sil_sa_cb_t_
control block for the SIL-SA module
Definition: sil_sa_types.h:167
SIL_SA_ST_START
@ SIL_SA_ST_START
SIL-SA serivice is starting up.
Definition: sil_sa_types.h:117
sil_sa_bundle_t_::qhdr
dlq_hdr_t qhdr
queue header
Definition: sil_sa_types.h:142
sil_sa_edit_t_::hook_type
agt_hook_type_t hook_type
hook type if a hook edit
Definition: sil_sa_types.h:329
sil_sa_added_edit_t_::point
const xmlChar * point
edit operation insert_point parameter
Definition: sil_sa_types.h:359
SIL_SA_ST_WAIT_REGISTER
@ SIL_SA_ST_WAIT_REGISTER
connection to server starting with register request
Definition: sil_sa_types.h:129
sil_sa_edit_t_
SIL-SA added edit data structure.
Definition: sil_sa_types.h:297
dlq.h
dlq provides general double-linked list and queue support:
sil_sa_cb_t_::is_hook_validate
boolean is_hook_validate
Not the same as is_validate.
Definition: sil_sa_types.h:269
sil_sa_cb_t_::user_id
const xmlChar * user_id
user-id backptr from the transaction
Definition: sil_sa_types.h:222
ncx_transaction_id_t
uint64 ncx_transaction_id_t
transaction is scoped to single session write operation on a config
Definition: ncxtypes.h:548