yumapro  21.10T-9
YumaPro SDK
agt_acm_ietf.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_ietf
13 #define _H_agt_acm_ietf
14 
15 /* FILE: agt_acm_ietf.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 #ifndef _H_agt
41 #include "agt.h"
42 #endif
43 
44 #ifndef _H_dlq
45 #include "dlq.h"
46 #endif
47 
48 #ifndef _H_obj
49 #include "obj.h"
50 #endif
51 
52 #ifndef _H_ses
53 #include "ses.h"
54 #endif
55 
56 #ifndef _H_status
57 #include "status.h"
58 #endif
59 
60 #ifndef _H_val
61 #include "val.h"
62 #endif
63 
64 #ifndef _H_xml_msg
65 #include "xmlmsg.h"
66 #endif
67 
68 #ifndef _H_xmlns
69 #include "xmlns.h"
70 #endif
71 
72 #ifndef _H_xpath
73 #include "xpath.h"
74 #endif
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
80 /********************************************************************
81 * *
82 * C O N S T A N T S *
83 * *
84 *********************************************************************/
85 
86 #define y_ietf_netconf_acm_M_ietf_netconf_acm \
87  (const xmlChar *)"ietf-netconf-acm"
88 
89 // accept either 2012 or 2018 version
90 //#define y_ietf_netconf_acm_R_ietf_netconf_acm (const xmlChar *)"2012-02-22"
91 //#define y_ietf_netconf_acm_R_ietf_netconf_acm (const xmlChar *)"2018-02-14"
92 #define y_ietf_netconf_acm_R_ietf_netconf_acm NULL
93 
94 #define y_ietf_netconf_acm_N_access_operations \
95  (const xmlChar *)"access-operations"
96 #define y_ietf_netconf_acm_N_action (const xmlChar *)"action"
97 #define y_ietf_netconf_acm_N_comment (const xmlChar *)"comment"
98 #define y_ietf_netconf_acm_N_data_node (const xmlChar *)"data-node"
99 #define y_ietf_netconf_acm_N_denied_data_writes \
100  (const xmlChar *)"denied-data-writes"
101 #define y_ietf_netconf_acm_N_denied_notifications \
102  (const xmlChar *)"denied-notifications"
103 #define y_ietf_netconf_acm_N_denied_operations \
104  (const xmlChar *)"denied-operations"
105 #define y_ietf_netconf_acm_N_enable_external_groups \
106  (const xmlChar *)"enable-external-groups"
107 #define y_ietf_netconf_acm_N_enable_nacm (const xmlChar *)"enable-nacm"
108 #define y_ietf_netconf_acm_N_exec_default (const xmlChar *)"exec-default"
109 #define y_ietf_netconf_acm_N_group (const xmlChar *)"group"
110 #define y_ietf_netconf_acm_N_groups (const xmlChar *)"groups"
111 #define y_ietf_netconf_acm_N_module_name (const xmlChar *)"module-name"
112 #define y_ietf_netconf_acm_N_nacm (const xmlChar *)"nacm"
113 #define y_ietf_netconf_acm_N_name (const xmlChar *)"name"
114 #define y_ietf_netconf_acm_N_notification (const xmlChar *)"notification"
115 #define y_ietf_netconf_acm_N_notification_name \
116  (const xmlChar *)"notification-name"
117 #define y_ietf_netconf_acm_N_path (const xmlChar *)"path"
118 #define y_ietf_netconf_acm_N_protocol_operation \
119  (const xmlChar *)"protocol-operation"
120 #define y_ietf_netconf_acm_N_read_default (const xmlChar *)"read-default"
121 #define y_ietf_netconf_acm_N_rpc_name (const xmlChar *)"rpc-name"
122 #define y_ietf_netconf_acm_N_rule (const xmlChar *)"rule"
123 #define y_ietf_netconf_acm_N_rule_list (const xmlChar *)"rule-list"
124 #define y_ietf_netconf_acm_N_rule_type (const xmlChar *)"rule-type"
125 #define y_ietf_netconf_acm_N_user_name (const xmlChar *)"user-name"
126 #define y_ietf_netconf_acm_N_write_default (const xmlChar *)"write-default"
127 
128 
129 /********************************************************************
130 * *
131 * T Y P E S *
132 * *
133 *********************************************************************/
134 
135 
163 typedef status_t
164  (*agt_acm_group_cbfn_t) (const xmlChar *username,
165  xmlChar **retgroups);
166 
167 
168 /********************************************************************
169 * *
170 * F U N C T I O N S *
171 * *
172 *********************************************************************/
173 
174 
181 extern status_t
182  agt_acm_ietf_init2 (void);
183 
184 
190 extern status_t
191  agt_acm_ietf_init1 (void);
192 
193 
199 extern void
200  agt_acm_ietf_cleanup (void);
201 
202 
211 extern boolean
213  const xmlChar *user,
214  const obj_template_t *rpcobj);
215 
216 
227 extern boolean
228  agt_acm_ietf_notif_allowed (const xmlChar *user,
229  const obj_template_t *notifobj);
230 
231 
247 extern boolean
249  const xmlChar *user,
250  val_value_t *newval,
251  val_value_t *curval,
252  op_editop_t editop);
253 
254 
263 extern boolean
265  const xmlChar *user,
266  val_value_t *val);
267 
268 
279 extern status_t
281  xml_msg_hdr_t *msg);
282 
283 
290 extern void agt_acm_ietf_clear_session_cache (ses_cb_t *scb);
291 
292 
300 
301 
310 extern boolean agt_acm_ietf_session_cache_valid (const ses_cb_t *scb);
311 
312 
319 extern void
321 
322 
331 extern void
333 
334 
335 
343 extern void
345  uint32 msgid);
346 
347 
354 extern void
356 
357 
361 #ifdef __cplusplus
362 } /* end extern 'C' */
363 #endif
364 
365 #endif /* _H_agt_acm_ietf */
void agt_acm_ietf_invalidate_session_cache(ses_cb_t *scb)
Invalidate an agt_acm_cache_t struct in a session control block.
Definition: agt_acm_ietf.c:5592
Data Object Support.
dlq provides general double-linked list and queue support:
Common Encoding Message Header No longer XML specific!! Used by JSON parsing as well!! Allows common ...
Definition: xml_msg.h:351
boolean agt_acm_ietf_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_ietf.c:5404
One YANG data-def-stmt.
Definition: obj.h:1140
void agt_acm_ietf_cleanup(void)
Cleanup the external access control module.
Definition: agt_acm_ietf.c:5158
NETCONF Session Common definitions module.
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1054
Schema and data model Xpath search support.
Value Node Basic Support.
boolean agt_acm_ietf_session_cache_valid(const ses_cb_t *scb)
Check if a session ACM cache is valid.
Definition: agt_acm_ietf.c:5616
status_t agt_acm_ietf_init2(void)
Phase 2 : Initialize the external data model configuration data structures.
Definition: agt_acm_ietf.c:5121
void agt_acm_ietf_clear_session_cache(ses_cb_t *scb)
Clear an agt_acm_cache_t struct in a session control block.
Definition: agt_acm_ietf.c:5571
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
boolean agt_acm_ietf_val_read_allowed(xml_msg_hdr_t *msg, const xmlChar *user, val_value_t *val)
Check if the specified user is allowed to read a value node.
Definition: agt_acm_ietf.c:5488
status_t agt_acm_ietf_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_ietf.c:5528
one value to match one type
Definition: val.h:870
void agt_acm_ietf_set_datarules(val_value_t *val, uint32 msgid)
Check the dataruleQ in the object and all child nodes For each rule found.
Definition: agt_acm_ietf.c:5706
status_t agt_acm_ietf_init1(void)
Phase 1: Load the external data module.
Definition: agt_acm_ietf.c:5002
Session Control Block.
Definition: ses.h:542
status_t
global error return code
Definition: status_enum.h:186
Multi-Protocol Network Management Server.
void agt_acm_ietf_clean_obj_datarule(ncx_module_t *mod)
Check all the rule list entry and its OBJ datarule cache and clean if the modules is getting unloaded...
Definition: agt_acm_ietf.c:5770
Global error messages for status code enumerations.
status_t(* agt_acm_group_cbfn_t)(const xmlChar *username, xmlChar **retgroups)
typedef for NACM External Groups callback function
Definition: agt_acm_ietf.h:164
boolean agt_acm_ietf_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_ietf.c:5293
boolean agt_acm_ietf_val_write_allowed(xml_msg_hdr_t *msg, const xmlChar *user, val_value_t *newval, val_value_t *curval, op_editop_t editop)
Check if the specified user is allowed to access a value node.
Definition: agt_acm_ietf.c:5435
XML namespace support.
void agt_acm_ietf_clean_xpath_cache(void)
Clean any cached XPath results because the data rule results.
Definition: agt_acm_ietf.c:5637
void agt_acm_ietf_register_group_cbfn(agt_acm_group_cbfn_t cbfn)
Register a get-external-groups callback function.
Definition: agt_acm_ietf.c:5689