/src/frr/bgpd/bgp_evpn_vty_clippy.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* bgp_evpn_flood_control => "[no$no] flooding <disable$disable|head-end-replication$her>" */ |
2 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_flood_control) |
3 | | #define funcdecl_bgp_evpn_flood_control static int bgp_evpn_flood_control_magic(\ |
4 | | const struct cmd_element *self __attribute__ ((unused)),\ |
5 | | struct vty *vty __attribute__ ((unused)),\ |
6 | | int argc __attribute__ ((unused)),\ |
7 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
8 | | const char * no,\ |
9 | | const char * disable,\ |
10 | | const char * her) |
11 | | funcdecl_bgp_evpn_flood_control; |
12 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_flood_control) |
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 *no = NULL; |
20 | 0 | const char *disable = NULL; |
21 | 0 | const char *her = 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, "no")) { |
31 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
32 | 0 | } |
33 | 0 | if (!strcmp(argv[_i]->varname, "disable")) { |
34 | 0 | disable = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
35 | 0 | } |
36 | 0 | if (!strcmp(argv[_i]->varname, "her")) { |
37 | 0 | her = (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 bgp_evpn_flood_control_magic(self, vty, argc, argv, no, disable, her); |
53 | 0 | } |
54 | | |
55 | | /* dup_addr_detection => "dup-addr-detection [max-moves (2-1000)$max_moves_val time (2-1800)$time_val]" */ |
56 | | DEFUN_CMD_FUNC_DECL(dup_addr_detection) |
57 | | #define funcdecl_dup_addr_detection static int dup_addr_detection_magic(\ |
58 | | const struct cmd_element *self __attribute__ ((unused)),\ |
59 | | struct vty *vty __attribute__ ((unused)),\ |
60 | | int argc __attribute__ ((unused)),\ |
61 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
62 | | long max_moves_val,\ |
63 | | const char * max_moves_val_str __attribute__ ((unused)),\ |
64 | | long time_val,\ |
65 | | const char * time_val_str __attribute__ ((unused))) |
66 | | funcdecl_dup_addr_detection; |
67 | | DEFUN_CMD_FUNC_TEXT(dup_addr_detection) |
68 | 0 | { |
69 | 0 | #if 2 /* anything to parse? */ |
70 | 0 | int _i; |
71 | 0 | #if 1 /* anything that can fail? */ |
72 | 0 | unsigned _fail = 0, _failcnt = 0; |
73 | 0 | #endif |
74 | 0 | long max_moves_val = 0; |
75 | 0 | const char *max_moves_val_str = NULL; |
76 | 0 | long time_val = 0; |
77 | 0 | const char *time_val_str = NULL; |
78 | |
|
79 | 0 | for (_i = 0; _i < argc; _i++) { |
80 | 0 | if (!argv[_i]->varname) |
81 | 0 | continue; |
82 | 0 | #if 1 /* anything that can fail? */ |
83 | 0 | _fail = 0; |
84 | 0 | #endif |
85 | |
|
86 | 0 | if (!strcmp(argv[_i]->varname, "max_moves_val")) { |
87 | 0 | max_moves_val_str = argv[_i]->arg; |
88 | 0 | char *_end; |
89 | 0 | max_moves_val = strtol(argv[_i]->arg, &_end, 10); |
90 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
91 | 0 | } |
92 | 0 | if (!strcmp(argv[_i]->varname, "time_val")) { |
93 | 0 | time_val_str = argv[_i]->arg; |
94 | 0 | char *_end; |
95 | 0 | time_val = strtol(argv[_i]->arg, &_end, 10); |
96 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
97 | 0 | } |
98 | 0 | #if 1 /* anything that can fail? */ |
99 | 0 | if (_fail) |
100 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
101 | 0 | argv[_i]->varname, argv[_i]->arg); |
102 | 0 | _failcnt += _fail; |
103 | 0 | #endif |
104 | 0 | } |
105 | 0 | #if 1 /* anything that can fail? */ |
106 | 0 | if (_failcnt) |
107 | 0 | return CMD_WARNING; |
108 | 0 | #endif |
109 | 0 | #endif |
110 | | |
111 | 0 | return dup_addr_detection_magic(self, vty, argc, argv, max_moves_val, max_moves_val_str, time_val, time_val_str); |
112 | 0 | } |
113 | | |
114 | | /* dup_addr_detection_auto_recovery => "dup-addr-detection freeze <permanent |(30-3600)$freeze_time_val>" */ |
115 | | DEFUN_CMD_FUNC_DECL(dup_addr_detection_auto_recovery) |
116 | | #define funcdecl_dup_addr_detection_auto_recovery static int dup_addr_detection_auto_recovery_magic(\ |
117 | | const struct cmd_element *self __attribute__ ((unused)),\ |
118 | | struct vty *vty __attribute__ ((unused)),\ |
119 | | int argc __attribute__ ((unused)),\ |
120 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
121 | | long freeze_time_val,\ |
122 | | const char * freeze_time_val_str __attribute__ ((unused))) |
123 | | funcdecl_dup_addr_detection_auto_recovery; |
124 | | DEFUN_CMD_FUNC_TEXT(dup_addr_detection_auto_recovery) |
125 | 0 | { |
126 | 0 | #if 1 /* anything to parse? */ |
127 | 0 | int _i; |
128 | 0 | #if 1 /* anything that can fail? */ |
129 | 0 | unsigned _fail = 0, _failcnt = 0; |
130 | 0 | #endif |
131 | 0 | long freeze_time_val = 0; |
132 | 0 | const char *freeze_time_val_str = NULL; |
133 | |
|
134 | 0 | for (_i = 0; _i < argc; _i++) { |
135 | 0 | if (!argv[_i]->varname) |
136 | 0 | continue; |
137 | 0 | #if 1 /* anything that can fail? */ |
138 | 0 | _fail = 0; |
139 | 0 | #endif |
140 | |
|
141 | 0 | if (!strcmp(argv[_i]->varname, "freeze_time_val")) { |
142 | 0 | freeze_time_val_str = argv[_i]->arg; |
143 | 0 | char *_end; |
144 | 0 | freeze_time_val = strtol(argv[_i]->arg, &_end, 10); |
145 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
146 | 0 | } |
147 | 0 | #if 1 /* anything that can fail? */ |
148 | 0 | if (_fail) |
149 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
150 | 0 | argv[_i]->varname, argv[_i]->arg); |
151 | 0 | _failcnt += _fail; |
152 | 0 | #endif |
153 | 0 | } |
154 | 0 | #if 1 /* anything that can fail? */ |
155 | 0 | if (_failcnt) |
156 | 0 | return CMD_WARNING; |
157 | 0 | #endif |
158 | 0 | #endif |
159 | | |
160 | 0 | return dup_addr_detection_auto_recovery_magic(self, vty, argc, argv, freeze_time_val, freeze_time_val_str); |
161 | 0 | } |
162 | | |
163 | | /* no_dup_addr_detection => "no dup-addr-detection [max-moves (2-1000)$max_moves_val time (2-1800)$time_val | freeze <permanent$permanent_val | (30-3600)$freeze_time_val>]" */ |
164 | | DEFUN_CMD_FUNC_DECL(no_dup_addr_detection) |
165 | | #define funcdecl_no_dup_addr_detection static int no_dup_addr_detection_magic(\ |
166 | | const struct cmd_element *self __attribute__ ((unused)),\ |
167 | | struct vty *vty __attribute__ ((unused)),\ |
168 | | int argc __attribute__ ((unused)),\ |
169 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
170 | | long max_moves_val,\ |
171 | | const char * max_moves_val_str __attribute__ ((unused)),\ |
172 | | long time_val,\ |
173 | | const char * time_val_str __attribute__ ((unused)),\ |
174 | | const char * permanent_val,\ |
175 | | long freeze_time_val,\ |
176 | | const char * freeze_time_val_str __attribute__ ((unused))) |
177 | | funcdecl_no_dup_addr_detection; |
178 | | DEFUN_CMD_FUNC_TEXT(no_dup_addr_detection) |
179 | 0 | { |
180 | 0 | #if 4 /* anything to parse? */ |
181 | 0 | int _i; |
182 | 0 | #if 1 /* anything that can fail? */ |
183 | 0 | unsigned _fail = 0, _failcnt = 0; |
184 | 0 | #endif |
185 | 0 | long max_moves_val = 0; |
186 | 0 | const char *max_moves_val_str = NULL; |
187 | 0 | long time_val = 0; |
188 | 0 | const char *time_val_str = NULL; |
189 | 0 | const char *permanent_val = NULL; |
190 | 0 | long freeze_time_val = 0; |
191 | 0 | const char *freeze_time_val_str = NULL; |
192 | |
|
193 | 0 | for (_i = 0; _i < argc; _i++) { |
194 | 0 | if (!argv[_i]->varname) |
195 | 0 | continue; |
196 | 0 | #if 1 /* anything that can fail? */ |
197 | 0 | _fail = 0; |
198 | 0 | #endif |
199 | |
|
200 | 0 | if (!strcmp(argv[_i]->varname, "max_moves_val")) { |
201 | 0 | max_moves_val_str = argv[_i]->arg; |
202 | 0 | char *_end; |
203 | 0 | max_moves_val = strtol(argv[_i]->arg, &_end, 10); |
204 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
205 | 0 | } |
206 | 0 | if (!strcmp(argv[_i]->varname, "time_val")) { |
207 | 0 | time_val_str = argv[_i]->arg; |
208 | 0 | char *_end; |
209 | 0 | time_val = strtol(argv[_i]->arg, &_end, 10); |
210 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
211 | 0 | } |
212 | 0 | if (!strcmp(argv[_i]->varname, "permanent_val")) { |
213 | 0 | permanent_val = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
214 | 0 | } |
215 | 0 | if (!strcmp(argv[_i]->varname, "freeze_time_val")) { |
216 | 0 | freeze_time_val_str = argv[_i]->arg; |
217 | 0 | char *_end; |
218 | 0 | freeze_time_val = strtol(argv[_i]->arg, &_end, 10); |
219 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
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 | | |
234 | 0 | return no_dup_addr_detection_magic(self, vty, argc, argv, max_moves_val, max_moves_val_str, time_val, time_val_str, permanent_val, freeze_time_val, freeze_time_val_str); |
235 | 0 | } |
236 | | |
237 | | /* bgp_evpn_advertise_svi_ip => "[no$no] advertise-svi-ip" */ |
238 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_advertise_svi_ip) |
239 | | #define funcdecl_bgp_evpn_advertise_svi_ip static int bgp_evpn_advertise_svi_ip_magic(\ |
240 | | const struct cmd_element *self __attribute__ ((unused)),\ |
241 | | struct vty *vty __attribute__ ((unused)),\ |
242 | | int argc __attribute__ ((unused)),\ |
243 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
244 | | const char * no) |
245 | | funcdecl_bgp_evpn_advertise_svi_ip; |
246 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_advertise_svi_ip) |
247 | 0 | { |
248 | 0 | #if 1 /* anything to parse? */ |
249 | 0 | int _i; |
250 | | #if 0 /* anything that can fail? */ |
251 | | unsigned _fail = 0, _failcnt = 0; |
252 | | #endif |
253 | 0 | const char *no = NULL; |
254 | |
|
255 | 0 | for (_i = 0; _i < argc; _i++) { |
256 | 0 | if (!argv[_i]->varname) |
257 | 0 | continue; |
258 | | #if 0 /* anything that can fail? */ |
259 | | _fail = 0; |
260 | | #endif |
261 | | |
262 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
263 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
264 | 0 | } |
265 | | #if 0 /* anything that can fail? */ |
266 | | if (_fail) |
267 | | vty_out (vty, "%% invalid input for %s: %s\n", |
268 | | argv[_i]->varname, argv[_i]->arg); |
269 | | _failcnt += _fail; |
270 | | #endif |
271 | 0 | } |
272 | | #if 0 /* anything that can fail? */ |
273 | | if (_failcnt) |
274 | | return CMD_WARNING; |
275 | | #endif |
276 | 0 | #endif |
277 | |
|
278 | 0 | return bgp_evpn_advertise_svi_ip_magic(self, vty, argc, argv, no); |
279 | 0 | } |
280 | | |
281 | | /* bgp_evpn_advertise_svi_ip_vni => "[no$no] advertise-svi-ip" */ |
282 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_advertise_svi_ip_vni) |
283 | | #define funcdecl_bgp_evpn_advertise_svi_ip_vni static int bgp_evpn_advertise_svi_ip_vni_magic(\ |
284 | | const struct cmd_element *self __attribute__ ((unused)),\ |
285 | | struct vty *vty __attribute__ ((unused)),\ |
286 | | int argc __attribute__ ((unused)),\ |
287 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
288 | | const char * no) |
289 | | funcdecl_bgp_evpn_advertise_svi_ip_vni; |
290 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_advertise_svi_ip_vni) |
291 | 0 | { |
292 | 0 | #if 1 /* anything to parse? */ |
293 | 0 | int _i; |
294 | | #if 0 /* anything that can fail? */ |
295 | | unsigned _fail = 0, _failcnt = 0; |
296 | | #endif |
297 | 0 | const char *no = NULL; |
298 | |
|
299 | 0 | for (_i = 0; _i < argc; _i++) { |
300 | 0 | if (!argv[_i]->varname) |
301 | 0 | continue; |
302 | | #if 0 /* anything that can fail? */ |
303 | | _fail = 0; |
304 | | #endif |
305 | | |
306 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
307 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
308 | 0 | } |
309 | | #if 0 /* anything that can fail? */ |
310 | | if (_fail) |
311 | | vty_out (vty, "%% invalid input for %s: %s\n", |
312 | | argv[_i]->varname, argv[_i]->arg); |
313 | | _failcnt += _fail; |
314 | | #endif |
315 | 0 | } |
316 | | #if 0 /* anything that can fail? */ |
317 | | if (_failcnt) |
318 | | return CMD_WARNING; |
319 | | #endif |
320 | 0 | #endif |
321 | |
|
322 | 0 | return bgp_evpn_advertise_svi_ip_vni_magic(self, vty, argc, argv, no); |
323 | 0 | } |
324 | | |
325 | | /* bgp_evpn_use_es_l3nhg => "[no$no] use-es-l3nhg" */ |
326 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_use_es_l3nhg) |
327 | | #define funcdecl_bgp_evpn_use_es_l3nhg static int bgp_evpn_use_es_l3nhg_magic(\ |
328 | | const struct cmd_element *self __attribute__ ((unused)),\ |
329 | | struct vty *vty __attribute__ ((unused)),\ |
330 | | int argc __attribute__ ((unused)),\ |
331 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
332 | | const char * no) |
333 | | funcdecl_bgp_evpn_use_es_l3nhg; |
334 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_use_es_l3nhg) |
335 | 0 | { |
336 | 0 | #if 1 /* anything to parse? */ |
337 | 0 | int _i; |
338 | | #if 0 /* anything that can fail? */ |
339 | | unsigned _fail = 0, _failcnt = 0; |
340 | | #endif |
341 | 0 | const char *no = NULL; |
342 | |
|
343 | 0 | for (_i = 0; _i < argc; _i++) { |
344 | 0 | if (!argv[_i]->varname) |
345 | 0 | continue; |
346 | | #if 0 /* anything that can fail? */ |
347 | | _fail = 0; |
348 | | #endif |
349 | | |
350 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
351 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
352 | 0 | } |
353 | | #if 0 /* anything that can fail? */ |
354 | | if (_fail) |
355 | | vty_out (vty, "%% invalid input for %s: %s\n", |
356 | | argv[_i]->varname, argv[_i]->arg); |
357 | | _failcnt += _fail; |
358 | | #endif |
359 | 0 | } |
360 | | #if 0 /* anything that can fail? */ |
361 | | if (_failcnt) |
362 | | return CMD_WARNING; |
363 | | #endif |
364 | 0 | #endif |
365 | |
|
366 | 0 | return bgp_evpn_use_es_l3nhg_magic(self, vty, argc, argv, no); |
367 | 0 | } |
368 | | |
369 | | /* bgp_evpn_ead_evi_rx_disable => "[no$no] disable-ead-evi-rx" */ |
370 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_ead_evi_rx_disable) |
371 | | #define funcdecl_bgp_evpn_ead_evi_rx_disable static int bgp_evpn_ead_evi_rx_disable_magic(\ |
372 | | const struct cmd_element *self __attribute__ ((unused)),\ |
373 | | struct vty *vty __attribute__ ((unused)),\ |
374 | | int argc __attribute__ ((unused)),\ |
375 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
376 | | const char * no) |
377 | | funcdecl_bgp_evpn_ead_evi_rx_disable; |
378 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_ead_evi_rx_disable) |
379 | 0 | { |
380 | 0 | #if 1 /* anything to parse? */ |
381 | 0 | int _i; |
382 | | #if 0 /* anything that can fail? */ |
383 | | unsigned _fail = 0, _failcnt = 0; |
384 | | #endif |
385 | 0 | const char *no = NULL; |
386 | |
|
387 | 0 | for (_i = 0; _i < argc; _i++) { |
388 | 0 | if (!argv[_i]->varname) |
389 | 0 | continue; |
390 | | #if 0 /* anything that can fail? */ |
391 | | _fail = 0; |
392 | | #endif |
393 | | |
394 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
395 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
396 | 0 | } |
397 | | #if 0 /* anything that can fail? */ |
398 | | if (_fail) |
399 | | vty_out (vty, "%% invalid input for %s: %s\n", |
400 | | argv[_i]->varname, argv[_i]->arg); |
401 | | _failcnt += _fail; |
402 | | #endif |
403 | 0 | } |
404 | | #if 0 /* anything that can fail? */ |
405 | | if (_failcnt) |
406 | | return CMD_WARNING; |
407 | | #endif |
408 | 0 | #endif |
409 | |
|
410 | 0 | return bgp_evpn_ead_evi_rx_disable_magic(self, vty, argc, argv, no); |
411 | 0 | } |
412 | | |
413 | | /* bgp_evpn_ead_evi_tx_disable => "[no$no] disable-ead-evi-tx" */ |
414 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_ead_evi_tx_disable) |
415 | | #define funcdecl_bgp_evpn_ead_evi_tx_disable static int bgp_evpn_ead_evi_tx_disable_magic(\ |
416 | | const struct cmd_element *self __attribute__ ((unused)),\ |
417 | | struct vty *vty __attribute__ ((unused)),\ |
418 | | int argc __attribute__ ((unused)),\ |
419 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
420 | | const char * no) |
421 | | funcdecl_bgp_evpn_ead_evi_tx_disable; |
422 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_ead_evi_tx_disable) |
423 | 0 | { |
424 | 0 | #if 1 /* anything to parse? */ |
425 | 0 | int _i; |
426 | | #if 0 /* anything that can fail? */ |
427 | | unsigned _fail = 0, _failcnt = 0; |
428 | | #endif |
429 | 0 | const char *no = NULL; |
430 | |
|
431 | 0 | for (_i = 0; _i < argc; _i++) { |
432 | 0 | if (!argv[_i]->varname) |
433 | 0 | continue; |
434 | | #if 0 /* anything that can fail? */ |
435 | | _fail = 0; |
436 | | #endif |
437 | | |
438 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
439 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
440 | 0 | } |
441 | | #if 0 /* anything that can fail? */ |
442 | | if (_fail) |
443 | | vty_out (vty, "%% invalid input for %s: %s\n", |
444 | | argv[_i]->varname, argv[_i]->arg); |
445 | | _failcnt += _fail; |
446 | | #endif |
447 | 0 | } |
448 | | #if 0 /* anything that can fail? */ |
449 | | if (_failcnt) |
450 | | return CMD_WARNING; |
451 | | #endif |
452 | 0 | #endif |
453 | |
|
454 | 0 | return bgp_evpn_ead_evi_tx_disable_magic(self, vty, argc, argv, no); |
455 | 0 | } |
456 | | |
457 | | /* bgp_evpn_enable_resolve_overlay_index => "[no$no] enable-resolve-overlay-index" */ |
458 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_enable_resolve_overlay_index) |
459 | | #define funcdecl_bgp_evpn_enable_resolve_overlay_index static int bgp_evpn_enable_resolve_overlay_index_magic(\ |
460 | | const struct cmd_element *self __attribute__ ((unused)),\ |
461 | | struct vty *vty __attribute__ ((unused)),\ |
462 | | int argc __attribute__ ((unused)),\ |
463 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
464 | | const char * no) |
465 | | funcdecl_bgp_evpn_enable_resolve_overlay_index; |
466 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_enable_resolve_overlay_index) |
467 | 0 | { |
468 | 0 | #if 1 /* anything to parse? */ |
469 | 0 | int _i; |
470 | | #if 0 /* anything that can fail? */ |
471 | | unsigned _fail = 0, _failcnt = 0; |
472 | | #endif |
473 | 0 | const char *no = NULL; |
474 | |
|
475 | 0 | for (_i = 0; _i < argc; _i++) { |
476 | 0 | if (!argv[_i]->varname) |
477 | 0 | continue; |
478 | | #if 0 /* anything that can fail? */ |
479 | | _fail = 0; |
480 | | #endif |
481 | | |
482 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
483 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
484 | 0 | } |
485 | | #if 0 /* anything that can fail? */ |
486 | | if (_fail) |
487 | | vty_out (vty, "%% invalid input for %s: %s\n", |
488 | | argv[_i]->varname, argv[_i]->arg); |
489 | | _failcnt += _fail; |
490 | | #endif |
491 | 0 | } |
492 | | #if 0 /* anything that can fail? */ |
493 | | if (_failcnt) |
494 | | return CMD_WARNING; |
495 | | #endif |
496 | 0 | #endif |
497 | |
|
498 | 0 | return bgp_evpn_enable_resolve_overlay_index_magic(self, vty, argc, argv, no); |
499 | 0 | } |
500 | | |
501 | | /* bgp_evpn_advertise_pip_ip_mac => "[no$no] advertise-pip [ip <A.B.C.D> [mac <X:X:X:X:X:X|X:X:X:X:X:X/M>]]" */ |
502 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_advertise_pip_ip_mac) |
503 | | #define funcdecl_bgp_evpn_advertise_pip_ip_mac static int bgp_evpn_advertise_pip_ip_mac_magic(\ |
504 | | const struct cmd_element *self __attribute__ ((unused)),\ |
505 | | struct vty *vty __attribute__ ((unused)),\ |
506 | | int argc __attribute__ ((unused)),\ |
507 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
508 | | const char * no,\ |
509 | | struct in_addr ip,\ |
510 | | const char * ip_str __attribute__ ((unused)),\ |
511 | | struct prefix_eth * mac,\ |
512 | | const char * mac_str __attribute__ ((unused))) |
513 | | funcdecl_bgp_evpn_advertise_pip_ip_mac; |
514 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_advertise_pip_ip_mac) |
515 | 0 | { |
516 | 0 | #if 3 /* anything to parse? */ |
517 | 0 | int _i; |
518 | 0 | #if 1 /* anything that can fail? */ |
519 | 0 | unsigned _fail = 0, _failcnt = 0; |
520 | 0 | #endif |
521 | 0 | const char *no = NULL; |
522 | 0 | struct in_addr ip = { INADDR_ANY }; |
523 | 0 | const char *ip_str = NULL; |
524 | 0 | struct prefix_eth mac = { }; |
525 | 0 | const char *mac_str = NULL; |
526 | |
|
527 | 0 | for (_i = 0; _i < argc; _i++) { |
528 | 0 | if (!argv[_i]->varname) |
529 | 0 | continue; |
530 | 0 | #if 1 /* anything that can fail? */ |
531 | 0 | _fail = 0; |
532 | 0 | #endif |
533 | |
|
534 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
535 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
536 | 0 | } |
537 | 0 | if (!strcmp(argv[_i]->varname, "ip")) { |
538 | 0 | ip_str = argv[_i]->arg; |
539 | 0 | _fail = !inet_aton(argv[_i]->arg, &ip); |
540 | 0 | } |
541 | 0 | if (!strcmp(argv[_i]->varname, "mac")) { |
542 | 0 | mac_str = argv[_i]->arg; |
543 | 0 | _fail = !str2prefix_eth(argv[_i]->arg, &mac); |
544 | 0 | } |
545 | 0 | #if 1 /* anything that can fail? */ |
546 | 0 | if (_fail) |
547 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
548 | 0 | argv[_i]->varname, argv[_i]->arg); |
549 | 0 | _failcnt += _fail; |
550 | 0 | #endif |
551 | 0 | } |
552 | 0 | #if 1 /* anything that can fail? */ |
553 | 0 | if (_failcnt) |
554 | 0 | return CMD_WARNING; |
555 | 0 | #endif |
556 | 0 | #endif |
557 | | |
558 | 0 | return bgp_evpn_advertise_pip_ip_mac_magic(self, vty, argc, argv, no, ip, ip_str, &mac, mac_str); |
559 | 0 | } |
560 | | |
561 | | /* show_bgp_l2vpn_evpn_es_evi => "show bgp l2vpn evpn es-evi [vni (1-16777215)$vni] [json$uj] [detail$detail]" */ |
562 | | DEFUN_CMD_FUNC_DECL(show_bgp_l2vpn_evpn_es_evi) |
563 | | #define funcdecl_show_bgp_l2vpn_evpn_es_evi static int show_bgp_l2vpn_evpn_es_evi_magic(\ |
564 | | const struct cmd_element *self __attribute__ ((unused)),\ |
565 | | struct vty *vty __attribute__ ((unused)),\ |
566 | | int argc __attribute__ ((unused)),\ |
567 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
568 | | long vni,\ |
569 | | const char * vni_str __attribute__ ((unused)),\ |
570 | | const char * uj,\ |
571 | | const char * detail) |
572 | | funcdecl_show_bgp_l2vpn_evpn_es_evi; |
573 | | DEFUN_CMD_FUNC_TEXT(show_bgp_l2vpn_evpn_es_evi) |
574 | 0 | { |
575 | 0 | #if 3 /* anything to parse? */ |
576 | 0 | int _i; |
577 | 0 | #if 1 /* anything that can fail? */ |
578 | 0 | unsigned _fail = 0, _failcnt = 0; |
579 | 0 | #endif |
580 | 0 | long vni = 0; |
581 | 0 | const char *vni_str = NULL; |
582 | 0 | const char *uj = NULL; |
583 | 0 | const char *detail = NULL; |
584 | |
|
585 | 0 | for (_i = 0; _i < argc; _i++) { |
586 | 0 | if (!argv[_i]->varname) |
587 | 0 | continue; |
588 | 0 | #if 1 /* anything that can fail? */ |
589 | 0 | _fail = 0; |
590 | 0 | #endif |
591 | |
|
592 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
593 | 0 | vni_str = argv[_i]->arg; |
594 | 0 | char *_end; |
595 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
596 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
597 | 0 | } |
598 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
599 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
600 | 0 | } |
601 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
602 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
603 | 0 | } |
604 | 0 | #if 1 /* anything that can fail? */ |
605 | 0 | if (_fail) |
606 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
607 | 0 | argv[_i]->varname, argv[_i]->arg); |
608 | 0 | _failcnt += _fail; |
609 | 0 | #endif |
610 | 0 | } |
611 | 0 | #if 1 /* anything that can fail? */ |
612 | 0 | if (_failcnt) |
613 | 0 | return CMD_WARNING; |
614 | 0 | #endif |
615 | 0 | #endif |
616 | | |
617 | 0 | return show_bgp_l2vpn_evpn_es_evi_magic(self, vty, argc, argv, vni, vni_str, uj, detail); |
618 | 0 | } |
619 | | |
620 | | /* show_bgp_l2vpn_evpn_es => "show bgp l2vpn evpn es [NAME$esi_str|detail$detail] [json$uj]" */ |
621 | | DEFUN_CMD_FUNC_DECL(show_bgp_l2vpn_evpn_es) |
622 | | #define funcdecl_show_bgp_l2vpn_evpn_es static int show_bgp_l2vpn_evpn_es_magic(\ |
623 | | const struct cmd_element *self __attribute__ ((unused)),\ |
624 | | struct vty *vty __attribute__ ((unused)),\ |
625 | | int argc __attribute__ ((unused)),\ |
626 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
627 | | const char * esi_str,\ |
628 | | const char * detail,\ |
629 | | const char * uj) |
630 | | funcdecl_show_bgp_l2vpn_evpn_es; |
631 | | DEFUN_CMD_FUNC_TEXT(show_bgp_l2vpn_evpn_es) |
632 | 0 | { |
633 | 0 | #if 3 /* anything to parse? */ |
634 | 0 | int _i; |
635 | | #if 0 /* anything that can fail? */ |
636 | | unsigned _fail = 0, _failcnt = 0; |
637 | | #endif |
638 | 0 | const char *esi_str = NULL; |
639 | 0 | const char *detail = NULL; |
640 | 0 | const char *uj = NULL; |
641 | |
|
642 | 0 | for (_i = 0; _i < argc; _i++) { |
643 | 0 | if (!argv[_i]->varname) |
644 | 0 | continue; |
645 | | #if 0 /* anything that can fail? */ |
646 | | _fail = 0; |
647 | | #endif |
648 | | |
649 | 0 | if (!strcmp(argv[_i]->varname, "esi_str")) { |
650 | 0 | esi_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
651 | 0 | } |
652 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
653 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
654 | 0 | } |
655 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
656 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
657 | 0 | } |
658 | | #if 0 /* anything that can fail? */ |
659 | | if (_fail) |
660 | | vty_out (vty, "%% invalid input for %s: %s\n", |
661 | | argv[_i]->varname, argv[_i]->arg); |
662 | | _failcnt += _fail; |
663 | | #endif |
664 | 0 | } |
665 | | #if 0 /* anything that can fail? */ |
666 | | if (_failcnt) |
667 | | return CMD_WARNING; |
668 | | #endif |
669 | 0 | #endif |
670 | |
|
671 | 0 | return show_bgp_l2vpn_evpn_es_magic(self, vty, argc, argv, esi_str, detail, uj); |
672 | 0 | } |
673 | | |
674 | | /* show_bgp_l2vpn_evpn_es_vrf => "show bgp l2vpn evpn es-vrf [NAME$esi_str] [json$uj]" */ |
675 | | DEFUN_CMD_FUNC_DECL(show_bgp_l2vpn_evpn_es_vrf) |
676 | | #define funcdecl_show_bgp_l2vpn_evpn_es_vrf static int show_bgp_l2vpn_evpn_es_vrf_magic(\ |
677 | | const struct cmd_element *self __attribute__ ((unused)),\ |
678 | | struct vty *vty __attribute__ ((unused)),\ |
679 | | int argc __attribute__ ((unused)),\ |
680 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
681 | | const char * esi_str,\ |
682 | | const char * uj) |
683 | | funcdecl_show_bgp_l2vpn_evpn_es_vrf; |
684 | | DEFUN_CMD_FUNC_TEXT(show_bgp_l2vpn_evpn_es_vrf) |
685 | 0 | { |
686 | 0 | #if 2 /* 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 *esi_str = NULL; |
692 | 0 | const char *uj = NULL; |
693 | |
|
694 | 0 | for (_i = 0; _i < argc; _i++) { |
695 | 0 | if (!argv[_i]->varname) |
696 | 0 | continue; |
697 | | #if 0 /* anything that can fail? */ |
698 | | _fail = 0; |
699 | | #endif |
700 | | |
701 | 0 | if (!strcmp(argv[_i]->varname, "esi_str")) { |
702 | 0 | esi_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
703 | 0 | } |
704 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
705 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
706 | 0 | } |
707 | | #if 0 /* anything that can fail? */ |
708 | | if (_fail) |
709 | | vty_out (vty, "%% invalid input for %s: %s\n", |
710 | | argv[_i]->varname, argv[_i]->arg); |
711 | | _failcnt += _fail; |
712 | | #endif |
713 | 0 | } |
714 | | #if 0 /* anything that can fail? */ |
715 | | if (_failcnt) |
716 | | return CMD_WARNING; |
717 | | #endif |
718 | 0 | #endif |
719 | |
|
720 | 0 | return show_bgp_l2vpn_evpn_es_vrf_magic(self, vty, argc, argv, esi_str, uj); |
721 | 0 | } |
722 | | |
723 | | /* show_bgp_l2vpn_evpn_nh => "show bgp l2vpn evpn next-hops [json$uj]" */ |
724 | | DEFUN_CMD_FUNC_DECL(show_bgp_l2vpn_evpn_nh) |
725 | | #define funcdecl_show_bgp_l2vpn_evpn_nh static int show_bgp_l2vpn_evpn_nh_magic(\ |
726 | | const struct cmd_element *self __attribute__ ((unused)),\ |
727 | | struct vty *vty __attribute__ ((unused)),\ |
728 | | int argc __attribute__ ((unused)),\ |
729 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
730 | | const char * uj) |
731 | | funcdecl_show_bgp_l2vpn_evpn_nh; |
732 | | DEFUN_CMD_FUNC_TEXT(show_bgp_l2vpn_evpn_nh) |
733 | 0 | { |
734 | 0 | #if 1 /* anything to parse? */ |
735 | 0 | int _i; |
736 | | #if 0 /* anything that can fail? */ |
737 | | unsigned _fail = 0, _failcnt = 0; |
738 | | #endif |
739 | 0 | const char *uj = NULL; |
740 | |
|
741 | 0 | for (_i = 0; _i < argc; _i++) { |
742 | 0 | if (!argv[_i]->varname) |
743 | 0 | continue; |
744 | | #if 0 /* anything that can fail? */ |
745 | | _fail = 0; |
746 | | #endif |
747 | | |
748 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
749 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
750 | 0 | } |
751 | | #if 0 /* anything that can fail? */ |
752 | | if (_fail) |
753 | | vty_out (vty, "%% invalid input for %s: %s\n", |
754 | | argv[_i]->varname, argv[_i]->arg); |
755 | | _failcnt += _fail; |
756 | | #endif |
757 | 0 | } |
758 | | #if 0 /* anything that can fail? */ |
759 | | if (_failcnt) |
760 | | return CMD_WARNING; |
761 | | #endif |
762 | 0 | #endif |
763 | |
|
764 | 0 | return show_bgp_l2vpn_evpn_nh_magic(self, vty, argc, argv, uj); |
765 | 0 | } |
766 | | |
767 | | /* show_bgp_vni_all => "show bgp vni all [vtep A.B.C.D$addr] [detail$detail] [json$uj]" */ |
768 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_all) |
769 | | #define funcdecl_show_bgp_vni_all static int show_bgp_vni_all_magic(\ |
770 | | const struct cmd_element *self __attribute__ ((unused)),\ |
771 | | struct vty *vty __attribute__ ((unused)),\ |
772 | | int argc __attribute__ ((unused)),\ |
773 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
774 | | struct in_addr addr,\ |
775 | | const char * addr_str __attribute__ ((unused)),\ |
776 | | const char * detail,\ |
777 | | const char * uj) |
778 | | funcdecl_show_bgp_vni_all; |
779 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_all) |
780 | 0 | { |
781 | 0 | #if 3 /* anything to parse? */ |
782 | 0 | int _i; |
783 | 0 | #if 1 /* anything that can fail? */ |
784 | 0 | unsigned _fail = 0, _failcnt = 0; |
785 | 0 | #endif |
786 | 0 | struct in_addr addr = { INADDR_ANY }; |
787 | 0 | const char *addr_str = NULL; |
788 | 0 | const char *detail = NULL; |
789 | 0 | const char *uj = NULL; |
790 | |
|
791 | 0 | for (_i = 0; _i < argc; _i++) { |
792 | 0 | if (!argv[_i]->varname) |
793 | 0 | continue; |
794 | 0 | #if 1 /* anything that can fail? */ |
795 | 0 | _fail = 0; |
796 | 0 | #endif |
797 | |
|
798 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
799 | 0 | addr_str = argv[_i]->arg; |
800 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
801 | 0 | } |
802 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
803 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
804 | 0 | } |
805 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
806 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
807 | 0 | } |
808 | 0 | #if 1 /* anything that can fail? */ |
809 | 0 | if (_fail) |
810 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
811 | 0 | argv[_i]->varname, argv[_i]->arg); |
812 | 0 | _failcnt += _fail; |
813 | 0 | #endif |
814 | 0 | } |
815 | 0 | #if 1 /* anything that can fail? */ |
816 | 0 | if (_failcnt) |
817 | 0 | return CMD_WARNING; |
818 | 0 | #endif |
819 | 0 | #endif |
820 | | |
821 | 0 | return show_bgp_vni_all_magic(self, vty, argc, argv, addr, addr_str, detail, uj); |
822 | 0 | } |
823 | | |
824 | | /* show_bgp_vni_all_ead => "show bgp vni all type <1|ead> [vtep A.B.C.D$addr] [<detail$detail|json$uj>]" */ |
825 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_all_ead) |
826 | | #define funcdecl_show_bgp_vni_all_ead static int show_bgp_vni_all_ead_magic(\ |
827 | | const struct cmd_element *self __attribute__ ((unused)),\ |
828 | | struct vty *vty __attribute__ ((unused)),\ |
829 | | int argc __attribute__ ((unused)),\ |
830 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
831 | | struct in_addr addr,\ |
832 | | const char * addr_str __attribute__ ((unused)),\ |
833 | | const char * detail,\ |
834 | | const char * uj) |
835 | | funcdecl_show_bgp_vni_all_ead; |
836 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_all_ead) |
837 | 0 | { |
838 | 0 | #if 3 /* anything to parse? */ |
839 | 0 | int _i; |
840 | 0 | #if 1 /* anything that can fail? */ |
841 | 0 | unsigned _fail = 0, _failcnt = 0; |
842 | 0 | #endif |
843 | 0 | struct in_addr addr = { INADDR_ANY }; |
844 | 0 | const char *addr_str = NULL; |
845 | 0 | const char *detail = NULL; |
846 | 0 | const char *uj = NULL; |
847 | |
|
848 | 0 | for (_i = 0; _i < argc; _i++) { |
849 | 0 | if (!argv[_i]->varname) |
850 | 0 | continue; |
851 | 0 | #if 1 /* anything that can fail? */ |
852 | 0 | _fail = 0; |
853 | 0 | #endif |
854 | |
|
855 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
856 | 0 | addr_str = argv[_i]->arg; |
857 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
858 | 0 | } |
859 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
860 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
861 | 0 | } |
862 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
863 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
864 | 0 | } |
865 | 0 | #if 1 /* anything that can fail? */ |
866 | 0 | if (_fail) |
867 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
868 | 0 | argv[_i]->varname, argv[_i]->arg); |
869 | 0 | _failcnt += _fail; |
870 | 0 | #endif |
871 | 0 | } |
872 | 0 | #if 1 /* anything that can fail? */ |
873 | 0 | if (_failcnt) |
874 | 0 | return CMD_WARNING; |
875 | 0 | #endif |
876 | 0 | #endif |
877 | | |
878 | 0 | return show_bgp_vni_all_ead_magic(self, vty, argc, argv, addr, addr_str, detail, uj); |
879 | 0 | } |
880 | | |
881 | | /* show_bgp_vni_all_macip_mac => "show bgp vni all type <2|macip> mac [vtep A.B.C.D$addr] [<detail$detail|json$uj>]" */ |
882 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_all_macip_mac) |
883 | | #define funcdecl_show_bgp_vni_all_macip_mac static int show_bgp_vni_all_macip_mac_magic(\ |
884 | | const struct cmd_element *self __attribute__ ((unused)),\ |
885 | | struct vty *vty __attribute__ ((unused)),\ |
886 | | int argc __attribute__ ((unused)),\ |
887 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
888 | | struct in_addr addr,\ |
889 | | const char * addr_str __attribute__ ((unused)),\ |
890 | | const char * detail,\ |
891 | | const char * uj) |
892 | | funcdecl_show_bgp_vni_all_macip_mac; |
893 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_all_macip_mac) |
894 | 0 | { |
895 | 0 | #if 3 /* anything to parse? */ |
896 | 0 | int _i; |
897 | 0 | #if 1 /* anything that can fail? */ |
898 | 0 | unsigned _fail = 0, _failcnt = 0; |
899 | 0 | #endif |
900 | 0 | struct in_addr addr = { INADDR_ANY }; |
901 | 0 | const char *addr_str = NULL; |
902 | 0 | const char *detail = NULL; |
903 | 0 | const char *uj = NULL; |
904 | |
|
905 | 0 | for (_i = 0; _i < argc; _i++) { |
906 | 0 | if (!argv[_i]->varname) |
907 | 0 | continue; |
908 | 0 | #if 1 /* anything that can fail? */ |
909 | 0 | _fail = 0; |
910 | 0 | #endif |
911 | |
|
912 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
913 | 0 | addr_str = argv[_i]->arg; |
914 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
915 | 0 | } |
916 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
917 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
918 | 0 | } |
919 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
920 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
921 | 0 | } |
922 | 0 | #if 1 /* anything that can fail? */ |
923 | 0 | if (_fail) |
924 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
925 | 0 | argv[_i]->varname, argv[_i]->arg); |
926 | 0 | _failcnt += _fail; |
927 | 0 | #endif |
928 | 0 | } |
929 | 0 | #if 1 /* anything that can fail? */ |
930 | 0 | if (_failcnt) |
931 | 0 | return CMD_WARNING; |
932 | 0 | #endif |
933 | 0 | #endif |
934 | | |
935 | 0 | return show_bgp_vni_all_macip_mac_magic(self, vty, argc, argv, addr, addr_str, detail, uj); |
936 | 0 | } |
937 | | |
938 | | /* show_bgp_vni_all_macip_ip => "show bgp vni all type <2|macip> ip [vtep A.B.C.D$addr] [<detail$detail|json$uj>]" */ |
939 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_all_macip_ip) |
940 | | #define funcdecl_show_bgp_vni_all_macip_ip static int show_bgp_vni_all_macip_ip_magic(\ |
941 | | const struct cmd_element *self __attribute__ ((unused)),\ |
942 | | struct vty *vty __attribute__ ((unused)),\ |
943 | | int argc __attribute__ ((unused)),\ |
944 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
945 | | struct in_addr addr,\ |
946 | | const char * addr_str __attribute__ ((unused)),\ |
947 | | const char * detail,\ |
948 | | const char * uj) |
949 | | funcdecl_show_bgp_vni_all_macip_ip; |
950 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_all_macip_ip) |
951 | 0 | { |
952 | 0 | #if 3 /* anything to parse? */ |
953 | 0 | int _i; |
954 | 0 | #if 1 /* anything that can fail? */ |
955 | 0 | unsigned _fail = 0, _failcnt = 0; |
956 | 0 | #endif |
957 | 0 | struct in_addr addr = { INADDR_ANY }; |
958 | 0 | const char *addr_str = NULL; |
959 | 0 | const char *detail = NULL; |
960 | 0 | const char *uj = NULL; |
961 | |
|
962 | 0 | for (_i = 0; _i < argc; _i++) { |
963 | 0 | if (!argv[_i]->varname) |
964 | 0 | continue; |
965 | 0 | #if 1 /* anything that can fail? */ |
966 | 0 | _fail = 0; |
967 | 0 | #endif |
968 | |
|
969 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
970 | 0 | addr_str = argv[_i]->arg; |
971 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
972 | 0 | } |
973 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
974 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
975 | 0 | } |
976 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
977 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
978 | 0 | } |
979 | 0 | #if 1 /* anything that can fail? */ |
980 | 0 | if (_fail) |
981 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
982 | 0 | argv[_i]->varname, argv[_i]->arg); |
983 | 0 | _failcnt += _fail; |
984 | 0 | #endif |
985 | 0 | } |
986 | 0 | #if 1 /* anything that can fail? */ |
987 | 0 | if (_failcnt) |
988 | 0 | return CMD_WARNING; |
989 | 0 | #endif |
990 | 0 | #endif |
991 | | |
992 | 0 | return show_bgp_vni_all_macip_ip_magic(self, vty, argc, argv, addr, addr_str, detail, uj); |
993 | 0 | } |
994 | | |
995 | | /* show_bgp_vni_all_imet => "show bgp vni all type <3|multicast> [vtep A.B.C.D$addr] [<detail$detail|json$uj>]" */ |
996 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_all_imet) |
997 | | #define funcdecl_show_bgp_vni_all_imet static int show_bgp_vni_all_imet_magic(\ |
998 | | const struct cmd_element *self __attribute__ ((unused)),\ |
999 | | struct vty *vty __attribute__ ((unused)),\ |
1000 | | int argc __attribute__ ((unused)),\ |
1001 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1002 | | struct in_addr addr,\ |
1003 | | const char * addr_str __attribute__ ((unused)),\ |
1004 | | const char * detail,\ |
1005 | | const char * uj) |
1006 | | funcdecl_show_bgp_vni_all_imet; |
1007 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_all_imet) |
1008 | 0 | { |
1009 | 0 | #if 3 /* anything to parse? */ |
1010 | 0 | int _i; |
1011 | 0 | #if 1 /* anything that can fail? */ |
1012 | 0 | unsigned _fail = 0, _failcnt = 0; |
1013 | 0 | #endif |
1014 | 0 | struct in_addr addr = { INADDR_ANY }; |
1015 | 0 | const char *addr_str = NULL; |
1016 | 0 | const char *detail = NULL; |
1017 | 0 | const char *uj = NULL; |
1018 | |
|
1019 | 0 | for (_i = 0; _i < argc; _i++) { |
1020 | 0 | if (!argv[_i]->varname) |
1021 | 0 | continue; |
1022 | 0 | #if 1 /* anything that can fail? */ |
1023 | 0 | _fail = 0; |
1024 | 0 | #endif |
1025 | |
|
1026 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1027 | 0 | addr_str = argv[_i]->arg; |
1028 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
1029 | 0 | } |
1030 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
1031 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1032 | 0 | } |
1033 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1034 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1035 | 0 | } |
1036 | 0 | #if 1 /* anything that can fail? */ |
1037 | 0 | if (_fail) |
1038 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1039 | 0 | argv[_i]->varname, argv[_i]->arg); |
1040 | 0 | _failcnt += _fail; |
1041 | 0 | #endif |
1042 | 0 | } |
1043 | 0 | #if 1 /* anything that can fail? */ |
1044 | 0 | if (_failcnt) |
1045 | 0 | return CMD_WARNING; |
1046 | 0 | #endif |
1047 | 0 | #endif |
1048 | | |
1049 | 0 | return show_bgp_vni_all_imet_magic(self, vty, argc, argv, addr, addr_str, detail, uj); |
1050 | 0 | } |
1051 | | |
1052 | | /* show_bgp_vni => "show bgp vni (1-16777215)$vni [vtep A.B.C.D$addr] [json$uj]" */ |
1053 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni) |
1054 | | #define funcdecl_show_bgp_vni static int show_bgp_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 | | long vni,\ |
1060 | | const char * vni_str __attribute__ ((unused)),\ |
1061 | | struct in_addr addr,\ |
1062 | | const char * addr_str __attribute__ ((unused)),\ |
1063 | | const char * uj) |
1064 | | funcdecl_show_bgp_vni; |
1065 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni) |
1066 | 0 | { |
1067 | 0 | #if 3 /* anything to parse? */ |
1068 | 0 | int _i; |
1069 | 0 | #if 1 /* anything that can fail? */ |
1070 | 0 | unsigned _fail = 0, _failcnt = 0; |
1071 | 0 | #endif |
1072 | 0 | long vni = 0; |
1073 | 0 | const char *vni_str = NULL; |
1074 | 0 | struct in_addr addr = { INADDR_ANY }; |
1075 | 0 | const char *addr_str = NULL; |
1076 | 0 | const char *uj = NULL; |
1077 | |
|
1078 | 0 | for (_i = 0; _i < argc; _i++) { |
1079 | 0 | if (!argv[_i]->varname) |
1080 | 0 | continue; |
1081 | 0 | #if 1 /* anything that can fail? */ |
1082 | 0 | _fail = 0; |
1083 | 0 | #endif |
1084 | |
|
1085 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1086 | 0 | vni_str = argv[_i]->arg; |
1087 | 0 | char *_end; |
1088 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1089 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1090 | 0 | } |
1091 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1092 | 0 | addr_str = argv[_i]->arg; |
1093 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
1094 | 0 | } |
1095 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1096 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1097 | 0 | } |
1098 | 0 | #if 1 /* anything that can fail? */ |
1099 | 0 | if (_fail) |
1100 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1101 | 0 | argv[_i]->varname, argv[_i]->arg); |
1102 | 0 | _failcnt += _fail; |
1103 | 0 | #endif |
1104 | 0 | } |
1105 | 0 | #if 1 /* anything that can fail? */ |
1106 | 0 | if (_failcnt) |
1107 | 0 | return CMD_WARNING; |
1108 | 0 | #endif |
1109 | 0 | #endif |
1110 | 0 | if (!vni_str) { |
1111 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1112 | 0 | return CMD_WARNING; |
1113 | 0 | } |
1114 | | |
1115 | 0 | return show_bgp_vni_magic(self, vty, argc, argv, vni, vni_str, addr, addr_str, uj); |
1116 | 0 | } |
1117 | | |
1118 | | /* show_bgp_vni_ead => "show bgp vni (1-16777215)$vni type <1|ead> [vtep A.B.C.D$addr] [json$uj]" */ |
1119 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_ead) |
1120 | | #define funcdecl_show_bgp_vni_ead static int show_bgp_vni_ead_magic(\ |
1121 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1122 | | struct vty *vty __attribute__ ((unused)),\ |
1123 | | int argc __attribute__ ((unused)),\ |
1124 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1125 | | long vni,\ |
1126 | | const char * vni_str __attribute__ ((unused)),\ |
1127 | | struct in_addr addr,\ |
1128 | | const char * addr_str __attribute__ ((unused)),\ |
1129 | | const char * uj) |
1130 | | funcdecl_show_bgp_vni_ead; |
1131 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_ead) |
1132 | 0 | { |
1133 | 0 | #if 3 /* anything to parse? */ |
1134 | 0 | int _i; |
1135 | 0 | #if 1 /* anything that can fail? */ |
1136 | 0 | unsigned _fail = 0, _failcnt = 0; |
1137 | 0 | #endif |
1138 | 0 | long vni = 0; |
1139 | 0 | const char *vni_str = NULL; |
1140 | 0 | struct in_addr addr = { INADDR_ANY }; |
1141 | 0 | const char *addr_str = NULL; |
1142 | 0 | const char *uj = NULL; |
1143 | |
|
1144 | 0 | for (_i = 0; _i < argc; _i++) { |
1145 | 0 | if (!argv[_i]->varname) |
1146 | 0 | continue; |
1147 | 0 | #if 1 /* anything that can fail? */ |
1148 | 0 | _fail = 0; |
1149 | 0 | #endif |
1150 | |
|
1151 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1152 | 0 | vni_str = argv[_i]->arg; |
1153 | 0 | char *_end; |
1154 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1155 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1156 | 0 | } |
1157 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1158 | 0 | addr_str = argv[_i]->arg; |
1159 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
1160 | 0 | } |
1161 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1162 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1163 | 0 | } |
1164 | 0 | #if 1 /* anything that can fail? */ |
1165 | 0 | if (_fail) |
1166 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1167 | 0 | argv[_i]->varname, argv[_i]->arg); |
1168 | 0 | _failcnt += _fail; |
1169 | 0 | #endif |
1170 | 0 | } |
1171 | 0 | #if 1 /* anything that can fail? */ |
1172 | 0 | if (_failcnt) |
1173 | 0 | return CMD_WARNING; |
1174 | 0 | #endif |
1175 | 0 | #endif |
1176 | 0 | if (!vni_str) { |
1177 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1178 | 0 | return CMD_WARNING; |
1179 | 0 | } |
1180 | | |
1181 | 0 | return show_bgp_vni_ead_magic(self, vty, argc, argv, vni, vni_str, addr, addr_str, uj); |
1182 | 0 | } |
1183 | | |
1184 | | /* show_bgp_vni_macip_mac => "show bgp vni (1-16777215)$vni type <2|macip> mac [vtep A.B.C.D$addr] [json$uj]" */ |
1185 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_macip_mac) |
1186 | | #define funcdecl_show_bgp_vni_macip_mac static int show_bgp_vni_macip_mac_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 | | long vni,\ |
1192 | | const char * vni_str __attribute__ ((unused)),\ |
1193 | | struct in_addr addr,\ |
1194 | | const char * addr_str __attribute__ ((unused)),\ |
1195 | | const char * uj) |
1196 | | funcdecl_show_bgp_vni_macip_mac; |
1197 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_macip_mac) |
1198 | 0 | { |
1199 | 0 | #if 3 /* anything to parse? */ |
1200 | 0 | int _i; |
1201 | 0 | #if 1 /* anything that can fail? */ |
1202 | 0 | unsigned _fail = 0, _failcnt = 0; |
1203 | 0 | #endif |
1204 | 0 | long vni = 0; |
1205 | 0 | const char *vni_str = NULL; |
1206 | 0 | struct in_addr addr = { INADDR_ANY }; |
1207 | 0 | const char *addr_str = NULL; |
1208 | 0 | const char *uj = NULL; |
1209 | |
|
1210 | 0 | for (_i = 0; _i < argc; _i++) { |
1211 | 0 | if (!argv[_i]->varname) |
1212 | 0 | continue; |
1213 | 0 | #if 1 /* anything that can fail? */ |
1214 | 0 | _fail = 0; |
1215 | 0 | #endif |
1216 | |
|
1217 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1218 | 0 | vni_str = argv[_i]->arg; |
1219 | 0 | char *_end; |
1220 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1221 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1222 | 0 | } |
1223 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1224 | 0 | addr_str = argv[_i]->arg; |
1225 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
1226 | 0 | } |
1227 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1228 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1229 | 0 | } |
1230 | 0 | #if 1 /* anything that can fail? */ |
1231 | 0 | if (_fail) |
1232 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1233 | 0 | argv[_i]->varname, argv[_i]->arg); |
1234 | 0 | _failcnt += _fail; |
1235 | 0 | #endif |
1236 | 0 | } |
1237 | 0 | #if 1 /* anything that can fail? */ |
1238 | 0 | if (_failcnt) |
1239 | 0 | return CMD_WARNING; |
1240 | 0 | #endif |
1241 | 0 | #endif |
1242 | 0 | if (!vni_str) { |
1243 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1244 | 0 | return CMD_WARNING; |
1245 | 0 | } |
1246 | | |
1247 | 0 | return show_bgp_vni_macip_mac_magic(self, vty, argc, argv, vni, vni_str, addr, addr_str, uj); |
1248 | 0 | } |
1249 | | |
1250 | | /* show_bgp_vni_macip_ip => "show bgp vni (1-16777215)$vni type <2|macip> ip [vtep A.B.C.D$addr] [json$uj]" */ |
1251 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_macip_ip) |
1252 | | #define funcdecl_show_bgp_vni_macip_ip static int show_bgp_vni_macip_ip_magic(\ |
1253 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1254 | | struct vty *vty __attribute__ ((unused)),\ |
1255 | | int argc __attribute__ ((unused)),\ |
1256 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1257 | | long vni,\ |
1258 | | const char * vni_str __attribute__ ((unused)),\ |
1259 | | struct in_addr addr,\ |
1260 | | const char * addr_str __attribute__ ((unused)),\ |
1261 | | const char * uj) |
1262 | | funcdecl_show_bgp_vni_macip_ip; |
1263 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_macip_ip) |
1264 | 0 | { |
1265 | 0 | #if 3 /* anything to parse? */ |
1266 | 0 | int _i; |
1267 | 0 | #if 1 /* anything that can fail? */ |
1268 | 0 | unsigned _fail = 0, _failcnt = 0; |
1269 | 0 | #endif |
1270 | 0 | long vni = 0; |
1271 | 0 | const char *vni_str = NULL; |
1272 | 0 | struct in_addr addr = { INADDR_ANY }; |
1273 | 0 | const char *addr_str = NULL; |
1274 | 0 | const char *uj = NULL; |
1275 | |
|
1276 | 0 | for (_i = 0; _i < argc; _i++) { |
1277 | 0 | if (!argv[_i]->varname) |
1278 | 0 | continue; |
1279 | 0 | #if 1 /* anything that can fail? */ |
1280 | 0 | _fail = 0; |
1281 | 0 | #endif |
1282 | |
|
1283 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1284 | 0 | vni_str = argv[_i]->arg; |
1285 | 0 | char *_end; |
1286 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1287 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1288 | 0 | } |
1289 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1290 | 0 | addr_str = argv[_i]->arg; |
1291 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
1292 | 0 | } |
1293 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1294 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1295 | 0 | } |
1296 | 0 | #if 1 /* anything that can fail? */ |
1297 | 0 | if (_fail) |
1298 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1299 | 0 | argv[_i]->varname, argv[_i]->arg); |
1300 | 0 | _failcnt += _fail; |
1301 | 0 | #endif |
1302 | 0 | } |
1303 | 0 | #if 1 /* anything that can fail? */ |
1304 | 0 | if (_failcnt) |
1305 | 0 | return CMD_WARNING; |
1306 | 0 | #endif |
1307 | 0 | #endif |
1308 | 0 | if (!vni_str) { |
1309 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1310 | 0 | return CMD_WARNING; |
1311 | 0 | } |
1312 | | |
1313 | 0 | return show_bgp_vni_macip_ip_magic(self, vty, argc, argv, vni, vni_str, addr, addr_str, uj); |
1314 | 0 | } |
1315 | | |
1316 | | /* show_bgp_vni_imet => "show bgp vni (1-16777215)$vni type <3|multicast> [vtep A.B.C.D$addr] [json$uj]" */ |
1317 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_imet) |
1318 | | #define funcdecl_show_bgp_vni_imet static int show_bgp_vni_imet_magic(\ |
1319 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1320 | | struct vty *vty __attribute__ ((unused)),\ |
1321 | | int argc __attribute__ ((unused)),\ |
1322 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1323 | | long vni,\ |
1324 | | const char * vni_str __attribute__ ((unused)),\ |
1325 | | struct in_addr addr,\ |
1326 | | const char * addr_str __attribute__ ((unused)),\ |
1327 | | const char * uj) |
1328 | | funcdecl_show_bgp_vni_imet; |
1329 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_imet) |
1330 | 0 | { |
1331 | 0 | #if 3 /* anything to parse? */ |
1332 | 0 | int _i; |
1333 | 0 | #if 1 /* anything that can fail? */ |
1334 | 0 | unsigned _fail = 0, _failcnt = 0; |
1335 | 0 | #endif |
1336 | 0 | long vni = 0; |
1337 | 0 | const char *vni_str = NULL; |
1338 | 0 | struct in_addr addr = { INADDR_ANY }; |
1339 | 0 | const char *addr_str = NULL; |
1340 | 0 | const char *uj = NULL; |
1341 | |
|
1342 | 0 | for (_i = 0; _i < argc; _i++) { |
1343 | 0 | if (!argv[_i]->varname) |
1344 | 0 | continue; |
1345 | 0 | #if 1 /* anything that can fail? */ |
1346 | 0 | _fail = 0; |
1347 | 0 | #endif |
1348 | |
|
1349 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1350 | 0 | vni_str = argv[_i]->arg; |
1351 | 0 | char *_end; |
1352 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1353 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1354 | 0 | } |
1355 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1356 | 0 | addr_str = argv[_i]->arg; |
1357 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
1358 | 0 | } |
1359 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1360 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1361 | 0 | } |
1362 | 0 | #if 1 /* anything that can fail? */ |
1363 | 0 | if (_fail) |
1364 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1365 | 0 | argv[_i]->varname, argv[_i]->arg); |
1366 | 0 | _failcnt += _fail; |
1367 | 0 | #endif |
1368 | 0 | } |
1369 | 0 | #if 1 /* anything that can fail? */ |
1370 | 0 | if (_failcnt) |
1371 | 0 | return CMD_WARNING; |
1372 | 0 | #endif |
1373 | 0 | #endif |
1374 | 0 | if (!vni_str) { |
1375 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1376 | 0 | return CMD_WARNING; |
1377 | 0 | } |
1378 | | |
1379 | 0 | return show_bgp_vni_imet_magic(self, vty, argc, argv, vni, vni_str, addr, addr_str, uj); |
1380 | 0 | } |
1381 | | |
1382 | | /* show_bgp_vni_macip_mac_addr => "show bgp vni (1-16777215)$vni type <2|macip> mac X:X:X:X:X:X [json$uj]" */ |
1383 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_macip_mac_addr) |
1384 | | #define funcdecl_show_bgp_vni_macip_mac_addr static int show_bgp_vni_macip_mac_addr_magic(\ |
1385 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1386 | | struct vty *vty __attribute__ ((unused)),\ |
1387 | | int argc __attribute__ ((unused)),\ |
1388 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1389 | | long vni,\ |
1390 | | const char * vni_str __attribute__ ((unused)),\ |
1391 | | struct prefix_eth * mac,\ |
1392 | | const char * mac_str __attribute__ ((unused)),\ |
1393 | | const char * uj) |
1394 | | funcdecl_show_bgp_vni_macip_mac_addr; |
1395 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_macip_mac_addr) |
1396 | 0 | { |
1397 | 0 | #if 3 /* anything to parse? */ |
1398 | 0 | int _i; |
1399 | 0 | #if 1 /* anything that can fail? */ |
1400 | 0 | unsigned _fail = 0, _failcnt = 0; |
1401 | 0 | #endif |
1402 | 0 | long vni = 0; |
1403 | 0 | const char *vni_str = NULL; |
1404 | 0 | struct prefix_eth mac = { }; |
1405 | 0 | const char *mac_str = NULL; |
1406 | 0 | const char *uj = NULL; |
1407 | |
|
1408 | 0 | for (_i = 0; _i < argc; _i++) { |
1409 | 0 | if (!argv[_i]->varname) |
1410 | 0 | continue; |
1411 | 0 | #if 1 /* anything that can fail? */ |
1412 | 0 | _fail = 0; |
1413 | 0 | #endif |
1414 | |
|
1415 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1416 | 0 | vni_str = argv[_i]->arg; |
1417 | 0 | char *_end; |
1418 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1419 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1420 | 0 | } |
1421 | 0 | if (!strcmp(argv[_i]->varname, "mac")) { |
1422 | 0 | mac_str = argv[_i]->arg; |
1423 | 0 | _fail = !str2prefix_eth(argv[_i]->arg, &mac); |
1424 | 0 | } |
1425 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1426 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1427 | 0 | } |
1428 | 0 | #if 1 /* anything that can fail? */ |
1429 | 0 | if (_fail) |
1430 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1431 | 0 | argv[_i]->varname, argv[_i]->arg); |
1432 | 0 | _failcnt += _fail; |
1433 | 0 | #endif |
1434 | 0 | } |
1435 | 0 | #if 1 /* anything that can fail? */ |
1436 | 0 | if (_failcnt) |
1437 | 0 | return CMD_WARNING; |
1438 | 0 | #endif |
1439 | 0 | #endif |
1440 | 0 | if (!vni_str) { |
1441 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1442 | 0 | return CMD_WARNING; |
1443 | 0 | } |
1444 | 0 | if (!mac_str) { |
1445 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "mac_str"); |
1446 | 0 | return CMD_WARNING; |
1447 | 0 | } |
1448 | | |
1449 | 0 | return show_bgp_vni_macip_mac_addr_magic(self, vty, argc, argv, vni, vni_str, &mac, mac_str, uj); |
1450 | 0 | } |
1451 | | |
1452 | | /* show_bgp_vni_macip_ip_addr => "show bgp vni (1-16777215)$vni type <2|macip> ip <A.B.C.D|X:X::X:X> [json$uj]" */ |
1453 | | DEFUN_CMD_FUNC_DECL(show_bgp_vni_macip_ip_addr) |
1454 | | #define funcdecl_show_bgp_vni_macip_ip_addr static int show_bgp_vni_macip_ip_addr_magic(\ |
1455 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1456 | | struct vty *vty __attribute__ ((unused)),\ |
1457 | | int argc __attribute__ ((unused)),\ |
1458 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1459 | | long vni,\ |
1460 | | const char * vni_str __attribute__ ((unused)),\ |
1461 | | const union sockunion * ip,\ |
1462 | | const char * ip_str __attribute__ ((unused)),\ |
1463 | | const char * uj) |
1464 | | funcdecl_show_bgp_vni_macip_ip_addr; |
1465 | | DEFUN_CMD_FUNC_TEXT(show_bgp_vni_macip_ip_addr) |
1466 | 0 | { |
1467 | 0 | #if 3 /* anything to parse? */ |
1468 | 0 | int _i; |
1469 | 0 | #if 1 /* anything that can fail? */ |
1470 | 0 | unsigned _fail = 0, _failcnt = 0; |
1471 | 0 | #endif |
1472 | 0 | long vni = 0; |
1473 | 0 | const char *vni_str = NULL; |
1474 | 0 | union sockunion s__ip = { .sa.sa_family = AF_UNSPEC }, *ip = NULL; |
1475 | 0 | const char *ip_str = NULL; |
1476 | 0 | const char *uj = NULL; |
1477 | |
|
1478 | 0 | for (_i = 0; _i < argc; _i++) { |
1479 | 0 | if (!argv[_i]->varname) |
1480 | 0 | continue; |
1481 | 0 | #if 1 /* anything that can fail? */ |
1482 | 0 | _fail = 0; |
1483 | 0 | #endif |
1484 | |
|
1485 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1486 | 0 | vni_str = argv[_i]->arg; |
1487 | 0 | char *_end; |
1488 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1489 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1490 | 0 | } |
1491 | 0 | if (!strcmp(argv[_i]->varname, "ip")) { |
1492 | 0 | ip_str = argv[_i]->arg; |
1493 | 0 | if (argv[_i]->text[0] == 'X') { |
1494 | 0 | s__ip.sa.sa_family = AF_INET6; |
1495 | 0 | _fail = !inet_pton(AF_INET6, argv[_i]->arg, &s__ip.sin6.sin6_addr); |
1496 | 0 | ip = &s__ip; |
1497 | 0 | } else { |
1498 | 0 | s__ip.sa.sa_family = AF_INET; |
1499 | 0 | _fail = !inet_aton(argv[_i]->arg, &s__ip.sin.sin_addr); |
1500 | 0 | ip = &s__ip; |
1501 | 0 | } |
1502 | 0 | } |
1503 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1504 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1505 | 0 | } |
1506 | 0 | #if 1 /* anything that can fail? */ |
1507 | 0 | if (_fail) |
1508 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1509 | 0 | argv[_i]->varname, argv[_i]->arg); |
1510 | 0 | _failcnt += _fail; |
1511 | 0 | #endif |
1512 | 0 | } |
1513 | 0 | #if 1 /* anything that can fail? */ |
1514 | 0 | if (_failcnt) |
1515 | 0 | return CMD_WARNING; |
1516 | 0 | #endif |
1517 | 0 | #endif |
1518 | 0 | if (!vni_str) { |
1519 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1520 | 0 | return CMD_WARNING; |
1521 | 0 | } |
1522 | 0 | if (!ip) { |
1523 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "ip"); |
1524 | 0 | return CMD_WARNING; |
1525 | 0 | } |
1526 | 0 | if (!ip_str) { |
1527 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "ip_str"); |
1528 | 0 | return CMD_WARNING; |
1529 | 0 | } |
1530 | | |
1531 | 0 | return show_bgp_vni_macip_ip_addr_magic(self, vty, argc, argv, vni, vni_str, ip, ip_str, uj); |
1532 | 0 | } |
1533 | | |
1534 | | /* show_bgp_l2vpn_evpn_route_mac_ip_evi_es => "show bgp l2vpn evpn route mac-ip-evi-es [NAME$esi_str|detail$detail] [json$uj]" */ |
1535 | | DEFUN_CMD_FUNC_DECL(show_bgp_l2vpn_evpn_route_mac_ip_evi_es) |
1536 | | #define funcdecl_show_bgp_l2vpn_evpn_route_mac_ip_evi_es static int show_bgp_l2vpn_evpn_route_mac_ip_evi_es_magic(\ |
1537 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1538 | | struct vty *vty __attribute__ ((unused)),\ |
1539 | | int argc __attribute__ ((unused)),\ |
1540 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1541 | | const char * esi_str,\ |
1542 | | const char * detail,\ |
1543 | | const char * uj) |
1544 | | funcdecl_show_bgp_l2vpn_evpn_route_mac_ip_evi_es; |
1545 | | DEFUN_CMD_FUNC_TEXT(show_bgp_l2vpn_evpn_route_mac_ip_evi_es) |
1546 | 0 | { |
1547 | 0 | #if 3 /* anything to parse? */ |
1548 | 0 | int _i; |
1549 | | #if 0 /* anything that can fail? */ |
1550 | | unsigned _fail = 0, _failcnt = 0; |
1551 | | #endif |
1552 | 0 | const char *esi_str = NULL; |
1553 | 0 | const char *detail = NULL; |
1554 | 0 | const char *uj = NULL; |
1555 | |
|
1556 | 0 | for (_i = 0; _i < argc; _i++) { |
1557 | 0 | if (!argv[_i]->varname) |
1558 | 0 | continue; |
1559 | | #if 0 /* anything that can fail? */ |
1560 | | _fail = 0; |
1561 | | #endif |
1562 | | |
1563 | 0 | if (!strcmp(argv[_i]->varname, "esi_str")) { |
1564 | 0 | esi_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1565 | 0 | } |
1566 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
1567 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1568 | 0 | } |
1569 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1570 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1571 | 0 | } |
1572 | | #if 0 /* anything that can fail? */ |
1573 | | if (_fail) |
1574 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1575 | | argv[_i]->varname, argv[_i]->arg); |
1576 | | _failcnt += _fail; |
1577 | | #endif |
1578 | 0 | } |
1579 | | #if 0 /* anything that can fail? */ |
1580 | | if (_failcnt) |
1581 | | return CMD_WARNING; |
1582 | | #endif |
1583 | 0 | #endif |
1584 | |
|
1585 | 0 | return show_bgp_l2vpn_evpn_route_mac_ip_evi_es_magic(self, vty, argc, argv, esi_str, detail, uj); |
1586 | 0 | } |
1587 | | |
1588 | | /* show_bgp_l2vpn_evpn_route_mac_ip_global_es => "show bgp l2vpn evpn route mac-ip-global-es [NAME$esi_str|detail$detail] [json$uj]" */ |
1589 | | DEFUN_CMD_FUNC_DECL(show_bgp_l2vpn_evpn_route_mac_ip_global_es) |
1590 | | #define funcdecl_show_bgp_l2vpn_evpn_route_mac_ip_global_es static int show_bgp_l2vpn_evpn_route_mac_ip_global_es_magic(\ |
1591 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1592 | | struct vty *vty __attribute__ ((unused)),\ |
1593 | | int argc __attribute__ ((unused)),\ |
1594 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1595 | | const char * esi_str,\ |
1596 | | const char * detail,\ |
1597 | | const char * uj) |
1598 | | funcdecl_show_bgp_l2vpn_evpn_route_mac_ip_global_es; |
1599 | | DEFUN_CMD_FUNC_TEXT(show_bgp_l2vpn_evpn_route_mac_ip_global_es) |
1600 | 0 | { |
1601 | 0 | #if 3 /* anything to parse? */ |
1602 | 0 | int _i; |
1603 | | #if 0 /* anything that can fail? */ |
1604 | | unsigned _fail = 0, _failcnt = 0; |
1605 | | #endif |
1606 | 0 | const char *esi_str = NULL; |
1607 | 0 | const char *detail = NULL; |
1608 | 0 | const char *uj = NULL; |
1609 | |
|
1610 | 0 | for (_i = 0; _i < argc; _i++) { |
1611 | 0 | if (!argv[_i]->varname) |
1612 | 0 | continue; |
1613 | | #if 0 /* anything that can fail? */ |
1614 | | _fail = 0; |
1615 | | #endif |
1616 | | |
1617 | 0 | if (!strcmp(argv[_i]->varname, "esi_str")) { |
1618 | 0 | esi_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1619 | 0 | } |
1620 | 0 | if (!strcmp(argv[_i]->varname, "detail")) { |
1621 | 0 | detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1622 | 0 | } |
1623 | 0 | if (!strcmp(argv[_i]->varname, "uj")) { |
1624 | 0 | uj = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1625 | 0 | } |
1626 | | #if 0 /* anything that can fail? */ |
1627 | | if (_fail) |
1628 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1629 | | argv[_i]->varname, argv[_i]->arg); |
1630 | | _failcnt += _fail; |
1631 | | #endif |
1632 | 0 | } |
1633 | | #if 0 /* anything that can fail? */ |
1634 | | if (_failcnt) |
1635 | | return CMD_WARNING; |
1636 | | #endif |
1637 | 0 | #endif |
1638 | |
|
1639 | 0 | return show_bgp_l2vpn_evpn_route_mac_ip_global_es_magic(self, vty, argc, argv, esi_str, detail, uj); |
1640 | 0 | } |
1641 | | |
1642 | | /* test_es_add => "[no$no] test es NAME$esi_str [state NAME$state_str]" */ |
1643 | | DEFUN_CMD_FUNC_DECL(test_es_add) |
1644 | | #define funcdecl_test_es_add static int test_es_add_magic(\ |
1645 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1646 | | struct vty *vty __attribute__ ((unused)),\ |
1647 | | int argc __attribute__ ((unused)),\ |
1648 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1649 | | const char * no,\ |
1650 | | const char * esi_str,\ |
1651 | | const char * state_str) |
1652 | | funcdecl_test_es_add; |
1653 | | DEFUN_CMD_FUNC_TEXT(test_es_add) |
1654 | 0 | { |
1655 | 0 | #if 3 /* anything to parse? */ |
1656 | 0 | int _i; |
1657 | | #if 0 /* anything that can fail? */ |
1658 | | unsigned _fail = 0, _failcnt = 0; |
1659 | | #endif |
1660 | 0 | const char *no = NULL; |
1661 | 0 | const char *esi_str = NULL; |
1662 | 0 | const char *state_str = NULL; |
1663 | |
|
1664 | 0 | for (_i = 0; _i < argc; _i++) { |
1665 | 0 | if (!argv[_i]->varname) |
1666 | 0 | continue; |
1667 | | #if 0 /* anything that can fail? */ |
1668 | | _fail = 0; |
1669 | | #endif |
1670 | | |
1671 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
1672 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1673 | 0 | } |
1674 | 0 | if (!strcmp(argv[_i]->varname, "esi_str")) { |
1675 | 0 | esi_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1676 | 0 | } |
1677 | 0 | if (!strcmp(argv[_i]->varname, "state_str")) { |
1678 | 0 | state_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1679 | 0 | } |
1680 | | #if 0 /* anything that can fail? */ |
1681 | | if (_fail) |
1682 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1683 | | argv[_i]->varname, argv[_i]->arg); |
1684 | | _failcnt += _fail; |
1685 | | #endif |
1686 | 0 | } |
1687 | | #if 0 /* anything that can fail? */ |
1688 | | if (_failcnt) |
1689 | | return CMD_WARNING; |
1690 | | #endif |
1691 | 0 | #endif |
1692 | 0 | if (!esi_str) { |
1693 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "esi_str"); |
1694 | 0 | return CMD_WARNING; |
1695 | 0 | } |
1696 | | |
1697 | 0 | return test_es_add_magic(self, vty, argc, argv, no, esi_str, state_str); |
1698 | 0 | } |
1699 | | |
1700 | | /* test_es_vni_add => "[no$no] test es NAME$esi_str vni (1-16777215)$vni" */ |
1701 | | DEFUN_CMD_FUNC_DECL(test_es_vni_add) |
1702 | | #define funcdecl_test_es_vni_add static int test_es_vni_add_magic(\ |
1703 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1704 | | struct vty *vty __attribute__ ((unused)),\ |
1705 | | int argc __attribute__ ((unused)),\ |
1706 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1707 | | const char * no,\ |
1708 | | const char * esi_str,\ |
1709 | | long vni,\ |
1710 | | const char * vni_str __attribute__ ((unused))) |
1711 | | funcdecl_test_es_vni_add; |
1712 | | DEFUN_CMD_FUNC_TEXT(test_es_vni_add) |
1713 | 0 | { |
1714 | 0 | #if 3 /* anything to parse? */ |
1715 | 0 | int _i; |
1716 | 0 | #if 1 /* anything that can fail? */ |
1717 | 0 | unsigned _fail = 0, _failcnt = 0; |
1718 | 0 | #endif |
1719 | 0 | const char *no = NULL; |
1720 | 0 | const char *esi_str = NULL; |
1721 | 0 | long vni = 0; |
1722 | 0 | const char *vni_str = NULL; |
1723 | |
|
1724 | 0 | for (_i = 0; _i < argc; _i++) { |
1725 | 0 | if (!argv[_i]->varname) |
1726 | 0 | continue; |
1727 | 0 | #if 1 /* anything that can fail? */ |
1728 | 0 | _fail = 0; |
1729 | 0 | #endif |
1730 | |
|
1731 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
1732 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1733 | 0 | } |
1734 | 0 | if (!strcmp(argv[_i]->varname, "esi_str")) { |
1735 | 0 | esi_str = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1736 | 0 | } |
1737 | 0 | if (!strcmp(argv[_i]->varname, "vni")) { |
1738 | 0 | vni_str = argv[_i]->arg; |
1739 | 0 | char *_end; |
1740 | 0 | vni = strtol(argv[_i]->arg, &_end, 10); |
1741 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\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 | 0 | if (!esi_str) { |
1756 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "esi_str"); |
1757 | 0 | return CMD_WARNING; |
1758 | 0 | } |
1759 | 0 | if (!vni_str) { |
1760 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "vni_str"); |
1761 | 0 | return CMD_WARNING; |
1762 | 0 | } |
1763 | | |
1764 | 0 | return test_es_vni_add_magic(self, vty, argc, argv, no, esi_str, vni, vni_str); |
1765 | 0 | } |
1766 | | |
1767 | | /* bgp_evpn_vrf_rt_auto => "route-target <both|import|export>$type auto" */ |
1768 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_vrf_rt_auto) |
1769 | | #define funcdecl_bgp_evpn_vrf_rt_auto static int bgp_evpn_vrf_rt_auto_magic(\ |
1770 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1771 | | struct vty *vty __attribute__ ((unused)),\ |
1772 | | int argc __attribute__ ((unused)),\ |
1773 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1774 | | const char * type) |
1775 | | funcdecl_bgp_evpn_vrf_rt_auto; |
1776 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_vrf_rt_auto) |
1777 | 0 | { |
1778 | 0 | #if 1 /* anything to parse? */ |
1779 | 0 | int _i; |
1780 | | #if 0 /* anything that can fail? */ |
1781 | | unsigned _fail = 0, _failcnt = 0; |
1782 | | #endif |
1783 | 0 | const char *type = NULL; |
1784 | |
|
1785 | 0 | for (_i = 0; _i < argc; _i++) { |
1786 | 0 | if (!argv[_i]->varname) |
1787 | 0 | continue; |
1788 | | #if 0 /* anything that can fail? */ |
1789 | | _fail = 0; |
1790 | | #endif |
1791 | | |
1792 | 0 | if (!strcmp(argv[_i]->varname, "type")) { |
1793 | 0 | type = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1794 | 0 | } |
1795 | | #if 0 /* anything that can fail? */ |
1796 | | if (_fail) |
1797 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1798 | | argv[_i]->varname, argv[_i]->arg); |
1799 | | _failcnt += _fail; |
1800 | | #endif |
1801 | 0 | } |
1802 | | #if 0 /* anything that can fail? */ |
1803 | | if (_failcnt) |
1804 | | return CMD_WARNING; |
1805 | | #endif |
1806 | 0 | #endif |
1807 | 0 | if (!type) { |
1808 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "type"); |
1809 | 0 | return CMD_WARNING; |
1810 | 0 | } |
1811 | | |
1812 | 0 | return bgp_evpn_vrf_rt_auto_magic(self, vty, argc, argv, type); |
1813 | 0 | } |
1814 | | |
1815 | | /* no_bgp_evpn_vrf_rt_auto => "no route-target <both|import|export>$type auto" */ |
1816 | | DEFUN_CMD_FUNC_DECL(no_bgp_evpn_vrf_rt_auto) |
1817 | | #define funcdecl_no_bgp_evpn_vrf_rt_auto static int no_bgp_evpn_vrf_rt_auto_magic(\ |
1818 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1819 | | struct vty *vty __attribute__ ((unused)),\ |
1820 | | int argc __attribute__ ((unused)),\ |
1821 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1822 | | const char * type) |
1823 | | funcdecl_no_bgp_evpn_vrf_rt_auto; |
1824 | | DEFUN_CMD_FUNC_TEXT(no_bgp_evpn_vrf_rt_auto) |
1825 | 0 | { |
1826 | 0 | #if 1 /* anything to parse? */ |
1827 | 0 | int _i; |
1828 | | #if 0 /* anything that can fail? */ |
1829 | | unsigned _fail = 0, _failcnt = 0; |
1830 | | #endif |
1831 | 0 | const char *type = NULL; |
1832 | |
|
1833 | 0 | for (_i = 0; _i < argc; _i++) { |
1834 | 0 | if (!argv[_i]->varname) |
1835 | 0 | continue; |
1836 | | #if 0 /* anything that can fail? */ |
1837 | | _fail = 0; |
1838 | | #endif |
1839 | | |
1840 | 0 | if (!strcmp(argv[_i]->varname, "type")) { |
1841 | 0 | type = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1842 | 0 | } |
1843 | | #if 0 /* anything that can fail? */ |
1844 | | if (_fail) |
1845 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1846 | | argv[_i]->varname, argv[_i]->arg); |
1847 | | _failcnt += _fail; |
1848 | | #endif |
1849 | 0 | } |
1850 | | #if 0 /* anything that can fail? */ |
1851 | | if (_failcnt) |
1852 | | return CMD_WARNING; |
1853 | | #endif |
1854 | 0 | #endif |
1855 | 0 | if (!type) { |
1856 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "type"); |
1857 | 0 | return CMD_WARNING; |
1858 | 0 | } |
1859 | | |
1860 | 0 | return no_bgp_evpn_vrf_rt_auto_magic(self, vty, argc, argv, type); |
1861 | 0 | } |
1862 | | |
1863 | | /* bgp_evpn_ead_ess_frag_evi_limit => "[no$no] ead-es-frag evi-limit (1-1000)$limit" */ |
1864 | | DEFUN_CMD_FUNC_DECL(bgp_evpn_ead_ess_frag_evi_limit) |
1865 | | #define funcdecl_bgp_evpn_ead_ess_frag_evi_limit static int bgp_evpn_ead_ess_frag_evi_limit_magic(\ |
1866 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1867 | | struct vty *vty __attribute__ ((unused)),\ |
1868 | | int argc __attribute__ ((unused)),\ |
1869 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1870 | | const char * no,\ |
1871 | | long limit,\ |
1872 | | const char * limit_str __attribute__ ((unused))) |
1873 | | funcdecl_bgp_evpn_ead_ess_frag_evi_limit; |
1874 | | DEFUN_CMD_FUNC_TEXT(bgp_evpn_ead_ess_frag_evi_limit) |
1875 | 0 | { |
1876 | 0 | #if 2 /* anything to parse? */ |
1877 | 0 | int _i; |
1878 | 0 | #if 1 /* anything that can fail? */ |
1879 | 0 | unsigned _fail = 0, _failcnt = 0; |
1880 | 0 | #endif |
1881 | 0 | const char *no = NULL; |
1882 | 0 | long limit = 0; |
1883 | 0 | const char *limit_str = NULL; |
1884 | |
|
1885 | 0 | for (_i = 0; _i < argc; _i++) { |
1886 | 0 | if (!argv[_i]->varname) |
1887 | 0 | continue; |
1888 | 0 | #if 1 /* anything that can fail? */ |
1889 | 0 | _fail = 0; |
1890 | 0 | #endif |
1891 | |
|
1892 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
1893 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1894 | 0 | } |
1895 | 0 | if (!strcmp(argv[_i]->varname, "limit")) { |
1896 | 0 | limit_str = argv[_i]->arg; |
1897 | 0 | char *_end; |
1898 | 0 | limit = strtol(argv[_i]->arg, &_end, 10); |
1899 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1900 | 0 | } |
1901 | 0 | #if 1 /* anything that can fail? */ |
1902 | 0 | if (_fail) |
1903 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1904 | 0 | argv[_i]->varname, argv[_i]->arg); |
1905 | 0 | _failcnt += _fail; |
1906 | 0 | #endif |
1907 | 0 | } |
1908 | 0 | #if 1 /* anything that can fail? */ |
1909 | 0 | if (_failcnt) |
1910 | 0 | return CMD_WARNING; |
1911 | 0 | #endif |
1912 | 0 | #endif |
1913 | 0 | if (!limit_str) { |
1914 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "limit_str"); |
1915 | 0 | return CMD_WARNING; |
1916 | 0 | } |
1917 | | |
1918 | 0 | return bgp_evpn_ead_ess_frag_evi_limit_magic(self, vty, argc, argv, no, limit, limit_str); |
1919 | 0 | } |
1920 | | |