Coverage Report

Created: 2025-10-08 06:07

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/frr/lib/if_rmap_clippy.c
Line
Count
Source
1
/* if_ipv4_route_map => "route-map ROUTE-MAP <in$in|out> IFNAME" */
2
DEFUN_CMD_FUNC_DECL(if_ipv4_route_map)
3
#define funcdecl_if_ipv4_route_map static int if_ipv4_route_map_magic(\
4
  const struct cmd_element *self __attribute__ ((unused)),\
5
  struct vty *vty __attribute__ ((unused)),\
6
  int argc __attribute__ ((unused)),\
7
  struct cmd_token *argv[] __attribute__ ((unused)),\
8
  const char * route_map,\
9
  const char * in,\
10
  const char * ifname)
11
funcdecl_if_ipv4_route_map;
12
DEFUN_CMD_FUNC_TEXT(if_ipv4_route_map)
13
0
{
14
0
#if 3 /* anything to parse? */
15
0
  int _i;
16
#if 0 /* anything that can fail? */
17
  unsigned _fail = 0, _failcnt = 0;
18
#endif
19
0
  const char *route_map = NULL;
20
0
  const char *in = NULL;
21
0
  const char *ifname = NULL;
22
23
0
  for (_i = 0; _i < argc; _i++) {
24
0
    if (!argv[_i]->varname)
25
0
      continue;
26
#if 0 /* anything that can fail? */
27
    _fail = 0;
28
#endif
29
30
0
    if (!strcmp(argv[_i]->varname, "route_map")) {
31
0
      route_map = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
32
0
    }
33
0
    if (!strcmp(argv[_i]->varname, "in")) {
34
0
      in = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
35
0
    }
36
0
    if (!strcmp(argv[_i]->varname, "ifname")) {
37
0
      ifname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
38
0
    }
39
#if 0 /* anything that can fail? */
40
    if (_fail)
41
      vty_out (vty, "%% invalid input for %s: %s\n",
42
           argv[_i]->varname, argv[_i]->arg);
43
    _failcnt += _fail;
44
#endif
45
0
  }
46
#if 0 /* anything that can fail? */
47
  if (_failcnt)
48
    return CMD_WARNING;
49
#endif
50
0
#endif
51
0
  if (!route_map) {
52
0
    vty_out(vty, "Internal CLI error [%s]\n", "route_map");
53
0
    return CMD_WARNING;
54
0
  }
55
0
  if (!ifname) {
56
0
    vty_out(vty, "Internal CLI error [%s]\n", "ifname");
57
0
    return CMD_WARNING;
58
0
  }
59
60
0
  return if_ipv4_route_map_magic(self, vty, argc, argv, route_map, in, ifname);
61
0
}
62
63
/* no_if_ipv4_route_map => "no route-map [ROUTE-MAP] <in$in|out> IFNAME" */
64
DEFUN_CMD_FUNC_DECL(no_if_ipv4_route_map)
65
#define funcdecl_no_if_ipv4_route_map static int no_if_ipv4_route_map_magic(\
66
  const struct cmd_element *self __attribute__ ((unused)),\
67
  struct vty *vty __attribute__ ((unused)),\
68
  int argc __attribute__ ((unused)),\
69
  struct cmd_token *argv[] __attribute__ ((unused)),\
70
  const char * route_map,\
71
  const char * in,\
72
  const char * ifname)
73
funcdecl_no_if_ipv4_route_map;
74
DEFUN_CMD_FUNC_TEXT(no_if_ipv4_route_map)
75
0
{
76
0
#if 3 /* anything to parse? */
77
0
  int _i;
78
#if 0 /* anything that can fail? */
79
  unsigned _fail = 0, _failcnt = 0;
80
#endif
81
0
  const char *route_map = NULL;
82
0
  const char *in = NULL;
83
0
  const char *ifname = NULL;
84
85
0
  for (_i = 0; _i < argc; _i++) {
86
0
    if (!argv[_i]->varname)
87
0
      continue;
88
#if 0 /* anything that can fail? */
89
    _fail = 0;
90
#endif
91
92
0
    if (!strcmp(argv[_i]->varname, "route_map")) {
93
0
      route_map = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
94
0
    }
95
0
    if (!strcmp(argv[_i]->varname, "in")) {
96
0
      in = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
97
0
    }
98
0
    if (!strcmp(argv[_i]->varname, "ifname")) {
99
0
      ifname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
100
0
    }
101
#if 0 /* anything that can fail? */
102
    if (_fail)
103
      vty_out (vty, "%% invalid input for %s: %s\n",
104
           argv[_i]->varname, argv[_i]->arg);
105
    _failcnt += _fail;
106
#endif
107
0
  }
108
#if 0 /* anything that can fail? */
109
  if (_failcnt)
110
    return CMD_WARNING;
111
#endif
112
0
#endif
113
0
  if (!ifname) {
114
0
    vty_out(vty, "Internal CLI error [%s]\n", "ifname");
115
0
    return CMD_WARNING;
116
0
  }
117
118
0
  return no_if_ipv4_route_map_magic(self, vty, argc, argv, route_map, in, ifname);
119
0
}
120
121
/* if_ipv6_route_map => "route-map ROUTE-MAP <in$in|out> IFNAME" */
122
DEFUN_CMD_FUNC_DECL(if_ipv6_route_map)
123
#define funcdecl_if_ipv6_route_map static int if_ipv6_route_map_magic(\
124
  const struct cmd_element *self __attribute__ ((unused)),\
