Coverage Report

Created: 2025-08-26 06:20

/src/frr/ospfd/ospf_dump_clippy.c
Line
Count
Source (jump to first uncovered line)
1
/* debug_ospf_packet => "[no$no] debug ospf [(1-65535)$inst] packet <hello|dd|ls-request|ls-update|ls-ack|all>$packet [<send$send [detail$detail]|recv$recv [detail$detail]|detail$detail>]" */
2
DEFUN_CMD_FUNC_DECL(debug_ospf_packet)
3
#define funcdecl_debug_ospf_packet static int debug_ospf_packet_magic(\
4
  const struct cmd_element *self __attribute__ ((unused)),\
5
  struct vty *vty __attribute__ ((unused)),\
6
  int argc __attribute__ ((unused)),\
7
  struct cmd_token *argv[] __attribute__ ((unused)),\
8
  const char * no,\
9
  long inst,\
10
  const char * inst_str __attribute__ ((unused)),\
11
  const char * packet,\
12
  const char * send,\
13
  const char * detail,\
14
  const char * recv)
15
funcdecl_debug_ospf_packet;
16
DEFUN_CMD_FUNC_TEXT(debug_ospf_packet)
17
0
{
18
0
#if 6 /* anything to parse? */
19
0
  int _i;
20
0
#if 1 /* anything that can fail? */
21
0
  unsigned _fail = 0, _failcnt = 0;
22
0
#endif
23
0
  const char *no = NULL;
24
0
  long inst = 0;
25
0
  const char *inst_str = NULL;
26
0
  const char *packet = NULL;
27
0
  const char *send = NULL;
28
0
  const char *detail = NULL;
29
0
  const char *recv = NULL;
30
31
0
  for (_i = 0; _i < argc; _i++) {
32
0
    if (!argv[_i]->varname)
33
0
      continue;
34
0
#if 1 /* anything that can fail? */
35
0
    _fail = 0;
36
0
#endif
37
38
0
    if (!strcmp(argv[_i]->varname, "no")) {
39
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
40
0
    }
41
0
    if (!strcmp(argv[_i]->varname, "inst")) {
42
0
      inst_str = argv[_i]->arg;
43
0
      char *_end;
44
0
      inst = strtol(argv[_i]->arg, &_end, 10);
45
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
46
0
    }
47
0
    if (!strcmp(argv[_i]->varname, "packet")) {
48
0
      packet = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
49
0
    }
50
0
    if (!strcmp(argv[_i]->varname, "send")) {
51
0
      send = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
52
0
    }
53
0
    if (!strcmp(argv[_i]->varname, "detail")) {
54
0
      detail = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
55
0
    }
56
0
    if (!strcmp(argv[_i]->varname, "recv")) {
57
0
      recv = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
58
0
    }
59
0
#if 1 /* anything that can fail? */
60
0
    if (_fail)
61
0
      vty_out (vty, "%% invalid input for %s: %s\n",
62
0
           argv[_i]->varname, argv[_i]->arg);
63
0
    _failcnt += _fail;
64
0
#endif
65
0
  }
66
0
#if 1 /* anything that can fail? */
67
0
  if (_failcnt)
68
0
    return CMD_WARNING;
69
0
#endif
70
0
#endif
71
0
  if (!packet) {
72
0
    vty_out(vty, "Internal CLI error [%s]\n", "packet");
73
0
    return CMD_WARNING;
74
0
  }
75
76
0
  return debug_ospf_packet_magic(self, vty, argc, argv, no, inst, inst_str, packet, send, detail, recv);
77
0
}
78
79
/* debug_ospf_te => "[no$no] debug ospf [(1-65535)$instance] te" */
80
DEFUN_CMD_FUNC_DECL(debug_ospf_te)
81
#define funcdecl_debug_ospf_te static int debug_ospf_te_magic(\
82
  const struct cmd_element *self __attribute__ ((unused)),\
83
  struct vty *vty __attribute__ ((unused)),\
84
  int argc __attribute__ ((unused)),\
85
  struct cmd_token *argv[] __attribute__ ((unused)),\
86
  const char * no,\
87
  long instance,\
88
  const char * instance_str __attribute__ ((unused)))
