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