sysrepo  3.3.4
YANG-based system repository for all-around configuration management.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
netconf_acm.h File Reference

NACM functionality header. More...

#include "../sysrepo.h"
Include dependency graph for netconf_acm.h:

Go to the source code of this file.

Functions

void sr_nacm_destroy (void)
 Destroy NACM. More...
 
const char * sr_nacm_get_recovery_user (void)
 Get username of the NACM recovery user with unrestricted access. More...
 
const char * sr_nacm_get_user (sr_session_ctx_t *session)
 Get the NACM user of the session. More...
 
int sr_nacm_glob_stats_subscribe (sr_session_ctx_t *session, sr_subscr_options_t opts, sr_subscription_ctx_t **sub)
 Subscribe for providing global NACM stats. These include triggering subscriptions made by sr_nacm_init() so another subscription structure is required. More...
 
int sr_nacm_init (sr_session_ctx_t *session, sr_subscr_options_t opts, sr_subscription_ctx_t **sub)
 Initialize NACM and its callbacks. More...
 
int sr_nacm_set_user (sr_session_ctx_t *session, const char *user)
 Set the NACM user for this session, which enables NACM for all operations on this session. More...
 

Detailed Description

NACM functionality header.

Author
Michal Vasko mvask.nosp@m.o@ce.nosp@m.snet..nosp@m.cz

This source code is licensed under BSD 3-Clause License (the "License"). You may not use this file except in compliance with the License. You may obtain a copy of the License at

https://opensource.org/licenses/BSD-3-Clause

Definition in file netconf_acm.h.

Function Documentation

void sr_nacm_destroy ( void  )

Destroy NACM.

const char* sr_nacm_get_recovery_user ( void  )

Get username of the NACM recovery user with unrestricted access.

Returns
Username of NACM recovery session.
const char* sr_nacm_get_user ( sr_session_ctx_t session)

Get the NACM user of the session.

Returns
Session NACM user.
int sr_nacm_glob_stats_subscribe ( sr_session_ctx_t session,
sr_subscr_options_t  opts,
sr_subscription_ctx_t **  sub 
)

Subscribe for providing global NACM stats. These include triggering subscriptions made by sr_nacm_init() so another subscription structure is required.

There can be only a single provider of these data on a system and in case there already is, this function returns success but does not modify sub.

Parameters
[in]sessionSession to use.
[in]optsOptionally, SR_SUBSCR_NO_THREAD can be specified. No other flags are allowed.
[out]subSubscription context, must be different from the one used in sr_nacm_init()!
Returns
Error code (SR_ERR_OK on success).
int sr_nacm_init ( sr_session_ctx_t session,
sr_subscr_options_t  opts,
sr_subscription_ctx_t **  sub 
)

Initialize NACM and its callbacks.

Needs to be called only once in each process. Subscriptions created in sub need to be unsubscribed separately and before calling sr_nacm_destroy().

Parameters
[in]sessionSession to use.
[in]optsOptionally, SR_SUBSCR_NO_THREAD can be specified. No other flags are allowed.
[out]subSubscription context.
Returns
Error code (SR_ERR_OK on success).
int sr_nacm_set_user ( sr_session_ctx_t session,
const char *  user 
)

Set the NACM user for this session, which enables NACM for all operations on this session.

Affected operations:

  • reading data - unaccesible data are silently filtered out from the returned data;
  • editing data - on an attempt to edit data without the proper access NETCONF error is returned;
  • sending RPC/action - on an attempt to send RPC/action without the proper access NETCONF error is returned;
  • receiving notifications - notifications without the proper access are silently dropped;
  • subscribing to YANG Push - unreadable data are silently filtered out from the received notifications.
Parameters
[in]sessionSession to use.
[in]userNACM username to use. If NULL, the username is cleared disabling NACM.
Returns
Error code (SR_ERR_OK on success).