/src/frr/lib/routemap_cli_clippy.c
Line | Count | Source (jump to first uncovered line) |
1 | | /* route_map => "route-map RMAP_NAME$name <deny|permit>$action (1-65535)$sequence" */ |
2 | | DEFUN_CMD_FUNC_DECL(route_map) |
3 | | #define funcdecl_route_map static int route_map_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 * name,\ |
9 | | const char * action,\ |
10 | | long sequence,\ |
11 | | const char * sequence_str __attribute__ ((unused))) |
12 | | funcdecl_route_map; |
13 | | DEFUN_CMD_FUNC_TEXT(route_map) |
14 | 0 | { |
15 | 0 | #if 3 /* anything to parse? */ |
16 | 0 | int _i; |
17 | 0 | #if 1 /* anything that can fail? */ |
18 | 0 | unsigned _fail = 0, _failcnt = 0; |
19 | 0 | #endif |
20 | 0 | const char *name = NULL; |
21 | 0 | const char *action = NULL; |
22 | 0 | long sequence = 0; |
23 | 0 | const char *sequence_str = NULL; |
24 | |
|
25 | 0 | for (_i = 0; _i < argc; _i++) { |
26 | 0 | if (!argv[_i]->varname) |
27 | 0 | continue; |
28 | 0 | #if 1 /* anything that can fail? */ |
29 | 0 | _fail = 0; |
30 | 0 | #endif |
31 | |
|
32 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
33 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
34 | 0 | } |
35 | 0 | if (!strcmp(argv[_i]->varname, "action")) { |
36 | 0 | action = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
37 | 0 | } |
38 | 0 | if (!strcmp(argv[_i]->varname, "sequence")) { |
39 | 0 | sequence_str = argv[_i]->arg; |
40 | 0 | char *_end; |
41 | 0 | sequence = strtol(argv[_i]->arg, &_end, 10); |
42 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
43 | 0 | } |
44 | 0 | #if 1 /* anything that can fail? */ |
45 | 0 | if (_fail) |
46 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
47 | 0 | argv[_i]->varname, argv[_i]->arg); |
48 | 0 | _failcnt += _fail; |
49 | 0 | #endif |
50 | 0 | } |
51 | 0 | #if 1 /* anything that can fail? */ |
52 | 0 | if (_failcnt) |
53 | 0 | return CMD_WARNING; |
54 | 0 | #endif |
55 | 0 | #endif |
56 | 0 | if (!name) { |
57 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
58 | 0 | return CMD_WARNING; |
59 | 0 | } |
60 | 0 | if (!action) { |
61 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "action"); |
62 | 0 | return CMD_WARNING; |
63 | 0 | } |
64 | 0 | if (!sequence_str) { |
65 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "sequence_str"); |
66 | 0 | return CMD_WARNING; |
67 | 0 | } |
68 | | |
69 | 0 | return route_map_magic(self, vty, argc, argv, name, action, sequence, sequence_str); |
70 | 0 | } |
71 | | |
72 | | /* no_route_map_all => "no route-map RMAP_NAME$name" */ |
73 | | DEFUN_CMD_FUNC_DECL(no_route_map_all) |
74 | | #define funcdecl_no_route_map_all static int no_route_map_all_magic(\ |
75 | | const struct cmd_element *self __attribute__ ((unused)),\ |
76 | | struct vty *vty __attribute__ ((unused)),\ |
77 | | int argc __attribute__ ((unused)),\ |
78 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
79 | | const char * name) |
80 | | funcdecl_no_route_map_all; |
81 | | DEFUN_CMD_FUNC_TEXT(no_route_map_all) |
82 | 0 | { |
83 | 0 | #if 1 /* anything to parse? */ |
84 | 0 | int _i; |
85 | | #if 0 /* anything that can fail? */ |
86 | | unsigned _fail = 0, _failcnt = 0; |
87 | | #endif |
88 | 0 | const char *name = NULL; |
89 | |
|
90 | 0 | for (_i = 0; _i < argc; _i++) { |
91 | 0 | if (!argv[_i]->varname) |
92 | 0 | continue; |
93 | | #if 0 /* anything that can fail? */ |
94 | | _fail = 0; |
95 | | #endif |
96 | | |
97 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
98 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
99 | 0 | } |
100 | | #if 0 /* anything that can fail? */ |
101 | | if (_fail) |
102 | | vty_out (vty, "%% invalid input for %s: %s\n", |
103 | | argv[_i]->varname, argv[_i]->arg); |
104 | | _failcnt += _fail; |
105 | | #endif |
106 | 0 | } |
107 | | #if 0 /* anything that can fail? */ |
108 | | if (_failcnt) |
109 | | return CMD_WARNING; |
110 | | #endif |
111 | 0 | #endif |
112 | 0 | if (!name) { |
113 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
114 | 0 | return CMD_WARNING; |
115 | 0 | } |
116 | | |
117 | 0 | return no_route_map_all_magic(self, vty, argc, argv, name); |
118 | 0 | } |
119 | | |
120 | | /* no_route_map => "no route-map RMAP_NAME$name <deny|permit>$action (1-65535)$sequence" */ |
121 | | DEFUN_CMD_FUNC_DECL(no_route_map) |
122 | | #define funcdecl_no_route_map static int no_route_map_magic(\ |
123 | | const struct cmd_element *self __attribute__ ((unused)),\ |
124 | | struct vty *vty __attribute__ ((unused)),\ |
125 | | int argc __attribute__ ((unused)),\ |
126 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
127 | | const char * name,\ |
128 | | const char * action,\ |
129 | | long sequence,\ |
130 | | const char * sequence_str __attribute__ ((unused))) |
131 | | funcdecl_no_route_map; |
132 | | DEFUN_CMD_FUNC_TEXT(no_route_map) |
133 | 0 | { |
134 | 0 | #if 3 /* anything to parse? */ |
135 | 0 | int _i; |
136 | 0 | #if 1 /* anything that can fail? */ |
137 | 0 | unsigned _fail = 0, _failcnt = 0; |
138 | 0 | #endif |
139 | 0 | const char *name = NULL; |
140 | 0 | const char *action = NULL; |
141 | 0 | long sequence = 0; |
142 | 0 | const char *sequence_str = NULL; |
143 | |
|
144 | 0 | for (_i = 0; _i < argc; _i++) { |
145 | 0 | if (!argv[_i]->varname) |
146 | 0 | continue; |
147 | 0 | #if 1 /* anything that can fail? */ |
148 | 0 | _fail = 0; |
149 | 0 | #endif |
150 | |
|
151 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
152 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
153 | 0 | } |
154 | 0 | if (!strcmp(argv[_i]->varname, "action")) { |
155 | 0 | action = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
156 | 0 | } |
157 | 0 | if (!strcmp(argv[_i]->varname, "sequence")) { |
158 | 0 | sequence_str = argv[_i]->arg; |
159 | 0 | char *_end; |
160 | 0 | sequence = strtol(argv[_i]->arg, &_end, 10); |
161 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
162 | 0 | } |
163 | 0 | #if 1 /* anything that can fail? */ |
164 | 0 | if (_fail) |
165 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
166 | 0 | argv[_i]->varname, argv[_i]->arg); |
167 | 0 | _failcnt += _fail; |
168 | 0 | #endif |
169 | 0 | } |
170 | 0 | #if 1 /* anything that can fail? */ |
171 | 0 | if (_failcnt) |
172 | 0 | return CMD_WARNING; |
173 | 0 | #endif |
174 | 0 | #endif |
175 | 0 | if (!name) { |
176 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
177 | 0 | return CMD_WARNING; |
178 | 0 | } |
179 | 0 | if (!action) { |
180 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "action"); |
181 | 0 | return CMD_WARNING; |
182 | 0 | } |
183 | 0 | if (!sequence_str) { |
184 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "sequence_str"); |
185 | 0 | return CMD_WARNING; |
186 | 0 | } |
187 | | |
188 | 0 | return no_route_map_magic(self, vty, argc, argv, name, action, sequence, sequence_str); |
189 | 0 | } |
190 | | |
191 | | /* match_interface => "match interface IFNAME" */ |
192 | | DEFUN_CMD_FUNC_DECL(match_interface) |
193 | | #define funcdecl_match_interface static int match_interface_magic(\ |
194 | | const struct cmd_element *self __attribute__ ((unused)),\ |
195 | | struct vty *vty __attribute__ ((unused)),\ |
196 | | int argc __attribute__ ((unused)),\ |
197 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
198 | | const char * ifname) |
199 | | funcdecl_match_interface; |
200 | | DEFUN_CMD_FUNC_TEXT(match_interface) |
201 | 0 | { |
202 | 0 | #if 1 /* anything to parse? */ |
203 | 0 | int _i; |
204 | | #if 0 /* anything that can fail? */ |
205 | | unsigned _fail = 0, _failcnt = 0; |
206 | | #endif |
207 | 0 | const char *ifname = NULL; |
208 | |
|
209 | 0 | for (_i = 0; _i < argc; _i++) { |
210 | 0 | if (!argv[_i]->varname) |
211 | 0 | continue; |
212 | | #if 0 /* anything that can fail? */ |
213 | | _fail = 0; |
214 | | #endif |
215 | | |
216 | 0 | if (!strcmp(argv[_i]->varname, "ifname")) { |
217 | 0 | ifname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
218 | 0 | } |
219 | | #if 0 /* anything that can fail? */ |
220 | | if (_fail) |
221 | | vty_out (vty, "%% invalid input for %s: %s\n", |
222 | | argv[_i]->varname, argv[_i]->arg); |
223 | | _failcnt += _fail; |
224 | | #endif |
225 | 0 | } |
226 | | #if 0 /* anything that can fail? */ |
227 | | if (_failcnt) |
228 | | return CMD_WARNING; |
229 | | #endif |
230 | 0 | #endif |
231 | 0 | if (!ifname) { |
232 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "ifname"); |
233 | 0 | return CMD_WARNING; |
234 | 0 | } |
235 | | |
236 | 0 | return match_interface_magic(self, vty, argc, argv, ifname); |
237 | 0 | } |
238 | | |
239 | | /* no_match_interface => "no match interface [IFNAME]" */ |
240 | | DEFUN_CMD_FUNC_DECL(no_match_interface) |
241 | | #define funcdecl_no_match_interface static int no_match_interface_magic(\ |
242 | | const struct cmd_element *self __attribute__ ((unused)),\ |
243 | | struct vty *vty __attribute__ ((unused)),\ |
244 | | int argc __attribute__ ((unused)),\ |
245 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
246 | | const char * ifname) |
247 | | funcdecl_no_match_interface; |
248 | | DEFUN_CMD_FUNC_TEXT(no_match_interface) |
249 | 0 | { |
250 | 0 | #if 1 /* anything to parse? */ |
251 | 0 | int _i; |
252 | | #if 0 /* anything that can fail? */ |
253 | | unsigned _fail = 0, _failcnt = 0; |
254 | | #endif |
255 | 0 | const char *ifname = NULL; |
256 | |
|
257 | 0 | for (_i = 0; _i < argc; _i++) { |
258 | 0 | if (!argv[_i]->varname) |
259 | 0 | continue; |
260 | | #if 0 /* anything that can fail? */ |
261 | | _fail = 0; |
262 | | #endif |
263 | | |
264 | 0 | if (!strcmp(argv[_i]->varname, "ifname")) { |
265 | 0 | ifname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
266 | 0 | } |
267 | | #if 0 /* anything that can fail? */ |
268 | | if (_fail) |
269 | | vty_out (vty, "%% invalid input for %s: %s\n", |
270 | | argv[_i]->varname, argv[_i]->arg); |
271 | | _failcnt += _fail; |
272 | | #endif |
273 | 0 | } |
274 | | #if 0 /* anything that can fail? */ |
275 | | if (_failcnt) |
276 | | return CMD_WARNING; |
277 | | #endif |
278 | 0 | #endif |
279 | |
|
280 | 0 | return no_match_interface_magic(self, vty, argc, argv, ifname); |
281 | 0 | } |
282 | | |
283 | | /* match_ip_address => "match ip address ACCESSLIST4_NAME$name" */ |
284 | | DEFUN_CMD_FUNC_DECL(match_ip_address) |
285 | | #define funcdecl_match_ip_address static int match_ip_address_magic(\ |
286 | | const struct cmd_element *self __attribute__ ((unused)),\ |
287 | | struct vty *vty __attribute__ ((unused)),\ |
288 | | int argc __attribute__ ((unused)),\ |
289 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
290 | | const char * name) |
291 | | funcdecl_match_ip_address; |
292 | | DEFUN_CMD_FUNC_TEXT(match_ip_address) |
293 | 0 | { |
294 | 0 | #if 1 /* anything to parse? */ |
295 | 0 | int _i; |
296 | | #if 0 /* anything that can fail? */ |
297 | | unsigned _fail = 0, _failcnt = 0; |
298 | | #endif |
299 | 0 | const char *name = NULL; |
300 | |
|
301 | 0 | for (_i = 0; _i < argc; _i++) { |
302 | 0 | if (!argv[_i]->varname) |
303 | 0 | continue; |
304 | | #if 0 /* anything that can fail? */ |
305 | | _fail = 0; |
306 | | #endif |
307 | | |
308 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
309 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
310 | 0 | } |
311 | | #if 0 /* anything that can fail? */ |
312 | | if (_fail) |
313 | | vty_out (vty, "%% invalid input for %s: %s\n", |
314 | | argv[_i]->varname, argv[_i]->arg); |
315 | | _failcnt += _fail; |
316 | | #endif |
317 | 0 | } |
318 | | #if 0 /* anything that can fail? */ |
319 | | if (_failcnt) |
320 | | return CMD_WARNING; |
321 | | #endif |
322 | 0 | #endif |
323 | 0 | if (!name) { |
324 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
325 | 0 | return CMD_WARNING; |
326 | 0 | } |
327 | | |
328 | 0 | return match_ip_address_magic(self, vty, argc, argv, name); |
329 | 0 | } |
330 | | |
331 | | /* no_match_ip_address => "no match ip address [ACCESSLIST4_NAME]" */ |
332 | | DEFUN_CMD_FUNC_DECL(no_match_ip_address) |
333 | | #define funcdecl_no_match_ip_address static int no_match_ip_address_magic(\ |
334 | | const struct cmd_element *self __attribute__ ((unused)),\ |
335 | | struct vty *vty __attribute__ ((unused)),\ |
336 | | int argc __attribute__ ((unused)),\ |
337 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
338 | | const char * accesslist4_name) |
339 | | funcdecl_no_match_ip_address; |
340 | | DEFUN_CMD_FUNC_TEXT(no_match_ip_address) |
341 | 0 | { |
342 | 0 | #if 1 /* anything to parse? */ |
343 | 0 | int _i; |
344 | | #if 0 /* anything that can fail? */ |
345 | | unsigned _fail = 0, _failcnt = 0; |
346 | | #endif |
347 | 0 | const char *accesslist4_name = NULL; |
348 | |
|
349 | 0 | for (_i = 0; _i < argc; _i++) { |
350 | 0 | if (!argv[_i]->varname) |
351 | 0 | continue; |
352 | | #if 0 /* anything that can fail? */ |
353 | | _fail = 0; |
354 | | #endif |
355 | | |
356 | 0 | if (!strcmp(argv[_i]->varname, "accesslist4_name")) { |
357 | 0 | accesslist4_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
358 | 0 | } |
359 | | #if 0 /* anything that can fail? */ |
360 | | if (_fail) |
361 | | vty_out (vty, "%% invalid input for %s: %s\n", |
362 | | argv[_i]->varname, argv[_i]->arg); |
363 | | _failcnt += _fail; |
364 | | #endif |
365 | 0 | } |
366 | | #if 0 /* anything that can fail? */ |
367 | | if (_failcnt) |
368 | | return CMD_WARNING; |
369 | | #endif |
370 | 0 | #endif |
371 | |
|
372 | 0 | return no_match_ip_address_magic(self, vty, argc, argv, accesslist4_name); |
373 | 0 | } |
374 | | |
375 | | /* match_ip_address_prefix_list => "match ip address prefix-list PREFIXLIST_NAME$name" */ |
376 | | DEFUN_CMD_FUNC_DECL(match_ip_address_prefix_list) |
377 | | #define funcdecl_match_ip_address_prefix_list static int match_ip_address_prefix_list_magic(\ |
378 | | const struct cmd_element *self __attribute__ ((unused)),\ |
379 | | struct vty *vty __attribute__ ((unused)),\ |
380 | | int argc __attribute__ ((unused)),\ |
381 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
382 | | const char * name) |
383 | | funcdecl_match_ip_address_prefix_list; |
384 | | DEFUN_CMD_FUNC_TEXT(match_ip_address_prefix_list) |
385 | 0 | { |
386 | 0 | #if 1 /* anything to parse? */ |
387 | 0 | int _i; |
388 | | #if 0 /* anything that can fail? */ |
389 | | unsigned _fail = 0, _failcnt = 0; |
390 | | #endif |
391 | 0 | const char *name = NULL; |
392 | |
|
393 | 0 | for (_i = 0; _i < argc; _i++) { |
394 | 0 | if (!argv[_i]->varname) |
395 | 0 | continue; |
396 | | #if 0 /* anything that can fail? */ |
397 | | _fail = 0; |
398 | | #endif |
399 | | |
400 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
401 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
402 | 0 | } |
403 | | #if 0 /* anything that can fail? */ |
404 | | if (_fail) |
405 | | vty_out (vty, "%% invalid input for %s: %s\n", |
406 | | argv[_i]->varname, argv[_i]->arg); |
407 | | _failcnt += _fail; |
408 | | #endif |
409 | 0 | } |
410 | | #if 0 /* anything that can fail? */ |
411 | | if (_failcnt) |
412 | | return CMD_WARNING; |
413 | | #endif |
414 | 0 | #endif |
415 | 0 | if (!name) { |
416 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
417 | 0 | return CMD_WARNING; |
418 | 0 | } |
419 | | |
420 | 0 | return match_ip_address_prefix_list_magic(self, vty, argc, argv, name); |
421 | 0 | } |
422 | | |
423 | | /* no_match_ip_address_prefix_list => "no match ip address prefix-list [PREFIXLIST_NAME]" */ |
424 | | DEFUN_CMD_FUNC_DECL(no_match_ip_address_prefix_list) |
425 | | #define funcdecl_no_match_ip_address_prefix_list static int no_match_ip_address_prefix_list_magic(\ |
426 | | const struct cmd_element *self __attribute__ ((unused)),\ |
427 | | struct vty *vty __attribute__ ((unused)),\ |
428 | | int argc __attribute__ ((unused)),\ |
429 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
430 | | const char * prefixlist_name) |
431 | | funcdecl_no_match_ip_address_prefix_list; |
432 | | DEFUN_CMD_FUNC_TEXT(no_match_ip_address_prefix_list) |
433 | 0 | { |
434 | 0 | #if 1 /* anything to parse? */ |
435 | 0 | int _i; |
436 | | #if 0 /* anything that can fail? */ |
437 | | unsigned _fail = 0, _failcnt = 0; |
438 | | #endif |
439 | 0 | const char *prefixlist_name = NULL; |
440 | |
|
441 | 0 | for (_i = 0; _i < argc; _i++) { |
442 | 0 | if (!argv[_i]->varname) |
443 | 0 | continue; |
444 | | #if 0 /* anything that can fail? */ |
445 | | _fail = 0; |
446 | | #endif |
447 | | |
448 | 0 | if (!strcmp(argv[_i]->varname, "prefixlist_name")) { |
449 | 0 | prefixlist_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
450 | 0 | } |
451 | | #if 0 /* anything that can fail? */ |
452 | | if (_fail) |
453 | | vty_out (vty, "%% invalid input for %s: %s\n", |
454 | | argv[_i]->varname, argv[_i]->arg); |
455 | | _failcnt += _fail; |
456 | | #endif |
457 | 0 | } |
458 | | #if 0 /* anything that can fail? */ |
459 | | if (_failcnt) |
460 | | return CMD_WARNING; |
461 | | #endif |
462 | 0 | #endif |
463 | |
|
464 | 0 | return no_match_ip_address_prefix_list_magic(self, vty, argc, argv, prefixlist_name); |
465 | 0 | } |
466 | | |
467 | | /* match_ip_next_hop => "match ip next-hop ACCESSLIST4_NAME$name" */ |
468 | | DEFUN_CMD_FUNC_DECL(match_ip_next_hop) |
469 | | #define funcdecl_match_ip_next_hop static int match_ip_next_hop_magic(\ |
470 | | const struct cmd_element *self __attribute__ ((unused)),\ |
471 | | struct vty *vty __attribute__ ((unused)),\ |
472 | | int argc __attribute__ ((unused)),\ |
473 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
474 | | const char * name) |
475 | | funcdecl_match_ip_next_hop; |
476 | | DEFUN_CMD_FUNC_TEXT(match_ip_next_hop) |
477 | 0 | { |
478 | 0 | #if 1 /* anything to parse? */ |
479 | 0 | int _i; |
480 | | #if 0 /* anything that can fail? */ |
481 | | unsigned _fail = 0, _failcnt = 0; |
482 | | #endif |
483 | 0 | const char *name = NULL; |
484 | |
|
485 | 0 | for (_i = 0; _i < argc; _i++) { |
486 | 0 | if (!argv[_i]->varname) |
487 | 0 | continue; |
488 | | #if 0 /* anything that can fail? */ |
489 | | _fail = 0; |
490 | | #endif |
491 | | |
492 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
493 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
494 | 0 | } |
495 | | #if 0 /* anything that can fail? */ |
496 | | if (_fail) |
497 | | vty_out (vty, "%% invalid input for %s: %s\n", |
498 | | argv[_i]->varname, argv[_i]->arg); |
499 | | _failcnt += _fail; |
500 | | #endif |
501 | 0 | } |
502 | | #if 0 /* anything that can fail? */ |
503 | | if (_failcnt) |
504 | | return CMD_WARNING; |
505 | | #endif |
506 | 0 | #endif |
507 | 0 | if (!name) { |
508 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
509 | 0 | return CMD_WARNING; |
510 | 0 | } |
511 | | |
512 | 0 | return match_ip_next_hop_magic(self, vty, argc, argv, name); |
513 | 0 | } |
514 | | |
515 | | /* no_match_ip_next_hop => "no match ip next-hop [ACCESSLIST4_NAME]" */ |
516 | | DEFUN_CMD_FUNC_DECL(no_match_ip_next_hop) |
517 | | #define funcdecl_no_match_ip_next_hop static int no_match_ip_next_hop_magic(\ |
518 | | const struct cmd_element *self __attribute__ ((unused)),\ |
519 | | struct vty *vty __attribute__ ((unused)),\ |
520 | | int argc __attribute__ ((unused)),\ |
521 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
522 | | const char * accesslist4_name) |
523 | | funcdecl_no_match_ip_next_hop; |
524 | | DEFUN_CMD_FUNC_TEXT(no_match_ip_next_hop) |
525 | 0 | { |
526 | 0 | #if 1 /* anything to parse? */ |
527 | 0 | int _i; |
528 | | #if 0 /* anything that can fail? */ |
529 | | unsigned _fail = 0, _failcnt = 0; |
530 | | #endif |
531 | 0 | const char *accesslist4_name = NULL; |
532 | |
|
533 | 0 | for (_i = 0; _i < argc; _i++) { |
534 | 0 | if (!argv[_i]->varname) |
535 | 0 | continue; |
536 | | #if 0 /* anything that can fail? */ |
537 | | _fail = 0; |
538 | | #endif |
539 | | |
540 | 0 | if (!strcmp(argv[_i]->varname, "accesslist4_name")) { |
541 | 0 | accesslist4_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
542 | 0 | } |
543 | | #if 0 /* anything that can fail? */ |
544 | | if (_fail) |
545 | | vty_out (vty, "%% invalid input for %s: %s\n", |
546 | | argv[_i]->varname, argv[_i]->arg); |
547 | | _failcnt += _fail; |
548 | | #endif |
549 | 0 | } |
550 | | #if 0 /* anything that can fail? */ |
551 | | if (_failcnt) |
552 | | return CMD_WARNING; |
553 | | #endif |
554 | 0 | #endif |
555 | |
|
556 | 0 | return no_match_ip_next_hop_magic(self, vty, argc, argv, accesslist4_name); |
557 | 0 | } |
558 | | |
559 | | /* match_ip_next_hop_prefix_list => "match ip next-hop prefix-list PREFIXLIST_NAME$name" */ |
560 | | DEFUN_CMD_FUNC_DECL(match_ip_next_hop_prefix_list) |
561 | | #define funcdecl_match_ip_next_hop_prefix_list static int match_ip_next_hop_prefix_list_magic(\ |
562 | | const struct cmd_element *self __attribute__ ((unused)),\ |
563 | | struct vty *vty __attribute__ ((unused)),\ |
564 | | int argc __attribute__ ((unused)),\ |
565 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
566 | | const char * name) |
567 | | funcdecl_match_ip_next_hop_prefix_list; |
568 | | DEFUN_CMD_FUNC_TEXT(match_ip_next_hop_prefix_list) |
569 | 0 | { |
570 | 0 | #if 1 /* anything to parse? */ |
571 | 0 | int _i; |
572 | | #if 0 /* anything that can fail? */ |
573 | | unsigned _fail = 0, _failcnt = 0; |
574 | | #endif |
575 | 0 | const char *name = NULL; |
576 | |
|
577 | 0 | for (_i = 0; _i < argc; _i++) { |
578 | 0 | if (!argv[_i]->varname) |
579 | 0 | continue; |
580 | | #if 0 /* anything that can fail? */ |
581 | | _fail = 0; |
582 | | #endif |
583 | | |
584 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
585 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
586 | 0 | } |
587 | | #if 0 /* anything that can fail? */ |
588 | | if (_fail) |
589 | | vty_out (vty, "%% invalid input for %s: %s\n", |
590 | | argv[_i]->varname, argv[_i]->arg); |
591 | | _failcnt += _fail; |
592 | | #endif |
593 | 0 | } |
594 | | #if 0 /* anything that can fail? */ |
595 | | if (_failcnt) |
596 | | return CMD_WARNING; |
597 | | #endif |
598 | 0 | #endif |
599 | 0 | if (!name) { |
600 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
601 | 0 | return CMD_WARNING; |
602 | 0 | } |
603 | | |
604 | 0 | return match_ip_next_hop_prefix_list_magic(self, vty, argc, argv, name); |
605 | 0 | } |
606 | | |
607 | | /* no_match_ip_next_hop_prefix_list => "no match ip next-hop prefix-list [PREFIXLIST_NAME]" */ |
608 | | DEFUN_CMD_FUNC_DECL(no_match_ip_next_hop_prefix_list) |
609 | | #define funcdecl_no_match_ip_next_hop_prefix_list static int no_match_ip_next_hop_prefix_list_magic(\ |
610 | | const struct cmd_element *self __attribute__ ((unused)),\ |
611 | | struct vty *vty __attribute__ ((unused)),\ |
612 | | int argc __attribute__ ((unused)),\ |
613 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
614 | | const char * prefixlist_name) |
615 | | funcdecl_no_match_ip_next_hop_prefix_list; |
616 | | DEFUN_CMD_FUNC_TEXT(no_match_ip_next_hop_prefix_list) |
617 | 0 | { |
618 | 0 | #if 1 /* anything to parse? */ |
619 | 0 | int _i; |
620 | | #if 0 /* anything that can fail? */ |
621 | | unsigned _fail = 0, _failcnt = 0; |
622 | | #endif |
623 | 0 | const char *prefixlist_name = NULL; |
624 | |
|
625 | 0 | for (_i = 0; _i < argc; _i++) { |
626 | 0 | if (!argv[_i]->varname) |
627 | 0 | continue; |
628 | | #if 0 /* anything that can fail? */ |
629 | | _fail = 0; |
630 | | #endif |
631 | | |
632 | 0 | if (!strcmp(argv[_i]->varname, "prefixlist_name")) { |
633 | 0 | prefixlist_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
634 | 0 | } |
635 | | #if 0 /* anything that can fail? */ |
636 | | if (_fail) |
637 | | vty_out (vty, "%% invalid input for %s: %s\n", |
638 | | argv[_i]->varname, argv[_i]->arg); |
639 | | _failcnt += _fail; |
640 | | #endif |
641 | 0 | } |
642 | | #if 0 /* anything that can fail? */ |
643 | | if (_failcnt) |
644 | | return CMD_WARNING; |
645 | | #endif |
646 | 0 | #endif |
647 | |
|
648 | 0 | return no_match_ip_next_hop_prefix_list_magic(self, vty, argc, argv, prefixlist_name); |
649 | 0 | } |
650 | | |
651 | | /* match_ip_next_hop_type => "match ip next-hop type <blackhole>$type" */ |
652 | | DEFUN_CMD_FUNC_DECL(match_ip_next_hop_type) |
653 | | #define funcdecl_match_ip_next_hop_type static int match_ip_next_hop_type_magic(\ |
654 | | const struct cmd_element *self __attribute__ ((unused)),\ |
655 | | struct vty *vty __attribute__ ((unused)),\ |
656 | | int argc __attribute__ ((unused)),\ |
657 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
658 | | const char * type) |
659 | | funcdecl_match_ip_next_hop_type; |
660 | | DEFUN_CMD_FUNC_TEXT(match_ip_next_hop_type) |
661 | 0 | { |
662 | 0 | #if 1 /* anything to parse? */ |
663 | 0 | int _i; |
664 | | #if 0 /* anything that can fail? */ |
665 | | unsigned _fail = 0, _failcnt = 0; |
666 | | #endif |
667 | 0 | const char *type = NULL; |
668 | |
|
669 | 0 | for (_i = 0; _i < argc; _i++) { |
670 | 0 | if (!argv[_i]->varname) |
671 | 0 | continue; |
672 | | #if 0 /* anything that can fail? */ |
673 | | _fail = 0; |
674 | | #endif |
675 | | |
676 | 0 | if (!strcmp(argv[_i]->varname, "type")) { |
677 | 0 | type = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
678 | 0 | } |
679 | | #if 0 /* anything that can fail? */ |
680 | | if (_fail) |
681 | | vty_out (vty, "%% invalid input for %s: %s\n", |
682 | | argv[_i]->varname, argv[_i]->arg); |
683 | | _failcnt += _fail; |
684 | | #endif |
685 | 0 | } |
686 | | #if 0 /* anything that can fail? */ |
687 | | if (_failcnt) |
688 | | return CMD_WARNING; |
689 | | #endif |
690 | 0 | #endif |
691 | 0 | if (!type) { |
692 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "type"); |
693 | 0 | return CMD_WARNING; |
694 | 0 | } |
695 | | |
696 | 0 | return match_ip_next_hop_type_magic(self, vty, argc, argv, type); |
697 | 0 | } |
698 | | |
699 | | /* no_match_ip_next_hop_type => "no match ip next-hop type [<blackhole>]" */ |
700 | | DEFUN_CMD_FUNC_DECL(no_match_ip_next_hop_type) |
701 | | #define funcdecl_no_match_ip_next_hop_type static int no_match_ip_next_hop_type_magic(\ |
702 | | const struct cmd_element *self __attribute__ ((unused)),\ |
703 | | struct vty *vty __attribute__ ((unused)),\ |
704 | | int argc __attribute__ ((unused)),\ |
705 | | struct cmd_token *argv[] __attribute__ ((unused))) |
706 | | funcdecl_no_match_ip_next_hop_type; |
707 | | DEFUN_CMD_FUNC_TEXT(no_match_ip_next_hop_type) |
708 | 0 | { |
709 | | #if 0 /* anything to parse? */ |
710 | | int _i; |
711 | | #if 0 /* anything that can fail? */ |
712 | | unsigned _fail = 0, _failcnt = 0; |
713 | | #endif |
714 | | |
715 | | for (_i = 0; _i < argc; _i++) { |
716 | | if (!argv[_i]->varname) |
717 | | continue; |
718 | | #if 0 /* anything that can fail? */ |
719 | | _fail = 0; |
720 | | #endif |
721 | | |
722 | | #if 0 /* anything that can fail? */ |
723 | | if (_fail) |
724 | | vty_out (vty, "%% invalid input for %s: %s\n", |
725 | | argv[_i]->varname, argv[_i]->arg); |
726 | | _failcnt += _fail; |
727 | | #endif |
728 | | } |
729 | | #if 0 /* anything that can fail? */ |
730 | | if (_failcnt) |
731 | | return CMD_WARNING; |
732 | | #endif |
733 | | #endif |
734 | |
|
735 | 0 | return no_match_ip_next_hop_type_magic(self, vty, argc, argv); |
736 | 0 | } |
737 | | |
738 | | /* match_ipv6_address => "match ipv6 address ACCESSLIST6_NAME$name" */ |
739 | | DEFUN_CMD_FUNC_DECL(match_ipv6_address) |
740 | | #define funcdecl_match_ipv6_address static int match_ipv6_address_magic(\ |
741 | | const struct cmd_element *self __attribute__ ((unused)),\ |
742 | | struct vty *vty __attribute__ ((unused)),\ |
743 | | int argc __attribute__ ((unused)),\ |
744 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
745 | | const char * name) |
746 | | funcdecl_match_ipv6_address; |
747 | | DEFUN_CMD_FUNC_TEXT(match_ipv6_address) |
748 | 0 | { |
749 | 0 | #if 1 /* anything to parse? */ |
750 | 0 | int _i; |
751 | | #if 0 /* anything that can fail? */ |
752 | | unsigned _fail = 0, _failcnt = 0; |
753 | | #endif |
754 | 0 | const char *name = NULL; |
755 | |
|
756 | 0 | for (_i = 0; _i < argc; _i++) { |
757 | 0 | if (!argv[_i]->varname) |
758 | 0 | continue; |
759 | | #if 0 /* anything that can fail? */ |
760 | | _fail = 0; |
761 | | #endif |
762 | | |
763 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
764 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
765 | 0 | } |
766 | | #if 0 /* anything that can fail? */ |
767 | | if (_fail) |
768 | | vty_out (vty, "%% invalid input for %s: %s\n", |
769 | | argv[_i]->varname, argv[_i]->arg); |
770 | | _failcnt += _fail; |
771 | | #endif |
772 | 0 | } |
773 | | #if 0 /* anything that can fail? */ |
774 | | if (_failcnt) |
775 | | return CMD_WARNING; |
776 | | #endif |
777 | 0 | #endif |
778 | 0 | if (!name) { |
779 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
780 | 0 | return CMD_WARNING; |
781 | 0 | } |
782 | | |
783 | 0 | return match_ipv6_address_magic(self, vty, argc, argv, name); |
784 | 0 | } |
785 | | |
786 | | /* no_match_ipv6_address => "no match ipv6 address [ACCESSLIST6_NAME]" */ |
787 | | DEFUN_CMD_FUNC_DECL(no_match_ipv6_address) |
788 | | #define funcdecl_no_match_ipv6_address static int no_match_ipv6_address_magic(\ |
789 | | const struct cmd_element *self __attribute__ ((unused)),\ |
790 | | struct vty *vty __attribute__ ((unused)),\ |
791 | | int argc __attribute__ ((unused)),\ |
792 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
793 | | const char * accesslist6_name) |
794 | | funcdecl_no_match_ipv6_address; |
795 | | DEFUN_CMD_FUNC_TEXT(no_match_ipv6_address) |
796 | 0 | { |
797 | 0 | #if 1 /* anything to parse? */ |
798 | 0 | int _i; |
799 | | #if 0 /* anything that can fail? */ |
800 | | unsigned _fail = 0, _failcnt = 0; |
801 | | #endif |
802 | 0 | const char *accesslist6_name = NULL; |
803 | |
|
804 | 0 | for (_i = 0; _i < argc; _i++) { |
805 | 0 | if (!argv[_i]->varname) |
806 | 0 | continue; |
807 | | #if 0 /* anything that can fail? */ |
808 | | _fail = 0; |
809 | | #endif |
810 | | |
811 | 0 | if (!strcmp(argv[_i]->varname, "accesslist6_name")) { |
812 | 0 | accesslist6_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
813 | 0 | } |
814 | | #if 0 /* anything that can fail? */ |
815 | | if (_fail) |
816 | | vty_out (vty, "%% invalid input for %s: %s\n", |
817 | | argv[_i]->varname, argv[_i]->arg); |
818 | | _failcnt += _fail; |
819 | | #endif |
820 | 0 | } |
821 | | #if 0 /* anything that can fail? */ |
822 | | if (_failcnt) |
823 | | return CMD_WARNING; |
824 | | #endif |
825 | 0 | #endif |
826 | |
|
827 | 0 | return no_match_ipv6_address_magic(self, vty, argc, argv, accesslist6_name); |
828 | 0 | } |
829 | | |
830 | | /* match_ipv6_address_prefix_list => "match ipv6 address prefix-list PREFIXLIST_NAME$name" */ |
831 | | DEFUN_CMD_FUNC_DECL(match_ipv6_address_prefix_list) |
832 | | #define funcdecl_match_ipv6_address_prefix_list static int match_ipv6_address_prefix_list_magic(\ |
833 | | const struct cmd_element *self __attribute__ ((unused)),\ |
834 | | struct vty *vty __attribute__ ((unused)),\ |
835 | | int argc __attribute__ ((unused)),\ |
836 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
837 | | const char * name) |
838 | | funcdecl_match_ipv6_address_prefix_list; |
839 | | DEFUN_CMD_FUNC_TEXT(match_ipv6_address_prefix_list) |
840 | 0 | { |
841 | 0 | #if 1 /* anything to parse? */ |
842 | 0 | int _i; |
843 | | #if 0 /* anything that can fail? */ |
844 | | unsigned _fail = 0, _failcnt = 0; |
845 | | #endif |
846 | 0 | const char *name = NULL; |
847 | |
|
848 | 0 | for (_i = 0; _i < argc; _i++) { |
849 | 0 | if (!argv[_i]->varname) |
850 | 0 | continue; |
851 | | #if 0 /* anything that can fail? */ |
852 | | _fail = 0; |
853 | | #endif |
854 | | |
855 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
856 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
857 | 0 | } |
858 | | #if 0 /* anything that can fail? */ |
859 | | if (_fail) |
860 | | vty_out (vty, "%% invalid input for %s: %s\n", |
861 | | argv[_i]->varname, argv[_i]->arg); |
862 | | _failcnt += _fail; |
863 | | #endif |
864 | 0 | } |
865 | | #if 0 /* anything that can fail? */ |
866 | | if (_failcnt) |
867 | | return CMD_WARNING; |
868 | | #endif |
869 | 0 | #endif |
870 | 0 | if (!name) { |
871 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
872 | 0 | return CMD_WARNING; |
873 | 0 | } |
874 | | |
875 | 0 | return match_ipv6_address_prefix_list_magic(self, vty, argc, argv, name); |
876 | 0 | } |
877 | | |
878 | | /* no_match_ipv6_address_prefix_list => "no match ipv6 address prefix-list [PREFIXLIST_NAME]" */ |
879 | | DEFUN_CMD_FUNC_DECL(no_match_ipv6_address_prefix_list) |
880 | | #define funcdecl_no_match_ipv6_address_prefix_list static int no_match_ipv6_address_prefix_list_magic(\ |
881 | | const struct cmd_element *self __attribute__ ((unused)),\ |
882 | | struct vty *vty __attribute__ ((unused)),\ |
883 | | int argc __attribute__ ((unused)),\ |
884 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
885 | | const char * prefixlist_name) |
886 | | funcdecl_no_match_ipv6_address_prefix_list; |
887 | | DEFUN_CMD_FUNC_TEXT(no_match_ipv6_address_prefix_list) |
888 | 0 | { |
889 | 0 | #if 1 /* anything to parse? */ |
890 | 0 | int _i; |
891 | | #if 0 /* anything that can fail? */ |
892 | | unsigned _fail = 0, _failcnt = 0; |
893 | | #endif |
894 | 0 | const char *prefixlist_name = NULL; |
895 | |
|
896 | 0 | for (_i = 0; _i < argc; _i++) { |
897 | 0 | if (!argv[_i]->varname) |
898 | 0 | continue; |
899 | | #if 0 /* anything that can fail? */ |
900 | | _fail = 0; |
901 | | #endif |
902 | | |
903 | 0 | if (!strcmp(argv[_i]->varname, "prefixlist_name")) { |
904 | 0 | prefixlist_name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
905 | 0 | } |
906 | | #if 0 /* anything that can fail? */ |
907 | | if (_fail) |
908 | | vty_out (vty, "%% invalid input for %s: %s\n", |
909 | | argv[_i]->varname, argv[_i]->arg); |
910 | | _failcnt += _fail; |
911 | | #endif |
912 | 0 | } |
913 | | #if 0 /* anything that can fail? */ |
914 | | if (_failcnt) |
915 | | return CMD_WARNING; |
916 | | #endif |
917 | 0 | #endif |
918 | |
|
919 | 0 | return no_match_ipv6_address_prefix_list_magic(self, vty, argc, argv, prefixlist_name); |
920 | 0 | } |
921 | | |
922 | | /* match_ipv6_next_hop_type => "match ipv6 next-hop type <blackhole>$type" */ |
923 | | DEFUN_CMD_FUNC_DECL(match_ipv6_next_hop_type) |
924 | | #define funcdecl_match_ipv6_next_hop_type static int match_ipv6_next_hop_type_magic(\ |
925 | | const struct cmd_element *self __attribute__ ((unused)),\ |
926 | | struct vty *vty __attribute__ ((unused)),\ |
927 | | int argc __attribute__ ((unused)),\ |
928 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
929 | | const char * type) |
930 | | funcdecl_match_ipv6_next_hop_type; |
931 | | DEFUN_CMD_FUNC_TEXT(match_ipv6_next_hop_type) |
932 | 0 | { |
933 | 0 | #if 1 /* anything to parse? */ |
934 | 0 | int _i; |
935 | | #if 0 /* anything that can fail? */ |
936 | | unsigned _fail = 0, _failcnt = 0; |
937 | | #endif |
938 | 0 | const char *type = NULL; |
939 | |
|
940 | 0 | for (_i = 0; _i < argc; _i++) { |
941 | 0 | if (!argv[_i]->varname) |
942 | 0 | continue; |
943 | | #if 0 /* anything that can fail? */ |
944 | | _fail = 0; |
945 | | #endif |
946 | | |
947 | 0 | if (!strcmp(argv[_i]->varname, "type")) { |
948 | 0 | type = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
949 | 0 | } |
950 | | #if 0 /* anything that can fail? */ |
951 | | if (_fail) |
952 | | vty_out (vty, "%% invalid input for %s: %s\n", |
953 | | argv[_i]->varname, argv[_i]->arg); |
954 | | _failcnt += _fail; |
955 | | #endif |
956 | 0 | } |
957 | | #if 0 /* anything that can fail? */ |
958 | | if (_failcnt) |
959 | | return CMD_WARNING; |
960 | | #endif |
961 | 0 | #endif |
962 | 0 | if (!type) { |
963 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "type"); |
964 | 0 | return CMD_WARNING; |
965 | 0 | } |
966 | | |
967 | 0 | return match_ipv6_next_hop_type_magic(self, vty, argc, argv, type); |
968 | 0 | } |
969 | | |
970 | | /* no_match_ipv6_next_hop_type => "no match ipv6 next-hop type [<blackhole>]" */ |
971 | | DEFUN_CMD_FUNC_DECL(no_match_ipv6_next_hop_type) |
972 | | #define funcdecl_no_match_ipv6_next_hop_type static int no_match_ipv6_next_hop_type_magic(\ |
973 | | const struct cmd_element *self __attribute__ ((unused)),\ |
974 | | struct vty *vty __attribute__ ((unused)),\ |
975 | | int argc __attribute__ ((unused)),\ |
976 | | struct cmd_token *argv[] __attribute__ ((unused))) |
977 | | funcdecl_no_match_ipv6_next_hop_type; |
978 | | DEFUN_CMD_FUNC_TEXT(no_match_ipv6_next_hop_type) |
979 | 0 | { |
980 | | #if 0 /* anything to parse? */ |
981 | | int _i; |
982 | | #if 0 /* anything that can fail? */ |
983 | | unsigned _fail = 0, _failcnt = 0; |
984 | | #endif |
985 | | |
986 | | for (_i = 0; _i < argc; _i++) { |
987 | | if (!argv[_i]->varname) |
988 | | continue; |
989 | | #if 0 /* anything that can fail? */ |
990 | | _fail = 0; |
991 | | #endif |
992 | | |
993 | | #if 0 /* anything that can fail? */ |
994 | | if (_fail) |
995 | | vty_out (vty, "%% invalid input for %s: %s\n", |
996 | | argv[_i]->varname, argv[_i]->arg); |
997 | | _failcnt += _fail; |
998 | | #endif |
999 | | } |
1000 | | #if 0 /* anything that can fail? */ |
1001 | | if (_failcnt) |
1002 | | return CMD_WARNING; |
1003 | | #endif |
1004 | | #endif |
1005 | |
|
1006 | 0 | return no_match_ipv6_next_hop_type_magic(self, vty, argc, argv); |
1007 | 0 | } |
1008 | | |
1009 | | /* match_metric => "match metric (0-4294967295)$metric" */ |
1010 | | DEFUN_CMD_FUNC_DECL(match_metric) |
1011 | | #define funcdecl_match_metric static int match_metric_magic(\ |
1012 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1013 | | struct vty *vty __attribute__ ((unused)),\ |
1014 | | int argc __attribute__ ((unused)),\ |
1015 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1016 | | long metric,\ |
1017 | | const char * metric_str __attribute__ ((unused))) |
1018 | | funcdecl_match_metric; |
1019 | | DEFUN_CMD_FUNC_TEXT(match_metric) |
1020 | 0 | { |
1021 | 0 | #if 1 /* anything to parse? */ |
1022 | 0 | int _i; |
1023 | 0 | #if 1 /* anything that can fail? */ |
1024 | 0 | unsigned _fail = 0, _failcnt = 0; |
1025 | 0 | #endif |
1026 | 0 | long metric = 0; |
1027 | 0 | const char *metric_str = NULL; |
1028 | |
|
1029 | 0 | for (_i = 0; _i < argc; _i++) { |
1030 | 0 | if (!argv[_i]->varname) |
1031 | 0 | continue; |
1032 | 0 | #if 1 /* anything that can fail? */ |
1033 | 0 | _fail = 0; |
1034 | 0 | #endif |
1035 | |
|
1036 | 0 | if (!strcmp(argv[_i]->varname, "metric")) { |
1037 | 0 | metric_str = argv[_i]->arg; |
1038 | 0 | char *_end; |
1039 | 0 | metric = strtol(argv[_i]->arg, &_end, 10); |
1040 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1041 | 0 | } |
1042 | 0 | #if 1 /* anything that can fail? */ |
1043 | 0 | if (_fail) |
1044 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1045 | 0 | argv[_i]->varname, argv[_i]->arg); |
1046 | 0 | _failcnt += _fail; |
1047 | 0 | #endif |
1048 | 0 | } |
1049 | 0 | #if 1 /* anything that can fail? */ |
1050 | 0 | if (_failcnt) |
1051 | 0 | return CMD_WARNING; |
1052 | 0 | #endif |
1053 | 0 | #endif |
1054 | 0 | if (!metric_str) { |
1055 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "metric_str"); |
1056 | 0 | return CMD_WARNING; |
1057 | 0 | } |
1058 | | |
1059 | 0 | return match_metric_magic(self, vty, argc, argv, metric, metric_str); |
1060 | 0 | } |
1061 | | |
1062 | | /* no_match_metric => "no match metric [(0-4294967295)]" */ |
1063 | | DEFUN_CMD_FUNC_DECL(no_match_metric) |
1064 | | #define funcdecl_no_match_metric static int no_match_metric_magic(\ |
1065 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1066 | | struct vty *vty __attribute__ ((unused)),\ |
1067 | | int argc __attribute__ ((unused)),\ |
1068 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1069 | | long metric,\ |
1070 | | const char * metric_str __attribute__ ((unused))) |
1071 | | funcdecl_no_match_metric; |
1072 | | DEFUN_CMD_FUNC_TEXT(no_match_metric) |
1073 | 0 | { |
1074 | 0 | #if 1 /* anything to parse? */ |
1075 | 0 | int _i; |
1076 | 0 | #if 1 /* anything that can fail? */ |
1077 | 0 | unsigned _fail = 0, _failcnt = 0; |
1078 | 0 | #endif |
1079 | 0 | long metric = 0; |
1080 | 0 | const char *metric_str = NULL; |
1081 | |
|
1082 | 0 | for (_i = 0; _i < argc; _i++) { |
1083 | 0 | if (!argv[_i]->varname) |
1084 | 0 | continue; |
1085 | 0 | #if 1 /* anything that can fail? */ |
1086 | 0 | _fail = 0; |
1087 | 0 | #endif |
1088 | |
|
1089 | 0 | if (!strcmp(argv[_i]->varname, "metric")) { |
1090 | 0 | metric_str = argv[_i]->arg; |
1091 | 0 | char *_end; |
1092 | 0 | metric = strtol(argv[_i]->arg, &_end, 10); |
1093 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1094 | 0 | } |
1095 | 0 | #if 1 /* anything that can fail? */ |
1096 | 0 | if (_fail) |
1097 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1098 | 0 | argv[_i]->varname, argv[_i]->arg); |
1099 | 0 | _failcnt += _fail; |
1100 | 0 | #endif |
1101 | 0 | } |
1102 | 0 | #if 1 /* anything that can fail? */ |
1103 | 0 | if (_failcnt) |
1104 | 0 | return CMD_WARNING; |
1105 | 0 | #endif |
1106 | 0 | #endif |
1107 | | |
1108 | 0 | return no_match_metric_magic(self, vty, argc, argv, metric, metric_str); |
1109 | 0 | } |
1110 | | |
1111 | | /* match_tag => "match tag (1-4294967295)$tag" */ |
1112 | | DEFUN_CMD_FUNC_DECL(match_tag) |
1113 | | #define funcdecl_match_tag static int match_tag_magic(\ |
1114 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1115 | | struct vty *vty __attribute__ ((unused)),\ |
1116 | | int argc __attribute__ ((unused)),\ |
1117 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1118 | | long tag,\ |
1119 | | const char * tag_str __attribute__ ((unused))) |
1120 | | funcdecl_match_tag; |
1121 | | DEFUN_CMD_FUNC_TEXT(match_tag) |
1122 | 0 | { |
1123 | 0 | #if 1 /* anything to parse? */ |
1124 | 0 | int _i; |
1125 | 0 | #if 1 /* anything that can fail? */ |
1126 | 0 | unsigned _fail = 0, _failcnt = 0; |
1127 | 0 | #endif |
1128 | 0 | long tag = 0; |
1129 | 0 | const char *tag_str = NULL; |
1130 | |
|
1131 | 0 | for (_i = 0; _i < argc; _i++) { |
1132 | 0 | if (!argv[_i]->varname) |
1133 | 0 | continue; |
1134 | 0 | #if 1 /* anything that can fail? */ |
1135 | 0 | _fail = 0; |
1136 | 0 | #endif |
1137 | |
|
1138 | 0 | if (!strcmp(argv[_i]->varname, "tag")) { |
1139 | 0 | tag_str = argv[_i]->arg; |
1140 | 0 | char *_end; |
1141 | 0 | tag = strtol(argv[_i]->arg, &_end, 10); |
1142 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1143 | 0 | } |
1144 | 0 | #if 1 /* anything that can fail? */ |
1145 | 0 | if (_fail) |
1146 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1147 | 0 | argv[_i]->varname, argv[_i]->arg); |
1148 | 0 | _failcnt += _fail; |
1149 | 0 | #endif |
1150 | 0 | } |
1151 | 0 | #if 1 /* anything that can fail? */ |
1152 | 0 | if (_failcnt) |
1153 | 0 | return CMD_WARNING; |
1154 | 0 | #endif |
1155 | 0 | #endif |
1156 | 0 | if (!tag_str) { |
1157 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "tag_str"); |
1158 | 0 | return CMD_WARNING; |
1159 | 0 | } |
1160 | | |
1161 | 0 | return match_tag_magic(self, vty, argc, argv, tag, tag_str); |
1162 | 0 | } |
1163 | | |
1164 | | /* no_match_tag => "no match tag [(1-4294967295)]" */ |
1165 | | DEFUN_CMD_FUNC_DECL(no_match_tag) |
1166 | | #define funcdecl_no_match_tag static int no_match_tag_magic(\ |
1167 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1168 | | struct vty *vty __attribute__ ((unused)),\ |
1169 | | int argc __attribute__ ((unused)),\ |
1170 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1171 | | long tag,\ |
1172 | | const char * tag_str __attribute__ ((unused))) |
1173 | | funcdecl_no_match_tag; |
1174 | | DEFUN_CMD_FUNC_TEXT(no_match_tag) |
1175 | 0 | { |
1176 | 0 | #if 1 /* anything to parse? */ |
1177 | 0 | int _i; |
1178 | 0 | #if 1 /* anything that can fail? */ |
1179 | 0 | unsigned _fail = 0, _failcnt = 0; |
1180 | 0 | #endif |
1181 | 0 | long tag = 0; |
1182 | 0 | const char *tag_str = NULL; |
1183 | |
|
1184 | 0 | for (_i = 0; _i < argc; _i++) { |
1185 | 0 | if (!argv[_i]->varname) |
1186 | 0 | continue; |
1187 | 0 | #if 1 /* anything that can fail? */ |
1188 | 0 | _fail = 0; |
1189 | 0 | #endif |
1190 | |
|
1191 | 0 | if (!strcmp(argv[_i]->varname, "tag")) { |
1192 | 0 | tag_str = argv[_i]->arg; |
1193 | 0 | char *_end; |
1194 | 0 | tag = strtol(argv[_i]->arg, &_end, 10); |
1195 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1196 | 0 | } |
1197 | 0 | #if 1 /* anything that can fail? */ |
1198 | 0 | if (_fail) |
1199 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1200 | 0 | argv[_i]->varname, argv[_i]->arg); |
1201 | 0 | _failcnt += _fail; |
1202 | 0 | #endif |
1203 | 0 | } |
1204 | 0 | #if 1 /* anything that can fail? */ |
1205 | 0 | if (_failcnt) |
1206 | 0 | return CMD_WARNING; |
1207 | 0 | #endif |
1208 | 0 | #endif |
1209 | | |
1210 | 0 | return no_match_tag_magic(self, vty, argc, argv, tag, tag_str); |
1211 | 0 | } |
1212 | | |
1213 | | /* set_ip_nexthop => "set ip next-hop A.B.C.D$addr" */ |
1214 | | DEFUN_CMD_FUNC_DECL(set_ip_nexthop) |
1215 | | #define funcdecl_set_ip_nexthop static int set_ip_nexthop_magic(\ |
1216 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1217 | | struct vty *vty __attribute__ ((unused)),\ |
1218 | | int argc __attribute__ ((unused)),\ |
1219 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1220 | | struct in_addr addr,\ |
1221 | | const char * addr_str __attribute__ ((unused))) |
1222 | | funcdecl_set_ip_nexthop; |
1223 | | DEFUN_CMD_FUNC_TEXT(set_ip_nexthop) |
1224 | 0 | { |
1225 | 0 | #if 1 /* anything to parse? */ |
1226 | 0 | int _i; |
1227 | 0 | #if 1 /* anything that can fail? */ |
1228 | 0 | unsigned _fail = 0, _failcnt = 0; |
1229 | 0 | #endif |
1230 | 0 | struct in_addr addr = { INADDR_ANY }; |
1231 | 0 | const char *addr_str = NULL; |
1232 | |
|
1233 | 0 | for (_i = 0; _i < argc; _i++) { |
1234 | 0 | if (!argv[_i]->varname) |
1235 | 0 | continue; |
1236 | 0 | #if 1 /* anything that can fail? */ |
1237 | 0 | _fail = 0; |
1238 | 0 | #endif |
1239 | |
|
1240 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1241 | 0 | addr_str = argv[_i]->arg; |
1242 | 0 | _fail = !inet_aton(argv[_i]->arg, &addr); |
1243 | 0 | } |
1244 | 0 | #if 1 /* anything that can fail? */ |
1245 | 0 | if (_fail) |
1246 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1247 | 0 | argv[_i]->varname, argv[_i]->arg); |
1248 | 0 | _failcnt += _fail; |
1249 | 0 | #endif |
1250 | 0 | } |
1251 | 0 | #if 1 /* anything that can fail? */ |
1252 | 0 | if (_failcnt) |
1253 | 0 | return CMD_WARNING; |
1254 | 0 | #endif |
1255 | 0 | #endif |
1256 | 0 | if (!addr_str) { |
1257 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "addr_str"); |
1258 | 0 | return CMD_WARNING; |
1259 | 0 | } |
1260 | | |
1261 | 0 | return set_ip_nexthop_magic(self, vty, argc, argv, addr, addr_str); |
1262 | 0 | } |
1263 | | |
1264 | | /* no_set_ip_nexthop => "no set ip next-hop [A.B.C.D]" */ |
1265 | | DEFUN_CMD_FUNC_DECL(no_set_ip_nexthop) |
1266 | | #define funcdecl_no_set_ip_nexthop static int no_set_ip_nexthop_magic(\ |
1267 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1268 | | struct vty *vty __attribute__ ((unused)),\ |
1269 | | int argc __attribute__ ((unused)),\ |
1270 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1271 | | struct in_addr next_hop,\ |
1272 | | const char * next_hop_str __attribute__ ((unused))) |
1273 | | funcdecl_no_set_ip_nexthop; |
1274 | | DEFUN_CMD_FUNC_TEXT(no_set_ip_nexthop) |
1275 | 0 | { |
1276 | 0 | #if 1 /* anything to parse? */ |
1277 | 0 | int _i; |
1278 | 0 | #if 1 /* anything that can fail? */ |
1279 | 0 | unsigned _fail = 0, _failcnt = 0; |
1280 | 0 | #endif |
1281 | 0 | struct in_addr next_hop = { INADDR_ANY }; |
1282 | 0 | const char *next_hop_str = NULL; |
1283 | |
|
1284 | 0 | for (_i = 0; _i < argc; _i++) { |
1285 | 0 | if (!argv[_i]->varname) |
1286 | 0 | continue; |
1287 | 0 | #if 1 /* anything that can fail? */ |
1288 | 0 | _fail = 0; |
1289 | 0 | #endif |
1290 | |
|
1291 | 0 | if (!strcmp(argv[_i]->varname, "next_hop")) { |
1292 | 0 | next_hop_str = argv[_i]->arg; |
1293 | 0 | _fail = !inet_aton(argv[_i]->arg, &next_hop); |
1294 | 0 | } |
1295 | 0 | #if 1 /* anything that can fail? */ |
1296 | 0 | if (_fail) |
1297 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1298 | 0 | argv[_i]->varname, argv[_i]->arg); |
1299 | 0 | _failcnt += _fail; |
1300 | 0 | #endif |
1301 | 0 | } |
1302 | 0 | #if 1 /* anything that can fail? */ |
1303 | 0 | if (_failcnt) |
1304 | 0 | return CMD_WARNING; |
1305 | 0 | #endif |
1306 | 0 | #endif |
1307 | | |
1308 | 0 | return no_set_ip_nexthop_magic(self, vty, argc, argv, next_hop, next_hop_str); |
1309 | 0 | } |
1310 | | |
1311 | | /* set_ipv6_nexthop_local => "set ipv6 next-hop local X:X::X:X$addr" */ |
1312 | | DEFUN_CMD_FUNC_DECL(set_ipv6_nexthop_local) |
1313 | | #define funcdecl_set_ipv6_nexthop_local static int set_ipv6_nexthop_local_magic(\ |
1314 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1315 | | struct vty *vty __attribute__ ((unused)),\ |
1316 | | int argc __attribute__ ((unused)),\ |
1317 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1318 | | struct in6_addr addr,\ |
1319 | | const char * addr_str __attribute__ ((unused))) |
1320 | | funcdecl_set_ipv6_nexthop_local; |
1321 | | DEFUN_CMD_FUNC_TEXT(set_ipv6_nexthop_local) |
1322 | 0 | { |
1323 | 0 | #if 1 /* anything to parse? */ |
1324 | 0 | int _i; |
1325 | 0 | #if 1 /* anything that can fail? */ |
1326 | 0 | unsigned _fail = 0, _failcnt = 0; |
1327 | 0 | #endif |
1328 | 0 | struct in6_addr addr = {}; |
1329 | 0 | const char *addr_str = NULL; |
1330 | |
|
1331 | 0 | for (_i = 0; _i < argc; _i++) { |
1332 | 0 | if (!argv[_i]->varname) |
1333 | 0 | continue; |
1334 | 0 | #if 1 /* anything that can fail? */ |
1335 | 0 | _fail = 0; |
1336 | 0 | #endif |
1337 | |
|
1338 | 0 | if (!strcmp(argv[_i]->varname, "addr")) { |
1339 | 0 | addr_str = argv[_i]->arg; |
1340 | 0 | _fail = !inet_pton(AF_INET6, argv[_i]->arg, &addr); |
1341 | 0 | } |
1342 | 0 | #if 1 /* anything that can fail? */ |
1343 | 0 | if (_fail) |
1344 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1345 | 0 | argv[_i]->varname, argv[_i]->arg); |
1346 | 0 | _failcnt += _fail; |
1347 | 0 | #endif |
1348 | 0 | } |
1349 | 0 | #if 1 /* anything that can fail? */ |
1350 | 0 | if (_failcnt) |
1351 | 0 | return CMD_WARNING; |
1352 | 0 | #endif |
1353 | 0 | #endif |
1354 | 0 | if (!addr_str) { |
1355 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "addr_str"); |
1356 | 0 | return CMD_WARNING; |
1357 | 0 | } |
1358 | | |
1359 | 0 | return set_ipv6_nexthop_local_magic(self, vty, argc, argv, addr, addr_str); |
1360 | 0 | } |
1361 | | |
1362 | | /* no_set_ipv6_nexthop_local => "no set ipv6 next-hop local [X:X::X:X]" */ |
1363 | | DEFUN_CMD_FUNC_DECL(no_set_ipv6_nexthop_local) |
1364 | | #define funcdecl_no_set_ipv6_nexthop_local static int no_set_ipv6_nexthop_local_magic(\ |
1365 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1366 | | struct vty *vty __attribute__ ((unused)),\ |
1367 | | int argc __attribute__ ((unused)),\ |
1368 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1369 | | struct in6_addr local,\ |
1370 | | const char * local_str __attribute__ ((unused))) |
1371 | | funcdecl_no_set_ipv6_nexthop_local; |
1372 | | DEFUN_CMD_FUNC_TEXT(no_set_ipv6_nexthop_local) |
1373 | 0 | { |
1374 | 0 | #if 1 /* anything to parse? */ |
1375 | 0 | int _i; |
1376 | 0 | #if 1 /* anything that can fail? */ |
1377 | 0 | unsigned _fail = 0, _failcnt = 0; |
1378 | 0 | #endif |
1379 | 0 | struct in6_addr local = {}; |
1380 | 0 | const char *local_str = NULL; |
1381 | |
|
1382 | 0 | for (_i = 0; _i < argc; _i++) { |
1383 | 0 | if (!argv[_i]->varname) |
1384 | 0 | continue; |
1385 | 0 | #if 1 /* anything that can fail? */ |
1386 | 0 | _fail = 0; |
1387 | 0 | #endif |
1388 | |
|
1389 | 0 | if (!strcmp(argv[_i]->varname, "local")) { |
1390 | 0 | local_str = argv[_i]->arg; |
1391 | 0 | _fail = !inet_pton(AF_INET6, argv[_i]->arg, &local); |
1392 | 0 | } |
1393 | 0 | #if 1 /* anything that can fail? */ |
1394 | 0 | if (_fail) |
1395 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1396 | 0 | argv[_i]->varname, argv[_i]->arg); |
1397 | 0 | _failcnt += _fail; |
1398 | 0 | #endif |
1399 | 0 | } |
1400 | 0 | #if 1 /* anything that can fail? */ |
1401 | 0 | if (_failcnt) |
1402 | 0 | return CMD_WARNING; |
1403 | 0 | #endif |
1404 | 0 | #endif |
1405 | | |
1406 | 0 | return no_set_ipv6_nexthop_local_magic(self, vty, argc, argv, local, local_str); |
1407 | 0 | } |
1408 | | |
1409 | | /* set_metric => "set metric <(-4294967295-4294967295)$metric|rtt$rtt|+rtt$artt|-rtt$srtt>" */ |
1410 | | DEFUN_CMD_FUNC_DECL(set_metric) |
1411 | | #define funcdecl_set_metric static int set_metric_magic(\ |
1412 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1413 | | struct vty *vty __attribute__ ((unused)),\ |
1414 | | int argc __attribute__ ((unused)),\ |
1415 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1416 | | long metric,\ |
1417 | | const char * metric_str __attribute__ ((unused)),\ |
1418 | | const char * rtt,\ |
1419 | | const char * artt,\ |
1420 | | const char * srtt) |
1421 | | funcdecl_set_metric; |
1422 | | DEFUN_CMD_FUNC_TEXT(set_metric) |
1423 | 0 | { |
1424 | 0 | #if 4 /* anything to parse? */ |
1425 | 0 | int _i; |
1426 | 0 | #if 1 /* anything that can fail? */ |
1427 | 0 | unsigned _fail = 0, _failcnt = 0; |
1428 | 0 | #endif |
1429 | 0 | long metric = 0; |
1430 | 0 | const char *metric_str = NULL; |
1431 | 0 | const char *rtt = NULL; |
1432 | 0 | const char *artt = NULL; |
1433 | 0 | const char *srtt = NULL; |
1434 | |
|
1435 | 0 | for (_i = 0; _i < argc; _i++) { |
1436 | 0 | if (!argv[_i]->varname) |
1437 | 0 | continue; |
1438 | 0 | #if 1 /* anything that can fail? */ |
1439 | 0 | _fail = 0; |
1440 | 0 | #endif |
1441 | |
|
1442 | 0 | if (!strcmp(argv[_i]->varname, "metric")) { |
1443 | 0 | metric_str = argv[_i]->arg; |
1444 | 0 | char *_end; |
1445 | 0 | metric = strtol(argv[_i]->arg, &_end, 10); |
1446 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1447 | 0 | } |
1448 | 0 | if (!strcmp(argv[_i]->varname, "rtt")) { |
1449 | 0 | rtt = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1450 | 0 | } |
1451 | 0 | if (!strcmp(argv[_i]->varname, "artt")) { |
1452 | 0 | artt = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1453 | 0 | } |
1454 | 0 | if (!strcmp(argv[_i]->varname, "srtt")) { |
1455 | 0 | srtt = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1456 | 0 | } |
1457 | 0 | #if 1 /* anything that can fail? */ |
1458 | 0 | if (_fail) |
1459 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1460 | 0 | argv[_i]->varname, argv[_i]->arg); |
1461 | 0 | _failcnt += _fail; |
1462 | 0 | #endif |
1463 | 0 | } |
1464 | 0 | #if 1 /* anything that can fail? */ |
1465 | 0 | if (_failcnt) |
1466 | 0 | return CMD_WARNING; |
1467 | 0 | #endif |
1468 | 0 | #endif |
1469 | | |
1470 | 0 | return set_metric_magic(self, vty, argc, argv, metric, metric_str, rtt, artt, srtt); |
1471 | 0 | } |
1472 | | |
1473 | | /* no_set_metric => "no set metric [OPTVAL]" */ |
1474 | | DEFUN_CMD_FUNC_DECL(no_set_metric) |
1475 | | #define funcdecl_no_set_metric static int no_set_metric_magic(\ |
1476 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1477 | | struct vty *vty __attribute__ ((unused)),\ |
1478 | | int argc __attribute__ ((unused)),\ |
1479 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1480 | | const char * optval) |
1481 | | funcdecl_no_set_metric; |
1482 | | DEFUN_CMD_FUNC_TEXT(no_set_metric) |
1483 | 0 | { |
1484 | 0 | #if 1 /* anything to parse? */ |
1485 | 0 | int _i; |
1486 | | #if 0 /* anything that can fail? */ |
1487 | | unsigned _fail = 0, _failcnt = 0; |
1488 | | #endif |
1489 | 0 | const char *optval = NULL; |
1490 | |
|
1491 | 0 | for (_i = 0; _i < argc; _i++) { |
1492 | 0 | if (!argv[_i]->varname) |
1493 | 0 | continue; |
1494 | | #if 0 /* anything that can fail? */ |
1495 | | _fail = 0; |
1496 | | #endif |
1497 | | |
1498 | 0 | if (!strcmp(argv[_i]->varname, "optval")) { |
1499 | 0 | optval = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
1500 | 0 | } |
1501 | | #if 0 /* anything that can fail? */ |
1502 | | if (_fail) |
1503 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1504 | | argv[_i]->varname, argv[_i]->arg); |
1505 | | _failcnt += _fail; |
1506 | | #endif |
1507 | 0 | } |
1508 | | #if 0 /* anything that can fail? */ |
1509 | | if (_failcnt) |
1510 | | return CMD_WARNING; |
1511 | | #endif |
1512 | 0 | #endif |
1513 | |
|
1514 | 0 | return no_set_metric_magic(self, vty, argc, argv, optval); |
1515 | 0 | } |
1516 | | |
1517 | | /* set_min_metric => "set min-metric <(0-4294967295)$metric>" */ |
1518 | | DEFUN_CMD_FUNC_DECL(set_min_metric) |
1519 | | #define funcdecl_set_min_metric static int set_min_metric_magic(\ |
1520 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1521 | | struct vty *vty __attribute__ ((unused)),\ |
1522 | | int argc __attribute__ ((unused)),\ |
1523 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1524 | | long metric,\ |
1525 | | const char * metric_str __attribute__ ((unused))) |
1526 | | funcdecl_set_min_metric; |
1527 | | DEFUN_CMD_FUNC_TEXT(set_min_metric) |
1528 | 0 | { |
1529 | 0 | #if 1 /* anything to parse? */ |
1530 | 0 | int _i; |
1531 | 0 | #if 1 /* anything that can fail? */ |
1532 | 0 | unsigned _fail = 0, _failcnt = 0; |
1533 | 0 | #endif |
1534 | 0 | long metric = 0; |
1535 | 0 | const char *metric_str = NULL; |
1536 | |
|
1537 | 0 | for (_i = 0; _i < argc; _i++) { |
1538 | 0 | if (!argv[_i]->varname) |
1539 | 0 | continue; |
1540 | 0 | #if 1 /* anything that can fail? */ |
1541 | 0 | _fail = 0; |
1542 | 0 | #endif |
1543 | |
|
1544 | 0 | if (!strcmp(argv[_i]->varname, "metric")) { |
1545 | 0 | metric_str = argv[_i]->arg; |
1546 | 0 | char *_end; |
1547 | 0 | metric = strtol(argv[_i]->arg, &_end, 10); |
1548 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1549 | 0 | } |
1550 | 0 | #if 1 /* anything that can fail? */ |
1551 | 0 | if (_fail) |
1552 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1553 | 0 | argv[_i]->varname, argv[_i]->arg); |
1554 | 0 | _failcnt += _fail; |
1555 | 0 | #endif |
1556 | 0 | } |
1557 | 0 | #if 1 /* anything that can fail? */ |
1558 | 0 | if (_failcnt) |
1559 | 0 | return CMD_WARNING; |
1560 | 0 | #endif |
1561 | 0 | #endif |
1562 | 0 | if (!metric_str) { |
1563 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "metric_str"); |
1564 | 0 | return CMD_WARNING; |
1565 | 0 | } |
1566 | | |
1567 | 0 | return set_min_metric_magic(self, vty, argc, argv, metric, metric_str); |
1568 | 0 | } |
1569 | | |
1570 | | /* no_set_min_metric => "no set min-metric [(0-4294967295)]" */ |
1571 | | DEFUN_CMD_FUNC_DECL(no_set_min_metric) |
1572 | | #define funcdecl_no_set_min_metric static int no_set_min_metric_magic(\ |
1573 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1574 | | struct vty *vty __attribute__ ((unused)),\ |
1575 | | int argc __attribute__ ((unused)),\ |
1576 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1577 | | long min_metric,\ |
1578 | | const char * min_metric_str __attribute__ ((unused))) |
1579 | | funcdecl_no_set_min_metric; |
1580 | | DEFUN_CMD_FUNC_TEXT(no_set_min_metric) |
1581 | 0 | { |
1582 | 0 | #if 1 /* anything to parse? */ |
1583 | 0 | int _i; |
1584 | 0 | #if 1 /* anything that can fail? */ |
1585 | 0 | unsigned _fail = 0, _failcnt = 0; |
1586 | 0 | #endif |
1587 | 0 | long min_metric = 0; |
1588 | 0 | const char *min_metric_str = NULL; |
1589 | |
|
1590 | 0 | for (_i = 0; _i < argc; _i++) { |
1591 | 0 | if (!argv[_i]->varname) |
1592 | 0 | continue; |
1593 | 0 | #if 1 /* anything that can fail? */ |
1594 | 0 | _fail = 0; |
1595 | 0 | #endif |
1596 | |
|
1597 | 0 | if (!strcmp(argv[_i]->varname, "min_metric")) { |
1598 | 0 | min_metric_str = argv[_i]->arg; |
1599 | 0 | char *_end; |
1600 | 0 | min_metric = strtol(argv[_i]->arg, &_end, 10); |
1601 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1602 | 0 | } |
1603 | 0 | #if 1 /* anything that can fail? */ |
1604 | 0 | if (_fail) |
1605 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1606 | 0 | argv[_i]->varname, argv[_i]->arg); |
1607 | 0 | _failcnt += _fail; |
1608 | 0 | #endif |
1609 | 0 | } |
1610 | 0 | #if 1 /* anything that can fail? */ |
1611 | 0 | if (_failcnt) |
1612 | 0 | return CMD_WARNING; |
1613 | 0 | #endif |
1614 | 0 | #endif |
1615 | | |
1616 | 0 | return no_set_min_metric_magic(self, vty, argc, argv, min_metric, min_metric_str); |
1617 | 0 | } |
1618 | | |
1619 | | /* set_max_metric => "set max-metric <(0-4294967295)$metric>" */ |
1620 | | DEFUN_CMD_FUNC_DECL(set_max_metric) |
1621 | | #define funcdecl_set_max_metric static int set_max_metric_magic(\ |
1622 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1623 | | struct vty *vty __attribute__ ((unused)),\ |
1624 | | int argc __attribute__ ((unused)),\ |
1625 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1626 | | long metric,\ |
1627 | | const char * metric_str __attribute__ ((unused))) |
1628 | | funcdecl_set_max_metric; |
1629 | | DEFUN_CMD_FUNC_TEXT(set_max_metric) |
1630 | 0 | { |
1631 | 0 | #if 1 /* anything to parse? */ |
1632 | 0 | int _i; |
1633 | 0 | #if 1 /* anything that can fail? */ |
1634 | 0 | unsigned _fail = 0, _failcnt = 0; |
1635 | 0 | #endif |
1636 | 0 | long metric = 0; |
1637 | 0 | const char *metric_str = NULL; |
1638 | |
|
1639 | 0 | for (_i = 0; _i < argc; _i++) { |
1640 | 0 | if (!argv[_i]->varname) |
1641 | 0 | continue; |
1642 | 0 | #if 1 /* anything that can fail? */ |
1643 | 0 | _fail = 0; |
1644 | 0 | #endif |
1645 | |
|
1646 | 0 | if (!strcmp(argv[_i]->varname, "metric")) { |
1647 | 0 | metric_str = argv[_i]->arg; |
1648 | 0 | char *_end; |
1649 | 0 | metric = strtol(argv[_i]->arg, &_end, 10); |
1650 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1651 | 0 | } |
1652 | 0 | #if 1 /* anything that can fail? */ |
1653 | 0 | if (_fail) |
1654 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1655 | 0 | argv[_i]->varname, argv[_i]->arg); |
1656 | 0 | _failcnt += _fail; |
1657 | 0 | #endif |
1658 | 0 | } |
1659 | 0 | #if 1 /* anything that can fail? */ |
1660 | 0 | if (_failcnt) |
1661 | 0 | return CMD_WARNING; |
1662 | 0 | #endif |
1663 | 0 | #endif |
1664 | 0 | if (!metric_str) { |
1665 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "metric_str"); |
1666 | 0 | return CMD_WARNING; |
1667 | 0 | } |
1668 | | |
1669 | 0 | return set_max_metric_magic(self, vty, argc, argv, metric, metric_str); |
1670 | 0 | } |
1671 | | |
1672 | | /* no_set_max_metric => "no set max-metric [(0-4294967295)]" */ |
1673 | | DEFUN_CMD_FUNC_DECL(no_set_max_metric) |
1674 | | #define funcdecl_no_set_max_metric static int no_set_max_metric_magic(\ |
1675 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1676 | | struct vty *vty __attribute__ ((unused)),\ |
1677 | | int argc __attribute__ ((unused)),\ |
1678 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1679 | | long max_metric,\ |
1680 | | const char * max_metric_str __attribute__ ((unused))) |
1681 | | funcdecl_no_set_max_metric; |
1682 | | DEFUN_CMD_FUNC_TEXT(no_set_max_metric) |
1683 | 0 | { |
1684 | 0 | #if 1 /* anything to parse? */ |
1685 | 0 | int _i; |
1686 | 0 | #if 1 /* anything that can fail? */ |
1687 | 0 | unsigned _fail = 0, _failcnt = 0; |
1688 | 0 | #endif |
1689 | 0 | long max_metric = 0; |
1690 | 0 | const char *max_metric_str = NULL; |
1691 | |
|
1692 | 0 | for (_i = 0; _i < argc; _i++) { |
1693 | 0 | if (!argv[_i]->varname) |
1694 | 0 | continue; |
1695 | 0 | #if 1 /* anything that can fail? */ |
1696 | 0 | _fail = 0; |
1697 | 0 | #endif |
1698 | |
|
1699 | 0 | if (!strcmp(argv[_i]->varname, "max_metric")) { |
1700 | 0 | max_metric_str = argv[_i]->arg; |
1701 | 0 | char *_end; |
1702 | 0 | max_metric = strtol(argv[_i]->arg, &_end, 10); |
1703 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1704 | 0 | } |
1705 | 0 | #if 1 /* anything that can fail? */ |
1706 | 0 | if (_fail) |
1707 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1708 | 0 | argv[_i]->varname, argv[_i]->arg); |
1709 | 0 | _failcnt += _fail; |
1710 | 0 | #endif |
1711 | 0 | } |
1712 | 0 | #if 1 /* anything that can fail? */ |
1713 | 0 | if (_failcnt) |
1714 | 0 | return CMD_WARNING; |
1715 | 0 | #endif |
1716 | 0 | #endif |
1717 | | |
1718 | 0 | return no_set_max_metric_magic(self, vty, argc, argv, max_metric, max_metric_str); |
1719 | 0 | } |
1720 | | |
1721 | | /* set_tag => "set tag (1-4294967295)$tag" */ |
1722 | | DEFUN_CMD_FUNC_DECL(set_tag) |
1723 | | #define funcdecl_set_tag static int set_tag_magic(\ |
1724 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1725 | | struct vty *vty __attribute__ ((unused)),\ |
1726 | | int argc __attribute__ ((unused)),\ |
1727 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1728 | | long tag,\ |
1729 | | const char * tag_str __attribute__ ((unused))) |
1730 | | funcdecl_set_tag; |
1731 | | DEFUN_CMD_FUNC_TEXT(set_tag) |
1732 | 0 | { |
1733 | 0 | #if 1 /* anything to parse? */ |
1734 | 0 | int _i; |
1735 | 0 | #if 1 /* anything that can fail? */ |
1736 | 0 | unsigned _fail = 0, _failcnt = 0; |
1737 | 0 | #endif |
1738 | 0 | long tag = 0; |
1739 | 0 | const char *tag_str = NULL; |
1740 | |
|
1741 | 0 | for (_i = 0; _i < argc; _i++) { |
1742 | 0 | if (!argv[_i]->varname) |
1743 | 0 | continue; |
1744 | 0 | #if 1 /* anything that can fail? */ |
1745 | 0 | _fail = 0; |
1746 | 0 | #endif |
1747 | |
|
1748 | 0 | if (!strcmp(argv[_i]->varname, "tag")) { |
1749 | 0 | tag_str = argv[_i]->arg; |
1750 | 0 | char *_end; |
1751 | 0 | tag = strtol(argv[_i]->arg, &_end, 10); |
1752 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1753 | 0 | } |
1754 | 0 | #if 1 /* anything that can fail? */ |
1755 | 0 | if (_fail) |
1756 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1757 | 0 | argv[_i]->varname, argv[_i]->arg); |
1758 | 0 | _failcnt += _fail; |
1759 | 0 | #endif |
1760 | 0 | } |
1761 | 0 | #if 1 /* anything that can fail? */ |
1762 | 0 | if (_failcnt) |
1763 | 0 | return CMD_WARNING; |
1764 | 0 | #endif |
1765 | 0 | #endif |
1766 | 0 | if (!tag_str) { |
1767 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "tag_str"); |
1768 | 0 | return CMD_WARNING; |
1769 | 0 | } |
1770 | | |
1771 | 0 | return set_tag_magic(self, vty, argc, argv, tag, tag_str); |
1772 | 0 | } |
1773 | | |
1774 | | /* no_set_tag => "no set tag [(1-4294967295)]" */ |
1775 | | DEFUN_CMD_FUNC_DECL(no_set_tag) |
1776 | | #define funcdecl_no_set_tag static int no_set_tag_magic(\ |
1777 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1778 | | struct vty *vty __attribute__ ((unused)),\ |
1779 | | int argc __attribute__ ((unused)),\ |
1780 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1781 | | long tag,\ |
1782 | | const char * tag_str __attribute__ ((unused))) |
1783 | | funcdecl_no_set_tag; |
1784 | | DEFUN_CMD_FUNC_TEXT(no_set_tag) |
1785 | 0 | { |
1786 | 0 | #if 1 /* anything to parse? */ |
1787 | 0 | int _i; |
1788 | 0 | #if 1 /* anything that can fail? */ |
1789 | 0 | unsigned _fail = 0, _failcnt = 0; |
1790 | 0 | #endif |
1791 | 0 | long tag = 0; |
1792 | 0 | const char *tag_str = NULL; |
1793 | |
|
1794 | 0 | for (_i = 0; _i < argc; _i++) { |
1795 | 0 | if (!argv[_i]->varname) |
1796 | 0 | continue; |
1797 | 0 | #if 1 /* anything that can fail? */ |
1798 | 0 | _fail = 0; |
1799 | 0 | #endif |
1800 | |
|
1801 | 0 | if (!strcmp(argv[_i]->varname, "tag")) { |
1802 | 0 | tag_str = argv[_i]->arg; |
1803 | 0 | char *_end; |
1804 | 0 | tag = strtol(argv[_i]->arg, &_end, 10); |
1805 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1806 | 0 | } |
1807 | 0 | #if 1 /* anything that can fail? */ |
1808 | 0 | if (_fail) |
1809 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1810 | 0 | argv[_i]->varname, argv[_i]->arg); |
1811 | 0 | _failcnt += _fail; |
1812 | 0 | #endif |
1813 | 0 | } |
1814 | 0 | #if 1 /* anything that can fail? */ |
1815 | 0 | if (_failcnt) |
1816 | 0 | return CMD_WARNING; |
1817 | 0 | #endif |
1818 | 0 | #endif |
1819 | | |
1820 | 0 | return no_set_tag_magic(self, vty, argc, argv, tag, tag_str); |
1821 | 0 | } |
1822 | | |
1823 | | /* rmap_onmatch_next => "on-match next" */ |
1824 | | DEFUN_CMD_FUNC_DECL(rmap_onmatch_next) |
1825 | | #define funcdecl_rmap_onmatch_next static int rmap_onmatch_next_magic(\ |
1826 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1827 | | struct vty *vty __attribute__ ((unused)),\ |
1828 | | int argc __attribute__ ((unused)),\ |
1829 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1830 | | funcdecl_rmap_onmatch_next; |
1831 | | DEFUN_CMD_FUNC_TEXT(rmap_onmatch_next) |
1832 | 0 | { |
1833 | | #if 0 /* anything to parse? */ |
1834 | | int _i; |
1835 | | #if 0 /* anything that can fail? */ |
1836 | | unsigned _fail = 0, _failcnt = 0; |
1837 | | #endif |
1838 | | |
1839 | | for (_i = 0; _i < argc; _i++) { |
1840 | | if (!argv[_i]->varname) |
1841 | | continue; |
1842 | | #if 0 /* anything that can fail? */ |
1843 | | _fail = 0; |
1844 | | #endif |
1845 | | |
1846 | | #if 0 /* anything that can fail? */ |
1847 | | if (_fail) |
1848 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1849 | | argv[_i]->varname, argv[_i]->arg); |
1850 | | _failcnt += _fail; |
1851 | | #endif |
1852 | | } |
1853 | | #if 0 /* anything that can fail? */ |
1854 | | if (_failcnt) |
1855 | | return CMD_WARNING; |
1856 | | #endif |
1857 | | #endif |
1858 | |
|
1859 | 0 | return rmap_onmatch_next_magic(self, vty, argc, argv); |
1860 | 0 | } |
1861 | | |
1862 | | /* no_rmap_onmatch_next => "no on-match next" */ |
1863 | | DEFUN_CMD_FUNC_DECL(no_rmap_onmatch_next) |
1864 | | #define funcdecl_no_rmap_onmatch_next static int no_rmap_onmatch_next_magic(\ |
1865 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1866 | | struct vty *vty __attribute__ ((unused)),\ |
1867 | | int argc __attribute__ ((unused)),\ |
1868 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1869 | | funcdecl_no_rmap_onmatch_next; |
1870 | | DEFUN_CMD_FUNC_TEXT(no_rmap_onmatch_next) |
1871 | 0 | { |
1872 | | #if 0 /* anything to parse? */ |
1873 | | int _i; |
1874 | | #if 0 /* anything that can fail? */ |
1875 | | unsigned _fail = 0, _failcnt = 0; |
1876 | | #endif |
1877 | | |
1878 | | for (_i = 0; _i < argc; _i++) { |
1879 | | if (!argv[_i]->varname) |
1880 | | continue; |
1881 | | #if 0 /* anything that can fail? */ |
1882 | | _fail = 0; |
1883 | | #endif |
1884 | | |
1885 | | #if 0 /* anything that can fail? */ |
1886 | | if (_fail) |
1887 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1888 | | argv[_i]->varname, argv[_i]->arg); |
1889 | | _failcnt += _fail; |
1890 | | #endif |
1891 | | } |
1892 | | #if 0 /* anything that can fail? */ |
1893 | | if (_failcnt) |
1894 | | return CMD_WARNING; |
1895 | | #endif |
1896 | | #endif |
1897 | |
|
1898 | 0 | return no_rmap_onmatch_next_magic(self, vty, argc, argv); |
1899 | 0 | } |
1900 | | |
1901 | | /* rmap_onmatch_goto => "on-match goto (1-65535)$rm_num" */ |
1902 | | DEFUN_CMD_FUNC_DECL(rmap_onmatch_goto) |
1903 | | #define funcdecl_rmap_onmatch_goto static int rmap_onmatch_goto_magic(\ |
1904 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1905 | | struct vty *vty __attribute__ ((unused)),\ |
1906 | | int argc __attribute__ ((unused)),\ |
1907 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
1908 | | long rm_num,\ |
1909 | | const char * rm_num_str __attribute__ ((unused))) |
1910 | | funcdecl_rmap_onmatch_goto; |
1911 | | DEFUN_CMD_FUNC_TEXT(rmap_onmatch_goto) |
1912 | 0 | { |
1913 | 0 | #if 1 /* anything to parse? */ |
1914 | 0 | int _i; |
1915 | 0 | #if 1 /* anything that can fail? */ |
1916 | 0 | unsigned _fail = 0, _failcnt = 0; |
1917 | 0 | #endif |
1918 | 0 | long rm_num = 0; |
1919 | 0 | const char *rm_num_str = NULL; |
1920 | |
|
1921 | 0 | for (_i = 0; _i < argc; _i++) { |
1922 | 0 | if (!argv[_i]->varname) |
1923 | 0 | continue; |
1924 | 0 | #if 1 /* anything that can fail? */ |
1925 | 0 | _fail = 0; |
1926 | 0 | #endif |
1927 | |
|
1928 | 0 | if (!strcmp(argv[_i]->varname, "rm_num")) { |
1929 | 0 | rm_num_str = argv[_i]->arg; |
1930 | 0 | char *_end; |
1931 | 0 | rm_num = strtol(argv[_i]->arg, &_end, 10); |
1932 | 0 | _fail = (_end == argv[_i]->arg) || (*_end != '\0'); |
1933 | 0 | } |
1934 | 0 | #if 1 /* anything that can fail? */ |
1935 | 0 | if (_fail) |
1936 | 0 | vty_out (vty, "%% invalid input for %s: %s\n", |
1937 | 0 | argv[_i]->varname, argv[_i]->arg); |
1938 | 0 | _failcnt += _fail; |
1939 | 0 | #endif |
1940 | 0 | } |
1941 | 0 | #if 1 /* anything that can fail? */ |
1942 | 0 | if (_failcnt) |
1943 | 0 | return CMD_WARNING; |
1944 | 0 | #endif |
1945 | 0 | #endif |
1946 | 0 | if (!rm_num_str) { |
1947 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "rm_num_str"); |
1948 | 0 | return CMD_WARNING; |
1949 | 0 | } |
1950 | | |
1951 | 0 | return rmap_onmatch_goto_magic(self, vty, argc, argv, rm_num, rm_num_str); |
1952 | 0 | } |
1953 | | |
1954 | | /* no_rmap_onmatch_goto => "no on-match goto" */ |
1955 | | DEFUN_CMD_FUNC_DECL(no_rmap_onmatch_goto) |
1956 | | #define funcdecl_no_rmap_onmatch_goto static int no_rmap_onmatch_goto_magic(\ |
1957 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1958 | | struct vty *vty __attribute__ ((unused)),\ |
1959 | | int argc __attribute__ ((unused)),\ |
1960 | | struct cmd_token *argv[] __attribute__ ((unused))) |
1961 | | funcdecl_no_rmap_onmatch_goto; |
1962 | | DEFUN_CMD_FUNC_TEXT(no_rmap_onmatch_goto) |
1963 | 0 | { |
1964 | | #if 0 /* anything to parse? */ |
1965 | | int _i; |
1966 | | #if 0 /* anything that can fail? */ |
1967 | | unsigned _fail = 0, _failcnt = 0; |
1968 | | #endif |
1969 | | |
1970 | | for (_i = 0; _i < argc; _i++) { |
1971 | | if (!argv[_i]->varname) |
1972 | | continue; |
1973 | | #if 0 /* anything that can fail? */ |
1974 | | _fail = 0; |
1975 | | #endif |
1976 | | |
1977 | | #if 0 /* anything that can fail? */ |
1978 | | if (_fail) |
1979 | | vty_out (vty, "%% invalid input for %s: %s\n", |
1980 | | argv[_i]->varname, argv[_i]->arg); |
1981 | | _failcnt += _fail; |
1982 | | #endif |
1983 | | } |
1984 | | #if 0 /* anything that can fail? */ |
1985 | | if (_failcnt) |
1986 | | return CMD_WARNING; |
1987 | | #endif |
1988 | | #endif |
1989 | |
|
1990 | 0 | return no_rmap_onmatch_goto_magic(self, vty, argc, argv); |
1991 | 0 | } |
1992 | | |
1993 | | /* rmap_call => "call WORD$name" */ |
1994 | | DEFUN_CMD_FUNC_DECL(rmap_call) |
1995 | | #define funcdecl_rmap_call static int rmap_call_magic(\ |
1996 | | const struct cmd_element *self __attribute__ ((unused)),\ |
1997 | | struct vty *vty __attribute__ ((unused)),\ |
1998 | | int argc __attribute__ ((unused)),\ |
1999 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
2000 | | const char * name) |
2001 | | funcdecl_rmap_call; |
2002 | | DEFUN_CMD_FUNC_TEXT(rmap_call) |
2003 | 0 | { |
2004 | 0 | #if 1 /* anything to parse? */ |
2005 | 0 | int _i; |
2006 | | #if 0 /* anything that can fail? */ |
2007 | | unsigned _fail = 0, _failcnt = 0; |
2008 | | #endif |
2009 | 0 | const char *name = NULL; |
2010 | |
|
2011 | 0 | for (_i = 0; _i < argc; _i++) { |
2012 | 0 | if (!argv[_i]->varname) |
2013 | 0 | continue; |
2014 | | #if 0 /* anything that can fail? */ |
2015 | | _fail = 0; |
2016 | | #endif |
2017 | | |
2018 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
2019 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
2020 | 0 | } |
2021 | | #if 0 /* anything that can fail? */ |
2022 | | if (_fail) |
2023 | | vty_out (vty, "%% invalid input for %s: %s\n", |
2024 | | argv[_i]->varname, argv[_i]->arg); |
2025 | | _failcnt += _fail; |
2026 | | #endif |
2027 | 0 | } |
2028 | | #if 0 /* anything that can fail? */ |
2029 | | if (_failcnt) |
2030 | | return CMD_WARNING; |
2031 | | #endif |
2032 | 0 | #endif |
2033 | 0 | if (!name) { |
2034 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
2035 | 0 | return CMD_WARNING; |
2036 | 0 | } |
2037 | | |
2038 | 0 | return rmap_call_magic(self, vty, argc, argv, name); |
2039 | 0 | } |
2040 | | |
2041 | | /* no_rmap_call => "no call [NAME]" */ |
2042 | | DEFUN_CMD_FUNC_DECL(no_rmap_call) |
2043 | | #define funcdecl_no_rmap_call static int no_rmap_call_magic(\ |
2044 | | const struct cmd_element *self __attribute__ ((unused)),\ |
2045 | | struct vty *vty __attribute__ ((unused)),\ |
2046 | | int argc __attribute__ ((unused)),\ |
2047 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
2048 | | const char * call) |
2049 | | funcdecl_no_rmap_call; |
2050 | | DEFUN_CMD_FUNC_TEXT(no_rmap_call) |
2051 | 0 | { |
2052 | 0 | #if 1 /* anything to parse? */ |
2053 | 0 | int _i; |
2054 | | #if 0 /* anything that can fail? */ |
2055 | | unsigned _fail = 0, _failcnt = 0; |
2056 | | #endif |
2057 | 0 | const char *call = NULL; |
2058 | |
|
2059 | 0 | for (_i = 0; _i < argc; _i++) { |
2060 | 0 | if (!argv[_i]->varname) |
2061 | 0 | continue; |
2062 | | #if 0 /* anything that can fail? */ |
2063 | | _fail = 0; |
2064 | | #endif |
2065 | | |
2066 | 0 | if (!strcmp(argv[_i]->varname, "call")) { |
2067 | 0 | call = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
2068 | 0 | } |
2069 | | #if 0 /* anything that can fail? */ |
2070 | | if (_fail) |
2071 | | vty_out (vty, "%% invalid input for %s: %s\n", |
2072 | | argv[_i]->varname, argv[_i]->arg); |
2073 | | _failcnt += _fail; |
2074 | | #endif |
2075 | 0 | } |
2076 | | #if 0 /* anything that can fail? */ |
2077 | | if (_failcnt) |
2078 | | return CMD_WARNING; |
2079 | | #endif |
2080 | 0 | #endif |
2081 | |
|
2082 | 0 | return no_rmap_call_magic(self, vty, argc, argv, call); |
2083 | 0 | } |
2084 | | |
2085 | | /* rmap_description => "description LINE..." */ |
2086 | | DEFUN_CMD_FUNC_DECL(rmap_description) |
2087 | | #define funcdecl_rmap_description static int rmap_description_magic(\ |
2088 | | const struct cmd_element *self __attribute__ ((unused)),\ |
2089 | | struct vty *vty __attribute__ ((unused)),\ |
2090 | | int argc __attribute__ ((unused)),\ |
2091 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
2092 | | const char * line) |
2093 | | funcdecl_rmap_description; |
2094 | | DEFUN_CMD_FUNC_TEXT(rmap_description) |
2095 | 0 | { |
2096 | 0 | #if 1 /* anything to parse? */ |
2097 | 0 | int _i; |
2098 | | #if 0 /* anything that can fail? */ |
2099 | | unsigned _fail = 0, _failcnt = 0; |
2100 | | #endif |
2101 | 0 | const char *line = NULL; |
2102 | |
|
2103 | 0 | for (_i = 0; _i < argc; _i++) { |
2104 | 0 | if (!argv[_i]->varname) |
2105 | 0 | continue; |
2106 | | #if 0 /* anything that can fail? */ |
2107 | | _fail = 0; |
2108 | | #endif |
2109 | | |
2110 | 0 | if (!strcmp(argv[_i]->varname, "line")) { |
2111 | 0 | line = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
2112 | 0 | } |
2113 | | #if 0 /* anything that can fail? */ |
2114 | | if (_fail) |
2115 | | vty_out (vty, "%% invalid input for %s: %s\n", |
2116 | | argv[_i]->varname, argv[_i]->arg); |
2117 | | _failcnt += _fail; |
2118 | | #endif |
2119 | 0 | } |
2120 | | #if 0 /* anything that can fail? */ |
2121 | | if (_failcnt) |
2122 | | return CMD_WARNING; |
2123 | | #endif |
2124 | 0 | #endif |
2125 | 0 | if (!line) { |
2126 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "line"); |
2127 | 0 | return CMD_WARNING; |
2128 | 0 | } |
2129 | | |
2130 | 0 | return rmap_description_magic(self, vty, argc, argv, line); |
2131 | 0 | } |
2132 | | |
2133 | | /* route_map_optimization => "[no] route-map RMAP_NAME$name optimization" */ |
2134 | | DEFUN_CMD_FUNC_DECL(route_map_optimization) |
2135 | | #define funcdecl_route_map_optimization static int route_map_optimization_magic(\ |
2136 | | const struct cmd_element *self __attribute__ ((unused)),\ |
2137 | | struct vty *vty __attribute__ ((unused)),\ |
2138 | | int argc __attribute__ ((unused)),\ |
2139 | | struct cmd_token *argv[] __attribute__ ((unused)),\ |
2140 | | const char * no,\ |
2141 | | const char * name) |
2142 | | funcdecl_route_map_optimization; |
2143 | | DEFUN_CMD_FUNC_TEXT(route_map_optimization) |
2144 | 0 | { |
2145 | 0 | #if 2 /* anything to parse? */ |
2146 | 0 | int _i; |
2147 | | #if 0 /* anything that can fail? */ |
2148 | | unsigned _fail = 0, _failcnt = 0; |
2149 | | #endif |
2150 | 0 | const char *no = NULL; |
2151 | 0 | const char *name = NULL; |
2152 | |
|
2153 | 0 | for (_i = 0; _i < argc; _i++) { |
2154 | 0 | if (!argv[_i]->varname) |
2155 | 0 | continue; |
2156 | | #if 0 /* anything that can fail? */ |
2157 | | _fail = 0; |
2158 | | #endif |
2159 | | |
2160 | 0 | if (!strcmp(argv[_i]->varname, "no")) { |
2161 | 0 | no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
2162 | 0 | } |
2163 | 0 | if (!strcmp(argv[_i]->varname, "name")) { |
2164 | 0 | name = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg; |
2165 | 0 | } |
2166 | | #if 0 /* anything that can fail? */ |
2167 | | if (_fail) |
2168 | | vty_out (vty, "%% invalid input for %s: %s\n", |
2169 | | argv[_i]->varname, argv[_i]->arg); |
2170 | | _failcnt += _fail; |
2171 | | #endif |
2172 | 0 | } |
2173 | | #if 0 /* anything that can fail? */ |
2174 | | if (_failcnt) |
2175 | | return CMD_WARNING; |
2176 | | #endif |
2177 | 0 | #endif |
2178 | 0 | if (!name) { |
2179 | 0 | vty_out(vty, "Internal CLI error [%s]\n", "name"); |
2180 | 0 | return CMD_WARNING; |
2181 | 0 | } |
2182 | | |
2183 | 0 | return route_map_optimization_magic(self, vty, argc, argv, no, name); |
2184 | 0 | } |
2185 | | |