89
funcdecl_debug_ospf_te;
90
DEFUN_CMD_FUNC_TEXT(debug_ospf_te)
91
0
{
92
0
#if 2 /* anything to parse? */
93
0
  int _i;
94
0
#if 1 /* anything that can fail? */
95
0
  unsigned _fail = 0, _failcnt = 0;
96
0
#endif
97
0
  const char *no = NULL;
98
0
  long instance = 0;
99
0
  const char *instance_str = NULL;
100
101
0
  for (_i = 0; _i < argc; _i++) {
102
0
    if (!argv[_i]->varname)
103
0
      continue;
104
0
#if 1 /* anything that can fail? */
105
0
    _fail = 0;
106
0
#endif
107
108
0
    if (!strcmp(argv[_i]->varname, "no")) {
109
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
110
0
    }
111
0
    if (!strcmp(argv[_i]->varname, "instance")) {
112
0
      instance_str = argv[_i]->arg;
113
0
      char *_end;
114
0
      instance = strtol(argv[_i]->arg, &_end, 10);
115
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
116
0
    }
117
0
#if 1 /* anything that can fail? */
118
0
    if (_fail)
119
0
      vty_out (vty, "%% invalid input for %s: %s\n",
120
0
           argv[_i]->varname, argv[_i]->arg);
121
0
    _failcnt += _fail;
122
0
#endif
123
0
  }
124
0
#if 1 /* anything that can fail? */
125
0
  if (_failcnt)
126
0
    return CMD_WARNING;
127
0
#endif
128
0
#endif
129
130
0
  return debug_ospf_te_magic(self, vty, argc, argv, no, instance, instance_str);
131
0
}
132
133
/* debug_ospf_sr => "[no$no] debug ospf [(1-65535)$instance] sr" */
134
DEFUN_CMD_FUNC_DECL(debug_ospf_sr)
135
#define funcdecl_debug_ospf_sr static int debug_ospf_sr_magic(\
136
  const struct cmd_element *self __attribute__ ((unused)),\
137
  struct vty *vty __attribute__ ((unused)),\
138
  int argc __attribute__ ((unused)),\
139
  struct cmd_token *argv[] __attribute__ ((unused)),\
140
  const char * no,\
141
  long instance,\
142
  const char * instance_str __attribute__ ((unused)))
143
funcdecl_debug_ospf_sr;
144
DEFUN_CMD_FUNC_TEXT(debug_ospf_sr)
145
0
{
146
0
#if 2 /* anything to parse? */
147
0
  int _i;
148
0
#if 1 /* anything that can fail? */
149
0
  unsigned _fail = 0, _failcnt = 0;
150
0
#endif
151
0
  const char *no = NULL;
152
0
  long instance = 0;
153
0
  const char *instance_str = NULL;
154
155
0
  for (_i = 0; _i < argc; _i++) {
156
0
    if (!argv[_i]->varname)
157
0
      continue;
158
0
#if 1 /* anything that can fail? */
159
0
    _fail = 0;
160
0
#endif
161
162
0
    if (!strcmp(argv[_i]->varname, "no")) {
163
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
164
0
    }
165
0
    if (!strcmp(argv[_i]->varname, "instance")) {
166
0
      instance_str = argv[_i]->arg;
167
0
      char *_end;
168
0
      instance = strtol(argv[_i]->arg, &_end, 10);
169
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
170
0
    }
171
0
#if 1 /* anything that can fail? */
172
0
    if (_fail)
173
0
      vty_out (vty, "%% invalid input for %s: %s\n",
174
0
           argv[_i]->varname, argv[_i]->arg);
175
0
    _failcnt += _fail;
176
0
#endif
177
0
  }
178
0
#if 1 /* anything that can fail? */
179
0
  if (_failcnt)
180
0
    return CMD_WARNING;
181
0
#endif
182
0
#endif
183
184
0
  return debug_ospf_sr_magic(self, vty, argc, argv, no, instance, instance_str);
185
0
}
186
187
/* debug_ospf_ti_lfa => "[no$no] debug ospf [(1-65535)$instance] ti-lfa" */
188
DEFUN_CMD_FUNC_DECL(debug_ospf_ti_lfa)
189
#define funcdecl_debug_ospf_ti_lfa static int debug_ospf_ti_lfa_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 * no,\
195
  long instance,\
196
  const char * instance_str __attribute__ ((unused)))
