Coverage Report

Created: 2025-08-28 06:29

/src/frr/bgpd/bgp_labelpool_clippy.c
Line
Count
Source (jump to first uncovered line)
1
/* show_bgp_nexthop_label => "show bgp [<view|vrf> VIEWVRFNAME] label-nexthop [detail]" */
2
DEFUN_CMD_FUNC_DECL(show_bgp_nexthop_label)
3
#define funcdecl_show_bgp_nexthop_label static int show_bgp_nexthop_label_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 * viewvrfname)
9
funcdecl_show_bgp_nexthop_label;
10
DEFUN_CMD_FUNC_TEXT(show_bgp_nexthop_label)
11
0
{
12
0
#if 1 /* anything to parse? */
13
0
  int _i;
14
#if 0 /* anything that can fail? */
15
  unsigned _fail = 0, _failcnt = 0;
16
#endif
17
0
  const char *viewvrfname = NULL;
18
19
0
  for (_i = 0; _i < argc; _i++) {
20
0
    if (!argv[_i]->varname)
21
0
      continue;
22
#if 0 /* anything that can fail? */
23
    _fail = 0;
24
#endif
25
26
0
    if (!strcmp(argv[_i]->varname, "viewvrfname")) {
27
0
      viewvrfname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
28
0
    }
29
#if 0 /* anything that can fail? */
30
    if (_fail)
31
      vty_out (vty, "%% invalid input for %s: %s\n",
32
           argv[_i]->varname, argv[_i]->arg);
33
    _failcnt += _fail;
34
#endif
35
0
  }
36
#if 0 /* anything that can fail? */
37
  if (_failcnt)
38
    return CMD_WARNING;
39
#endif
40
0
#endif
41
42
0
  return show_bgp_nexthop_label_magic(self, vty, argc, argv, viewvrfname);
43
0
}
44
45
#if BGP_LABELPOOL_ENABLE_TESTS
46
/* start_labelpool_perf_test => "debug bgp lptest start" */
47
DEFUN_CMD_FUNC_DECL(start_labelpool_perf_test)
48
#define funcdecl_start_labelpool_perf_test static int start_labelpool_perf_test_magic(\
49
  const struct cmd_element *self __attribute__ ((unused)),\
50
  struct vty *vty __attribute__ ((unused)),\
51
  int argc __attribute__ ((unused)),\
52
  struct cmd_token *argv[] __attribute__ ((unused)))
53
funcdecl_start_labelpool_perf_test;
54
DEFUN_CMD_FUNC_TEXT(start_labelpool_perf_test)
55
{
56
#if 0 /* anything to parse? */
57
  int _i;
58
#if 0 /* anything that can fail? */
59
  unsigned _fail = 0, _failcnt = 0;
60
#endif
61
62
  for (_i = 0; _i < argc; _i++) {
63
    if (!argv[_i]->varname)
64
      continue;
65
#if 0 /* anything that can fail? */
66
    _fail = 0;
67
#endif
68
69
#if 0 /* anything that can fail? */
70
    if (_fail)
71
      vty_out (vty, "%% invalid input for %s: %s\n",
72
           argv[_i]->varname, argv[_i]->arg);
73
    _failcnt += _fail;
74
#endif
75
  }
76
#if 0 /* anything that can fail? */
77
  if (_failcnt)
78
    return CMD_WARNING;
79
#endif
80
#endif
81
82
  return start_labelpool_perf_test_magic(self, vty, argc, argv);
83
}
84
#endif
85
86
#if BGP_LABELPOOL_ENABLE_TESTS
87
/* show_labelpool_perf_test => "debug bgp lptest show" */
88
DEFUN_CMD_FUNC_DECL(show_labelpool_perf_test)
89
#define funcdecl_show_labelpool_perf_test static int show_labelpool_perf_test_magic(\
90
  const struct cmd_element *self __attribute__ ((unused)),\
91
  struct vty *vty __attribute__ ((unused)),\
92
  int argc __attribute__ ((unused)),\
93
  struct cmd_token *argv[] __attribute__ ((unused)))
94
funcdecl_show_labelpool_perf_test;
95
DEFUN_CMD_FUNC_TEXT(show_labelpool_perf_test)
96
{
97
#if 0 /* anything to parse? */
98
  int _i;
99
#if 0 /* anything that can fail? */
100
  unsigned _fail = 0, _failcnt = 0;
101
#endif
102
103
  for (_i = 0; _i < argc; _i++) {
104
    if (!argv[_i]->varname)
105
      continue;
106
#if 0 /* anything that can fail? */
107
    _fail = 0;
108
#endif
109
110
#if 0 /* anything that can fail? */
111
    if (_fail)
112
      vty_out (vty, "%% invalid input for %s: %s\n",
113
           argv[_i]->varname, argv[_i]->arg);
114
    _failcnt += _fail;
115
#endif
116
  }
117
#if 0 /* anything that can fail? */
118
  if (_failcnt)
119
    return CMD_WARNING;
120
#endif
121
#endif
122
123
  return show_labelpool_perf_test_magic(self, vty, argc, argv);
124
}
125
#endif
126
127
#if BGP_LABELPOOL_ENABLE_TESTS
128
/* stop_labelpool_perf_test => "debug bgp lptest stop" */
129
DEFUN_CMD_FUNC_DECL(stop_labelpool_perf_test)
130
#define funcdecl_stop_labelpool_perf_test static int stop_labelpool_perf_test_magic(\
131
  const struct cmd_element *self __attribute__ ((unused)),\
132
  struct vty *vty __attribute__ ((unused)),\
