/src/frr/zebra/zebra_mlag_vty_clippy.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* test_mlag => "test zebra mlag <none$none|primary$primary|secondary$secondary>" */ |
2 | | DEFUN_CMD_FUNC_DECL(test_mlag) |
3 | | #define funcdecl_test_mlag static int test_mlag_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 * none,\ |
9 | | const char * primary,\ |
10 | | const char * secondary) |
11 | | funcdecl_test_mlag; |
12 | | DEFUN_CMD_FUNC_TEXT(test_mlag) |
13 | 0 | { |
14 | 0 | #if 3 /* anything to parse? */ |
15 | 0 | int _i; |
16 | | #if 0 /* anything that can fail? */ |
17 | | unsigned _fail = 0, _failcnt = 0; |
18 | | #endif |
19 | 0 | const char *none = NULL; |
20 | 0 | const char *primary = NULL; |
21 | 0 | const char *secondary = NULL; |
22 | |
|
23 | 0 | for (_i = 0; _i < argc; _i++) { |
24 | 0 | if (!argv[_i]->varname) |
25 | 0 | continue; |
26 | | #if 0 /* anything that can fail? */ |
27 | | _fail = 0; |
28 | | #endif |
29 | | |
30 | 0 | if (!strcmp(argv[_i]->varname, "none")) { |
31 | 0 | none = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
32 | 0 | } |
33 | 0 | if (!strcmp(argv[_i]->varname, "primary")) { |
34 | 0 | primary = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
35 | 0 | } |
36 | 0 | if (!strcmp(argv[_i]->varname, "secondary")) { |
37 | 0 | secondary = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
38 | 0 | } |
39 | | #if 0 /* anything that can fail? */ |
40 | | if (_fail) |
41 | | vty_out (vty, "%% invalid input for %s: %s\n", |
42 | | argv[_i]->varname, argv[_i]->arg); |
43 | | _failcnt += _fail; |
44 | | #endif |
45 | 0 | } |
46 | | #if 0 /* anything that can fail? */ |
47 | | if (_failcnt) |
48 | | return CMD_WARNING; |
49 | | #endif |
50 | 0 | #endif |
51 | |
|
52 | 0 | return test_mlag_magic(self, vty, argc, argv, none, primary, secondary); |
53 | 0 | } |
54 | | |