197
funcdecl_debug_ospf_ti_lfa;
198
DEFUN_CMD_FUNC_TEXT(debug_ospf_ti_lfa)
199
0
{
200
0
#if 2 /* anything to parse? */
201
0
  int _i;
202
0
#if 1 /* anything that can fail? */
203
0
  unsigned _fail = 0, _failcnt = 0;
204
0
#endif
205
0
  const char *no = NULL;
206
0
  long instance = 0;
207
0
  const char *instance_str = NULL;
208
209
0
  for (_i = 0; _i < argc; _i++) {
210
0
    if (!argv[_i]->varname)
211
0
      continue;
212
0
#if 1 /* anything that can fail? */
213
0
    _fail = 0;
214
0
#endif
215
216
0
    if (!strcmp(argv[_i]->varname, "no")) {
217
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
218
0
    }
219
0
    if (!strcmp(argv[_i]->varname, "instance")) {
220
0
      instance_str = argv[_i]->arg;
221
0
      char *_end;
222
0
      instance = strtol(argv[_i]->arg, &_end, 10);
223
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
224
0
    }
225
0
#if 1 /* anything that can fail? */
226
0
    if (_fail)
227
0
      vty_out (vty, "%% invalid input for %s: %s\n",
228
0
           argv[_i]->varname, argv[_i]->arg);
229
0
    _failcnt += _fail;
230
0
#endif
231
0
  }
232
0
#if 1 /* anything that can fail? */
233
0
  if (_failcnt)
234
0
    return CMD_WARNING;
235
0
#endif
236
0
#endif
237
238
0
  return debug_ospf_ti_lfa_magic(self, vty, argc, argv, no, instance, instance_str);
239
0
}
240
241
/* debug_ospf_default_info => "[no$no] debug ospf [(1-65535)$instance] default-information" */
242
DEFUN_CMD_FUNC_DECL(debug_ospf_default_info)
243
#define funcdecl_debug_ospf_default_info static int debug_ospf_default_info_magic(\
244
  const struct cmd_element *self __attribute__ ((unused)),\
245
  struct vty *vty __attribute__ ((unused)),\
246
  int argc __attribute__ ((unused)),\
247
  struct cmd_token *argv[] __attribute__ ((unused)),\
248
  const char * no,\
249
  long instance,\
250
  const char * instance_str __attribute__ ((unused)))
251
funcdecl_debug_ospf_default_info;
252
DEFUN_CMD_FUNC_TEXT(debug_ospf_default_info)
253
0
{
254
0
#if 2 /* anything to parse? */
255
0
  int _i;
256
0
#if 1 /* anything that can fail? */
257
0
  unsigned _fail = 0, _failcnt = 0;
258
0
#endif
259
0
  const char *no = NULL;
260
0
  long instance = 0;
261
0
  const char *instance_str = NULL;
262
263
0
  for (_i = 0; _i < argc; _i++) {
264
0
    if (!argv[_i]->varname)
265
0
      continue;
266
0
#if 1 /* anything that can fail? */
267
0
    _fail = 0;
268
0
#endif
269
270
0
    if (!strcmp(argv[_i]->varname, "no")) {
271
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
272
0
    }
273
0
    if (!strcmp(argv[_i]->varname, "instance")) {
274
0
      instance_str = argv[_i]->arg;
275
0
      char *_end;
276
0
      instance = strtol(argv[_i]->arg, &_end, 10);
277
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
278
0
    }
279
0
#if 1 /* anything that can fail? */
280
0
    if (_fail)
281
0
      vty_out (vty, "%% invalid input for %s: %s\n",
282
0
           argv[_i]->varname, argv[_i]->arg);
283
0
    _failcnt += _fail;
284
0
#endif
285
0
  }
286
0
#if 1 /* anything that can fail? */
287
0
  if (_failcnt)
288
0
    return CMD_WARNING;
289
0
#endif
290
0
#endif
291
292
0
  return debug_ospf_default_info_magic(self, vty, argc, argv, no, instance, instance_str);
293
0
}
294
295
/* debug_ospf_ldp_sync => "[no$no] debug ospf [(1-65535)$instance] ldp-sync" */
296
DEFUN_CMD_FUNC_DECL(debug_ospf_ldp_sync)
297
#define funcdecl_debug_ospf_ldp_sync static int debug_ospf_ldp_sync_magic(\
298
  const struct cmd_element *self __attribute__ ((unused)),\
299
  struct vty *vty __attribute__ ((unused)),\
300
  int argc __attribute__ ((unused)),\
301
  struct cmd_token *argv[] __attribute__ ((unused)),\