133
  int argc __attribute__ ((unused)),\
134
  struct cmd_token *argv[] __attribute__ ((unused)))
135
funcdecl_stop_labelpool_perf_test;
136
DEFUN_CMD_FUNC_TEXT(stop_labelpool_perf_test)
137
{
138
#if 0 /* anything to parse? */
139
  int _i;
140
#if 0 /* anything that can fail? */
141
  unsigned _fail = 0, _failcnt = 0;
142
#endif
143
144
  for (_i = 0; _i < argc; _i++) {
145
    if (!argv[_i]->varname)
146
      continue;
147
#if 0 /* anything that can fail? */
148
    _fail = 0;
149
#endif
150
151
#if 0 /* anything that can fail? */
152
    if (_fail)
153
      vty_out (vty, "%% invalid input for %s: %s\n",
154
           argv[_i]->varname, argv[_i]->arg);
155
    _failcnt += _fail;
156
#endif
157
  }
158
#if 0 /* anything that can fail? */
159
  if (_failcnt)
160
    return CMD_WARNING;
161
#endif
162
#endif
163
164
  return stop_labelpool_perf_test_magic(self, vty, argc, argv);
165
}
166
#endif
167
168
#if BGP_LABELPOOL_ENABLE_TESTS
169
/* clear_labelpool_perf_test => "debug bgp lptest clear" */
170
DEFUN_CMD_FUNC_DECL(clear_labelpool_perf_test)
171
#define funcdecl_clear_labelpool_perf_test static int clear_labelpool_perf_test_magic(\
172
  const struct cmd_element *self __attribute__ ((unused)),\
173
  struct vty *vty __attribute__ ((unused)),\
174
  int argc __attribute__ ((unused)),\
175
  struct cmd_token *argv[] __attribute__ ((unused)))
176
funcdecl_clear_labelpool_perf_test;
177
DEFUN_CMD_FUNC_TEXT(clear_labelpool_perf_test)
178
{
179
#if 0 /* anything to parse? */
180
  int _i;
181
#if 0 /* anything that can fail? */
182
  unsigned _fail = 0, _failcnt = 0;
183
#endif
184
185
  for (_i = 0; _i < argc; _i++) {
186
    if (!argv[_i]->varname)
187
      continue;
188
#if 0 /* anything that can fail? */
189
    _fail = 0;
190
#endif
191
192
#if 0 /* anything that can fail? */
193
    if (_fail)
194
      vty_out (vty, "%% invalid input for %s: %s\n",
195
           argv[_i]->varname, argv[_i]->arg);
196
    _failcnt += _fail;
197
#endif
198
  }
199
#if 0 /* anything that can fail? */
200
  if (_failcnt)
201
    return CMD_WARNING;
202
#endif
203
#endif
204
205
  return clear_labelpool_perf_test_magic(self, vty, argc, argv);
206
}
207
#endif
208
209
#if BGP_LABELPOOL_ENABLE_TESTS
210
/* release_labelpool_perf_test => "debug bgp lptest release test GENERATION$generation every (1-5)$every_nth" */
211
DEFUN_CMD_FUNC_DECL(release_labelpool_perf_test)
212
#define funcdecl_release_labelpool_perf_test static int release_labelpool_perf_test_magic(\
213
  const struct cmd_element *self __attribute__ ((unused)),\
214
  struct vty *vty __attribute__ ((unused)),\
215
  int argc __attribute__ ((unused)),\
216
  struct cmd_token *argv[] __attribute__ ((unused)),\
217
  const char * generation,\
218
  long every_nth,\
219
  const char * every_nth_str __attribute__ ((unused)))
220
funcdecl_release_labelpool_perf_test;
221
DEFUN_CMD_FUNC_TEXT(release_labelpool_perf_test)
222
{
223
#if 2 /* anything to parse? */
224
  int _i;
225
#if 1 /* anything that can fail? */
226
  unsigned _fail = 0, _failcnt = 0;
227
#endif
228
  const char *generation = NULL;
229
  long every_nth = 0;
230
  const char *every_nth_str = NULL;
231
232
  for (_i = 0; _i < argc; _i++) {
233
    if (!argv[_i]->varname)
234
      continue;
235
#if 1 /* anything that can fail? */
236
    _fail = 0;
237
#endif
238
239
    if (!strcmp(argv[_i]->varname, "generation")) {
240
      generation = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
241
    }
242
    if (!strcmp(argv[_i]->varname, "every_nth")) {
243
      every_nth_str = argv[_i]->arg;
244
      char *_end;
245
      every_nth = strtol(argv[_i]->arg, &_end, 10);
246
      _fail = (_end == argv[_i]->arg) || (*_end != '\0');
247
    }
248
#if 1 /* anything that can fail? */
249
    if (_fail)
250
      vty_out (vty, "%% invalid input for %s: %s\n",
251
           argv[_i]->varname, argv[_i]->arg);
252
    _failcnt += _fail;
253
#endif
254
  }
255
#if 1 /* anything that can fail? */
256
  if (_failcnt)
257
    return CMD_WARNING;
258
#endif
259
#endif
260
  if (!generation) {
261
    vty_out(vty, "Internal CLI error [%s]\n", "generation");
262
    return CMD_WARNING;
263
  }
264
  if (!every_nth_str) {
265
    vty_out(vty, "Internal CLI error [%s]\n", "every_nth_str");
266
    return CMD_WARNING;
267
  }
268
269
  return release_labelpool_perf_test_magic(self, vty, argc, argv, generation, every_nth, every_nth_str);
270
}
271
#endif
272