-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathlibcli.h
97 lines (74 loc) · 2.22 KB
/
libcli.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* =====================================================================================
*
* Filename: libcli.h
*
* Description: User interface Header file.
*
* Version: 1.0
* Created: Saturday 05 August 2017 11:23:15 IST
* Revision: 1.0
* Compiler: gcc
*
* Author: Er. Abhishek Sagar, Networking Developer (AS), [email protected]
* Company: Brocade Communications(Jul 2012- Mar 2016), Current : Juniper Networks(Apr 2017 - Present)
*
* =====================================================================================
*/
#ifndef __LIBCLI__
#define __LIBCLI__
#include <unistd.h>
#include "libcliid.h"
#include "cmd_hier.h"
extern int GL_FD_OUT;
void
init_libcli();
void
set_device_name(const char *cons_name);
/*import functions. These functions to be used to get access to
* library global variables - the zero level command hooks */
param_t *
libcli_get_show_hook(void);
param_t *
libcli_get_debug_hook(void);
param_t *
libcli_get_debug_show_hook(void);
param_t *
libcli_get_config_hook(void);
param_t *
libcli_get_clear_hook(void);
param_t *
libcli_get_run_hook(void);
void
enable_show_extension_param_brief(param_t *param);
void
set_param_cmd_code(param_t *param, int cmd_code);
/*See the definition of this fn to know about arguments*/
void
init_param(param_t *param,
param_type_t param_type,
char *cmd_name,
cmd_callback callback,
user_validation_callback user_validation_cb_fn,
leaf_type_t leaf_type,
char *leaf_id,
char *help);
void
libcli_register_param(param_t *parent, param_t *child);
void
libcli_register_display_callback(param_t *param,
display_possible_values_callback disp_callback);
show_ext_t
get_show_extension_type(ser_buff_t *b);
/*After this call, libcli_register_param MUST not be invoked on param*/
void
support_cmd_negation(param_t *param);
void
dump_cmd_tree();
void
start_shell(void);
#define HIDE_PARAM(param_ptr) ((param_ptr)->ishidden = 1)
#define IS_PARAM_HIDDEN(param_ptr) ((param_ptr)->ishidden == 1)
void
cli_register_ctrlC_handler(void (*app_ctrlC_signal_handler)(void ));
#endif