sysrepo 2.0.53
YANG-based system repository for all-around configuration management.
Loading...
Searching...
No Matches
Plugin API

Macros

#define SRP_CLEANUP_CB   "sr_plugin_cleanup_cb"
 sysrepo-plugind plugin cleanup callback name that must exist in every plugin.
 
#define SRP_INIT_CB   "sr_plugin_init_cb"
 sysrepo-plugind plugin initialization callback name that must exist in every plugin.
 
#define SRP_LOG_DBG(...)   srp_log(SR_LL_DBG, __VA_ARGS__)
 Deprecated, use SRPLG_LOG_DBG.
 
#define SRP_LOG_ERR(...)   srp_log(SR_LL_ERR, __VA_ARGS__)
 Deprecated, use SRPLG_LOG_ERR.
 
#define SRP_LOG_INF(...)   srp_log(SR_LL_INF, __VA_ARGS__)
 Deprecated, use SRPLG_LOG_INF.
 
#define SRP_LOG_WRN(...)   srp_log(SR_LL_WRN, __VA_ARGS__)
 Deprecated, use SRPLG_LOG_WRN.
 
#define SRPLG_LOG_DBG(plg_name, ...)   srplg_log(plg_name, SR_LL_DBG, __VA_ARGS__)
 Log a plugin debug message with format arguments.
 
#define SRPLG_LOG_ERR(plg_name, ...)   srplg_log(plg_name, SR_LL_ERR, __VA_ARGS__)
 Log a plugin error message with format arguments.
 
#define SRPLG_LOG_INF(plg_name, ...)   srplg_log(plg_name, SR_LL_INF, __VA_ARGS__)
 Log a plugin info message with format arguments.
 
#define SRPLG_LOG_WRN(plg_name, ...)   srplg_log(plg_name, SR_LL_WRN, __VA_ARGS__)
 Log a plugin warning message with format arguments.
 
typedef int(* srp_init_cb_t) (sr_session_ctx_t *session, void **private_data)
 Sysrepo plugin initialization callback.
 
typedef void(* srp_cleanup_cb_t) (sr_session_ctx_t *session, void *private_data)
 Sysrepo plugin cleanup callback.
 

Detailed Description

Macro Definition Documentation

◆ SRP_CLEANUP_CB

#define SRP_CLEANUP_CB   "sr_plugin_cleanup_cb"

sysrepo-plugind plugin cleanup callback name that must exist in every plugin.

The callback must be of srp_cleanup_cb_t type.

Definition at line 1579 of file sysrepo.h.

◆ SRP_INIT_CB

#define SRP_INIT_CB   "sr_plugin_init_cb"

sysrepo-plugind plugin initialization callback name that must exist in every plugin.

The callback must be of srp_init_cb_t type.

Definition at line 1572 of file sysrepo.h.

◆ SRP_LOG_DBG

#define SRP_LOG_DBG (   ...)    srp_log(SR_LL_DBG, __VA_ARGS__)

Deprecated, use SRPLG_LOG_DBG.

Parameters
[in]...Format string and arguments.

Definition at line 1639 of file sysrepo.h.

◆ SRP_LOG_ERR

#define SRP_LOG_ERR (   ...)    srp_log(SR_LL_ERR, __VA_ARGS__)

Deprecated, use SRPLG_LOG_ERR.

Parameters
[in]...Format string and arguments.

Definition at line 1618 of file sysrepo.h.

◆ SRP_LOG_INF

#define SRP_LOG_INF (   ...)    srp_log(SR_LL_INF, __VA_ARGS__)

Deprecated, use SRPLG_LOG_INF.

Parameters
[in]...Format string and arguments.

Definition at line 1632 of file sysrepo.h.

◆ SRP_LOG_WRN

#define SRP_LOG_WRN (   ...)    srp_log(SR_LL_WRN, __VA_ARGS__)

Deprecated, use SRPLG_LOG_WRN.

Parameters
[in]...Format string and arguments.

Definition at line 1625 of file sysrepo.h.

◆ SRPLG_LOG_DBG

#define SRPLG_LOG_DBG (   plg_name,
  ... 
)    srplg_log(plg_name, SR_LL_DBG, __VA_ARGS__)

Log a plugin debug message with format arguments.

Parameters
[in]plg_namePlugin name to print.
[in]...Format string and arguments.

Definition at line 1611 of file sysrepo.h.

◆ SRPLG_LOG_ERR

#define SRPLG_LOG_ERR (   plg_name,
  ... 
)    srplg_log(plg_name, SR_LL_ERR, __VA_ARGS__)

Log a plugin error message with format arguments.

Parameters
[in]plg_namePlugin name to print.
[in]...Format string and arguments.

Definition at line 1587 of file sysrepo.h.

◆ SRPLG_LOG_INF

#define SRPLG_LOG_INF (   plg_name,
  ... 
)    srplg_log(plg_name, SR_LL_INF, __VA_ARGS__)

Log a plugin info message with format arguments.

Parameters
[in]plg_namePlugin name to print.
[in]...Format string and arguments.

Definition at line 1603 of file sysrepo.h.

◆ SRPLG_LOG_WRN

#define SRPLG_LOG_WRN (   plg_name,
  ... 
)    srplg_log(plg_name, SR_LL_WRN, __VA_ARGS__)

Log a plugin warning message with format arguments.

Parameters
[in]plg_namePlugin name to print.
[in]...Format string and arguments.

Definition at line 1595 of file sysrepo.h.

Typedef Documentation

◆ srp_cleanup_cb_t

typedef void(* srp_cleanup_cb_t) (sr_session_ctx_t *session, void *private_data)

Sysrepo plugin cleanup callback.

Parameters
[in]sessionSysrepo session that can be used for any API calls needed for plugin cleanup (mainly for unsubscribing of subscriptions initialized in srp_init_cb_t).
[in]private_dataPrivate context as passed in srp_init_cb_t.

Definition at line 670 of file sysrepo_types.h.

◆ srp_init_cb_t

typedef int(* srp_init_cb_t) (sr_session_ctx_t *session, void **private_data)

Sysrepo plugin initialization callback.

Parameters
[in]sessionSysrepo session that can be used for any API calls needed for plugin initialization (mainly for reading of startup configuration and subscribing for notifications).
[out]private_dataPrivate context (opaque to sysrepo) that will be passed to srp_cleanup_cb_t when plugin cleanup is requested.
Returns
Error code (SR_ERR_OK on success).

Definition at line 660 of file sysrepo_types.h.