125
  struct vty *vty __attribute__ ((unused)),\
126
  int argc __attribute__ ((unused)),\
127
  struct cmd_token *argv[] __attribute__ ((unused)),\
128
  const char * route_map,\
129
  const char * in,\
130
  const char * ifname)
131
funcdecl_if_ipv6_route_map;
132
DEFUN_CMD_FUNC_TEXT(if_ipv6_route_map)
133
0
{
134
0
#if 3 /* anything to parse? */
135
0
  int _i;
136
#if 0 /* anything that can fail? */
137
  unsigned _fail = 0, _failcnt = 0;
138
#endif
139
0
  const char *route_map = NULL;
140
0
  const char *in = NULL;
141
0
  const char *ifname = NULL;
142
143
0
  for (_i = 0; _i < argc; _i++) {
144
0
    if (!argv[_i]->varname)
145
0
      continue;
146
#if 0 /* anything that can fail? */
147
    _fail = 0;
148
#endif
149
150
0
    if (!strcmp(argv[_i]->varname, "route_map")) {
151
0
      route_map = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
152
0
    }
153
0
    if (!strcmp(argv[_i]->varname, "in")) {
154
0
      in = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
155
0
    }
156
0
    if (!strcmp(argv[_i]->varname, "ifname")) {
157
0
      ifname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
158
0
    }
159
#if 0 /* anything that can fail? */
160
    if (_fail)
161
      vty_out (vty, "%% invalid input for %s: %s\n",
162
           argv[_i]->varname, argv[_i]->arg);
163
    _failcnt += _fail;
164
#endif
165
0
  }
166
#if 0 /* anything that can fail? */
167
  if (_failcnt)
168
    return CMD_WARNING;
169
#endif
170
0
#endif
171
0
  if (!route_map) {
172
0
    vty_out(vty, "Internal CLI error [%s]\n", "route_map");
173
0
    return CMD_WARNING;
174
0
  }
175
0
  if (!ifname) {
176
0
    vty_out(vty, "Internal CLI error [%s]\n", "ifname");
177
0
    return CMD_WARNING;
178
0
  }
179
180
0
  return if_ipv6_route_map_magic(self, vty, argc, argv, route_map, in, ifname);
181
0
}
182
183
/* no_if_ipv6_route_map => "no route-map [ROUTE-MAP] <in$in|out> IFNAME" */
184
DEFUN_CMD_FUNC_DECL(no_if_ipv6_route_map)
185
#define funcdecl_no_if_ipv6_route_map static int no_if_ipv6_route_map_magic(\
186
  const struct cmd_element *self __attribute__ ((unused)),\
187
  struct vty *vty __attribute__ ((unused)),\
188
  int argc __attribute__ ((unused)),\
189
  struct cmd_token *argv[] __attribute__ ((unused)),\
190
  const char * route_map,\
191
  const char * in,\
192
  const char * ifname)
193
funcdecl_no_if_ipv6_route_map;
194
DEFUN_CMD_FUNC_TEXT(no_if_ipv6_route_map)
195
0
{
196
0
#if 3 /* anything to parse? */
197
0
  int _i;
198
#if 0 /* anything that can fail? */
199
  unsigned _fail = 0, _failcnt = 0;
200
#endif
201
0
  const char *route_map = NULL;
202
0
  const char *in = NULL;
203
0
  const char *ifname = NULL;
204
205
0
  for (_i = 0; _i < argc; _i++) {
206
0
    if (!argv[_i]->varname)
207
0
      continue;
208
#if 0 /* anything that can fail? */
209
    _fail = 0;
210
#endif
211
212
0
    if (!strcmp(argv[_i]->varname, "route_map")) {
213
0
      route_map = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
214
0
    }
215
0
    if (!strcmp(argv[_i]->varname, "in")) {
216
0
      in = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
217
0
    }
218
0
    if (!strcmp(argv[_i]->varname, "ifname")) {
219
0
      ifname = (argv[_i]->type == WORD_TKN) ? argv[_i]->text : argv[_i]->arg;
220
0
    }
221
#if 0 /* anything that can fail? */
222
    if (_fail)
223
      vty_out (vty, "%% invalid input for %s: %s\n",
224
           argv[_i]->varname, argv[_i]->arg);
225
    _failcnt += _fail;
226
#endif
227
0
  }
228
#if 0 /* anything that can fail? */
229
  if (_failcnt)
230
    return CMD_WARNING;
231
#endif
232
0
#endif
233
0
  if (!ifname) {
234
0
    vty_out(vty, "Internal CLI error [%s]\n", "ifname");
235
0
    return CMD_WARNING;
236
0
  }
237
238
0
  return no_if_ipv6_route_map_magic(self, vty, argc, argv, route_map, in, ifname);
239
0
}
240