/src/frr/lib/event_clippy.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* service_cputime_stats => "[no] service cputime-stats" */ |
2 | | DEFUN_CMD_FUNC_DECL(service_cputime_stats) |
3 | | #define funcdecl_service_cputime_stats static int service_cputime_stats_magic(\ |
4 | | const struct cmd_element *self __attribute__ ((unused)),\ |
5 | | struct vty *vty __attribute__ ((unused)),\ |
6 | | int argc __attribute__ ((unused)),\ |
7 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
8 | | const char * no) |
9 | | funcdecl_service_cputime_stats; |
10 | | DEFUN_CMD_FUNC_TEXT(service_cputime_stats) |
11 | 0 | { |
12 | 0 | #if 1 /* anything to parse? */ |
13 | 0 | int _i; |
14 | | #if 0 /* anything that can fail? */ |
15 | | unsigned _fail = 0, _failcnt = 0; |
16 | | #endif |
17 | 0 | const char *no = NULL; |
18 | |
|
19 | 0 | for (_i = 0; _i < argc; _i++) { |
20 | 0 | if (!argv[_i]->varname) |
21 | 0 | continue; |
22 | | #if 0 /* anything that can fail? */ |
23 | | _fail = 0; |
24 | | #endif |
25 | | |
26 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
27 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
28 | 0 | } |
29 | | #if 0 /* anything that can fail? */ |
30 | | if (_fail) |
31 | | vty_out (vty, "%% invalid input for %s: %s\n", |
32 | | argv[_i]->varname, argv[_i]->arg); |
33 | | _failcnt += _fail; |
34 | | #endif |
35 | 0 | } |
36 | | #if 0 /* anything that can fail? */ |
37 | | if (_failcnt) |
38 | | return CMD_WARNING; |
39 | | #endif |
40 | 0 | #endif |
41 | |
|
42 | 0 | return service_cputime_stats_magic(self, vty, argc, argv, no); |
43 | 0 | } |
44 | | |
45 | | /* service_cputime_warning => "[no] service cputime-warning ![(1-4294967295)]" */ |
46 | | DEFUN_CMD_FUNC_DECL(service_cputime_warning) |
47 | | #define funcdecl_service_cputime_warning static int service_cputime_warning_magic(\ |
48 | | const struct cmd_element *self __attribute__ ((unused)),\ |
49 | | struct vty *vty __attribute__ ((unused)),\ |
50 | | int argc __attribute__ ((unused)),\ |
51 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
52 | | const char * no,\ |
53 | | long cputime_warning,\ |
54 | | const char * cputime_warning_str __attribute__ ((unused))) |
55 | | funcdecl_service_cputime_warning; |
56 | | DEFUN_CMD_FUNC_TEXT(service_cputime_warning) |
57 | 0 | { |
58 | 0 | #if 2 /* anything to parse? */ |
59 | 0 | int _i; |
60 | 0 | #if 1 /* anything that can fail? */ |
61 | 0 | unsigned _fail = 0, _failcnt = 0; |
62 | 0 | #endif |
63 | 0 | const char *no = NULL; |
64 | 0 | long cputime_warning = 0; |
65 | 0 | const char *cputime_warning_str = NULL; |
66 | |
|
67 | 0 | for (_i = 0; _i < argc; _i++) { |
68 | 0 | if (!argv[_i]->varname) |
69 | 0 | continue; |
70 | 0 | #if 1 /* anything that can fail? */ |
71 | 0 | _fail = 0; |
72 | 0 | #endif |
73 | |
|
74 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
75 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
76 | 0 | } |
77 | 0 | if (!strcmp(argv[_i]->varname, "cputime_warning")) { |
78 | 0 | cputime_warning_str = argv[_i]->arg; |
79 | 0 | char *_end; |
80 | 0 | cputime_warning = strtol(argv[_i]->arg, &_end, 10); |
81 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
82 | 0 | } |
83 | 0 | #if 1 /* anything that can fail? */ |
84 | 0 | if (_fail) |
85 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
86 | 0 | argv[_i]->varname, argv[_i]->arg); |
87 | 0 | _failcnt += _fail; |
88 | 0 | #endif |
89 | 0 | } |
90 | 0 | #if 1 /* anything that can fail? */ |
91 | 0 | if (_failcnt) |
92 | 0 | return CMD_WARNING; |
93 | 0 | #endif |
94 | 0 | #endif |
95 | | |
96 | 0 | return service_cputime_warning_magic(self, vty, argc, argv, no, cputime_warning, cputime_warning_str); |
97 | 0 | } |
98 | | |
99 | | /* service_walltime_warning => "[no] service walltime-warning ![(1-4294967295)]" */ |
100 | | DEFUN_CMD_FUNC_DECL(service_walltime_warning) |
101 | | #define funcdecl_service_walltime_warning static int service_walltime_warning_magic(\ |
102 | | const struct cmd_element *self __attribute__ ((unused)),\ |
103 | | struct vty *vty __attribute__ ((unused)),\ |
104 | | int argc __attribute__ ((unused)),\ |
105 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
106 | | const char * no,\ |
107 | | long walltime_warning,\ |
108 | | const char * walltime_warning_str __attribute__ ((unused))) |
109 | | funcdecl_service_walltime_warning; |
110 | | DEFUN_CMD_FUNC_TEXT(service_walltime_warning) |
111 | 0 | { |
112 | 0 | #if 2 /* anything to parse? */ |
113 | 0 | int _i; |
114 | 0 | #if 1 /* anything that can fail? */ |
115 | 0 | unsigned _fail = 0, _failcnt = 0; |
116 | 0 | #endif |
117 | 0 | const char *no = NULL; |
118 | 0 | long walltime_warning = 0; |
119 | 0 | const char *walltime_warning_str = NULL; |
120 | |
|
121 | 0 | for (_i = 0; _i < argc; _i++) { |
122 | 0 | if (!argv[_i]->varname) |
123 | 0 | continue; |
124 | 0 | #if 1 /* anything that can fail? */ |
125 | 0 | _fail = 0; |
126 | 0 | #endif |
127 | |
|
128 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
129 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
130 | 0 | } |
131 | 0 | if (!strcmp(argv[_i]->varname, "walltime_warning")) { |
132 | 0 | walltime_warning_str = argv[_i]->arg; |
133 | 0 | char *_end; |
134 | 0 | walltime_warning = strtol(argv[_i]->arg, &_end, 10); |
135 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
136 | 0 | } |
137 | 0 | #if 1 /* anything that can fail? */ |
138 | 0 | if (_fail) |
139 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
140 | 0 | argv[_i]->varname, argv[_i]->arg); |
141 | 0 | _failcnt += _fail; |
142 | 0 | #endif |
143 | 0 | } |
144 | 0 | #if 1 /* anything that can fail? */ |
145 | 0 | if (_failcnt) |
146 | 0 | return CMD_WARNING; |
147 | 0 | #endif |
148 | 0 | #endif |
149 | | |
150 | 0 | return service_walltime_warning_magic(self, vty, argc, argv, no, walltime_warning, walltime_warning_str); |
151 | 0 | } |
152 | | |
153 | | /* show_thread_timers => "show thread timers" */ |
154 | | DEFUN_CMD_FUNC_DECL(show_thread_timers) |
155 | | #define funcdecl_show_thread_timers static int show_thread_timers_magic(\ |
156 | | const struct cmd_element *self __attribute__ ((unused)),\ |
157 | | struct vty *vty __attribute__ ((unused)),\ |
158 | | int argc __attribute__ ((unused)),\ |
159 | | struct cmd_token *argv[] __attribute__ ((unused))) |
160 | | funcdecl_show_thread_timers; |
161 | | DEFUN_CMD_FUNC_TEXT(show_thread_timers) |
162 | 0 | { |
163 | | #if 0 /* anything to parse? */ |
164 | | int _i; |
165 | | #if 0 /* anything that can fail? */ |
166 | | unsigned _fail = 0, _failcnt = 0; |
167 | | #endif |
168 | | |
169 | | for (_i = 0; _i < argc; _i++) { |
170 | | if (!argv[_i]->varname) |
171 | | continue; |
172 | | #if 0 /* anything that can fail? */ |
173 | | _fail = 0; |
174 | | #endif |
175 | | |
176 | | #if 0 /* anything that can fail? */ |
177 | | if (_fail) |
178 | | vty_out (vty, "%% invalid input for %s: %s\n", |
179 | | argv[_i]->varname, argv[_i]->arg); |
180 | | _failcnt += _fail; |
181 | | #endif |
182 | | } |
183 | | #if 0 /* anything that can fail? */ |
184 | | if (_failcnt) |
185 | | return CMD_WARNING; |
186 | | #endif |
187 | | #endif |
188 | |
|
189 | 0 | return show_thread_timers_magic(self, vty, argc, argv); |
190 | 0 | } |
191 | | |