sysrepo
2.12.0
YANG-based system repository for all-around configuration management.
|
NACM functionality header. More...
#include "../sysrepo.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... | |
NACM functionality header.
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.
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.
const char* sr_nacm_get_user | ( | sr_session_ctx_t * | session | ) |
Get the NACM user of the session.
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
.
[in] | session | Session to use. |
[in] | opts | Optionally, SR_SUBSCR_NO_THREAD can be specified. No other flags are allowed. |
[out] | sub | Subscription context, must be different from the one used in sr_nacm_init()! |
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().
[in] | session | Session to use. |
[in] | opts | Optionally, SR_SUBSCR_NO_THREAD can be specified. No other flags are allowed. |
[out] | sub | Subscription context. |
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:
[in] | session | Session to use. |
[in] | user | NACM username to use. If NULL, the username is cleared disabling NACM. |