CliXoN
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
cli_show.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <errno.h>
#include <stdarg.h>
#include <time.h>
#include <ctype.h>
#include <unistd.h>
#include <dirent.h>
#include <syslog.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/wait.h>
#include <sys/param.h>
#include <sys/mount.h>
#include <pwd.h>
#include <assert.h>
#include <cligen/cligen.h>
#include <clixon/clixon.h>
#include "clixon_cli_api.h"
#include "cli_common.h"

Functions

int expand_dbvar (void *h, char *name, cvec *cvv, cvec *argv, cvec *commands, cvec *helptexts)
 
int expandv_dbvar (void *h, char *name, cvec *cvv, cvec *argv, cvec *commands, cvec *helptexts)
 
int expand_dir (char *dir, int *nr, char ***commands, mode_t flags, int detail)
 
int show_yang (clicon_handle h, cvec *cvv, cvec *argv)
 
int show_yangv (clicon_handle h, cvec *vars, cvec *argv)
 
int cli_show_config (clicon_handle h, cvec *cvv, cvec *argv)
 
int show_conf_xpath (clicon_handle h, cvec *cvv, cvec *argv)
 
int show_confv_xpath (clicon_handle h, cvec *vars, cvec *argv)
 

Function Documentation

int cli_show_config ( clicon_handle  h,
cvec *  cvv,
cvec *  argv 
)

Generic show configuration CLIGEN callback Utility function used by cligen spec file

Parameters
[in]hCLICON handle
[in]cvvVector of variables from CLIgen command-line
[in]argvString vector: <dbname> <format> <xpath> [<varname>] Format of argv: <dbname> "running"|"candidate"|"startup" <dbname> "text"|"xml"|"json"|"cli"|"netconf" (see format_enum) <xpath> xpath expression, that may contain one %, eg "/sender[name=%s]" <varname> optional name of variable in cvv. If set, xpath must have a 's'
show config id <n:string>, cli_show_config("running","xml","iface[name=%s]","n");
int expand_dbvar ( void *  h,
char *  name,
cvec *  cvv,
cvec *  argv,
cvec *  commands,
cvec *  helptexts 
)

Completion callback intended for automatically generated data model

Returns an expand-type list of commands as used by cligen 'expand' functionality.

Assume callback given in a cligen spec: a <x:int expand_dbvar("arg")

Parameters
[in]hclicon handle
[in]nameName of this function (eg "expand_dbvar")
[in]cvvThe command so far. Eg: cvec [0]:"a 5 b"; [1]: x=5;
[in]argvArguments given at the callback ("<db>" "<xmlkeyfmt>")
[out]lenlen of return commands & helptxt
[out]commandsvector of function pointers to callback functions
[out]helptxtvector of pointers to helptexts
See Also
cli_expand_var_generate This is where arg is generated XXX: helptexts?
int expand_dir ( char *  dir,
int *  nr,
char ***  commands,
mode_t  flags,
int  detail 
)

List files in a directory

int expandv_dbvar ( void *  h,
char *  name,
cvec *  cvv,
cvec *  argv,
cvec *  commands,
cvec *  helptexts 
)
int show_conf_xpath ( clicon_handle  h,
cvec *  cvv,
cvec *  argv 
)

Show configuration as text given an xpath Utility function used by cligen spec file

Parameters
[in]hCLICON handle
[in]cvvVector of variables from CLIgen command-line
[in]argA string: <dbname> <xpath>
Note
Hardcoded that a variable in cvv is named "xpath"
int show_confv_xpath ( clicon_handle  h,
cvec *  vars,
cvec *  argv 
)
int show_yang ( clicon_handle  h,
cvec *  cvv,
cvec *  argv 
)

CLI callback show yang spec. If arg given matches yang argument string

int show_yangv ( clicon_handle  h,
cvec *  vars,
cvec *  argv 
)