yumapro  20.10-12
YumaPro SDK
agt_acm_extern.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_agt_acm_extern
13 #define _H_agt_acm_extern
14 
15 /* FILE: agt_acm_extern.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 18-jun-12 abb Begun; split from agt_acm.h
36 */
37 
38 #include <xmlstring.h>
39 
40 
41 #ifndef _H_obj
42 #include "obj.h"
43 #endif
44 
45 #ifndef _H_op
46 #include "op.h"
47 #endif
48 
49 #ifndef _H_status
50 #include "status.h"
51 #endif
52 
53 #ifndef _H_val
54 #include "val.h"
55 #endif
56 
57 #ifndef _H_xml_msg
58 #include "xml_msg.h"
59 #endif
60 
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
66 /********************************************************************
67 * *
68 * C O N S T A N T S *
69 * *
70 *********************************************************************/
71 
72 
73 /********************************************************************
74 * *
75 * T Y P E S *
76 * *
77 *********************************************************************/
78 
79 
100 typedef boolean
101  (*agt_acm_extern_rpc_fn_t) (xml_msg_hdr_t *msg,
102  const xmlChar *user,
103  const obj_template_t *rpcobj);
104 
105 
115 typedef boolean
116  (*agt_acm_extern_notif_fn_t) (const xmlChar *user,
117  const obj_template_t *notifobj);
118 
119 
135 typedef boolean
136  (*agt_acm_extern_write_fn_t) (xml_msg_hdr_t *msg,
137  const xmlChar *user,
138  const val_value_t *newval,
139  const val_value_t *curval,
140  op_editop_t editop);
141 
142 
151 typedef boolean
152  (*agt_acm_extern_read_fn_t) (xml_msg_hdr_t *msg,
153  const xmlChar *user,
154  const val_value_t *val);
155 
156 
157 /********************************************************************
158 * *
159 * F U N C T I O N S *
160 * *
161 *********************************************************************/
162 
163 
170 extern status_t
171  agt_acm_extern_init2 (void);
172 
173 
182 extern void agt_acm_extern_init0 (void);
183 
184 
190 extern status_t
191  agt_acm_extern_init1 (void);
192 
193 
199 extern void
200  agt_acm_extern_cleanup (void);
201 
202 
213 extern status_t
214  agt_acm_extern_init_msg_cache (ses_cb_t *scb,
215  xml_msg_hdr_t *msg);
216 
217 
233  agt_acm_extern_read_fn_t readfn);
234 
235 
244 extern boolean
245  agt_acm_extern_rpc_allowed (xml_msg_hdr_t *msg,
246  const xmlChar *user,
247  const obj_template_t *rpcobj);
248 
249 
259 extern boolean
260  agt_acm_extern_notif_allowed (const xmlChar *user,
261  const obj_template_t *notifobj);
262 
263 
279 extern boolean
280  agt_acm_extern_val_write_allowed (xml_msg_hdr_t *msg,
281  const xmlChar *user,
282  const val_value_t *newval,
283  const val_value_t *curval,
284  op_editop_t editop);
285 
286 
295 extern boolean
296  agt_acm_extern_val_read_allowed (xml_msg_hdr_t *msg,
297  const xmlChar *user,
298  const val_value_t *val);
299 
300 
304 #ifdef __cplusplus
305 } /* end extern 'C' */
306 #endif
307 
308 #endif /* _H_agt_acm_extern */
agt_acm_extern_notif_fn_t
boolean(* agt_acm_extern_notif_fn_t)(const xmlChar *user, const obj_template_t *notifobj)
Check if the specified user is allowed to receive a notification event.
Definition: agt_acm_extern.h:116
agt_acm_extern_val_read_allowed
boolean agt_acm_extern_val_read_allowed(xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *val)
Check if the specified user is allowed to read a value node.
Definition: agt_acm_extern.c:290
agt_acm_extern.h
NETCONF Server Access Control handler for external data model.
val.h
Value Node Basic Support.
agt_acm_extern_notif_allowed
boolean agt_acm_extern_notif_allowed(const xmlChar *user, const obj_template_t *notifobj)
Check if the specified user is allowed to receive a notification event.
Definition: agt_acm_extern.c:229
agt_acm_extern_write_fn_t
boolean(* agt_acm_extern_write_fn_t)(xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *newval, const val_value_t *curval, op_editop_t editop)
Check if the specified user is allowed to access a value node.
Definition: agt_acm_extern.h:136
agt_acm_extern_read_fn_t
boolean(* agt_acm_extern_read_fn_t)(xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *val)
Check if the specified user is allowed to read a value node.
Definition: agt_acm_extern.h:152
op.h
NETCONF protocol operations.
ncxconst.h
Contains NCX constants.
agt_acm_extern_init1
status_t agt_acm_extern_init1(void)
Phase 1: Load the external data module.
Definition: agt_acm_extern.c:129
agt_acm_extern_register_callbacks
void agt_acm_extern_register_callbacks(agt_acm_extern_rpc_fn_t rpcfn, agt_acm_extern_notif_fn_t notfn, agt_acm_extern_write_fn_t writefn, agt_acm_extern_read_fn_t readfn)
Register the external callbacks for ACM implementation.
Definition: agt_acm_extern.c:319
agt_acm_extern_init0
void agt_acm_extern_init0(void)
Init 0 Pre-init 1 phase.
Definition: agt_acm_extern.c:105
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
agt_acm_extern_init_msg_cache
status_t agt_acm_extern_init_msg_cache(ses_cb_t *scb, xml_msg_hdr_t *msg)
Malloc and initialize an agt_acm_cache_t struct and attach it to the incoming message.
Definition: agt_acm_extern.c:173
agt.h
Multi-Protocol Network Management Server.
agt_acm_extern_rpc_allowed
boolean agt_acm_extern_rpc_allowed(xml_msg_hdr_t *msg, const xmlChar *user, const obj_template_t *rpcobj)
Check if the specified user is allowed to invoke an RPC.
Definition: agt_acm_extern.c:201
xml_msg.h
XML and JSON Message send and receive support.
agt_acm_extern_init2
status_t agt_acm_extern_init2(void)
Phase 2 : Initialize the external data model configuration data structures.
Definition: agt_acm_extern.c:89
agt_acm.h
NETCONF Server Access Control Entry Points.
agt_acm_extern_val_write_allowed
boolean agt_acm_extern_val_write_allowed(xml_msg_hdr_t *msg, const xmlChar *user, const val_value_t *newval, const val_value_t *curval, op_editop_t editop)
Check if the specified user is allowed to access a value node.
Definition: agt_acm_extern.c:261
obj.h
Data Object Support.
agt_acm_extern_rpc_fn_t
boolean(* agt_acm_extern_rpc_fn_t)(xml_msg_hdr_t *msg, const xmlChar *user, const obj_template_t *rpcobj)
Check if the specified user is allowed to invoke an RPC.
Definition: agt_acm_extern.h:101
status.h
Global error messages for status code enumerations.
agt_acm_extern_cleanup
void agt_acm_extern_cleanup(void)
Cleanup the external access control module.
Definition: agt_acm_extern.c:145