302
  const char * no,\
303
  long instance,\
304
  const char * instance_str __attribute__ ((unused)))
305
funcdecl_debug_ospf_ldp_sync;
306
DEFUN_CMD_FUNC_TEXT(debug_ospf_ldp_sync)
307
0
{
308
0
#if 2 /* anything to parse? */
309
0
  int _i;
310
0
#if 1 /* anything that can fail? */
311
0
  unsigned _fail = 0, _failcnt = 0;
312
0
#endif
313
0
  const char *no = NULL;
314
0
  long instance = 0;
315
0
  const char *instance_str = NULL;
316
317
0
  for (_i = 0; _i < argc; _i++) {
318
0
    if (!argv[_i]->varname)
319
0
      continue;
320
0
#if 1 /* anything that can fail? */
321
0
    _fail = 0;
322
0
#endif
323
324
0
    if (!strcmp(argv[_i]->varname, "no")) {
325
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
326
0
    }
327
0
    if (!strcmp(argv[_i]->varname, "instance")) {
328
0
      instance_str = argv[_i]->arg;
329
0
      char *_end;
330
0
      instance = strtol(argv[_i]->arg, &_end, 10);
331
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
332
0
    }
333
0
#if 1 /* anything that can fail? */
334
0
    if (_fail)
335
0
      vty_out (vty, "%% invalid input for %s: %s\n",
336
0
           argv[_i]->varname, argv[_i]->arg);
337
0
    _failcnt += _fail;
338
0
#endif
339
0
  }
340
0
#if 1 /* anything that can fail? */
341
0
  if (_failcnt)
342
0
    return CMD_WARNING;
343
0
#endif
344
0
#endif
345
346
0
  return debug_ospf_ldp_sync_magic(self, vty, argc, argv, no, instance, instance_str);
347
0
}
348
349
/* debug_ospf_gr => "[no$no] debug ospf [(1-65535)$instance] graceful-restart" */
350
DEFUN_CMD_FUNC_DECL(debug_ospf_gr)
351
#define funcdecl_debug_ospf_gr static int debug_ospf_gr_magic(\
352
  const struct cmd_element *self __attribute__ ((unused)),\
353
  struct vty *vty __attribute__ ((unused)),\
354
  int argc __attribute__ ((unused)),\
355
  struct cmd_token *argv[] __attribute__ ((unused)),\
356
  const char * no,\
357
  long instance,\
358
  const char * instance_str __attribute__ ((unused)))
359
funcdecl_debug_ospf_gr;
360
DEFUN_CMD_FUNC_TEXT(debug_ospf_gr)
361
0
{
362
0
#if 2 /* anything to parse? */
363
0
  int _i;
364
0
#if 1 /* anything that can fail? */
365
0
  unsigned _fail = 0, _failcnt = 0;
366
0
#endif
367
0
  const char *no = NULL;
368
0
  long instance = 0;
369
0
  const char *instance_str = NULL;
370
371
0
  for (_i = 0; _i < argc; _i++) {
372
0
    if (!argv[_i]->varname)
373
0
      continue;
374
0
#if 1 /* anything that can fail? */
375
0
    _fail = 0;
376
0
#endif
377
378
0
    if (!strcmp(argv[_i]->varname, "no")) {
379
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
380
0
    }
381
0
    if (!strcmp(argv[_i]->varname, "instance")) {
382
0
      instance_str = argv[_i]->arg;
383
0
      char *_end;
384
0
      instance = strtol(argv[_i]->arg, &_end, 10);
385
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
386
0
    }
387
0
#if 1 /* anything that can fail? */
388
0
    if (_fail)
389
0
      vty_out (vty, "%% invalid input for %s: %s\n",
390
0
           argv[_i]->varname, argv[_i]->arg);
391
0
    _failcnt += _fail;
392
0
#endif
393
0
  }
394
0
#if 1 /* anything that can fail? */
395
0
  if (_failcnt)
396
0
    return CMD_WARNING;
397
0
#endif
398
0
#endif
399
400
0
  return debug_ospf_gr_magic(self, vty, argc, argv, no, instance, instance_str);
401
0
}
402
403
/* debug_ospf_bfd => "[no] debug ospf [(1-65535)$instance] bfd" */
404
DEFUN_CMD_FUNC_DECL(debug_ospf_bfd)
405
#define funcdecl_debug_ospf_bfd static int debug_ospf_bfd_magic(\
406
  const struct cmd_element *self __attribute__ ((unused)),\
