/src/frr/zebra/zebra_vty_clippy.c
Line | Count | Source |
1 | | /* show_ip_rpf => "show [ip$ip|ipv6$ipv6] rpf [json]" */ |
2 | | DEFUN_CMD_FUNC_DECL(show_ip_rpf) |
3 | | #define funcdecl_show_ip_rpf static int show_ip_rpf_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 * ip,\ |
9 | | const char * ipv6) |
10 | | funcdecl_show_ip_rpf; |
11 | | DEFUN_CMD_FUNC_TEXT(show_ip_rpf) |
12 | 0 | { |
13 | 0 | #if 2 /* anything to parse? */ |
14 | 0 | int _i; |
15 | | #if 0 /* anything that can fail? */ |
16 | | unsigned _fail = 0, _failcnt = 0; |
17 | | #endif |
18 | 0 | const char *ip = NULL; |
19 | 0 | const char *ipv6 = NULL; |
20 | |
|
21 | 0 | for (_i = 0; _i < argc; _i++) { |
22 | 0 | if (!argv[_i]->varname) |
23 | 0 | continue; |
24 | | #if 0 /* anything that can fail? */ |
25 | | _fail = 0; |
26 | | #endif |
27 | | |
28 | 0 | if (!strcmp(argv[_i]->varname, "ip")) { |
29 | 0 | ip = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
30 | 0 | } |
31 | 0 | if (!strcmp(argv[_i]->varname, "ipv6")) { |
32 | 0 | ipv6 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
33 | 0 | } |
34 | | #if 0 /* anything that can fail? */ |
35 | | if (_fail) |
36 | | vty_out (vty, "%% invalid input for %s: %s\n", |
37 | | argv[_i]->varname, argv[_i]->arg); |
38 | | _failcnt += _fail; |
39 | | #endif |
40 | 0 | } |
41 | | #if 0 /* anything that can fail? */ |
42 | | if (_failcnt) |
43 | | return CMD_WARNING; |
44 | | #endif |
45 | 0 | #endif |
46 | |
|
47 | 0 | return show_ip_rpf_magic(self, vty, argc, argv, ip, ipv6); |
48 | 0 | } |
49 | | |
50 | | /* show_ip_rpf_addr => "show ip rpf A.B.C.D$address" */ |
51 | | DEFUN_CMD_FUNC_DECL(show_ip_rpf_addr) |
52 | | #define funcdecl_show_ip_rpf_addr static int show_ip_rpf_addr_magic(\ |
53 | | const struct cmd_element *self __attribute__ ((unused)),\ |
54 | | struct vty *vty __attribute__ ((unused)),\ |
55 | | int argc __attribute__ ((unused)),\ |
56 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
57 | | struct in_addr address,\ |
58 | | const char * address_str __attribute__ ((unused))) |
59 | | funcdecl_show_ip_rpf_addr; |
60 | | DEFUN_CMD_FUNC_TEXT(show_ip_rpf_addr) |
61 | 0 | { |
62 | 0 | #if 1 /* anything to parse? */ |
63 | 0 | int _i; |
64 | 0 | #if 1 /* anything that can fail? */ |
65 | 0 | unsigned _fail = 0, _failcnt = 0; |
66 | 0 | #endif |
67 | 0 | struct in_addr address = { INADDR_ANY }; |
68 | 0 | const char *address_str = NULL; |
69 | |
|
70 | 0 | for (_i = 0; _i < argc; _i++) { |
71 | 0 | if (!argv[_i]->varname) |
72 | 0 | continue; |
73 | 0 | #if 1 /* anything that can fail? */ |
74 | 0 | _fail = 0; |
75 | 0 | #endif |
76 | |
|
77 | 0 | if (!strcmp(argv[_i]->varname, "address")) { |
78 | 0 | address_str = argv[_i]->arg; |
79 | 0 | _fail = !inet_aton(argv[_i]->arg, &address); |
80 | 0 | } |
81 | 0 | #if 1 /* anything that can fail? */ |
82 | 0 | if (_fail) |
83 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
84 | 0 | argv[_i]->varname, argv[_i]->arg); |
85 | 0 | _failcnt += _fail; |
86 | 0 | #endif |
87 | 0 | } |
88 | 0 | #if 1 /* anything that can fail? */ |
89 | 0 | if (_failcnt) |
90 | 0 | return CMD_WARNING; |
91 | 0 | #endif |
92 | 0 | #endif |
93 | 0 | if (!address_str) { |
94 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "address_str"); |
95 | 0 | return CMD_WARNING; |
96 | 0 | } |
97 | | |
98 | 0 | return show_ip_rpf_addr_magic(self, vty, argc, argv, address, address_str); |
99 | 0 | } |
100 | | |
101 | | /* show_ipv6_rpf_addr => "show ipv6 rpf X:X::X:X$address" */ |
102 | | DEFUN_CMD_FUNC_DECL(show_ipv6_rpf_addr) |
103 | | #define funcdecl_show_ipv6_rpf_addr static int show_ipv6_rpf_addr_magic(\ |
104 | | const struct cmd_element *self __attribute__ ((unused)),\ |
105 | | struct vty *vty __attribute__ ((unused)),\ |
106 | | int argc __attribute__ ((unused)),\ |
107 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
108 | | struct in6_addr address,\ |
109 | | const char * address_str __attribute__ ((unused))) |
110 | | funcdecl_show_ipv6_rpf_addr; |
111 | | DEFUN_CMD_FUNC_TEXT(show_ipv6_rpf_addr) |
112 | 0 | { |
113 | 0 | #if 1 /* anything to parse? */ |
114 | 0 | int _i; |
115 | 0 | #if 1 /* anything that can fail? */ |
116 | 0 | unsigned _fail = 0, _failcnt = 0; |
117 | 0 | #endif |
118 | 0 | struct in6_addr address = {}; |
119 | 0 | const char *address_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, "address")) { |
129 | 0 | address_str = argv[_i]->arg; |
130 | 0 | _fail = !inet_pton(AF_INET6, argv[_i]->arg, &address); |
131 | 0 | } |
132 | 0 | #if 1 /* anything that can fail? */ |
133 | 0 | if (_fail) |
134 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
135 | 0 | argv[_i]->varname, argv[_i]->arg); |
136 | 0 | _failcnt += _fail; |
137 | 0 | #endif |
138 | 0 | } |
139 | 0 | #if 1 /* anything that can fail? */ |
140 | 0 | if (_failcnt) |
141 | 0 | return CMD_WARNING; |
142 | 0 | #endif |
143 | 0 | #endif |
144 | 0 | if (!address_str) { |
145 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "address_str"); |
146 | 0 | return CMD_WARNING; |
147 | 0 | } |
148 | | |
149 | 0 | return show_ipv6_rpf_addr_magic(self, vty, argc, argv, address, address_str); |
150 | 0 | } |
151 | | |
152 | | /* show_ip_nht => "show <ip$ipv4|ipv6$ipv6> <nht|import-check>$type [<A.B.C.D|X:X::X:X>$addr|vrf NAME$vrf_name [<A.B.C.D|X:X::X:X>$addr]|vrf all$vrf_all] [mrib$mrib] [json]" */ |
153 | | DEFUN_CMD_FUNC_DECL(show_ip_nht) |
154 | | #define funcdecl_show_ip_nht static int show_ip_nht_magic(\ |
155 | | const struct cmd_element *self __attribute__ ((unused)),\ |
156 | | struct vty *vty __attribute__ ((unused)),\ |
157 | | int argc __attribute__ ((unused)),\ |
158 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
159 | | const char * ipv4,\ |
160 | | const char * ipv6,\ |
161 | | const char * type,\ |
162 | | const union sockunion * addr,\ |
163 | | const char * addr_str __attribute__ ((unused)),\ |
164 | | const char * vrf_name,\ |
165 | | const char * vrf_all,\ |
166 | | const char * mrib) |
167 | | funcdecl_show_ip_nht; |
168 | | DEFUN_CMD_FUNC_TEXT(show_ip_nht) |
169 | 0 | { |
170 | 0 | #if 7 /* anything to parse? */ |
171 | 0 | int _i; |
172 | 0 | #if 1 /* anything that can fail? */ |
173 | 0 | unsigned _fail = 0, _failcnt = 0; |
174 | 0 | #endif |
175 | 0 | const char *ipv4 = NULL; |
176 | 0 | const char *ipv6 = NULL; |
177 | 0 | const char *type = NULL; |
178 | 0 | union sockunion s__addr = { .sa.sa_family = AF_UNSPEC }, *addr = NULL; |
179 | 0 | const char *addr_str = NULL; |
180 | 0 | const char *vrf_name = NULL; |
181 | 0 | const char *vrf_all = NULL; |
182 | 0 | const char *mrib = NULL; |
183 | |
|
184 | 0 | for (_i = 0; _i < argc; _i++) { |
185 | 0 | if (!argv[_i]->varname) |
186 | 0 | continue; |
187 | 0 | #if 1 /* anything that can fail? */ |
188 | 0 | _fail = 0; |
189 | 0 | #endif |
190 | |
|
191 | 0 | if (!strcmp(argv[_i]->varname, "ipv4")) { |
192 | 0 | ipv4 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
193 | 0 | } |
194 | 0 | if (!strcmp(argv[_i]->varname, "ipv6")) { |
195 | 0 | ipv6 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
196 | 0 | } |
197 | 0 | if (!strcmp(argv[_i]->varname, "type")) { |
198 | 0 | type = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
199 | 0 | } |
200 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
201 | 0 | addr_str = argv[_i]->arg; |
202 | 0 | if (argv[_i]->text[0] == 'X') { |
203 | 0 | s__addr.sa.sa_family = AF_INET6; |
204 | 0 | _fail = !inet_pton(AF_INET6, argv[_i]->arg, &s__addr.sin6.sin6_addr); |
205 | 0 | addr = &s__addr; |
206 | 0 | } else { |
207 | 0 | s__addr.sa.sa_family = AF_INET; |
208 | 0 | _fail = !inet_aton(argv[_i]->arg, &s__addr.sin.sin_addr); |
209 | 0 | addr = &s__addr; |
210 | 0 | } |
211 | 0 | } |
212 | 0 | if (!strcmp(argv[_i]->varname, "vrf_name")) { |
213 | 0 | vrf_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
214 | 0 | } |
215 | 0 | if (!strcmp(argv[_i]->varname, "vrf_all")) { |
216 | 0 | vrf_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
217 | 0 | } |
218 | 0 | if (!strcmp(argv[_i]->varname, "mrib")) { |
219 | 0 | mrib = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
220 | 0 | } |
221 | 0 | #if 1 /* anything that can fail? */ |
222 | 0 | if (_fail) |
223 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
224 | 0 | argv[_i]->varname, argv[_i]->arg); |
225 | 0 | _failcnt += _fail; |
226 | 0 | #endif |
227 | 0 | } |
228 | 0 | #if 1 /* anything that can fail? */ |
229 | 0 | if (_failcnt) |
230 | 0 | return CMD_WARNING; |
231 | 0 | #endif |
232 | 0 | #endif |
233 | 0 | if (!type) { |
234 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "type"); |
235 | 0 | return CMD_WARNING; |
236 | 0 | } |
237 | | |
238 | 0 | return show_ip_nht_magic(self, vty, argc, argv, ipv4, ipv6, type, addr, addr_str, vrf_name, vrf_all, mrib); |
239 | 0 | } |
240 | | |
241 | | /* show_interface_nexthop_group => "show interface [IFNAME$if_name] nexthop-group" */ |
242 | | DEFUN_CMD_FUNC_DECL(show_interface_nexthop_group) |
243 | | #define funcdecl_show_interface_nexthop_group static int show_interface_nexthop_group_magic(\ |
244 | | const struct cmd_element *self __attribute__ ((unused)),\ |
245 | | struct vty *vty __attribute__ ((unused)),\ |
246 | | int argc __attribute__ ((unused)),\ |
247 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
248 | | const char * if_name) |
249 | | funcdecl_show_interface_nexthop_group; |
250 | | DEFUN_CMD_FUNC_TEXT(show_interface_nexthop_group) |
251 | 0 | { |
252 | 0 | #if 1 /* anything to parse? */ |
253 | 0 | int _i; |
254 | | #if 0 /* anything that can fail? */ |
255 | | unsigned _fail = 0, _failcnt = 0; |
256 | | #endif |
257 | 0 | const char *if_name = NULL; |
258 | |
|
259 | 0 | for (_i = 0; _i < argc; _i++) { |
260 | 0 | if (!argv[_i]->varname) |
261 | 0 | continue; |
262 | | #if 0 /* anything that can fail? */ |
263 | | _fail = 0; |
264 | | #endif |
265 | | |
266 | 0 | if (!strcmp(argv[_i]->varname, "if_name")) { |
267 | 0 | if_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
268 | 0 | } |
269 | | #if 0 /* anything that can fail? */ |
270 | | if (_fail) |
271 | | vty_out (vty, "%% invalid input for %s: %s\n", |
272 | | argv[_i]->varname, argv[_i]->arg); |
273 | | _failcnt += _fail; |
274 | | #endif |
275 | 0 | } |
276 | | #if 0 /* anything that can fail? */ |
277 | | if (_failcnt) |
278 | | return CMD_WARNING; |
279 | | #endif |
280 | 0 | #endif |
281 | |
|
282 | 0 | return show_interface_nexthop_group_magic(self, vty, argc, argv, if_name); |
283 | 0 | } |
284 | | |
285 | | /* show_nexthop_group => "show nexthop-group rib <(0-4294967295)$id|[singleton <ip$v4|ipv6$v6>] [<kernel|zebra|bgp|sharp>$type_str] [vrf <NAME$vrf_name|all$vrf_all>]> [json]" */ |
286 | | DEFUN_CMD_FUNC_DECL(show_nexthop_group) |
287 | | #define funcdecl_show_nexthop_group static int show_nexthop_group_magic(\ |
288 | | const struct cmd_element *self __attribute__ ((unused)),\ |
289 | | struct vty *vty __attribute__ ((unused)),\ |
290 | | int argc __attribute__ ((unused)),\ |
291 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
292 | | long id,\ |
293 | | const char * id_str __attribute__ ((unused)),\ |
294 | | const char * v4,\ |
295 | | const char * v6,\ |
296 | | const char * type_str,\ |
297 | | const char * vrf_name,\ |
298 | | const char * vrf_all) |
299 | | funcdecl_show_nexthop_group; |
300 | | DEFUN_CMD_FUNC_TEXT(show_nexthop_group) |
301 | 0 | { |
302 | 0 | #if 6 /* anything to parse? */ |
303 | 0 | int _i; |
304 | 0 | #if 1 /* anything that can fail? */ |
305 | 0 | unsigned _fail = 0, _failcnt = 0; |
306 | 0 | #endif |
307 | 0 | long id = 0; |
308 | 0 | const char *id_str = NULL; |
309 | 0 | const char *v4 = NULL; |
310 | 0 | const char *v6 = NULL; |
311 | 0 | const char *type_str = NULL; |
312 | 0 | const char *vrf_name = NULL; |
313 | 0 | const char *vrf_all = NULL; |
314 | |
|
315 | 0 | for (_i = 0; _i < argc; _i++) { |
316 | 0 | if (!argv[_i]->varname) |
317 | 0 | continue; |
318 | 0 | #if 1 /* anything that can fail? */ |
319 | 0 | _fail = 0; |
320 | 0 | #endif |
321 | |
|
322 | 0 | if (!strcmp(argv[_i]->varname, "id")) { |
323 | 0 | id_str = argv[_i]->arg; |
324 | 0 | char *_end; |
325 | 0 | id = strtol(argv[_i]->arg, &_end, 10); |
326 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
327 | 0 | } |
328 | 0 | if (!strcmp(argv[_i]->varname, "v4")) { |
329 | 0 | v4 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
330 | 0 | } |
331 | 0 | if (!strcmp(argv[_i]->varname, "v6")) { |
332 | 0 | v6 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
333 | 0 | } |
334 | 0 | if (!strcmp(argv[_i]->varname, "type_str")) { |
335 | 0 | type_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
336 | 0 | } |
337 | 0 | if (!strcmp(argv[_i]->varname, "vrf_name")) { |
338 | 0 | vrf_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
339 | 0 | } |
340 | 0 | if (!strcmp(argv[_i]->varname, "vrf_all")) { |
341 | 0 | vrf_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
342 | 0 | } |
343 | 0 | #if 1 /* anything that can fail? */ |
344 | 0 | if (_fail) |
345 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
346 | 0 | argv[_i]->varname, argv[_i]->arg); |
347 | 0 | _failcnt += _fail; |
348 | 0 | #endif |
349 | 0 | } |
350 | 0 | #if 1 /* anything that can fail? */ |
351 | 0 | if (_failcnt) |
352 | 0 | return CMD_WARNING; |
353 | 0 | #endif |
354 | 0 | #endif |
355 | | |
356 | 0 | return show_nexthop_group_magic(self, vty, argc, argv, id, id_str, v4, v6, type_str, vrf_name, vrf_all); |
357 | 0 | } |
358 | | |
359 | | /* nexthop_group_use_enable => "[no] zebra nexthop kernel enable" */ |
360 | | DEFUN_CMD_FUNC_DECL(nexthop_group_use_enable) |
361 | | #define funcdecl_nexthop_group_use_enable static int nexthop_group_use_enable_magic(\ |
362 | | const struct cmd_element *self __attribute__ ((unused)),\ |
363 | | struct vty *vty __attribute__ ((unused)),\ |
364 | | int argc __attribute__ ((unused)),\ |
365 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
366 | | const char * no) |
367 | | funcdecl_nexthop_group_use_enable; |
368 | | DEFUN_CMD_FUNC_TEXT(nexthop_group_use_enable) |
369 | 0 | { |
370 | 0 | #if 1 /* anything to parse? */ |
371 | 0 | int _i; |
372 | | #if 0 /* anything that can fail? */ |
373 | | unsigned _fail = 0, _failcnt = 0; |
374 | | #endif |
375 | 0 | const char *no = NULL; |
376 | |
|
377 | 0 | for (_i = 0; _i < argc; _i++) { |
378 | 0 | if (!argv[_i]->varname) |
379 | 0 | continue; |
380 | | #if 0 /* anything that can fail? */ |
381 | | _fail = 0; |
382 | | #endif |
383 | | |
384 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
385 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
386 | 0 | } |
387 | | #if 0 /* anything that can fail? */ |
388 | | if (_fail) |
389 | | vty_out (vty, "%% invalid input for %s: %s\n", |
390 | | argv[_i]->varname, argv[_i]->arg); |
391 | | _failcnt += _fail; |
392 | | #endif |
393 | 0 | } |
394 | | #if 0 /* anything that can fail? */ |
395 | | if (_failcnt) |
396 | | return CMD_WARNING; |
397 | | #endif |
398 | 0 | #endif |
399 | |
|
400 | 0 | return nexthop_group_use_enable_magic(self, vty, argc, argv, no); |
401 | 0 | } |
402 | | |
403 | | /* proto_nexthop_group_only => "[no] zebra nexthop proto only" */ |
404 | | DEFUN_CMD_FUNC_DECL(proto_nexthop_group_only) |
405 | | #define funcdecl_proto_nexthop_group_only static int proto_nexthop_group_only_magic(\ |
406 | | const struct cmd_element *self __attribute__ ((unused)),\ |
407 | | struct vty *vty __attribute__ ((unused)),\ |
408 | | int argc __attribute__ ((unused)),\ |
409 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
410 | | const char * no) |
411 | | funcdecl_proto_nexthop_group_only; |
412 | | DEFUN_CMD_FUNC_TEXT(proto_nexthop_group_only) |
413 | 0 | { |
414 | 0 | #if 1 /* anything to parse? */ |
415 | 0 | int _i; |
416 | | #if 0 /* anything that can fail? */ |
417 | | unsigned _fail = 0, _failcnt = 0; |
418 | | #endif |
419 | 0 | const char *no = NULL; |
420 | |
|
421 | 0 | for (_i = 0; _i < argc; _i++) { |
422 | 0 | if (!argv[_i]->varname) |
423 | 0 | continue; |
424 | | #if 0 /* anything that can fail? */ |
425 | | _fail = 0; |
426 | | #endif |
427 | | |
428 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
429 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
430 | 0 | } |
431 | | #if 0 /* anything that can fail? */ |
432 | | if (_fail) |
433 | | vty_out (vty, "%% invalid input for %s: %s\n", |
434 | | argv[_i]->varname, argv[_i]->arg); |
435 | | _failcnt += _fail; |
436 | | #endif |
437 | 0 | } |
438 | | #if 0 /* anything that can fail? */ |
439 | | if (_failcnt) |
440 | | return CMD_WARNING; |
441 | | #endif |
442 | 0 | #endif |
443 | |
|
444 | 0 | return proto_nexthop_group_only_magic(self, vty, argc, argv, no); |
445 | 0 | } |
446 | | |
447 | | /* backup_nexthop_recursive_use_enable => "[no] zebra nexthop resolve-via-backup" */ |
448 | | DEFUN_CMD_FUNC_DECL(backup_nexthop_recursive_use_enable) |
449 | | #define funcdecl_backup_nexthop_recursive_use_enable static int backup_nexthop_recursive_use_enable_magic(\ |
450 | | const struct cmd_element *self __attribute__ ((unused)),\ |
451 | | struct vty *vty __attribute__ ((unused)),\ |
452 | | int argc __attribute__ ((unused)),\ |
453 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
454 | | const char * no) |
455 | | funcdecl_backup_nexthop_recursive_use_enable; |
456 | | DEFUN_CMD_FUNC_TEXT(backup_nexthop_recursive_use_enable) |
457 | 0 | { |
458 | 0 | #if 1 /* anything to parse? */ |
459 | 0 | int _i; |
460 | | #if 0 /* anything that can fail? */ |
461 | | unsigned _fail = 0, _failcnt = 0; |
462 | | #endif |
463 | 0 | const char *no = NULL; |
464 | |
|
465 | 0 | for (_i = 0; _i < argc; _i++) { |
466 | 0 | if (!argv[_i]->varname) |
467 | 0 | continue; |
468 | | #if 0 /* anything that can fail? */ |
469 | | _fail = 0; |
470 | | #endif |
471 | | |
472 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
473 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
474 | 0 | } |
475 | | #if 0 /* anything that can fail? */ |
476 | | if (_fail) |
477 | | vty_out (vty, "%% invalid input for %s: %s\n", |
478 | | argv[_i]->varname, argv[_i]->arg); |
479 | | _failcnt += _fail; |
480 | | #endif |
481 | 0 | } |
482 | | #if 0 /* anything that can fail? */ |
483 | | if (_failcnt) |
484 | | return CMD_WARNING; |
485 | | #endif |
486 | 0 | #endif |
487 | |
|
488 | 0 | return backup_nexthop_recursive_use_enable_magic(self, vty, argc, argv, no); |
489 | 0 | } |
490 | | |
491 | | /* rnh_hide_backups => "[no] ip nht hide-backup-events" */ |
492 | | DEFUN_CMD_FUNC_DECL(rnh_hide_backups) |
493 | | #define funcdecl_rnh_hide_backups static int rnh_hide_backups_magic(\ |
494 | | const struct cmd_element *self __attribute__ ((unused)),\ |
495 | | struct vty *vty __attribute__ ((unused)),\ |
496 | | int argc __attribute__ ((unused)),\ |
497 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
498 | | const char * no) |
499 | | funcdecl_rnh_hide_backups; |
500 | | DEFUN_CMD_FUNC_TEXT(rnh_hide_backups) |
501 | 0 | { |
502 | 0 | #if 1 /* anything to parse? */ |
503 | 0 | int _i; |
504 | | #if 0 /* anything that can fail? */ |
505 | | unsigned _fail = 0, _failcnt = 0; |
506 | | #endif |
507 | 0 | const char *no = NULL; |
508 | |
|
509 | 0 | for (_i = 0; _i < argc; _i++) { |
510 | 0 | if (!argv[_i]->varname) |
511 | 0 | continue; |
512 | | #if 0 /* anything that can fail? */ |
513 | | _fail = 0; |
514 | | #endif |
515 | | |
516 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
517 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
518 | 0 | } |
519 | | #if 0 /* anything that can fail? */ |
520 | | if (_fail) |
521 | | vty_out (vty, "%% invalid input for %s: %s\n", |
522 | | argv[_i]->varname, argv[_i]->arg); |
523 | | _failcnt += _fail; |
524 | | #endif |
525 | 0 | } |
526 | | #if 0 /* anything that can fail? */ |
527 | | if (_failcnt) |
528 | | return CMD_WARNING; |
529 | | #endif |
530 | 0 | #endif |
531 | |
|
532 | 0 | return rnh_hide_backups_magic(self, vty, argc, argv, no); |
533 | 0 | } |
534 | | |
535 | | /* show_route => "show < ip$ipv4 <fib$fib|route> [table <(1-4294967295)$table|all$table_all>] [vrf <NAME$vrf_name|all$vrf_all>] [{ tag (1-4294967295) |A.B.C.D/M$prefix longer-prefixes |supernets-only$supernets_only }] [< <kernel|connected|static|rip|ospf|isis|bgp|eigrp|nhrp|table|vnc|babel|openfabric>$type_str |ospf$type_str (1-65535)$ospf_instance_id >] |ipv6$ipv6 <fib$fib|route> [table <(1-4294967295)$table|all$table_all>] [vrf <NAME$vrf_name|all$vrf_all>] [{ tag (1-4294967295) |X:X::X:X/M$prefix longer-prefixes }] [<kernel|connected|static|ripng|ospf6|isis|bgp|nhrp|table|vnc|babel|openfabric>$type_str] > [<json$json|nexthop-group$ng>]" */ |
536 | | DEFUN_CMD_FUNC_DECL(show_route) |
537 | | #define funcdecl_show_route static int show_route_magic(\ |
538 | | const struct cmd_element *self __attribute__ ((unused)),\ |
539 | | struct vty *vty __attribute__ ((unused)),\ |
540 | | int argc __attribute__ ((unused)),\ |
541 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
542 | | const char * ipv4,\ |
543 | | const char * fib,\ |
544 | | long table,\ |
545 | | const char * table_str __attribute__ ((unused)),\ |
546 | | const char * table_all,\ |
547 | | const char * vrf_name,\ |
548 | | const char * vrf_all,\ |
549 | | long tag,\ |
550 | | const char * tag_str __attribute__ ((unused)),\ |
551 | | const struct prefix * prefix,\ |
552 | | const char * prefix_str __attribute__ ((unused)),\ |
553 | | const char * supernets_only,\ |
554 | | const char * type_str,\ |
555 | | long ospf_instance_id,\ |
556 | | const char * ospf_instance_id_str __attribute__ ((unused)),\ |
557 | | const char * ipv6,\ |
558 | | const char * json,\ |
559 | | const char * ng) |
560 | | funcdecl_show_route; |
561 | | DEFUN_CMD_FUNC_TEXT(show_route) |
562 | 0 | { |
563 | 0 | #if 14 /* anything to parse? */ |
564 | 0 | int _i; |
565 | 0 | #if 1 /* anything that can fail? */ |
566 | 0 | unsigned _fail = 0, _failcnt = 0; |
567 | 0 | #endif |
568 | 0 | const char *ipv4 = NULL; |
569 | 0 | const char *fib = NULL; |
570 | 0 | long table = 0; |
571 | 0 | const char *table_str = NULL; |
572 | 0 | const char *table_all = NULL; |
573 | 0 | const char *vrf_name = NULL; |
574 | 0 | const char *vrf_all = NULL; |
575 | 0 | long tag = 0; |
576 | 0 | const char *tag_str = NULL; |
577 | 0 | struct prefix prefix = { }; |
578 | 0 | const char *prefix_str = NULL; |
579 | 0 | const char *supernets_only = NULL; |
580 | 0 | const char *type_str = NULL; |
581 | 0 | long ospf_instance_id = 0; |
582 | 0 | const char *ospf_instance_id_str = NULL; |
583 | 0 | const char *ipv6 = NULL; |
584 | 0 | const char *json = NULL; |
585 | 0 | const char *ng = NULL; |
586 | |
|
587 | 0 | for (_i = 0; _i < argc; _i++) { |
588 | 0 | if (!argv[_i]->varname) |
589 | 0 | continue; |
590 | 0 | #if 1 /* anything that can fail? */ |
591 | 0 | _fail = 0; |
592 | 0 | #endif |
593 | |
|
594 | 0 | if (!strcmp(argv[_i]->varname, "ipv4")) { |
595 | 0 | ipv4 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
596 | 0 | } |
597 | 0 | if (!strcmp(argv[_i]->varname, "fib")) { |
598 | 0 | fib = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
599 | 0 | } |
600 | 0 | if (!strcmp(argv[_i]->varname, "table")) { |
601 | 0 | table_str = argv[_i]->arg; |
602 | 0 | char *_end; |
603 | 0 | table = strtol(argv[_i]->arg, &_end, 10); |
604 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
605 | 0 | } |
606 | 0 | if (!strcmp(argv[_i]->varname, "table_all")) { |
607 | 0 | table_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
608 | 0 | } |
609 | 0 | if (!strcmp(argv[_i]->varname, "vrf_name")) { |
610 | 0 | vrf_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
611 | 0 | } |
612 | 0 | if (!strcmp(argv[_i]->varname, "vrf_all")) { |
613 | 0 | vrf_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
614 | 0 | } |
615 | 0 | if (!strcmp(argv[_i]->varname, "tag")) { |
616 | 0 | tag_str = argv[_i]->arg; |
617 | 0 | char *_end; |
618 | 0 | tag = strtol(argv[_i]->arg, &_end, 10); |
619 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
620 | 0 | } |
621 | 0 | if (!strcmp(argv[_i]->varname, "prefix")) { |
622 | 0 | prefix_str = argv[_i]->arg; |
623 | 0 | _fail = !str2prefix(argv[_i]->arg, &prefix); |
624 | 0 | } |
625 | 0 | if (!strcmp(argv[_i]->varname, "supernets_only")) { |
626 | 0 | supernets_only = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
627 | 0 | } |
628 | 0 | if (!strcmp(argv[_i]->varname, "type_str")) { |
629 | 0 | type_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
630 | 0 | } |
631 | 0 | if (!strcmp(argv[_i]->varname, "ospf_instance_id")) { |
632 | 0 | ospf_instance_id_str = argv[_i]->arg; |
633 | 0 | char *_end; |
634 | 0 | ospf_instance_id = strtol(argv[_i]->arg, &_end, 10); |
635 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
636 | 0 | } |
637 | 0 | if (!strcmp(argv[_i]->varname, "ipv6")) { |
638 | 0 | ipv6 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
639 | 0 | } |
640 | 0 | if (!strcmp(argv[_i]->varname, "json")) { |
641 | 0 | json = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
642 | 0 | } |
643 | 0 | if (!strcmp(argv[_i]->varname, "ng")) { |
644 | 0 | ng = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
645 | 0 | } |
646 | 0 | #if 1 /* anything that can fail? */ |
647 | 0 | if (_fail) |
648 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
649 | 0 | argv[_i]->varname, argv[_i]->arg); |
650 | 0 | _failcnt += _fail; |
651 | 0 | #endif |
652 | 0 | } |
653 | 0 | #if 1 /* anything that can fail? */ |
654 | 0 | if (_failcnt) |
655 | 0 | return CMD_WARNING; |
656 | 0 | #endif |
657 | 0 | #endif |
658 | | |
659 | 0 | return show_route_magic(self, vty, argc, argv, ipv4, fib, table, table_str, table_all, vrf_name, vrf_all, tag, tag_str, &prefix, prefix_str, supernets_only, type_str, ospf_instance_id, ospf_instance_id_str, ipv6, json, ng); |
660 | 0 | } |
661 | | |
662 | | /* show_route_detail => "show < ip$ipv4 <fib$fib|route> [vrf <NAME$vrf_name|all$vrf_all>] < A.B.C.D$address |A.B.C.D/M$prefix > |ipv6$ipv6 <fib$fib|route> [vrf <NAME$vrf_name|all$vrf_all>] < X:X::X:X$address |X:X::X:X/M$prefix > > [json$json] [nexthop-group$ng]" */ |
663 | | DEFUN_CMD_FUNC_DECL(show_route_detail) |
664 | | #define funcdecl_show_route_detail static int show_route_detail_magic(\ |
665 | | const struct cmd_element *self __attribute__ ((unused)),\ |
666 | | struct vty *vty __attribute__ ((unused)),\ |
667 | | int argc __attribute__ ((unused)),\ |
668 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
669 | | const char * ipv4,\ |
670 | | const char * fib,\ |
671 | | const char * vrf_name,\ |
672 | | const char * vrf_all,\ |
673 | | const union sockunion * address,\ |
674 | | const char * address_str __attribute__ ((unused)),\ |
675 | | const struct prefix * prefix,\ |
676 | | const char * prefix_str __attribute__ ((unused)),\ |
677 | | const char * ipv6,\ |
678 | | const char * json,\ |
679 | | const char * ng) |
680 | | funcdecl_show_route_detail; |
681 | | DEFUN_CMD_FUNC_TEXT(show_route_detail) |
682 | 0 | { |
683 | 0 | #if 9 /* anything to parse? */ |
684 | 0 | int _i; |
685 | 0 | #if 1 /* anything that can fail? */ |
686 | 0 | unsigned _fail = 0, _failcnt = 0; |
687 | 0 | #endif |
688 | 0 | const char *ipv4 = NULL; |
689 | 0 | const char *fib = NULL; |
690 | 0 | const char *vrf_name = NULL; |
691 | 0 | const char *vrf_all = NULL; |
692 | 0 | union sockunion s__address = { .sa.sa_family = AF_UNSPEC }, *address = NULL; |
693 | 0 | const char *address_str = NULL; |
694 | 0 | struct prefix prefix = { }; |
695 | 0 | const char *prefix_str = NULL; |
696 | 0 | const char *ipv6 = NULL; |
697 | 0 | const char *json = NULL; |
698 | 0 | const char *ng = NULL; |
699 | |
|
700 | 0 | for (_i = 0; _i < argc; _i++) { |
701 | 0 | if (!argv[_i]->varname) |
702 | 0 | continue; |
703 | 0 | #if 1 /* anything that can fail? */ |
704 | 0 | _fail = 0; |
705 | 0 | #endif |
706 | |
|
707 | 0 | if (!strcmp(argv[_i]->varname, "ipv4")) { |
708 | 0 | ipv4 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
709 | 0 | } |
710 | 0 | if (!strcmp(argv[_i]->varname, "fib")) { |
711 | 0 | fib = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
712 | 0 | } |
713 | 0 | if (!strcmp(argv[_i]->varname, "vrf_name")) { |
714 | 0 | vrf_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
715 | 0 | } |
716 | 0 | if (!strcmp(argv[_i]->varname, "vrf_all")) { |
717 | 0 | vrf_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
718 | 0 | } |
719 | 0 | if (!strcmp(argv[_i]->varname, "address")) { |
720 | 0 | address_str = argv[_i]->arg; |
721 | 0 | if (argv[_i]->text[0] == 'X') { |
722 | 0 | s__address.sa.sa_family = AF_INET6; |
723 | 0 | _fail = !inet_pton(AF_INET6, argv[_i]->arg, &s__address.sin6.sin6_addr); |
724 | 0 | address = &s__address; |
725 | 0 | } else { |
726 | 0 | s__address.sa.sa_family = AF_INET; |
727 | 0 | _fail = !inet_aton(argv[_i]->arg, &s__address.sin.sin_addr); |
728 | 0 | address = &s__address; |
729 | 0 | } |
730 | 0 | } |
731 | 0 | if (!strcmp(argv[_i]->varname, "prefix")) { |
732 | 0 | prefix_str = argv[_i]->arg; |
733 | 0 | _fail = !str2prefix(argv[_i]->arg, &prefix); |
734 | 0 | } |
735 | 0 | if (!strcmp(argv[_i]->varname, "ipv6")) { |
736 | 0 | ipv6 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
737 | 0 | } |
738 | 0 | if (!strcmp(argv[_i]->varname, "json")) { |
739 | 0 | json = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
740 | 0 | } |
741 | 0 | if (!strcmp(argv[_i]->varname, "ng")) { |
742 | 0 | ng = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
743 | 0 | } |
744 | 0 | #if 1 /* anything that can fail? */ |
745 | 0 | if (_fail) |
746 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
747 | 0 | argv[_i]->varname, argv[_i]->arg); |
748 | 0 | _failcnt += _fail; |
749 | 0 | #endif |
750 | 0 | } |
751 | 0 | #if 1 /* anything that can fail? */ |
752 | 0 | if (_failcnt) |
753 | 0 | return CMD_WARNING; |
754 | 0 | #endif |
755 | 0 | #endif |
756 | | |
757 | 0 | return show_route_detail_magic(self, vty, argc, argv, ipv4, fib, vrf_name, vrf_all, address, address_str, &prefix, prefix_str, ipv6, json, ng); |
758 | 0 | } |
759 | | |
760 | | /* show_route_summary => "show <ip$ipv4|ipv6$ipv6> route [vrf <NAME$vrf_name|all$vrf_all>] summary [table (1-4294967295)$table_id] [prefix$prefix] [json]" */ |
761 | | DEFUN_CMD_FUNC_DECL(show_route_summary) |
762 | | #define funcdecl_show_route_summary static int show_route_summary_magic(\ |
763 | | const struct cmd_element *self __attribute__ ((unused)),\ |
764 | | struct vty *vty __attribute__ ((unused)),\ |
765 | | int argc __attribute__ ((unused)),\ |
766 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
767 | | const char * ipv4,\ |
768 | | const char * ipv6,\ |
769 | | const char * vrf_name,\ |
770 | | const char * vrf_all,\ |
771 | | long table_id,\ |
772 | | const char * table_id_str __attribute__ ((unused)),\ |
773 | | const char * prefix) |
774 | | funcdecl_show_route_summary; |
775 | | DEFUN_CMD_FUNC_TEXT(show_route_summary) |
776 | 0 | { |
777 | 0 | #if 6 /* anything to parse? */ |
778 | 0 | int _i; |
779 | 0 | #if 1 /* anything that can fail? */ |
780 | 0 | unsigned _fail = 0, _failcnt = 0; |
781 | 0 | #endif |
782 | 0 | const char *ipv4 = NULL; |
783 | 0 | const char *ipv6 = NULL; |
784 | 0 | const char *vrf_name = NULL; |
785 | 0 | const char *vrf_all = NULL; |
786 | 0 | long table_id = 0; |
787 | 0 | const char *table_id_str = NULL; |
788 | 0 | const char *prefix = NULL; |
789 | |
|
790 | 0 | for (_i = 0; _i < argc; _i++) { |
791 | 0 | if (!argv[_i]->varname) |
792 | 0 | continue; |
793 | 0 | #if 1 /* anything that can fail? */ |
794 | 0 | _fail = 0; |
795 | 0 | #endif |
796 | |
|
797 | 0 | if (!strcmp(argv[_i]->varname, "ipv4")) { |
798 | 0 | ipv4 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
799 | 0 | } |
800 | 0 | if (!strcmp(argv[_i]->varname, "ipv6")) { |
801 | 0 | ipv6 = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
802 | 0 | } |
803 | 0 | if (!strcmp(argv[_i]->varname, "vrf_name")) { |
804 | 0 | vrf_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
805 | 0 | } |
806 | 0 | if (!strcmp(argv[_i]->varname, "vrf_all")) { |
807 | 0 | vrf_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
808 | 0 | } |
809 | 0 | if (!strcmp(argv[_i]->varname, "table_id")) { |
810 | 0 | table_id_str = argv[_i]->arg; |
811 | 0 | char *_end; |
812 | 0 | table_id = strtol(argv[_i]->arg, &_end, 10); |
813 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
814 | 0 | } |
815 | 0 | if (!strcmp(argv[_i]->varname, "prefix")) { |
816 | 0 | prefix = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
817 | 0 | } |
818 | 0 | #if 1 /* anything that can fail? */ |
819 | 0 | if (_fail) |
820 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
821 | 0 | argv[_i]->varname, argv[_i]->arg); |
822 | 0 | _failcnt += _fail; |
823 | 0 | #endif |
824 | 0 | } |
825 | 0 | #if 1 /* anything that can fail? */ |
826 | 0 | if (_failcnt) |
827 | 0 | return CMD_WARNING; |
828 | 0 | #endif |
829 | 0 | #endif |
830 | | |
831 | 0 | return show_route_summary_magic(self, vty, argc, argv, ipv4, ipv6, vrf_name, vrf_all, table_id, table_id_str, prefix); |
832 | 0 | } |
833 | | |
834 | | /* evpn_mh_mac_holdtime => "[no$no] evpn mh mac-holdtime (0-86400)$duration" */ |
835 | | DEFUN_CMD_FUNC_DECL(evpn_mh_mac_holdtime) |
836 | | #define funcdecl_evpn_mh_mac_holdtime static int evpn_mh_mac_holdtime_magic(\ |
837 | | const struct cmd_element *self __attribute__ ((unused)),\ |
838 | | struct vty *vty __attribute__ ((unused)),\ |
839 | | int argc __attribute__ ((unused)),\ |
840 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
841 | | const char * no,\ |
842 | | long duration,\ |
843 | | const char * duration_str __attribute__ ((unused))) |
844 | | funcdecl_evpn_mh_mac_holdtime; |
845 | | DEFUN_CMD_FUNC_TEXT(evpn_mh_mac_holdtime) |
846 | 0 | { |
847 | 0 | #if 2 /* anything to parse? */ |
848 | 0 | int _i; |
849 | 0 | #if 1 /* anything that can fail? */ |
850 | 0 | unsigned _fail = 0, _failcnt = 0; |
851 | 0 | #endif |
852 | 0 | const char *no = NULL; |
853 | 0 | long duration = 0; |
854 | 0 | const char *duration_str = NULL; |
855 | |
|
856 | 0 | for (_i = 0; _i < argc; _i++) { |
857 | 0 | if (!argv[_i]->varname) |
858 | 0 | continue; |
859 | 0 | #if 1 /* anything that can fail? */ |
860 | 0 | _fail = 0; |
861 | 0 | #endif |
862 | |
|
863 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
864 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
865 | 0 | } |
866 | 0 | if (!strcmp(argv[_i]->varname, "duration")) { |
867 | 0 | duration_str = argv[_i]->arg; |
868 | 0 | char *_end; |
869 | 0 | duration = strtol(argv[_i]->arg, &_end, 10); |
870 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
871 | 0 | } |
872 | 0 | #if 1 /* anything that can fail? */ |
873 | 0 | if (_fail) |
874 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
875 | 0 | argv[_i]->varname, argv[_i]->arg); |
876 | 0 | _failcnt += _fail; |
877 | 0 | #endif |
878 | 0 | } |
879 | 0 | #if 1 /* anything that can fail? */ |
880 | 0 | if (_failcnt) |
881 | 0 | return CMD_WARNING; |
882 | 0 | #endif |
883 | 0 | #endif |
884 | 0 | if (!duration_str) { |
885 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "duration_str"); |
886 | 0 | return CMD_WARNING; |
887 | 0 | } |
888 | | |
889 | 0 | return evpn_mh_mac_holdtime_magic(self, vty, argc, argv, no, duration, duration_str); |
890 | 0 | } |
891 | | |
892 | | /* evpn_mh_neigh_holdtime => "[no$no] evpn mh neigh-holdtime (0-86400)$duration" */ |
893 | | DEFUN_CMD_FUNC_DECL(evpn_mh_neigh_holdtime) |
894 | | #define funcdecl_evpn_mh_neigh_holdtime static int evpn_mh_neigh_holdtime_magic(\ |
895 | | const struct cmd_element *self __attribute__ ((unused)),\ |
896 | | struct vty *vty __attribute__ ((unused)),\ |
897 | | int argc __attribute__ ((unused)),\ |
898 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
899 | | const char * no,\ |
900 | | long duration,\ |
901 | | const char * duration_str __attribute__ ((unused))) |
902 | | funcdecl_evpn_mh_neigh_holdtime; |
903 | | DEFUN_CMD_FUNC_TEXT(evpn_mh_neigh_holdtime) |
904 | 0 | { |
905 | 0 | #if 2 /* anything to parse? */ |
906 | 0 | int _i; |
907 | 0 | #if 1 /* anything that can fail? */ |
908 | 0 | unsigned _fail = 0, _failcnt = 0; |
909 | 0 | #endif |
910 | 0 | const char *no = NULL; |
911 | 0 | long duration = 0; |
912 | 0 | const char *duration_str = NULL; |
913 | |
|
914 | 0 | for (_i = 0; _i < argc; _i++) { |
915 | 0 | if (!argv[_i]->varname) |
916 | 0 | continue; |
917 | 0 | #if 1 /* anything that can fail? */ |
918 | 0 | _fail = 0; |
919 | 0 | #endif |
920 | |
|
921 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
922 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
923 | 0 | } |
924 | 0 | if (!strcmp(argv[_i]->varname, "duration")) { |
925 | 0 | duration_str = argv[_i]->arg; |
926 | 0 | char *_end; |
927 | 0 | duration = strtol(argv[_i]->arg, &_end, 10); |
928 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
929 | 0 | } |
930 | 0 | #if 1 /* anything that can fail? */ |
931 | 0 | if (_fail) |
932 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
933 | 0 | argv[_i]->varname, argv[_i]->arg); |
934 | 0 | _failcnt += _fail; |
935 | 0 | #endif |
936 | 0 | } |
937 | 0 | #if 1 /* anything that can fail? */ |
938 | 0 | if (_failcnt) |
939 | 0 | return CMD_WARNING; |
940 | 0 | #endif |
941 | 0 | #endif |
942 | 0 | if (!duration_str) { |
943 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "duration_str"); |
944 | 0 | return CMD_WARNING; |
945 | 0 | } |
946 | | |
947 | 0 | return evpn_mh_neigh_holdtime_magic(self, vty, argc, argv, no, duration, duration_str); |
948 | 0 | } |
949 | | |
950 | | /* evpn_mh_startup_delay => "[no] evpn mh startup-delay(0-3600)$duration" */ |
951 | | DEFUN_CMD_FUNC_DECL(evpn_mh_startup_delay) |
952 | | #define funcdecl_evpn_mh_startup_delay static int evpn_mh_startup_delay_magic(\ |
953 | | const struct cmd_element *self __attribute__ ((unused)),\ |
954 | | struct vty *vty __attribute__ ((unused)),\ |
955 | | int argc __attribute__ ((unused)),\ |
956 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
957 | | const char * no,\ |
958 | | long duration,\ |
959 | | const char * duration_str __attribute__ ((unused))) |
960 | | funcdecl_evpn_mh_startup_delay; |
961 | | DEFUN_CMD_FUNC_TEXT(evpn_mh_startup_delay) |
962 | 0 | { |
963 | 0 | #if 2 /* anything to parse? */ |
964 | 0 | int _i; |
965 | 0 | #if 1 /* anything that can fail? */ |
966 | 0 | unsigned _fail = 0, _failcnt = 0; |
967 | 0 | #endif |
968 | 0 | const char *no = NULL; |
969 | 0 | long duration = 0; |
970 | 0 | const char *duration_str = NULL; |
971 | |
|
972 | 0 | for (_i = 0; _i < argc; _i++) { |
973 | 0 | if (!argv[_i]->varname) |
974 | 0 | continue; |
975 | 0 | #if 1 /* anything that can fail? */ |
976 | 0 | _fail = 0; |
977 | 0 | #endif |
978 | |
|
979 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
980 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
981 | 0 | } |
982 | 0 | if (!strcmp(argv[_i]->varname, "duration")) { |
983 | 0 | duration_str = argv[_i]->arg; |
984 | 0 | char *_end; |
985 | 0 | duration = strtol(argv[_i]->arg, &_end, 10); |
986 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
987 | 0 | } |
988 | 0 | #if 1 /* anything that can fail? */ |
989 | 0 | if (_fail) |
990 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
991 | 0 | argv[_i]->varname, argv[_i]->arg); |
992 | 0 | _failcnt += _fail; |
993 | 0 | #endif |
994 | 0 | } |
995 | 0 | #if 1 /* anything that can fail? */ |
996 | 0 | if (_failcnt) |
997 | 0 | return CMD_WARNING; |
998 | 0 | #endif |
999 | 0 | #endif |
1000 | 0 | if (!duration_str) { |
1001 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "duration_str"); |
1002 | 0 | return CMD_WARNING; |
1003 | 0 | } |
1004 | | |
1005 | 0 | return evpn_mh_startup_delay_magic(self, vty, argc, argv, no, duration, duration_str); |
1006 | 0 | } |
1007 | | |
1008 | | /* evpn_mh_redirect_off => "[no$no] evpn mh redirect-off" */ |
1009 | | DEFUN_CMD_FUNC_DECL(evpn_mh_redirect_off) |
1010 | | #define funcdecl_evpn_mh_redirect_off static int evpn_mh_redirect_off_magic(\ |
1011 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1012 | | struct vty *vty __attribute__ ((unused)),\ |
1013 | | int argc __attribute__ ((unused)),\ |
1014 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1015 | | const char * no) |
1016 | | funcdecl_evpn_mh_redirect_off; |
1017 | | DEFUN_CMD_FUNC_TEXT(evpn_mh_redirect_off) |
1018 | 0 | { |
1019 | 0 | #if 1 /* anything to parse? */ |
1020 | 0 | int _i; |
1021 | | #if 0 /* anything that can fail? */ |
1022 | | unsigned _fail = 0, _failcnt = 0; |
1023 | | #endif |
1024 | 0 | const char *no = NULL; |
1025 | |
|
1026 | 0 | for (_i = 0; _i < argc; _i++) { |
1027 | 0 | if (!argv[_i]->varname) |
1028 | 0 | continue; |
1029 | | #if 0 /* anything that can fail? */ |
1030 | | _fail = 0; |
1031 | | #endif |
1032 | | |
1033 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
1034 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1035 | 0 | } |
1036 | | #if 0 /* anything that can fail? */ |
1037 | | if (_fail) |
1038 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1039 | | argv[_i]->varname, argv[_i]->arg); |
1040 | | _failcnt += _fail; |
1041 | | #endif |
1042 | 0 | } |
1043 | | #if 0 /* anything that can fail? */ |
1044 | | if (_failcnt) |
1045 | | return CMD_WARNING; |
1046 | | #endif |
1047 | 0 | #endif |
1048 | |
|
1049 | 0 | return evpn_mh_redirect_off_magic(self, vty, argc, argv, no); |
1050 | 0 | } |
1051 | | |
1052 | | /* show_vrf_vni => "show vrf [<NAME$vrf_name|all$vrf_all>] vni [json]" */ |
1053 | | DEFUN_CMD_FUNC_DECL(show_vrf_vni) |
1054 | | #define funcdecl_show_vrf_vni static int show_vrf_vni_magic(\ |
1055 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1056 | | struct vty *vty __attribute__ ((unused)),\ |
1057 | | int argc __attribute__ ((unused)),\ |
1058 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1059 | | const char * vrf_name,\ |
1060 | | const char * vrf_all) |
1061 | | funcdecl_show_vrf_vni; |
1062 | | DEFUN_CMD_FUNC_TEXT(show_vrf_vni) |
1063 | 0 | { |
1064 | 0 | #if 2 /* anything to parse? */ |
1065 | 0 | int _i; |
1066 | | #if 0 /* anything that can fail? */ |
1067 | | unsigned _fail = 0, _failcnt = 0; |
1068 | | #endif |
1069 | 0 | const char *vrf_name = NULL; |
1070 | 0 | const char *vrf_all = NULL; |
1071 | |
|
1072 | 0 | for (_i = 0; _i < argc; _i++) { |
1073 | 0 | if (!argv[_i]->varname) |
1074 | 0 | continue; |
1075 | | #if 0 /* anything that can fail? */ |
1076 | | _fail = 0; |
1077 | | #endif |
1078 | | |
1079 | 0 | if (!strcmp(argv[_i]->varname, "vrf_name")) { |
1080 | 0 | vrf_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1081 | 0 | } |
1082 | 0 | if (!strcmp(argv[_i]->varname, "vrf_all")) { |
1083 | 0 | vrf_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1084 | 0 | } |
1085 | | #if 0 /* anything that can fail? */ |
1086 | | if (_fail) |
1087 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1088 | | argv[_i]->varname, argv[_i]->arg); |
1089 | | _failcnt += _fail; |
1090 | | #endif |
1091 | 0 | } |
1092 | | #if 0 /* anything that can fail? */ |
1093 | | if (_failcnt) |
1094 | | return CMD_WARNING; |
1095 | | #endif |
1096 | 0 | #endif |
1097 | |
|
1098 | 0 | return show_vrf_vni_magic(self, vty, argc, argv, vrf_name, vrf_all); |
1099 | 0 | } |
1100 | | |
1101 | | /* show_evpn_neigh => "show ip neigh" */ |
1102 | | DEFUN_CMD_FUNC_DECL(show_evpn_neigh) |
1103 | | #define funcdecl_show_evpn_neigh static int show_evpn_neigh_magic(\ |
1104 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1105 | | struct vty *vty __attribute__ ((unused)),\ |
1106 | | int argc __attribute__ ((unused)),\ |
1107 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1108 | | funcdecl_show_evpn_neigh; |
1109 | | DEFUN_CMD_FUNC_TEXT(show_evpn_neigh) |
1110 | 0 | { |
1111 | | #if 0 /* anything to parse? */ |
1112 | | int _i; |
1113 | | #if 0 /* anything that can fail? */ |
1114 | | unsigned _fail = 0, _failcnt = 0; |
1115 | | #endif |
1116 | | |
1117 | | for (_i = 0; _i < argc; _i++) { |
1118 | | if (!argv[_i]->varname) |
1119 | | continue; |
1120 | | #if 0 /* anything that can fail? */ |
1121 | | _fail = 0; |
1122 | | #endif |
1123 | | |
1124 | | #if 0 /* anything that can fail? */ |
1125 | | if (_fail) |
1126 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1127 | | argv[_i]->varname, argv[_i]->arg); |
1128 | | _failcnt += _fail; |
1129 | | #endif |
1130 | | } |
1131 | | #if 0 /* anything that can fail? */ |
1132 | | if (_failcnt) |
1133 | | return CMD_WARNING; |
1134 | | #endif |
1135 | | #endif |
1136 | |
|
1137 | 0 | return show_evpn_neigh_magic(self, vty, argc, argv); |
1138 | 0 | } |
1139 | | |
1140 | | /* show_evpn_l2_nh => "show evpn l2-nh [json$json]" */ |
1141 | | DEFUN_CMD_FUNC_DECL(show_evpn_l2_nh) |
1142 | | #define funcdecl_show_evpn_l2_nh static int show_evpn_l2_nh_magic(\ |
1143 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1144 | | struct vty *vty __attribute__ ((unused)),\ |
1145 | | int argc __attribute__ ((unused)),\ |
1146 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1147 | | const char * json) |
1148 | | funcdecl_show_evpn_l2_nh; |
1149 | | DEFUN_CMD_FUNC_TEXT(show_evpn_l2_nh) |
1150 | 0 | { |
1151 | 0 | #if 1 /* anything to parse? */ |
1152 | 0 | int _i; |
1153 | | #if 0 /* anything that can fail? */ |
1154 | | unsigned _fail = 0, _failcnt = 0; |
1155 | | #endif |
1156 | 0 | const char *json = NULL; |
1157 | |
|
1158 | 0 | for (_i = 0; _i < argc; _i++) { |
1159 | 0 | if (!argv[_i]->varname) |
1160 | 0 | continue; |
1161 | | #if 0 /* anything that can fail? */ |
1162 | | _fail = 0; |
1163 | | #endif |
1164 | | |
1165 | 0 | if (!strcmp(argv[_i]->varname, "json")) { |
1166 | 0 | json = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1167 | 0 | } |
1168 | | #if 0 /* anything that can fail? */ |
1169 | | if (_fail) |
1170 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1171 | | argv[_i]->varname, argv[_i]->arg); |
1172 | | _failcnt += _fail; |
1173 | | #endif |
1174 | 0 | } |
1175 | | #if 0 /* anything that can fail? */ |
1176 | | if (_failcnt) |
1177 | | return CMD_WARNING; |
1178 | | #endif |
1179 | 0 | #endif |
1180 | |
|
1181 | 0 | return show_evpn_l2_nh_magic(self, vty, argc, argv, json); |
1182 | 0 | } |
1183 | | |
1184 | | /* show_evpn_es => "show evpn es [NAME$esi_str|detail$detail] [json$json]" */ |
1185 | | DEFUN_CMD_FUNC_DECL(show_evpn_es) |
1186 | | #define funcdecl_show_evpn_es static int show_evpn_es_magic(\ |
1187 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1188 | | struct vty *vty __attribute__ ((unused)),\ |
1189 | | int argc __attribute__ ((unused)),\ |
1190 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1191 | | const char * esi_str,\ |
1192 | | const char * detail,\ |
1193 | | const char * json) |
1194 | | funcdecl_show_evpn_es; |
1195 | | DEFUN_CMD_FUNC_TEXT(show_evpn_es) |
1196 | 0 | { |
1197 | 0 | #if 3 /* anything to parse? */ |
1198 | 0 | int _i; |
1199 | | #if 0 /* anything that can fail? */ |
1200 | | unsigned _fail = 0, _failcnt = 0; |
1201 | | #endif |
1202 | 0 | const char *esi_str = NULL; |
1203 | 0 | const char *detail = NULL; |
1204 | 0 | const char *json = NULL; |
1205 | |
|
1206 | 0 | for (_i = 0; _i < argc; _i++) { |
1207 | 0 | if (!argv[_i]->varname) |
1208 | 0 | continue; |
1209 | | #if 0 /* anything that can fail? */ |
1210 | | _fail = 0; |
1211 | | #endif |
1212 | | |
1213 | 0 | if (!strcmp(argv[_i]->varname, "esi_str")) { |
1214 | 0 | esi_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1215 | 0 | } |
1216 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
1217 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1218 | 0 | } |
1219 | 0 | if (!strcmp(argv[_i]->varname, "json")) { |
1220 | 0 | json = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1221 | 0 | } |
1222 | | #if 0 /* anything that can fail? */ |
1223 | | if (_fail) |
1224 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1225 | | argv[_i]->varname, argv[_i]->arg); |
1226 | | _failcnt += _fail; |
1227 | | #endif |
1228 | 0 | } |
1229 | | #if 0 /* anything that can fail? */ |
1230 | | if (_failcnt) |
1231 | | return CMD_WARNING; |
1232 | | #endif |
1233 | 0 | #endif |
1234 | |
|
1235 | 0 | return show_evpn_es_magic(self, vty, argc, argv, esi_str, detail, json); |
1236 | 0 | } |
1237 | | |
1238 | | /* show_evpn_es_evi => "show evpn es-evi [vni (1-16777215)$vni] [detail$detail] [json$json]" */ |
1239 | | DEFUN_CMD_FUNC_DECL(show_evpn_es_evi) |
1240 | | #define funcdecl_show_evpn_es_evi static int show_evpn_es_evi_magic(\ |
1241 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1242 | | struct vty *vty __attribute__ ((unused)),\ |
1243 | | int argc __attribute__ ((unused)),\ |
1244 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1245 | | long vni,\ |
1246 | | const char * vni_str __attribute__ ((unused)),\ |
1247 | | const char * detail,\ |
1248 | | const char * json) |
1249 | | funcdecl_show_evpn_es_evi; |
1250 | | DEFUN_CMD_FUNC_TEXT(show_evpn_es_evi) |
1251 | 0 | { |
1252 | 0 | #if 3 /* anything to parse? */ |
1253 | 0 | int _i; |
1254 | 0 | #if 1 /* anything that can fail? */ |
1255 | 0 | unsigned _fail = 0, _failcnt = 0; |
1256 | 0 | #endif |
1257 | 0 | long vni = 0; |
1258 | 0 | const char *vni_str = NULL; |
1259 | 0 | const char *detail = NULL; |
1260 | 0 | const char *json = NULL; |
1261 | |
|
1262 | 0 | for (_i = 0; _i < argc; _i++) { |
1263 | 0 | if (!argv[_i]->varname) |
1264 | 0 | continue; |
1265 | 0 | #if 1 /* anything that can fail? */ |
1266 | 0 | _fail = 0; |
1267 | 0 | #endif |
1268 | |
|
1269 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1270 | 0 | vni_str = argv[_i]->arg; |
1271 | 0 | char *_end; |
1272 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1273 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1274 | 0 | } |
1275 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
1276 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1277 | 0 | } |
1278 | 0 | if (!strcmp(argv[_i]->varname, "json")) { |
1279 | 0 | json = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1280 | 0 | } |
1281 | 0 | #if 1 /* anything that can fail? */ |
1282 | 0 | if (_fail) |
1283 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1284 | 0 | argv[_i]->varname, argv[_i]->arg); |
1285 | 0 | _failcnt += _fail; |
1286 | 0 | #endif |
1287 | 0 | } |
1288 | 0 | #if 1 /* anything that can fail? */ |
1289 | 0 | if (_failcnt) |
1290 | 0 | return CMD_WARNING; |
1291 | 0 | #endif |
1292 | 0 | #endif |
1293 | | |
1294 | 0 | return show_evpn_es_evi_magic(self, vty, argc, argv, vni, vni_str, detail, json); |
1295 | 0 | } |
1296 | | |
1297 | | /* show_evpn_access_vlan => "show evpn access-vlan [IFNAME$if_name (1-4094)$vid | detail$detail] [json$json]" */ |
1298 | | DEFUN_CMD_FUNC_DECL(show_evpn_access_vlan) |
1299 | | #define funcdecl_show_evpn_access_vlan static int show_evpn_access_vlan_magic(\ |
1300 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1301 | | struct vty *vty __attribute__ ((unused)),\ |
1302 | | int argc __attribute__ ((unused)),\ |
1303 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1304 | | const char * if_name,\ |
1305 | | long vid,\ |
1306 | | const char * vid_str __attribute__ ((unused)),\ |
1307 | | const char * detail,\ |
1308 | | const char * json) |
1309 | | funcdecl_show_evpn_access_vlan; |
1310 | | DEFUN_CMD_FUNC_TEXT(show_evpn_access_vlan) |
1311 | 0 | { |
1312 | 0 | #if 4 /* anything to parse? */ |
1313 | 0 | int _i; |
1314 | 0 | #if 1 /* anything that can fail? */ |
1315 | 0 | unsigned _fail = 0, _failcnt = 0; |
1316 | 0 | #endif |
1317 | 0 | const char *if_name = NULL; |
1318 | 0 | long vid = 0; |
1319 | 0 | const char *vid_str = NULL; |
1320 | 0 | const char *detail = NULL; |
1321 | 0 | const char *json = NULL; |
1322 | |
|
1323 | 0 | for (_i = 0; _i < argc; _i++) { |
1324 | 0 | if (!argv[_i]->varname) |
1325 | 0 | continue; |
1326 | 0 | #if 1 /* anything that can fail? */ |
1327 | 0 | _fail = 0; |
1328 | 0 | #endif |
1329 | |
|
1330 | 0 | if (!strcmp(argv[_i]->varname, "if_name")) { |
1331 | 0 | if_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1332 | 0 | } |
1333 | 0 | if (!strcmp(argv[_i]->varname, "vid")) { |
1334 | 0 | vid_str = argv[_i]->arg; |
1335 | 0 | char *_end; |
1336 | 0 | vid = strtol(argv[_i]->arg, &_end, 10); |
1337 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1338 | 0 | } |
1339 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
1340 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1341 | 0 | } |
1342 | 0 | if (!strcmp(argv[_i]->varname, "json")) { |
1343 | 0 | json = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1344 | 0 | } |
1345 | 0 | #if 1 /* anything that can fail? */ |
1346 | 0 | if (_fail) |
1347 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1348 | 0 | argv[_i]->varname, argv[_i]->arg); |
1349 | 0 | _failcnt += _fail; |
1350 | 0 | #endif |
1351 | 0 | } |
1352 | 0 | #if 1 /* anything that can fail? */ |
1353 | 0 | if (_failcnt) |
1354 | 0 | return CMD_WARNING; |
1355 | 0 | #endif |
1356 | 0 | #endif |
1357 | | |
1358 | 0 | return show_evpn_access_vlan_magic(self, vty, argc, argv, if_name, vid, vid_str, detail, json); |
1359 | 0 | } |
1360 | | |
1361 | | /* show_evpn_mac_vni_detail => "show evpn mac vni (1-16777215) detail [json]" */ |
1362 | | DEFUN_CMD_FUNC_DECL(show_evpn_mac_vni_detail) |
1363 | | #define funcdecl_show_evpn_mac_vni_detail static int show_evpn_mac_vni_detail_magic(\ |
1364 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1365 | | struct vty *vty __attribute__ ((unused)),\ |
1366 | | int argc __attribute__ ((unused)),\ |
1367 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1368 | | long vni,\ |
1369 | | const char * vni_str __attribute__ ((unused))) |
1370 | | funcdecl_show_evpn_mac_vni_detail; |
1371 | | DEFUN_CMD_FUNC_TEXT(show_evpn_mac_vni_detail) |
1372 | 0 | { |
1373 | 0 | #if 1 /* anything to parse? */ |
1374 | 0 | int _i; |
1375 | 0 | #if 1 /* anything that can fail? */ |
1376 | 0 | unsigned _fail = 0, _failcnt = 0; |
1377 | 0 | #endif |
1378 | 0 | long vni = 0; |
1379 | 0 | const char *vni_str = NULL; |
1380 | |
|
1381 | 0 | for (_i = 0; _i < argc; _i++) { |
1382 | 0 | if (!argv[_i]->varname) |
1383 | 0 | continue; |
1384 | 0 | #if 1 /* anything that can fail? */ |
1385 | 0 | _fail = 0; |
1386 | 0 | #endif |
1387 | |
|
1388 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1389 | 0 | vni_str = argv[_i]->arg; |
1390 | 0 | char *_end; |
1391 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1392 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1393 | 0 | } |
1394 | 0 | #if 1 /* anything that can fail? */ |
1395 | 0 | if (_fail) |
1396 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1397 | 0 | argv[_i]->varname, argv[_i]->arg); |
1398 | 0 | _failcnt += _fail; |
1399 | 0 | #endif |
1400 | 0 | } |
1401 | 0 | #if 1 /* anything that can fail? */ |
1402 | 0 | if (_failcnt) |
1403 | 0 | return CMD_WARNING; |
1404 | 0 | #endif |
1405 | 0 | #endif |
1406 | 0 | if (!vni_str) { |
1407 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1408 | 0 | return CMD_WARNING; |
1409 | 0 | } |
1410 | | |
1411 | 0 | return show_evpn_mac_vni_detail_magic(self, vty, argc, argv, vni, vni_str); |
1412 | 0 | } |
1413 | | |
1414 | | /* show_evpn_mac_vni_all_dad => "show evpn mac vni all duplicate [json]" */ |
1415 | | DEFUN_CMD_FUNC_DECL(show_evpn_mac_vni_all_dad) |
1416 | | #define funcdecl_show_evpn_mac_vni_all_dad static int show_evpn_mac_vni_all_dad_magic(\ |
1417 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1418 | | struct vty *vty __attribute__ ((unused)),\ |
1419 | | int argc __attribute__ ((unused)),\ |
1420 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1421 | | funcdecl_show_evpn_mac_vni_all_dad; |
1422 | | DEFUN_CMD_FUNC_TEXT(show_evpn_mac_vni_all_dad) |
1423 | 0 | { |
1424 | | #if 0 /* anything to parse? */ |
1425 | | int _i; |
1426 | | #if 0 /* anything that can fail? */ |
1427 | | unsigned _fail = 0, _failcnt = 0; |
1428 | | #endif |
1429 | | |
1430 | | for (_i = 0; _i < argc; _i++) { |
1431 | | if (!argv[_i]->varname) |
1432 | | continue; |
1433 | | #if 0 /* anything that can fail? */ |
1434 | | _fail = 0; |
1435 | | #endif |
1436 | | |
1437 | | #if 0 /* anything that can fail? */ |
1438 | | if (_fail) |
1439 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1440 | | argv[_i]->varname, argv[_i]->arg); |
1441 | | _failcnt += _fail; |
1442 | | #endif |
1443 | | } |
1444 | | #if 0 /* anything that can fail? */ |
1445 | | if (_failcnt) |
1446 | | return CMD_WARNING; |
1447 | | #endif |
1448 | | #endif |
1449 | |
|
1450 | 0 | return show_evpn_mac_vni_all_dad_magic(self, vty, argc, argv); |
1451 | 0 | } |
1452 | | |
1453 | | /* show_evpn_mac_vni_dad => "show evpn mac vni (1-16777215) duplicate [json]" */ |
1454 | | DEFUN_CMD_FUNC_DECL(show_evpn_mac_vni_dad) |
1455 | | #define funcdecl_show_evpn_mac_vni_dad static int show_evpn_mac_vni_dad_magic(\ |
1456 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1457 | | struct vty *vty __attribute__ ((unused)),\ |
1458 | | int argc __attribute__ ((unused)),\ |
1459 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1460 | | long vni,\ |
1461 | | const char * vni_str __attribute__ ((unused))) |
1462 | | funcdecl_show_evpn_mac_vni_dad; |
1463 | | DEFUN_CMD_FUNC_TEXT(show_evpn_mac_vni_dad) |
1464 | 0 | { |
1465 | 0 | #if 1 /* anything to parse? */ |
1466 | 0 | int _i; |
1467 | 0 | #if 1 /* anything that can fail? */ |
1468 | 0 | unsigned _fail = 0, _failcnt = 0; |
1469 | 0 | #endif |
1470 | 0 | long vni = 0; |
1471 | 0 | const char *vni_str = NULL; |
1472 | |
|
1473 | 0 | for (_i = 0; _i < argc; _i++) { |
1474 | 0 | if (!argv[_i]->varname) |
1475 | 0 | continue; |
1476 | 0 | #if 1 /* anything that can fail? */ |
1477 | 0 | _fail = 0; |
1478 | 0 | #endif |
1479 | |
|
1480 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1481 | 0 | vni_str = argv[_i]->arg; |
1482 | 0 | char *_end; |
1483 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1484 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1485 | 0 | } |
1486 | 0 | #if 1 /* anything that can fail? */ |
1487 | 0 | if (_fail) |
1488 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1489 | 0 | argv[_i]->varname, argv[_i]->arg); |
1490 | 0 | _failcnt += _fail; |
1491 | 0 | #endif |
1492 | 0 | } |
1493 | 0 | #if 1 /* anything that can fail? */ |
1494 | 0 | if (_failcnt) |
1495 | 0 | return CMD_WARNING; |
1496 | 0 | #endif |
1497 | 0 | #endif |
1498 | 0 | if (!vni_str) { |
1499 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1500 | 0 | return CMD_WARNING; |
1501 | 0 | } |
1502 | | |
1503 | 0 | return show_evpn_mac_vni_dad_magic(self, vty, argc, argv, vni, vni_str); |
1504 | 0 | } |
1505 | | |
1506 | | /* show_evpn_neigh_vni_dad => "show evpn arp-cache vni (1-16777215)duplicate [json]" */ |
1507 | | DEFUN_CMD_FUNC_DECL(show_evpn_neigh_vni_dad) |
1508 | | #define funcdecl_show_evpn_neigh_vni_dad static int show_evpn_neigh_vni_dad_magic(\ |
1509 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1510 | | struct vty *vty __attribute__ ((unused)),\ |
1511 | | int argc __attribute__ ((unused)),\ |
1512 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1513 | | long vni,\ |
1514 | | const char * vni_str __attribute__ ((unused))) |
1515 | | funcdecl_show_evpn_neigh_vni_dad; |
1516 | | DEFUN_CMD_FUNC_TEXT(show_evpn_neigh_vni_dad) |
1517 | 0 | { |
1518 | 0 | #if 1 /* anything to parse? */ |
1519 | 0 | int _i; |
1520 | 0 | #if 1 /* anything that can fail? */ |
1521 | 0 | unsigned _fail = 0, _failcnt = 0; |
1522 | 0 | #endif |
1523 | 0 | long vni = 0; |
1524 | 0 | const char *vni_str = NULL; |
1525 | |
|
1526 | 0 | for (_i = 0; _i < argc; _i++) { |
1527 | 0 | if (!argv[_i]->varname) |
1528 | 0 | continue; |
1529 | 0 | #if 1 /* anything that can fail? */ |
1530 | 0 | _fail = 0; |
1531 | 0 | #endif |
1532 | |
|
1533 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1534 | 0 | vni_str = argv[_i]->arg; |
1535 | 0 | char *_end; |
1536 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1537 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1538 | 0 | } |
1539 | 0 | #if 1 /* anything that can fail? */ |
1540 | 0 | if (_fail) |
1541 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1542 | 0 | argv[_i]->varname, argv[_i]->arg); |
1543 | 0 | _failcnt += _fail; |
1544 | 0 | #endif |
1545 | 0 | } |
1546 | 0 | #if 1 /* anything that can fail? */ |
1547 | 0 | if (_failcnt) |
1548 | 0 | return CMD_WARNING; |
1549 | 0 | #endif |
1550 | 0 | #endif |
1551 | 0 | if (!vni_str) { |
1552 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1553 | 0 | return CMD_WARNING; |
1554 | 0 | } |
1555 | | |
1556 | 0 | return show_evpn_neigh_vni_dad_magic(self, vty, argc, argv, vni, vni_str); |
1557 | 0 | } |
1558 | | |
1559 | | /* show_evpn_neigh_vni_all_dad => "show evpn arp-cache vni all duplicate [json]" */ |
1560 | | DEFUN_CMD_FUNC_DECL(show_evpn_neigh_vni_all_dad) |
1561 | | #define funcdecl_show_evpn_neigh_vni_all_dad static int show_evpn_neigh_vni_all_dad_magic(\ |
1562 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1563 | | struct vty *vty __attribute__ ((unused)),\ |
1564 | | int argc __attribute__ ((unused)),\ |
1565 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1566 | | funcdecl_show_evpn_neigh_vni_all_dad; |
1567 | | DEFUN_CMD_FUNC_TEXT(show_evpn_neigh_vni_all_dad) |
1568 | 0 | { |
1569 | | #if 0 /* anything to parse? */ |
1570 | | int _i; |
1571 | | #if 0 /* anything that can fail? */ |
1572 | | unsigned _fail = 0, _failcnt = 0; |
1573 | | #endif |
1574 | | |
1575 | | for (_i = 0; _i < argc; _i++) { |
1576 | | if (!argv[_i]->varname) |
1577 | | continue; |
1578 | | #if 0 /* anything that can fail? */ |
1579 | | _fail = 0; |
1580 | | #endif |
1581 | | |
1582 | | #if 0 /* anything that can fail? */ |
1583 | | if (_fail) |
1584 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1585 | | argv[_i]->varname, argv[_i]->arg); |
1586 | | _failcnt += _fail; |
1587 | | #endif |
1588 | | } |
1589 | | #if 0 /* anything that can fail? */ |
1590 | | if (_failcnt) |
1591 | | return CMD_WARNING; |
1592 | | #endif |
1593 | | #endif |
1594 | |
|
1595 | 0 | return show_evpn_neigh_vni_all_dad_magic(self, vty, argc, argv); |
1596 | 0 | } |
1597 | | |
1598 | | /* show_pbr_rule => "show pbr rule" */ |
1599 | | DEFUN_CMD_FUNC_DECL(show_pbr_rule) |
1600 | | #define funcdecl_show_pbr_rule static int show_pbr_rule_magic(\ |
1601 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1602 | | struct vty *vty __attribute__ ((unused)),\ |
1603 | | int argc __attribute__ ((unused)),\ |
1604 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1605 | | funcdecl_show_pbr_rule; |
1606 | | DEFUN_CMD_FUNC_TEXT(show_pbr_rule) |
1607 | 0 | { |
1608 | | #if 0 /* anything to parse? */ |
1609 | | int _i; |
1610 | | #if 0 /* anything that can fail? */ |
1611 | | unsigned _fail = 0, _failcnt = 0; |
1612 | | #endif |
1613 | | |
1614 | | for (_i = 0; _i < argc; _i++) { |
1615 | | if (!argv[_i]->varname) |
1616 | | continue; |
1617 | | #if 0 /* anything that can fail? */ |
1618 | | _fail = 0; |
1619 | | #endif |
1620 | | |
1621 | | #if 0 /* anything that can fail? */ |
1622 | | if (_fail) |
1623 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1624 | | argv[_i]->varname, argv[_i]->arg); |
1625 | | _failcnt += _fail; |
1626 | | #endif |
1627 | | } |
1628 | | #if 0 /* anything that can fail? */ |
1629 | | if (_failcnt) |
1630 | | return CMD_WARNING; |
1631 | | #endif |
1632 | | #endif |
1633 | |
|
1634 | 0 | return show_pbr_rule_magic(self, vty, argc, argv); |
1635 | 0 | } |
1636 | | |
1637 | | /* pbr_nexthop_resolve => "[no$no] pbr nexthop-resolve" */ |
1638 | | DEFUN_CMD_FUNC_DECL(pbr_nexthop_resolve) |
1639 | | #define funcdecl_pbr_nexthop_resolve static int pbr_nexthop_resolve_magic(\ |
1640 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1641 | | struct vty *vty __attribute__ ((unused)),\ |
1642 | | int argc __attribute__ ((unused)),\ |
1643 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1644 | | const char * no) |
1645 | | funcdecl_pbr_nexthop_resolve; |
1646 | | DEFUN_CMD_FUNC_TEXT(pbr_nexthop_resolve) |
1647 | 0 | { |
1648 | 0 | #if 1 /* anything to parse? */ |
1649 | 0 | int _i; |
1650 | | #if 0 /* anything that can fail? */ |
1651 | | unsigned _fail = 0, _failcnt = 0; |
1652 | | #endif |
1653 | 0 | const char *no = NULL; |
1654 | |
|
1655 | 0 | for (_i = 0; _i < argc; _i++) { |
1656 | 0 | if (!argv[_i]->varname) |
1657 | 0 | continue; |
1658 | | #if 0 /* anything that can fail? */ |
1659 | | _fail = 0; |
1660 | | #endif |
1661 | | |
1662 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
1663 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1664 | 0 | } |
1665 | | #if 0 /* anything that can fail? */ |
1666 | | if (_fail) |
1667 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1668 | | argv[_i]->varname, argv[_i]->arg); |
1669 | | _failcnt += _fail; |
1670 | | #endif |
1671 | 0 | } |
1672 | | #if 0 /* anything that can fail? */ |
1673 | | if (_failcnt) |
1674 | | return CMD_WARNING; |
1675 | | #endif |
1676 | 0 | #endif |
1677 | |
|
1678 | 0 | return pbr_nexthop_resolve_magic(self, vty, argc, argv, no); |
1679 | 0 | } |
1680 | | |
1681 | | /* clear_evpn_dup_addr => "clear evpn dup-addr vni <all$vni_all |(1-16777215)$vni [mac X:X:X:X:X:X | ip <A.B.C.D|X:X::X:X>]>" */ |
1682 | | DEFUN_CMD_FUNC_DECL(clear_evpn_dup_addr) |
1683 | | #define funcdecl_clear_evpn_dup_addr static int clear_evpn_dup_addr_magic(\ |
1684 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1685 | | struct vty *vty __attribute__ ((unused)),\ |
1686 | | int argc __attribute__ ((unused)),\ |
1687 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1688 | | const char * vni_all,\ |
1689 | | long vni,\ |
1690 | | const char * vni_str __attribute__ ((unused)),\ |
1691 | | struct prefix_eth * mac,\ |
1692 | | const char * mac_str __attribute__ ((unused)),\ |
1693 | | const union sockunion * ip,\ |
1694 | | const char * ip_str __attribute__ ((unused))) |
1695 | | funcdecl_clear_evpn_dup_addr; |
1696 | | DEFUN_CMD_FUNC_TEXT(clear_evpn_dup_addr) |
1697 | 0 | { |
1698 | 0 | #if 4 /* anything to parse? */ |
1699 | 0 | int _i; |
1700 | 0 | #if 1 /* anything that can fail? */ |
1701 | 0 | unsigned _fail = 0, _failcnt = 0; |
1702 | 0 | #endif |
1703 | 0 | const char *vni_all = NULL; |
1704 | 0 | long vni = 0; |
1705 | 0 | const char *vni_str = NULL; |
1706 | 0 | struct prefix_eth mac = { }; |
1707 | 0 | const char *mac_str = NULL; |
1708 | 0 | union sockunion s__ip = { .sa.sa_family = AF_UNSPEC }, *ip = NULL; |
1709 | 0 | const char *ip_str = NULL; |
1710 | |
|
1711 | 0 | for (_i = 0; _i < argc; _i++) { |
1712 | 0 | if (!argv[_i]->varname) |
1713 | 0 | continue; |
1714 | 0 | #if 1 /* anything that can fail? */ |
1715 | 0 | _fail = 0; |
1716 | 0 | #endif |
1717 | |
|
1718 | 0 | if (!strcmp(argv[_i]->varname, "vni_all")) { |
1719 | 0 | vni_all = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1720 | 0 | } |
1721 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1722 | 0 | vni_str = argv[_i]->arg; |
1723 | 0 | char *_end; |
1724 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1725 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1726 | 0 | } |
1727 | 0 | if (!strcmp(argv[_i]->varname, "mac")) { |
1728 | 0 | mac_str = argv[_i]->arg; |
1729 | 0 | _fail = !str2prefix_eth(argv[_i]->arg, &mac); |
1730 | 0 | } |
1731 | 0 | if (!strcmp(argv[_i]->varname, "ip")) { |
1732 | 0 | ip_str = argv[_i]->arg; |
1733 | 0 | if (argv[_i]->text[0] == 'X') { |
1734 | 0 | s__ip.sa.sa_family = AF_INET6; |
1735 | 0 | _fail = !inet_pton(AF_INET6, argv[_i]->arg, &s__ip.sin6.sin6_addr); |
1736 | 0 | ip = &s__ip; |
1737 | 0 | } else { |
1738 | 0 | s__ip.sa.sa_family = AF_INET; |
1739 | 0 | _fail = !inet_aton(argv[_i]->arg, &s__ip.sin.sin_addr); |
1740 | 0 | ip = &s__ip; |
1741 | 0 | } |
1742 | 0 | } |
1743 | 0 | #if 1 /* anything that can fail? */ |
1744 | 0 | if (_fail) |
1745 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1746 | 0 | argv[_i]->varname, argv[_i]->arg); |
1747 | 0 | _failcnt += _fail; |
1748 | 0 | #endif |
1749 | 0 | } |
1750 | 0 | #if 1 /* anything that can fail? */ |
1751 | 0 | if (_failcnt) |
1752 | 0 | return CMD_WARNING; |
1753 | 0 | #endif |
1754 | 0 | #endif |
1755 | | |
1756 | 0 | return clear_evpn_dup_addr_magic(self, vty, argc, argv, vni_all, vni, vni_str, &mac, mac_str, ip, ip_str); |
1757 | 0 | } |
1758 | | |
1759 | | /* evpn_accept_bgp_seq => "evpn accept-bgp-seq" */ |
1760 | | DEFUN_CMD_FUNC_DECL(evpn_accept_bgp_seq) |
1761 | | #define funcdecl_evpn_accept_bgp_seq static int evpn_accept_bgp_seq_magic(\ |
1762 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1763 | | struct vty *vty __attribute__ ((unused)),\ |
1764 | | int argc __attribute__ ((unused)),\ |
1765 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1766 | | funcdecl_evpn_accept_bgp_seq; |
1767 | | DEFUN_CMD_FUNC_TEXT(evpn_accept_bgp_seq) |
1768 | 0 | { |
1769 | | #if 0 /* anything to parse? */ |
1770 | | int _i; |
1771 | | #if 0 /* anything that can fail? */ |
1772 | | unsigned _fail = 0, _failcnt = 0; |
1773 | | #endif |
1774 | | |
1775 | | for (_i = 0; _i < argc; _i++) { |
1776 | | if (!argv[_i]->varname) |
1777 | | continue; |
1778 | | #if 0 /* anything that can fail? */ |
1779 | | _fail = 0; |
1780 | | #endif |
1781 | | |
1782 | | #if 0 /* anything that can fail? */ |
1783 | | if (_fail) |
1784 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1785 | | argv[_i]->varname, argv[_i]->arg); |
1786 | | _failcnt += _fail; |
1787 | | #endif |
1788 | | } |
1789 | | #if 0 /* anything that can fail? */ |
1790 | | if (_failcnt) |
1791 | | return CMD_WARNING; |
1792 | | #endif |
1793 | | #endif |
1794 | |
|
1795 | 0 | return evpn_accept_bgp_seq_magic(self, vty, argc, argv); |
1796 | 0 | } |
1797 | | |
1798 | | /* no_evpn_accept_bgp_seq => "no evpn accept-bgp-seq" */ |
1799 | | DEFUN_CMD_FUNC_DECL(no_evpn_accept_bgp_seq) |
1800 | | #define funcdecl_no_evpn_accept_bgp_seq static int no_evpn_accept_bgp_seq_magic(\ |
1801 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1802 | | struct vty *vty __attribute__ ((unused)),\ |
1803 | | int argc __attribute__ ((unused)),\ |
1804 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1805 | | funcdecl_no_evpn_accept_bgp_seq; |
1806 | | DEFUN_CMD_FUNC_TEXT(no_evpn_accept_bgp_seq) |
1807 | 0 | { |
1808 | | #if 0 /* anything to parse? */ |
1809 | | int _i; |
1810 | | #if 0 /* anything that can fail? */ |
1811 | | unsigned _fail = 0, _failcnt = 0; |
1812 | | #endif |
1813 | | |
1814 | | for (_i = 0; _i < argc; _i++) { |
1815 | | if (!argv[_i]->varname) |
1816 | | continue; |
1817 | | #if 0 /* anything that can fail? */ |
1818 | | _fail = 0; |
1819 | | #endif |
1820 | | |
1821 | | #if 0 /* anything that can fail? */ |
1822 | | if (_fail) |
1823 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1824 | | argv[_i]->varname, argv[_i]->arg); |
1825 | | _failcnt += _fail; |
1826 | | #endif |
1827 | | } |
1828 | | #if 0 /* anything that can fail? */ |
1829 | | if (_failcnt) |
1830 | | return CMD_WARNING; |
1831 | | #endif |
1832 | | #endif |
1833 | |
|
1834 | 0 | return no_evpn_accept_bgp_seq_magic(self, vty, argc, argv); |
1835 | 0 | } |
1836 | | |
1837 | | /* zebra_nexthop_group_keep => "[no] zebra nexthop-group keep (1-3600)" */ |
1838 | | DEFUN_CMD_FUNC_DECL(zebra_nexthop_group_keep) |
1839 | | #define funcdecl_zebra_nexthop_group_keep static int zebra_nexthop_group_keep_magic(\ |
1840 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1841 | | struct vty *vty __attribute__ ((unused)),\ |
1842 | | int argc __attribute__ ((unused)),\ |
1843 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1844 | | const char * no,\ |
1845 | | long keep,\ |
1846 | | const char * keep_str __attribute__ ((unused))) |
1847 | | funcdecl_zebra_nexthop_group_keep; |
1848 | | DEFUN_CMD_FUNC_TEXT(zebra_nexthop_group_keep) |
1849 | 0 | { |
1850 | 0 | #if 2 /* anything to parse? */ |
1851 | 0 | int _i; |
1852 | 0 | #if 1 /* anything that can fail? */ |
1853 | 0 | unsigned _fail = 0, _failcnt = 0; |
1854 | 0 | #endif |
1855 | 0 | const char *no = NULL; |
1856 | 0 | long keep = 0; |
1857 | 0 | const char *keep_str = NULL; |
1858 | |
|
1859 | 0 | for (_i = 0; _i < argc; _i++) { |
1860 | 0 | if (!argv[_i]->varname) |
1861 | 0 | continue; |
1862 | 0 | #if 1 /* anything that can fail? */ |
1863 | 0 | _fail = 0; |
1864 | 0 | #endif |
1865 | |
|
1866 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
1867 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1868 | 0 | } |
1869 | 0 | if (!strcmp(argv[_i]->varname, "keep")) { |
1870 | 0 | keep_str = argv[_i]->arg; |
1871 | 0 | char *_end; |
1872 | 0 | keep = strtol(argv[_i]->arg, &_end, 10); |
1873 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1874 | 0 | } |
1875 | 0 | #if 1 /* anything that can fail? */ |
1876 | 0 | if (_fail) |
1877 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1878 | 0 | argv[_i]->varname, argv[_i]->arg); |
1879 | 0 | _failcnt += _fail; |
1880 | 0 | #endif |
1881 | 0 | } |
1882 | 0 | #if 1 /* anything that can fail? */ |
1883 | 0 | if (_failcnt) |
1884 | 0 | return CMD_WARNING; |
1885 | 0 | #endif |
1886 | 0 | #endif |
1887 | 0 | if (!keep_str) { |
1888 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "keep_str"); |
1889 | 0 | return CMD_WARNING; |
1890 | 0 | } |
1891 | | |
1892 | 0 | return zebra_nexthop_group_keep_magic(self, vty, argc, argv, no, keep, keep_str); |
1893 | 0 | } |
1894 | | |
1895 | | #ifdef HAVE_NETLINK |
1896 | | /* zebra_protodown_bit => "zebra protodown reason-bit (0-31)$bit" */ |
1897 | | DEFUN_CMD_FUNC_DECL(zebra_protodown_bit) |
1898 | | #define funcdecl_zebra_protodown_bit static int zebra_protodown_bit_magic(\ |
1899 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1900 | | struct vty *vty __attribute__ ((unused)),\ |
1901 | | int argc __attribute__ ((unused)),\ |
1902 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1903 | | long bit,\ |
1904 | | const char * bit_str __attribute__ ((unused))) |
1905 | | funcdecl_zebra_protodown_bit; |
1906 | | DEFUN_CMD_FUNC_TEXT(zebra_protodown_bit) |
1907 | 0 | { |
1908 | 0 | #if 1 /* anything to parse? */ |
1909 | 0 | int _i; |
1910 | 0 | #if 1 /* anything that can fail? */ |
1911 | 0 | unsigned _fail = 0, _failcnt = 0; |
1912 | 0 | #endif |
1913 | 0 | long bit = 0; |
1914 | 0 | const char *bit_str = NULL; |
1915 | |
|
1916 | 0 | for (_i = 0; _i < argc; _i++) { |
1917 | 0 | if (!argv[_i]->varname) |
1918 | 0 | continue; |
1919 | 0 | #if 1 /* anything that can fail? */ |
1920 | 0 | _fail = 0; |
1921 | 0 | #endif |
1922 | |
|
1923 | 0 | if (!strcmp(argv[_i]->varname, "bit")) { |
1924 | 0 | bit_str = argv[_i]->arg; |
1925 | 0 | char *_end; |
1926 | 0 | bit = strtol(argv[_i]->arg, &_end, 10); |
1927 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1928 | 0 | } |
1929 | 0 | #if 1 /* anything that can fail? */ |
1930 | 0 | if (_fail) |
1931 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1932 | 0 | argv[_i]->varname, argv[_i]->arg); |
1933 | 0 | _failcnt += _fail; |
1934 | 0 | #endif |
1935 | 0 | } |
1936 | 0 | #if 1 /* anything that can fail? */ |
1937 | 0 | if (_failcnt) |
1938 | 0 | return CMD_WARNING; |
1939 | 0 | #endif |
1940 | 0 | #endif |
1941 | 0 | if (!bit_str) { |
1942 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "bit_str"); |
1943 | 0 | return CMD_WARNING; |
1944 | 0 | } |
1945 | | |
1946 | 0 | return zebra_protodown_bit_magic(self, vty, argc, argv, bit, bit_str); |
1947 | 0 | } |
1948 | | #endif |
1949 | | |
1950 | | #ifdef HAVE_NETLINK |
1951 | | /* no_zebra_protodown_bit => "no zebra protodown reason-bit [(0-31)$bit]" */ |
1952 | | DEFUN_CMD_FUNC_DECL(no_zebra_protodown_bit) |
1953 | | #define funcdecl_no_zebra_protodown_bit static int no_zebra_protodown_bit_magic(\ |
1954 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1955 | | struct vty *vty __attribute__ ((unused)),\ |
1956 | | int argc __attribute__ ((unused)),\ |
1957 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1958 | | long bit,\ |
1959 | | const char * bit_str __attribute__ ((unused))) |
1960 | | funcdecl_no_zebra_protodown_bit; |
1961 | | DEFUN_CMD_FUNC_TEXT(no_zebra_protodown_bit) |
1962 | 0 | { |
1963 | 0 | #if 1 /* anything to parse? */ |
1964 | 0 | int _i; |
1965 | 0 | #if 1 /* anything that can fail? */ |
1966 | 0 | unsigned _fail = 0, _failcnt = 0; |
1967 | 0 | #endif |
1968 | 0 | long bit = 0; |
1969 | 0 | const char *bit_str = NULL; |
1970 | |
|
1971 | 0 | for (_i = 0; _i < argc; _i++) { |
1972 | 0 | if (!argv[_i]->varname) |
1973 | 0 | continue; |
1974 | 0 | #if 1 /* anything that can fail? */ |
1975 | 0 | _fail = 0; |
1976 | 0 | #endif |
1977 | |
|
1978 | 0 | if (!strcmp(argv[_i]->varname, "bit")) { |
1979 | 0 | bit_str = argv[_i]->arg; |
1980 | 0 | char *_end; |
1981 | 0 | bit = strtol(argv[_i]->arg, &_end, 10); |
1982 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1983 | 0 | } |
1984 | 0 | #if 1 /* anything that can fail? */ |
1985 | 0 | if (_fail) |
1986 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1987 | 0 | argv[_i]->varname, argv[_i]->arg); |
1988 | 0 | _failcnt += _fail; |
1989 | 0 | #endif |
1990 | 0 | } |
1991 | 0 | #if 1 /* anything that can fail? */ |
1992 | 0 | if (_failcnt) |
1993 | 0 | return CMD_WARNING; |
1994 | 0 | #endif |
1995 | 0 | #endif |
1996 | | |
1997 | 0 | return no_zebra_protodown_bit_magic(self, vty, argc, argv, bit, bit_str); |
1998 | 0 | } |
1999 | | #endif |
2000 | | |