All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Typedefs | Functions | Variables
netconf_plugin.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdarg.h>
#include <syslog.h>
#include <errno.h>
#include <assert.h>
#include <dlfcn.h>
#include <dirent.h>
#include <grp.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <cligen/cligen.h>
#include <clixon/clixon.h>
#include "clixon_netconf.h"
#include "netconf_lib.h"
#include "netconf_plugin.h"


typedef struct netconf_reg netconf_reg_t


static int plugin_unload (clicon_handle h, void *handle)
static plghndl_t plugin_load (clicon_handle h, char *file, int dlflags, const char *cnklbl)
int netconf_plugin_load (clicon_handle h)
int netconf_plugin_unload (clicon_handle h)
int netconf_plugin_start (clicon_handle h, int argc, char **argv)
int netconf_register_callback (clicon_handle h, netconf_cb_t cb, void *arg, char *tag)
int netconf_plugin_callbacks (clicon_handle h, cxobj *xn, cxobj **xret)


static int nplugins = 0
static plghndl_t * plugins = NULL
static netconf_reg_tdeps = NULL

Typedef Documentation

typedef struct netconf_reg netconf_reg_t

Function Documentation

int netconf_plugin_callbacks ( clicon_handle  h,
cxobj *  xn,
cxobj **  xret 

See if there is any callback registered for this tag

[in]hclicon handle
[in]xnSub-tree (under xorig) at child of rpc: <rpc><xn></rpc>.
[out]xretReturn XML, error or OK
Return values
0OK, not found handler.
1OK, handler called
int netconf_plugin_load ( clicon_handle  h)

Load all plugins you can find in CLICON_NETCONF_DIR

int netconf_plugin_start ( clicon_handle  h,
int  argc,
char **  argv 

Call plugin_start in all plugins

int netconf_plugin_unload ( clicon_handle  h)

Unload all netconf plugins

int netconf_register_callback ( clicon_handle  h,
netconf_cb_t  cb,
void *  arg,
char *  tag 

Register netconf callback Called from plugin to register a callback for a specific netconf XML tag.

static plghndl_t plugin_load ( clicon_handle  h,
char *  file,
int  dlflags,
const char *  cnklbl 
static int plugin_unload ( clicon_handle  h,
void *  handle 

Unload a plugin

Variable Documentation

netconf_reg_t* deps = NULL
int nplugins = 0
plghndl_t* plugins = NULL