-
Notifications
You must be signed in to change notification settings - Fork 11
/
clistd.h
118 lines (84 loc) · 3.13 KB
/
clistd.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
* =====================================================================================
*
* Filename: clistd.h
*
* Description: All Validation functions for leaves and standard default callbacks are defined in this file
*
* Version: 1.0
* Created: Sunday 06 August 2017 06:00:22 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 __CLISTD__
#define __CLISTD__
#include "libcliid.h"
typedef struct leaf leaf_t;
typedef struct _param_t_ param_t;
typedef struct serialized_buffer ser_buff_t;
typedef enum{
VALIDATION_FAILED = -1,
VALIDATION_SUCCESS
} CLI_VAL_RC;
/*Default validation handlers for Data types*/
CLI_VAL_RC
int_validation_handler(leaf_t *leaf, char *value_passed);
CLI_VAL_RC
string_validation_handler(leaf_t *leaf, char *value_passed);
CLI_VAL_RC
ipv4_validation_handler(leaf_t *leaf, char *value_passed);
CLI_VAL_RC
ipv6_validation_handler(leaf_t *leaf, char *value_passed);
CLI_VAL_RC
float_validation_handler(leaf_t *leaf, char *value_passed);
CLI_VAL_RC
boolean_validation_handler(leaf_t *leaf, char *value_passed);
int
enable_disable_validation_handler(char *value_passed);
int
grep_pattern_validation(char *value_passed);
/* Default command handlers */
int
config_console_name_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
repeat_last_command(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
mode_enter_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
display_sub_options_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
display_cmd_expansion_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
show_history_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
clear_screen_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
exit_cmd_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
end_cmd_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
config_mode_enter_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
negate_callback(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
supportsave_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
cli_terminate_handler (param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
show_help_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
show_resgistered_cmd_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
show_cmd_tree(param_t *param, ser_buff_t *tlv_buf, op_mode enable_or_disable);
void
record_command(char *hist_file, char *cons_input_buffer, unsigned int cmd_len);
int
show_extension_param_handler(param_t *param, ser_buff_t *b, op_mode enable_or_disable);
int
pipe_handler (param_t *param, ser_buff_t *b, op_mode enable_or_disable);
#endif /* __CLISTD__ */