/src/frr/lib/zlog_5424_cli_clippy.c
Line | Count | Source |
1 | | /* log_5424_target => "log extended-syslog EXTLOGNAME" */ |
2 | | DEFUN_CMD_FUNC_DECL(log_5424_target) |
3 | | #define funcdecl_log_5424_target static int log_5424_target_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 * extlogname) |
9 | | funcdecl_log_5424_target; |
10 | | DEFUN_CMD_FUNC_TEXT(log_5424_target) |
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 *extlogname = 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, "extlogname")) { |
27 | 0 | extlogname = (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 | 0 | if (!extlogname) { |
42 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "extlogname"); |
43 | 0 | return CMD_WARNING; |
44 | 0 | } |
45 | | |
46 | 0 | return log_5424_target_magic(self, vty, argc, argv, extlogname); |
47 | 0 | } |
48 | | |
49 | | /* no_log_5424_target => "no log extended-syslog EXTLOGNAME" */ |
50 | | DEFUN_CMD_FUNC_DECL(no_log_5424_target) |
51 | | #define funcdecl_no_log_5424_target static int no_log_5424_target_magic(\ |
52 | | const struct cmd_element *self __attribute__ ((unused)),\ |
53 | | struct vty *vty __attribute__ ((unused)),\ |
54 | | int argc __attribute__ ((unused)),\ |
55 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
56 | | const char * extlogname) |
57 | | funcdecl_no_log_5424_target; |
58 | | DEFUN_CMD_FUNC_TEXT(no_log_5424_target) |
59 | 0 | { |
60 | 0 | #if 1 /* anything to parse? */ |
61 | 0 | int _i; |
62 | | #if 0 /* anything that can fail? */ |
63 | | unsigned _fail = 0, _failcnt = 0; |
64 | | #endif |
65 | 0 | const char *extlogname = NULL; |
66 | |
|
67 | 0 | for (_i = 0; _i < argc; _i++) { |
68 | 0 | if (!argv[_i]->varname) |
69 | 0 | continue; |
70 | | #if 0 /* anything that can fail? */ |
71 | | _fail = 0; |
72 | | #endif |
73 | | |
74 | 0 | if (!strcmp(argv[_i]->varname, "extlogname")) { |
75 | 0 | extlogname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
76 | 0 | } |
77 | | #if 0 /* anything that can fail? */ |
78 | | if (_fail) |
79 | | vty_out (vty, "%% invalid input for %s: %s\n", |
80 | | argv[_i]->varname, argv[_i]->arg); |
81 | | _failcnt += _fail; |
82 | | #endif |
83 | 0 | } |
84 | | #if 0 /* anything that can fail? */ |
85 | | if (_failcnt) |
86 | | return CMD_WARNING; |
87 | | #endif |
88 | 0 | #endif |
89 | 0 | if (!extlogname) { |
90 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "extlogname"); |
91 | 0 | return CMD_WARNING; |
92 | 0 | } |
93 | | |
94 | 0 | return no_log_5424_target_magic(self, vty, argc, argv, extlogname); |
95 | 0 | } |
96 | | |
97 | | /* log_5424_destination_file => "[no] destination file$type PATH [create$create [{user WORD|group WORD|mode PERMS}]|no-create$nocreate] [format <rfc3164|rfc5424|local-syslogd|journald>$fmt]" */ |
98 | | DEFUN_CMD_FUNC_DECL(log_5424_destination_file) |
99 | | #define funcdecl_log_5424_destination_file static int log_5424_destination_file_magic(\ |
100 | | const struct cmd_element *self __attribute__ ((unused)),\ |
101 | | struct vty *vty __attribute__ ((unused)),\ |
102 | | int argc __attribute__ ((unused)),\ |
103 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
104 | | const char * no,\ |
105 | | const char * type,\ |
106 | | const char * path,\ |
107 | | const char * create,\ |
108 | | const char * user,\ |
109 | | const char * group,\ |
110 | | const char * perms,\ |
111 | | const char * nocreate,\ |
112 | | const char * fmt) |
113 | | funcdecl_log_5424_destination_file; |
114 | | DEFUN_CMD_FUNC_TEXT(log_5424_destination_file) |
115 | 0 | { |
116 | 0 | #if 9 /* anything to parse? */ |
117 | 0 | int _i; |
118 | | #if 0 /* anything that can fail? */ |
119 | | unsigned _fail = 0, _failcnt = 0; |
120 | | #endif |
121 | 0 | const char *no = NULL; |
122 | 0 | const char *type = NULL; |
123 | 0 | const char *path = NULL; |
124 | 0 | const char *create = NULL; |
125 | 0 | const char *user = NULL; |
126 | 0 | const char *group = NULL; |
127 | 0 | const char *perms = NULL; |
128 | 0 | const char *nocreate = NULL; |
129 | 0 | const char *fmt = NULL; |
130 | |
|
131 | 0 | for (_i = 0; _i < argc; _i++) { |
132 | 0 | if (!argv[_i]->varname) |
133 | 0 | continue; |
134 | | #if 0 /* anything that can fail? */ |
135 | | _fail = 0; |
136 | | #endif |
137 | | |
138 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
139 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
140 | 0 | } |
141 | 0 | if (!strcmp(argv[_i]->varname, "type")) { |
142 | 0 | type = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
143 | 0 | } |
144 | 0 | if (!strcmp(argv[_i]->varname, "path")) { |
145 | 0 | path = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
146 | 0 | } |
147 | 0 | if (!strcmp(argv[_i]->varname, "create")) { |
148 | 0 | create = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
149 | 0 | } |
150 | 0 | if (!strcmp(argv[_i]->varname, "user")) { |
151 | 0 | user = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
152 | 0 | } |
153 | 0 | if (!strcmp(argv[_i]->varname, "group")) { |
154 | 0 | group = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
155 | 0 | } |
156 | 0 | if (!strcmp(argv[_i]->varname, "perms")) { |
157 | 0 | perms = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
158 | 0 | } |
159 | 0 | if (!strcmp(argv[_i]->varname, "nocreate")) { |
160 | 0 | nocreate = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
161 | 0 | } |
162 | 0 | if (!strcmp(argv[_i]->varname, "fmt")) { |
163 | 0 | fmt = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
164 | 0 | } |
165 | | #if 0 /* anything that can fail? */ |
166 | | if (_fail) |
167 | | vty_out (vty, "%% invalid input for %s: %s\n", |
168 | | argv[_i]->varname, argv[_i]->arg); |
169 | | _failcnt += _fail; |
170 | | #endif |
171 | 0 | } |
172 | | #if 0 /* anything that can fail? */ |
173 | | if (_failcnt) |
174 | | return CMD_WARNING; |
175 | | #endif |
176 | 0 | #endif |
177 | 0 | if (!type) { |
178 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "type"); |
179 | 0 | return CMD_WARNING; |
180 | 0 | } |
181 | 0 | if (!path) { |
182 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "path"); |
183 | 0 | return CMD_WARNING; |
184 | 0 | } |
185 | | |
186 | 0 | return log_5424_destination_file_magic(self, vty, argc, argv, no, type, path, create, user, group, perms, nocreate, fmt); |
187 | 0 | } |
188 | | |
189 | | /* log_5424_destination_unix => "[no] destination unix PATH [format <rfc3164|rfc5424|local-syslogd|journald>$fmt]" */ |
190 | | DEFUN_CMD_FUNC_DECL(log_5424_destination_unix) |
191 | | #define funcdecl_log_5424_destination_unix static int log_5424_destination_unix_magic(\ |
192 | | const struct cmd_element *self __attribute__ ((unused)),\ |
193 | | struct vty *vty __attribute__ ((unused)),\ |
194 | | int argc __attribute__ ((unused)),\ |
195 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
196 | | const char * no,\ |
197 | | const char * path,\ |
198 | | const char * fmt) |
199 | | funcdecl_log_5424_destination_unix; |
200 | | DEFUN_CMD_FUNC_TEXT(log_5424_destination_unix) |
201 | 0 | { |
202 | 0 | #if 3 /* anything to parse? */ |
203 | 0 | int _i; |
204 | | #if 0 /* anything that can fail? */ |
205 | | unsigned _fail = 0, _failcnt = 0; |
206 | | #endif |
207 | 0 | const char *no = NULL; |
208 | 0 | const char *path = NULL; |
209 | 0 | const char *fmt = NULL; |
210 | |
|
211 | 0 | for (_i = 0; _i < argc; _i++) { |
212 | 0 | if (!argv[_i]->varname) |
213 | 0 | continue; |
214 | | #if 0 /* anything that can fail? */ |
215 | | _fail = 0; |
216 | | #endif |
217 | | |
218 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
219 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
220 | 0 | } |
221 | 0 | if (!strcmp(argv[_i]->varname, "path")) { |
222 | 0 | path = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
223 | 0 | } |
224 | 0 | if (!strcmp(argv[_i]->varname, "fmt")) { |
225 | 0 | fmt = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
226 | 0 | } |
227 | | #if 0 /* anything that can fail? */ |
228 | | if (_fail) |
229 | | vty_out (vty, "%% invalid input for %s: %s\n", |
230 | | argv[_i]->varname, argv[_i]->arg); |
231 | | _failcnt += _fail; |
232 | | #endif |
233 | 0 | } |
234 | | #if 0 /* anything that can fail? */ |
235 | | if (_failcnt) |
236 | | return CMD_WARNING; |
237 | | #endif |
238 | 0 | #endif |
239 | 0 | if (!path) { |
240 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "path"); |
241 | 0 | return CMD_WARNING; |
242 | 0 | } |
243 | | |
244 | 0 | return log_5424_destination_unix_magic(self, vty, argc, argv, no, path, fmt); |
245 | 0 | } |
246 | | |
247 | | /* log_5424_destination_journald => "[no] destination journald" */ |
248 | | DEFUN_CMD_FUNC_DECL(log_5424_destination_journald) |
249 | | #define funcdecl_log_5424_destination_journald static int log_5424_destination_journald_magic(\ |
250 | | const struct cmd_element *self __attribute__ ((unused)),\ |
251 | | struct vty *vty __attribute__ ((unused)),\ |
252 | | int argc __attribute__ ((unused)),\ |
253 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
254 | | const char * no) |
255 | | funcdecl_log_5424_destination_journald; |
256 | | DEFUN_CMD_FUNC_TEXT(log_5424_destination_journald) |
257 | 0 | { |
258 | 0 | #if 1 /* anything to parse? */ |
259 | 0 | int _i; |
260 | | #if 0 /* anything that can fail? */ |
261 | | unsigned _fail = 0, _failcnt = 0; |
262 | | #endif |
263 | 0 | const char *no = NULL; |
264 | |
|
265 | 0 | for (_i = 0; _i < argc; _i++) { |
266 | 0 | if (!argv[_i]->varname) |
267 | 0 | continue; |
268 | | #if 0 /* anything that can fail? */ |
269 | | _fail = 0; |
270 | | #endif |
271 | | |
272 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
273 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
274 | 0 | } |
275 | | #if 0 /* anything that can fail? */ |
276 | | if (_fail) |
277 | | vty_out (vty, "%% invalid input for %s: %s\n", |
278 | | argv[_i]->varname, argv[_i]->arg); |
279 | | _failcnt += _fail; |
280 | | #endif |
281 | 0 | } |
282 | | #if 0 /* anything that can fail? */ |
283 | | if (_failcnt) |
284 | | return CMD_WARNING; |
285 | | #endif |
286 | 0 | #endif |
287 | |
|
288 | 0 | return log_5424_destination_journald_magic(self, vty, argc, argv, no); |
289 | 0 | } |
290 | | |
291 | | /* log_5424_destination_syslog => "[no] destination syslog [supports-rfc5424]$supp5424" */ |
292 | | DEFUN_CMD_FUNC_DECL(log_5424_destination_syslog) |
293 | | #define funcdecl_log_5424_destination_syslog static int log_5424_destination_syslog_magic(\ |
294 | | const struct cmd_element *self __attribute__ ((unused)),\ |
295 | | struct vty *vty __attribute__ ((unused)),\ |
296 | | int argc __attribute__ ((unused)),\ |
297 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
298 | | const char * no,\ |
299 | | const char * supp5424) |
300 | | funcdecl_log_5424_destination_syslog; |
301 | | DEFUN_CMD_FUNC_TEXT(log_5424_destination_syslog) |
302 | 0 | { |
303 | 0 | #if 2 /* anything to parse? */ |
304 | 0 | int _i; |
305 | | #if 0 /* anything that can fail? */ |
306 | | unsigned _fail = 0, _failcnt = 0; |
307 | | #endif |
308 | 0 | const char *no = NULL; |
309 | 0 | const char *supp5424 = NULL; |
310 | |
|
311 | 0 | for (_i = 0; _i < argc; _i++) { |
312 | 0 | if (!argv[_i]->varname) |
313 | 0 | continue; |
314 | | #if 0 /* anything that can fail? */ |
315 | | _fail = 0; |
316 | | #endif |
317 | | |
318 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
319 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
320 | 0 | } |
321 | 0 | if (!strcmp(argv[_i]->varname, "supp5424")) { |
322 | 0 | supp5424 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
323 | 0 | } |
324 | | #if 0 /* anything that can fail? */ |
325 | | if (_fail) |
326 | | vty_out (vty, "%% invalid input for %s: %s\n", |
327 | | argv[_i]->varname, argv[_i]->arg); |
328 | | _failcnt += _fail; |
329 | | #endif |
330 | 0 | } |
331 | | #if 0 /* anything that can fail? */ |
332 | | if (_failcnt) |
333 | | return CMD_WARNING; |
334 | | #endif |
335 | 0 | #endif |
336 | |
|
337 | 0 | return log_5424_destination_syslog_magic(self, vty, argc, argv, no, supp5424); |
338 | 0 | } |
339 | | |
340 | | /* log_5424_destination_fd => "[no] destination <fd <(0-63)$fd|envvar WORD>|stdout$fd1|stderr$fd2>[format <rfc3164|rfc5424|local-syslogd|journald>$fmt]" */ |
341 | | DEFUN_CMD_FUNC_DECL(log_5424_destination_fd) |
342 | | #define funcdecl_log_5424_destination_fd static int log_5424_destination_fd_magic(\ |
343 | | const struct cmd_element *self __attribute__ ((unused)),\ |
344 | | struct vty *vty __attribute__ ((unused)),\ |
345 | | int argc __attribute__ ((unused)),\ |
346 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
347 | | const char * no,\ |
348 | | long fd,\ |
349 | | const char * fd_str __attribute__ ((unused)),\ |
350 | | const char * envvar,\ |
351 | | const char * fd1,\ |
352 | | const char * fd2,\ |
353 | | const char * fmt) |
354 | | funcdecl_log_5424_destination_fd; |
355 | | DEFUN_CMD_FUNC_TEXT(log_5424_destination_fd) |
356 | 0 | { |
357 | 0 | #if 6 /* anything to parse? */ |
358 | 0 | int _i; |
359 | 0 | #if 1 /* anything that can fail? */ |
360 | 0 | unsigned _fail = 0, _failcnt = 0; |
361 | 0 | #endif |
362 | 0 | const char *no = NULL; |
363 | 0 | long fd = 0; |
364 | 0 | const char *fd_str = NULL; |
365 | 0 | const char *envvar = NULL; |
366 | 0 | const char *fd1 = NULL; |
367 | 0 | const char *fd2 = NULL; |
368 | 0 | const char *fmt = NULL; |
369 | |
|
370 | 0 | for (_i = 0; _i < argc; _i++) { |
371 | 0 | if (!argv[_i]->varname) |
372 | 0 | continue; |
373 | 0 | #if 1 /* anything that can fail? */ |
374 | 0 | _fail = 0; |
375 | 0 | #endif |
376 | |
|
377 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
378 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
379 | 0 | } |
380 | 0 | if (!strcmp(argv[_i]->varname, "fd")) { |
381 | 0 | fd_str = argv[_i]->arg; |
382 | 0 | char *_end; |
383 | 0 | fd = strtol(argv[_i]->arg, &_end, 10); |
384 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
385 | 0 | } |
386 | 0 | if (!strcmp(argv[_i]->varname, "envvar")) { |
387 | 0 | envvar = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
388 | 0 | } |
389 | 0 | if (!strcmp(argv[_i]->varname, "fd1")) { |
390 | 0 | fd1 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
391 | 0 | } |
392 | 0 | if (!strcmp(argv[_i]->varname, "fd2")) { |
393 | 0 | fd2 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
394 | 0 | } |
395 | 0 | if (!strcmp(argv[_i]->varname, "fmt")) { |
396 | 0 | fmt = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
397 | 0 | } |
398 | 0 | #if 1 /* anything that can fail? */ |
399 | 0 | if (_fail) |
400 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
401 | 0 | argv[_i]->varname, argv[_i]->arg); |
402 | 0 | _failcnt += _fail; |
403 | 0 | #endif |
404 | 0 | } |
405 | 0 | #if 1 /* anything that can fail? */ |
406 | 0 | if (_failcnt) |
407 | 0 | return CMD_WARNING; |
408 | 0 | #endif |
409 | 0 | #endif |
410 | | |
411 | 0 | return log_5424_destination_fd_magic(self, vty, argc, argv, no, fd, fd_str, envvar, fd1, fd2, fmt); |
412 | 0 | } |
413 | | |
414 | | /* log_5424_destination_none => "[no] destination [none]" */ |
415 | | DEFUN_CMD_FUNC_DECL(log_5424_destination_none) |
416 | | #define funcdecl_log_5424_destination_none static int log_5424_destination_none_magic(\ |
417 | | const struct cmd_element *self __attribute__ ((unused)),\ |
418 | | struct vty *vty __attribute__ ((unused)),\ |
419 | | int argc __attribute__ ((unused)),\ |
420 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
421 | | const char * no) |
422 | | funcdecl_log_5424_destination_none; |
423 | | DEFUN_CMD_FUNC_TEXT(log_5424_destination_none) |
424 | 0 | { |
425 | 0 | #if 1 /* anything to parse? */ |
426 | 0 | int _i; |
427 | | #if 0 /* anything that can fail? */ |
428 | | unsigned _fail = 0, _failcnt = 0; |
429 | | #endif |
430 | 0 | const char *no = NULL; |
431 | |
|
432 | 0 | for (_i = 0; _i < argc; _i++) { |
433 | 0 | if (!argv[_i]->varname) |
434 | 0 | continue; |
435 | | #if 0 /* anything that can fail? */ |
436 | | _fail = 0; |
437 | | #endif |
438 | | |
439 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
440 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
441 | 0 | } |
442 | | #if 0 /* anything that can fail? */ |
443 | | if (_fail) |
444 | | vty_out (vty, "%% invalid input for %s: %s\n", |
445 | | argv[_i]->varname, argv[_i]->arg); |
446 | | _failcnt += _fail; |
447 | | #endif |
448 | 0 | } |
449 | | #if 0 /* anything that can fail? */ |
450 | | if (_failcnt) |
451 | | return CMD_WARNING; |
452 | | #endif |
453 | 0 | #endif |
454 | |
|
455 | 0 | return log_5424_destination_none_magic(self, vty, argc, argv, no); |
456 | 0 | } |
457 | | |
458 | | /* log_5424_prio => "[no] priority <emergencies|alerts|critical|errors|warnings|notifications|informational|debugging>$levelarg" */ |
459 | | DEFUN_CMD_FUNC_DECL(log_5424_prio) |
460 | | #define funcdecl_log_5424_prio static int log_5424_prio_magic(\ |
461 | | const struct cmd_element *self __attribute__ ((unused)),\ |
462 | | struct vty *vty __attribute__ ((unused)),\ |
463 | | int argc __attribute__ ((unused)),\ |
464 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
465 | | const char * no,\ |
466 | | const char * levelarg) |
467 | | funcdecl_log_5424_prio; |
468 | | DEFUN_CMD_FUNC_TEXT(log_5424_prio) |
469 | 0 | { |
470 | 0 | #if 2 /* anything to parse? */ |
471 | 0 | int _i; |
472 | | #if 0 /* anything that can fail? */ |
473 | | unsigned _fail = 0, _failcnt = 0; |
474 | | #endif |
475 | 0 | const char *no = NULL; |
476 | 0 | const char *levelarg = NULL; |
477 | |
|
478 | 0 | for (_i = 0; _i < argc; _i++) { |
479 | 0 | if (!argv[_i]->varname) |
480 | 0 | continue; |
481 | | #if 0 /* anything that can fail? */ |
482 | | _fail = 0; |
483 | | #endif |
484 | | |
485 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
486 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
487 | 0 | } |
488 | 0 | if (!strcmp(argv[_i]->varname, "levelarg")) { |
489 | 0 | levelarg = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
490 | 0 | } |
491 | | #if 0 /* anything that can fail? */ |
492 | | if (_fail) |
493 | | vty_out (vty, "%% invalid input for %s: %s\n", |
494 | | argv[_i]->varname, argv[_i]->arg); |
495 | | _failcnt += _fail; |
496 | | #endif |
497 | 0 | } |
498 | | #if 0 /* anything that can fail? */ |
499 | | if (_failcnt) |
500 | | return CMD_WARNING; |
501 | | #endif |
502 | 0 | #endif |
503 | 0 | if (!levelarg) { |
504 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "levelarg"); |
505 | 0 | return CMD_WARNING; |
506 | 0 | } |
507 | | |
508 | 0 | return log_5424_prio_magic(self, vty, argc, argv, no, levelarg); |
509 | 0 | } |
510 | | |
511 | | /* log_5424_facility => "[no] facility <kern|user|mail|daemon|auth|syslog|lpr|news|uucp|cron|local0|local1|local2|local3|local4|local5|local6|local7>$facilityarg" */ |
512 | | DEFUN_CMD_FUNC_DECL(log_5424_facility) |
513 | | #define funcdecl_log_5424_facility static int log_5424_facility_magic(\ |
514 | | const struct cmd_element *self __attribute__ ((unused)),\ |
515 | | struct vty *vty __attribute__ ((unused)),\ |
516 | | int argc __attribute__ ((unused)),\ |
517 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
518 | | const char * no,\ |
519 | | const char * facilityarg) |
520 | | funcdecl_log_5424_facility; |
521 | | DEFUN_CMD_FUNC_TEXT(log_5424_facility) |
522 | 0 | { |
523 | 0 | #if 2 /* anything to parse? */ |
524 | 0 | int _i; |
525 | | #if 0 /* anything that can fail? */ |
526 | | unsigned _fail = 0, _failcnt = 0; |
527 | | #endif |
528 | 0 | const char *no = NULL; |
529 | 0 | const char *facilityarg = NULL; |
530 | |
|
531 | 0 | for (_i = 0; _i < argc; _i++) { |
532 | 0 | if (!argv[_i]->varname) |
533 | 0 | continue; |
534 | | #if 0 /* anything that can fail? */ |
535 | | _fail = 0; |
536 | | #endif |
537 | | |
538 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
539 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
540 | 0 | } |
541 | 0 | if (!strcmp(argv[_i]->varname, "facilityarg")) { |
542 | 0 | facilityarg = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
543 | 0 | } |
544 | | #if 0 /* anything that can fail? */ |
545 | | if (_fail) |
546 | | vty_out (vty, "%% invalid input for %s: %s\n", |
547 | | argv[_i]->varname, argv[_i]->arg); |
548 | | _failcnt += _fail; |
549 | | #endif |
550 | 0 | } |
551 | | #if 0 /* anything that can fail? */ |
552 | | if (_failcnt) |
553 | | return CMD_WARNING; |
554 | | #endif |
555 | 0 | #endif |
556 | 0 | if (!facilityarg) { |
557 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "facilityarg"); |
558 | 0 | return CMD_WARNING; |
559 | 0 | } |
560 | | |
561 | 0 | return log_5424_facility_magic(self, vty, argc, argv, no, facilityarg); |
562 | 0 | } |
563 | | |
564 | | /* log_5424_meta => "[no] structured-data <code-location|version|unique-id|error-category|format-args>$option" */ |
565 | | DEFUN_CMD_FUNC_DECL(log_5424_meta) |
566 | | #define funcdecl_log_5424_meta static int log_5424_meta_magic(\ |
567 | | const struct cmd_element *self __attribute__ ((unused)),\ |
568 | | struct vty *vty __attribute__ ((unused)),\ |
569 | | int argc __attribute__ ((unused)),\ |
570 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
571 | | const char * no,\ |
572 | | const char * option) |
573 | | funcdecl_log_5424_meta; |
574 | | DEFUN_CMD_FUNC_TEXT(log_5424_meta) |
575 | 0 | { |
576 | 0 | #if 2 /* anything to parse? */ |
577 | 0 | int _i; |
578 | | #if 0 /* anything that can fail? */ |
579 | | unsigned _fail = 0, _failcnt = 0; |
580 | | #endif |
581 | 0 | const char *no = NULL; |
582 | 0 | const char *option = NULL; |
583 | |
|
584 | 0 | for (_i = 0; _i < argc; _i++) { |
585 | 0 | if (!argv[_i]->varname) |
586 | 0 | continue; |
587 | | #if 0 /* anything that can fail? */ |
588 | | _fail = 0; |
589 | | #endif |
590 | | |
591 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
592 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
593 | 0 | } |
594 | 0 | if (!strcmp(argv[_i]->varname, "option")) { |
595 | 0 | option = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
596 | 0 | } |
597 | | #if 0 /* anything that can fail? */ |
598 | | if (_fail) |
599 | | vty_out (vty, "%% invalid input for %s: %s\n", |
600 | | argv[_i]->varname, argv[_i]->arg); |
601 | | _failcnt += _fail; |
602 | | #endif |
603 | 0 | } |
604 | | #if 0 /* anything that can fail? */ |
605 | | if (_failcnt) |
606 | | return CMD_WARNING; |
607 | | #endif |
608 | 0 | #endif |
609 | 0 | if (!option) { |
610 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "option"); |
611 | 0 | return CMD_WARNING; |
612 | 0 | } |
613 | | |
614 | 0 | return log_5424_meta_magic(self, vty, argc, argv, no, option); |
615 | 0 | } |
616 | | |
617 | | /* log_5424_ts_prec => "[no] timestamp precision (0-9)" */ |
618 | | DEFUN_CMD_FUNC_DECL(log_5424_ts_prec) |
619 | | #define funcdecl_log_5424_ts_prec static int log_5424_ts_prec_magic(\ |
620 | | const struct cmd_element *self __attribute__ ((unused)),\ |
621 | | struct vty *vty __attribute__ ((unused)),\ |
622 | | int argc __attribute__ ((unused)),\ |
623 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
624 | | const char * no,\ |
625 | | long precision,\ |
626 | | const char * precision_str __attribute__ ((unused))) |
627 | | funcdecl_log_5424_ts_prec; |
628 | | DEFUN_CMD_FUNC_TEXT(log_5424_ts_prec) |
629 | 0 | { |
630 | 0 | #if 2 /* anything to parse? */ |
631 | 0 | int _i; |
632 | 0 | #if 1 /* anything that can fail? */ |
633 | 0 | unsigned _fail = 0, _failcnt = 0; |
634 | 0 | #endif |
635 | 0 | const char *no = NULL; |
636 | 0 | long precision = 0; |
637 | 0 | const char *precision_str = NULL; |
638 | |
|
639 | 0 | for (_i = 0; _i < argc; _i++) { |
640 | 0 | if (!argv[_i]->varname) |
641 | 0 | continue; |
642 | 0 | #if 1 /* anything that can fail? */ |
643 | 0 | _fail = 0; |
644 | 0 | #endif |
645 | |
|
646 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
647 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
648 | 0 | } |
649 | 0 | if (!strcmp(argv[_i]->varname, "precision")) { |
650 | 0 | precision_str = argv[_i]->arg; |
651 | 0 | char *_end; |
652 | 0 | precision = strtol(argv[_i]->arg, &_end, 10); |
653 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
654 | 0 | } |
655 | 0 | #if 1 /* anything that can fail? */ |
656 | 0 | if (_fail) |
657 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
658 | 0 | argv[_i]->varname, argv[_i]->arg); |
659 | 0 | _failcnt += _fail; |
660 | 0 | #endif |
661 | 0 | } |
662 | 0 | #if 1 /* anything that can fail? */ |
663 | 0 | if (_failcnt) |
664 | 0 | return CMD_WARNING; |
665 | 0 | #endif |
666 | 0 | #endif |
667 | 0 | if (!precision_str) { |
668 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "precision_str"); |
669 | 0 | return CMD_WARNING; |
670 | 0 | } |
671 | | |
672 | 0 | return log_5424_ts_prec_magic(self, vty, argc, argv, no, precision, precision_str); |
673 | 0 | } |
674 | | |
675 | | /* log_5424_ts_local => "[no] timestamp local-time" */ |
676 | | DEFUN_CMD_FUNC_DECL(log_5424_ts_local) |
677 | | #define funcdecl_log_5424_ts_local static int log_5424_ts_local_magic(\ |
678 | | const struct cmd_element *self __attribute__ ((unused)),\ |
679 | | struct vty *vty __attribute__ ((unused)),\ |
680 | | int argc __attribute__ ((unused)),\ |
681 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
682 | | const char * no) |
683 | | funcdecl_log_5424_ts_local; |
684 | | DEFUN_CMD_FUNC_TEXT(log_5424_ts_local) |
685 | 0 | { |
686 | 0 | #if 1 /* anything to parse? */ |
687 | 0 | int _i; |
688 | | #if 0 /* anything that can fail? */ |
689 | | unsigned _fail = 0, _failcnt = 0; |
690 | | #endif |
691 | 0 | const char *no = NULL; |
692 | |
|
693 | 0 | for (_i = 0; _i < argc; _i++) { |
694 | 0 | if (!argv[_i]->varname) |
695 | 0 | continue; |
696 | | #if 0 /* anything that can fail? */ |
697 | | _fail = 0; |
698 | | #endif |
699 | | |
700 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
701 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
702 | 0 | } |
703 | | #if 0 /* anything that can fail? */ |
704 | | if (_fail) |
705 | | vty_out (vty, "%% invalid input for %s: %s\n", |
706 | | argv[_i]->varname, argv[_i]->arg); |
707 | | _failcnt += _fail; |
708 | | #endif |
709 | 0 | } |
710 | | #if 0 /* anything that can fail? */ |
711 | | if (_failcnt) |
712 | | return CMD_WARNING; |
713 | | #endif |
714 | 0 | #endif |
715 | |
|
716 | 0 | return log_5424_ts_local_magic(self, vty, argc, argv, no); |
717 | 0 | } |
718 | | |