407
  struct vty *vty __attribute__ ((unused)),\
408
  int argc __attribute__ ((unused)),\
409
  struct cmd_token *argv[] __attribute__ ((unused)),\
410
  const char * no,\
411
  long instance,\
412
  const char * instance_str __attribute__ ((unused)))
413
funcdecl_debug_ospf_bfd;
414
DEFUN_CMD_FUNC_TEXT(debug_ospf_bfd)
415
0
{
416
0
#if 2 /* anything to parse? */
417
0
  int _i;
418
0
#if 1 /* anything that can fail? */
419
0
  unsigned _fail = 0, _failcnt = 0;
420
0
#endif
421
0
  const char *no = NULL;
422
0
  long instance = 0;
423
0
  const char *instance_str = NULL;
424
425
0
  for (_i = 0; _i < argc; _i++) {
426
0
    if (!argv[_i]->varname)
427
0
      continue;
428
0
#if 1 /* anything that can fail? */
429
0
    _fail = 0;
430
0
#endif
431
432
0
    if (!strcmp(argv[_i]->varname, "no")) {
433
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
434
0
    }
435
0
    if (!strcmp(argv[_i]->varname, "instance")) {
436
0
      instance_str = argv[_i]->arg;
437
0
      char *_end;
438
0
      instance = strtol(argv[_i]->arg, &_end, 10);
439
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
440
0
    }
441
0
#if 1 /* anything that can fail? */
442
0
    if (_fail)
443
0
      vty_out (vty, "%% invalid input for %s: %s\n",
444
0
           argv[_i]->varname, argv[_i]->arg);
445
0
    _failcnt += _fail;
446
0
#endif
447
0
  }
448
0
#if 1 /* anything that can fail? */
449
0
  if (_failcnt)
450
0
    return CMD_WARNING;
451
0
#endif
452
0
#endif
453
454
0
  return debug_ospf_bfd_magic(self, vty, argc, argv, no, instance, instance_str);
455
0
}
456
457
/* debug_ospf_client_api => "[no$no] debug ospf [(1-65535)$instance] client-api" */
458
DEFUN_CMD_FUNC_DECL(debug_ospf_client_api)
459
#define funcdecl_debug_ospf_client_api static int debug_ospf_client_api_magic(\
460
  const struct cmd_element *self __attribute__ ((unused)),\
461
  struct vty *vty __attribute__ ((unused)),\
462
  int argc __attribute__ ((unused)),\
463
  struct cmd_token *argv[] __attribute__ ((unused)),\
464
  const char * no,\
465
  long instance,\
466
  const char * instance_str __attribute__ ((unused)))
467
funcdecl_debug_ospf_client_api;
468
DEFUN_CMD_FUNC_TEXT(debug_ospf_client_api)
469
0
{
470
0
#if 2 /* anything to parse? */
471
0
  int _i;
472
0
#if 1 /* anything that can fail? */
473
0
  unsigned _fail = 0, _failcnt = 0;
474
0
#endif
475
0
  const char *no = NULL;
476
0
  long instance = 0;
477
0
  const char *instance_str = NULL;
478
479
0
  for (_i = 0; _i < argc; _i++) {
480
0
    if (!argv[_i]->varname)
481
0
      continue;
482
0
#if 1 /* anything that can fail? */
483
0
    _fail = 0;
484
0
#endif
485
486
0
    if (!strcmp(argv[_i]->varname, "no")) {
487
0
      no = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
488
0
    }
489
0
    if (!strcmp(argv[_i]->varname, "instance")) {
490
0
      instance_str = argv[_i]->arg;
491
0
      char *_end;
492
0
      instance = strtol(argv[_i]->arg, &_end, 10);
493
0
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
494
0
    }
495
0
#if 1 /* anything that can fail? */
496
0
    if (_fail)
497
0
      vty_out (vty, "%% invalid input for %s: %s\n",
498
0
           argv[_i]->varname, argv[_i]->arg);
499
0
    _failcnt += _fail;
500
0
#endif
501
0
  }
502
0
#if 1 /* anything that can fail? */
503
0
  if (_failcnt)
504
0
    return CMD_WARNING;
505
0
#endif
506
0
#endif
507
508
0
  return debug_ospf_client_api_magic(self, vty, argc, argv, no, instance, instance_str);
509
0
}
510