/src/frr/lib/routemap_clippy.c
Line | Count | Source |
1 | | /* rmap_clear_counters => "clear route-map counters [RMAP_NAME$rmapname]" */ |
2 | | DEFUN_CMD_FUNC_DECL(rmap_clear_counters) |
3 | | #define funcdecl_rmap_clear_counters static int rmap_clear_counters_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 * rmapname) |
9 | | funcdecl_rmap_clear_counters; |
10 | | DEFUN_CMD_FUNC_TEXT(rmap_clear_counters) |
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 *rmapname = 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, "rmapname")) { |
27 | 0 | rmapname = (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 rmap_clear_counters_magic(self, vty, argc, argv, rmapname); |
43 | 0 | } |
44 | | |
45 | | /* debug_rmap => "debug route-map [detail]$detail" */ |
46 | | DEFUN_CMD_FUNC_DECL(debug_rmap) |
47 | | #define funcdecl_debug_rmap static int debug_rmap_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 * detail) |
53 | | funcdecl_debug_rmap; |
54 | | DEFUN_CMD_FUNC_TEXT(debug_rmap) |
55 | 0 | { |
56 | 0 | #if 1 /* anything to parse? */ |
57 | 0 | int _i; |
58 | | #if 0 /* anything that can fail? */ |
59 | | unsigned _fail = 0, _failcnt = 0; |
60 | | #endif |
61 | 0 | const char *detail = NULL; |
62 | |
|
63 | 0 | for (_i = 0; _i < argc; _i++) { |
64 | 0 | if (!argv[_i]->varname) |
65 | 0 | continue; |
66 | | #if 0 /* anything that can fail? */ |
67 | | _fail = 0; |
68 | | #endif |
69 | | |
70 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
71 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
72 | 0 | } |
73 | | #if 0 /* anything that can fail? */ |
74 | | if (_fail) |
75 | | vty_out (vty, "%% invalid input for %s: %s\n", |
76 | | argv[_i]->varname, argv[_i]->arg); |
77 | | _failcnt += _fail; |
78 | | #endif |
79 | 0 | } |
80 | | #if 0 /* anything that can fail? */ |
81 | | if (_failcnt) |
82 | | return CMD_WARNING; |
83 | | #endif |
84 | 0 | #endif |
85 | |
|
86 | 0 | return debug_rmap_magic(self, vty, argc, argv, detail); |
87 | 0 | } |
88 | | |
89 | | /* no_debug_rmap => "no debug route-map [detail]$detail" */ |
90 | | DEFUN_CMD_FUNC_DECL(no_debug_rmap) |
91 | | #define funcdecl_no_debug_rmap static int no_debug_rmap_magic(\ |
92 | | const struct cmd_element *self __attribute__ ((unused)),\ |
93 | | struct vty *vty __attribute__ ((unused)),\ |
94 | | int argc __attribute__ ((unused)),\ |
95 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
96 | | const char * detail) |
97 | | funcdecl_no_debug_rmap; |
98 | | DEFUN_CMD_FUNC_TEXT(no_debug_rmap) |
99 | 0 | { |
100 | 0 | #if 1 /* anything to parse? */ |
101 | 0 | int _i; |
102 | | #if 0 /* anything that can fail? */ |
103 | | unsigned _fail = 0, _failcnt = 0; |
104 | | #endif |
105 | 0 | const char *detail = NULL; |
106 | |
|
107 | 0 | for (_i = 0; _i < argc; _i++) { |
108 | 0 | if (!argv[_i]->varname) |
109 | 0 | continue; |
110 | | #if 0 /* anything that can fail? */ |
111 | | _fail = 0; |
112 | | #endif |
113 | | |
114 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
115 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
116 | 0 | } |
117 | | #if 0 /* anything that can fail? */ |
118 | | if (_fail) |
119 | | vty_out (vty, "%% invalid input for %s: %s\n", |
120 | | argv[_i]->varname, argv[_i]->arg); |
121 | | _failcnt += _fail; |
122 | | #endif |
123 | 0 | } |
124 | | #if 0 /* anything that can fail? */ |
125 | | if (_failcnt) |
126 | | return CMD_WARNING; |
127 | | #endif |
128 | 0 | #endif |
129 | |
|
130 | 0 | return no_debug_rmap_magic(self, vty, argc, argv, detail); |
131 | 0 | } |
132 | | |