yumapro  24.10-11
YumaPro SDK
Loading...
Searching...
No Matches
agt_acm.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3 * Copyright (c) 2012 - 2025, 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
13#define _H_agt_acm
14
15/* FILE: agt_acm.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
31/*********************************************************************
32* *
33* C H A N G E H I S T O R Y *
34* *
35*********************************************************************
36
37date init comment
38----------------------------------------------------------------------
3903-feb-06 abb Begun
4014-may-09 abb add per-msg cache to speed up performance
41*/
42
43#include <xmlstring.h>
44
45#ifndef _H_agt
46#include "agt.h"
47#endif
48
49#ifndef _H_dlq
50#include "dlq.h"
51#endif
52
53#ifndef _H_obj
54#include "obj.h"
55#endif
56
57#ifndef _H_ses
58#include "ses.h"
59#endif
60
61#ifndef _H_status
62#include "status.h"
63#endif
64
65#ifndef _H_val
66#include "val.h"
67#endif
68
69#ifndef _H_xml_msg
70#include "xml_msg.h"
71#endif
72
73#ifndef _H_xmlns
74#include "xmlns.h"
75#endif
76
77#ifndef _H_xpath
78#include "xpath.h"
79#endif
80
81#ifdef __cplusplus
82extern "C" {
83#endif
84
85/********************************************************************
86* *
87* C O N S T A N T S *
88* *
89*********************************************************************/
90
91/* this is defined by the vendor and not allowed to change by
92 * the user since there are no translation functions between models
93 * Pick RFC 6536 as the default.
94 */
95// To change ACM models, also change the nacm:default-deny-* extensions
96// in all YANG modules using these YANG extensions
97#define AGT_DEF_ACM_MODEL AGT_ACM_MODEL_IETF_NACM
98
100//#define AGT_DEF_ACM_MODEL AGT_ACM_MODEL_YUMA_NACM
101
102
103/********************************************************************
104* *
105* T Y P E S *
106* *
107*********************************************************************/
108
109
110/********************************************************************
111* *
112* F U N C T I O N S *
113* *
114*********************************************************************/
115
116/* Header only */
117
118
144extern status_t
145 agt_acm_init (void);
146
147
154extern status_t
155 agt_acm_init2 (void);
156
157
164extern void
165 agt_acm_cleanup (void);
166
167
179extern boolean
180 agt_acm_rpc_allowed (xml_msg_hdr_t *msg,
181 const xmlChar *user,
182 const obj_template_t *rpcobj);
183
184
185
186
202extern boolean
203 agt_acm_action_allowed (xml_msg_hdr_t *msg,
204 const xmlChar *user,
205 val_value_t *actionval);
206
207
221extern boolean
222 agt_acm_notif_allowed (const xmlChar *user,
223 const obj_template_t *notifobj);
224
225
242extern boolean
243 agt_acm_val_write_allowed (xml_msg_hdr_t *msg,
244 const xmlChar *user,
245 val_value_t *newval,
246 val_value_t *curval,
247 op_editop_t editop);
248
249
261extern boolean
262 agt_acm_val_read_allowed (xml_msg_hdr_t *msg,
263 const xmlChar *user,
264 val_value_t *val);
265
266
280extern status_t
281 agt_acm_init_msg_cache (ses_cb_t *scb,
282 xml_msg_hdr_t *msg);
283
284
292extern void
293 agt_acm_clear_msg_cache (xml_msg_hdr_t *msg);
294
295
303extern void agt_acm_clear_session_cache (ses_cb_t *scb);
304
305
315extern void agt_acm_invalidate_session_cache (ses_cb_t *scb);
316
317
326extern boolean
327 agt_acm_session_cache_valid (const ses_cb_t *scb);
328
329
339extern boolean
341
342
350extern agt_acmode_t
351 agt_acm_get_acmode (void);
352
353
360extern void
361 agt_acm_set_acmode (agt_acmode_t newmode);
362
363
371extern boolean
373
374
382extern boolean
384
385
396extern boolean
397 agt_acm_is_superuser (const xmlChar *username);
398
399
407extern uint32
409
410
418extern uint32
420
421
429extern uint32
431
432
440extern void
441 agt_acm_clean_xpath_cache (void);
442
443
453extern void
454 agt_acm_set_datarules (val_value_t *val,
455 uint32 msgid);
456
457
465extern void
466 agt_acm_clean_obj_datarule_cache (ncx_module_t *mod);
467
468
469#ifdef WITH_YP_HA
470
477extern void
478 agt_acm_go_active (void);
479
480
487extern void
488 agt_acm_go_standby (void);
489
490#endif // WITH_YP_HA
491
492
496#ifdef __cplusplus
497} /* end extern 'C' */
498#endif
499
500#endif /* _H_agt_acm */
Multi-Protocol Network Management Server.
dlq provides general double-linked list and queue support:
agt_acmode_t
matches access-control enumeration in netconfd.yang
Definition: agt.h:730
boolean agt_acm_get_log_writes(void)
Get the log_writes flag.
Definition: agt_acm.c:1049
agt_acmode_t agt_acm_get_acmode(void)
Get the –access-control mode.
Definition: agt_acm.c:1017
uint32 agt_acm_get_deniedNotifications(void)
Get the deniedNotification counter.
Definition: agt_acm.c:1137
boolean agt_acm_is_superuser(const xmlChar *username)
Check if the specified user name is the superuser Low-level access; no scb available.
Definition: agt_acm.c:1086
uint32 agt_acm_get_deniedRpcs(void)
Get the deniedRpcs counter.
Definition: agt_acm.c:1105
boolean agt_acm_get_log_reads(void)
Get the log_reads flag.
Definition: agt_acm.c:1065
uint32 agt_acm_get_deniedDataWrites(void)
Get the deniedDataWrites counter.
Definition: agt_acm.c:1121
boolean agt_acm_session_is_superuser(const ses_cb_t *scb)
Check if the specified session is the superuser.
Definition: agt_acm.c:997
op_editop_t
NETCONF edit-config operation types.
Definition: op.h:122
status_t
global error return code
Definition: status_enum.h:219
Data Object Support.
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
representation of one module or submodule during and after parsing
Definition: ncxtypes.h:1138
One YANG data-def-stmt.
Definition: obj.h:1232
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
Value Node Basic Support.
XML and JSON Message send and receive support.
XML namespace support.
Schema and data model Xpath search support.