]>
Commit | Line | Data |
---|---|---|
d57639a4 AV |
1 | /* |
2 | * m_tunnel_key.c ip tunnel manipulation module | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or | |
5 | * modify it under the terms of the GNU General Public License | |
6 | * as published by the Free Software Foundation; either version | |
7 | * 2 of the License, or (at your option) any later version. | |
8 | * | |
9 | * Authors: Amir Vadai <amir@vadai.me> | |
10 | */ | |
11 | ||
12 | #include <stdio.h> | |
13 | #include <stdlib.h> | |
14 | #include <unistd.h> | |
15 | #include <string.h> | |
16 | #include <linux/if_ether.h> | |
17 | #include "utils.h" | |
18 | #include "rt_names.h" | |
19 | #include "tc_util.h" | |
20 | #include <linux/tc_act/tc_tunnel_key.h> | |
21 | ||
22 | static void explain(void) | |
23 | { | |
50907a82 | 24 | fprintf(stderr, |
8589eb4e MC |
25 | "Usage: tunnel_key unset\n" |
26 | " tunnel_key set <TUNNEL_KEY>\n" | |
50907a82 | 27 | "Where TUNNEL_KEY is a combination of:\n" |
dc0332b1 | 28 | "id <TUNNELID>\n" |
50907a82 JB |
29 | "src_ip <IP> (mandatory)\n" |
30 | "dst_ip <IP> (mandatory)\n" | |
59eb271d | 31 | "dst_port <UDP_PORT>\n" |
6217917a | 32 | "geneve_opts <OPTIONS>\n" |
59eb271d | 33 | "csum | nocsum (default is \"csum\")\n"); |
d57639a4 AV |
34 | } |
35 | ||
36 | static void usage(void) | |
37 | { | |
38 | explain(); | |
39 | exit(-1); | |
40 | } | |
41 | ||
42 | static int tunnel_key_parse_ip_addr(const char *str, int addr4_type, | |
43 | int addr6_type, struct nlmsghdr *n) | |
44 | { | |
45 | inet_prefix addr; | |
46 | int ret; | |
47 | ||
48 | ret = get_addr(&addr, str, AF_UNSPEC); | |
49 | if (ret) | |
50 | return ret; | |
51 | ||
52 | addattr_l(n, MAX_MSG, addr.family == AF_INET ? addr4_type : addr6_type, | |
53 | addr.data, addr.bytelen); | |
54 | ||
55 | return 0; | |
56 | } | |
57 | ||
58 | static int tunnel_key_parse_key_id(const char *str, int type, | |
59 | struct nlmsghdr *n) | |
60 | { | |
61 | __be32 key_id; | |
62 | int ret; | |
63 | ||
64 | ret = get_be32(&key_id, str, 10); | |
65 | if (!ret) | |
66 | addattr32(n, MAX_MSG, type, key_id); | |
67 | ||
68 | return ret; | |
69 | } | |
70 | ||
449c709c HHZ |
71 | static int tunnel_key_parse_dst_port(char *str, int type, struct nlmsghdr *n) |
72 | { | |
73 | int ret; | |
74 | __be16 dst_port; | |
75 | ||
76 | ret = get_be16(&dst_port, str, 10); | |
77 | if (ret) | |
78 | return -1; | |
79 | ||
80 | addattr16(n, MAX_MSG, type, dst_port); | |
81 | ||
82 | return 0; | |
83 | } | |
84 | ||
6217917a SH |
85 | static int tunnel_key_parse_be16(char *str, int base, int type, |
86 | struct nlmsghdr *n) | |
87 | { | |
88 | int ret; | |
89 | __be16 value; | |
90 | ||
91 | ret = get_be16(&value, str, base); | |
92 | if (ret) | |
93 | return ret; | |
94 | ||
95 | addattr16(n, MAX_MSG, type, value); | |
96 | ||
97 | return 0; | |
98 | } | |
99 | ||
100 | static int tunnel_key_parse_u8(char *str, int base, int type, | |
101 | struct nlmsghdr *n) | |
102 | { | |
103 | int ret; | |
104 | __u8 value; | |
105 | ||
106 | ret = get_u8(&value, str, base); | |
107 | if (ret) | |
108 | return ret; | |
109 | ||
110 | addattr8(n, MAX_MSG, type, value); | |
111 | ||
112 | return 0; | |
113 | } | |
114 | ||
115 | static int tunnel_key_parse_geneve_opt(char *str, struct nlmsghdr *n) | |
116 | { | |
117 | char *token, *saveptr = NULL; | |
118 | struct rtattr *nest; | |
119 | int i, ret; | |
120 | ||
121 | nest = addattr_nest(n, MAX_MSG, TCA_TUNNEL_KEY_ENC_OPTS_GENEVE); | |
122 | ||
123 | token = strtok_r(str, ":", &saveptr); | |
124 | i = 1; | |
125 | while (token) { | |
126 | switch (i) { | |
127 | case TCA_TUNNEL_KEY_ENC_OPT_GENEVE_CLASS: | |
128 | { | |
129 | ret = tunnel_key_parse_be16(token, 16, i, n); | |
130 | if (ret) | |
131 | return ret; | |
132 | break; | |
133 | } | |
134 | case TCA_TUNNEL_KEY_ENC_OPT_GENEVE_TYPE: | |
135 | { | |
136 | ret = tunnel_key_parse_u8(token, 16, i, n); | |
137 | if (ret) | |
138 | return ret; | |
139 | break; | |
140 | } | |
141 | case TCA_TUNNEL_KEY_ENC_OPT_GENEVE_DATA: | |
142 | { | |
143 | size_t token_len = strlen(token); | |
144 | uint8_t *opts; | |
145 | ||
146 | opts = malloc(token_len / 2); | |
147 | if (!opts) | |
148 | return -1; | |
149 | if (hex2mem(token, opts, token_len / 2) < 0) { | |
150 | free(opts); | |
151 | return -1; | |
152 | } | |
153 | addattr_l(n, MAX_MSG, i, opts, token_len / 2); | |
154 | free(opts); | |
155 | ||
156 | break; | |
157 | } | |
158 | default: | |
159 | return -1; | |
160 | } | |
161 | ||
162 | token = strtok_r(NULL, ":", &saveptr); | |
163 | i++; | |
164 | } | |
165 | ||
166 | addattr_nest_end(n, nest); | |
167 | ||
168 | return 0; | |
169 | } | |
170 | ||
171 | static int tunnel_key_parse_geneve_opts(char *str, struct nlmsghdr *n) | |
172 | { | |
173 | char *token, *saveptr = NULL; | |
174 | struct rtattr *nest; | |
175 | int ret; | |
176 | ||
177 | nest = addattr_nest(n, MAX_MSG, TCA_TUNNEL_KEY_ENC_OPTS); | |
178 | ||
179 | token = strtok_r(str, ",", &saveptr); | |
180 | while (token) { | |
181 | ret = tunnel_key_parse_geneve_opt(token, n); | |
182 | if (ret) | |
183 | return ret; | |
184 | ||
185 | token = strtok_r(NULL, ",", &saveptr); | |
186 | } | |
187 | ||
188 | addattr_nest_end(n, nest); | |
189 | ||
190 | return 0; | |
191 | } | |
192 | ||
9f89b0cc OG |
193 | static int tunnel_key_parse_tos_ttl(char *str, int type, struct nlmsghdr *n) |
194 | { | |
195 | int ret; | |
196 | __u8 val; | |
197 | ||
198 | ret = get_u8(&val, str, 10); | |
199 | if (ret) | |
200 | ret = get_u8(&val, str, 16); | |
201 | if (ret) | |
202 | return -1; | |
203 | ||
204 | addattr8(n, MAX_MSG, type, val); | |
205 | ||
206 | return 0; | |
207 | } | |
208 | ||
d57639a4 AV |
209 | static int parse_tunnel_key(struct action_util *a, int *argc_p, char ***argv_p, |
210 | int tca_id, struct nlmsghdr *n) | |
211 | { | |
e67aba55 | 212 | struct tc_tunnel_key parm = {}; |
d57639a4 AV |
213 | char **argv = *argv_p; |
214 | int argc = *argc_p; | |
215 | struct rtattr *tail; | |
216 | int action = 0; | |
217 | int ret; | |
218 | int has_src_ip = 0; | |
219 | int has_dst_ip = 0; | |
59eb271d | 220 | int csum = 1; |
d57639a4 AV |
221 | |
222 | if (matches(*argv, "tunnel_key") != 0) | |
223 | return -1; | |
224 | ||
c14f9d92 | 225 | tail = addattr_nest(n, MAX_MSG, tca_id); |
d57639a4 AV |
226 | |
227 | NEXT_ARG(); | |
228 | ||
229 | while (argc > 0) { | |
230 | if (matches(*argv, "unset") == 0) { | |
231 | if (action) { | |
232 | fprintf(stderr, "unexpected \"%s\" - action already specified\n", | |
233 | *argv); | |
234 | explain(); | |
235 | return -1; | |
236 | } | |
237 | action = TCA_TUNNEL_KEY_ACT_RELEASE; | |
238 | } else if (matches(*argv, "set") == 0) { | |
239 | if (action) { | |
240 | fprintf(stderr, "unexpected \"%s\" - action already specified\n", | |
241 | *argv); | |
242 | explain(); | |
243 | return -1; | |
244 | } | |
245 | action = TCA_TUNNEL_KEY_ACT_SET; | |
246 | } else if (matches(*argv, "src_ip") == 0) { | |
247 | NEXT_ARG(); | |
248 | ret = tunnel_key_parse_ip_addr(*argv, | |
249 | TCA_TUNNEL_KEY_ENC_IPV4_SRC, | |
250 | TCA_TUNNEL_KEY_ENC_IPV6_SRC, | |
251 | n); | |
252 | if (ret < 0) { | |
253 | fprintf(stderr, "Illegal \"src_ip\"\n"); | |
254 | return -1; | |
255 | } | |
256 | has_src_ip = 1; | |
257 | } else if (matches(*argv, "dst_ip") == 0) { | |
258 | NEXT_ARG(); | |
259 | ret = tunnel_key_parse_ip_addr(*argv, | |
260 | TCA_TUNNEL_KEY_ENC_IPV4_DST, | |
261 | TCA_TUNNEL_KEY_ENC_IPV6_DST, | |
262 | n); | |
263 | if (ret < 0) { | |
264 | fprintf(stderr, "Illegal \"dst_ip\"\n"); | |
265 | return -1; | |
266 | } | |
267 | has_dst_ip = 1; | |
268 | } else if (matches(*argv, "id") == 0) { | |
269 | NEXT_ARG(); | |
270 | ret = tunnel_key_parse_key_id(*argv, TCA_TUNNEL_KEY_ENC_KEY_ID, n); | |
271 | if (ret < 0) { | |
272 | fprintf(stderr, "Illegal \"id\"\n"); | |
273 | return -1; | |
274 | } | |
449c709c HHZ |
275 | } else if (matches(*argv, "dst_port") == 0) { |
276 | NEXT_ARG(); | |
277 | ret = tunnel_key_parse_dst_port(*argv, | |
278 | TCA_TUNNEL_KEY_ENC_DST_PORT, n); | |
279 | if (ret < 0) { | |
280 | fprintf(stderr, "Illegal \"dst port\"\n"); | |
281 | return -1; | |
282 | } | |
6217917a SH |
283 | } else if (matches(*argv, "geneve_opts") == 0) { |
284 | NEXT_ARG(); | |
285 | ||
286 | if (tunnel_key_parse_geneve_opts(*argv, n)) { | |
287 | fprintf(stderr, "Illegal \"geneve_opts\"\n"); | |
288 | return -1; | |
289 | } | |
9f89b0cc OG |
290 | } else if (matches(*argv, "tos") == 0) { |
291 | NEXT_ARG(); | |
292 | ret = tunnel_key_parse_tos_ttl(*argv, | |
293 | TCA_TUNNEL_KEY_ENC_TOS, n); | |
294 | if (ret < 0) { | |
295 | fprintf(stderr, "Illegal \"tos\"\n"); | |
296 | return -1; | |
297 | } | |
298 | } else if (matches(*argv, "ttl") == 0) { | |
299 | NEXT_ARG(); | |
300 | ret = tunnel_key_parse_tos_ttl(*argv, | |
301 | TCA_TUNNEL_KEY_ENC_TTL, n); | |
302 | if (ret < 0) { | |
303 | fprintf(stderr, "Illegal \"ttl\"\n"); | |
304 | return -1; | |
305 | } | |
59eb271d JB |
306 | } else if (matches(*argv, "csum") == 0) { |
307 | csum = 1; | |
308 | } else if (matches(*argv, "nocsum") == 0) { | |
309 | csum = 0; | |
d57639a4 AV |
310 | } else if (matches(*argv, "help") == 0) { |
311 | usage(); | |
312 | } else { | |
313 | break; | |
314 | } | |
315 | NEXT_ARG_FWD(); | |
316 | } | |
317 | ||
59eb271d JB |
318 | addattr8(n, MAX_MSG, TCA_TUNNEL_KEY_NO_CSUM, !csum); |
319 | ||
e67aba55 JP |
320 | parse_action_control_dflt(&argc, &argv, &parm.action, |
321 | false, TC_ACT_PIPE); | |
d57639a4 AV |
322 | |
323 | if (argc) { | |
324 | if (matches(*argv, "index") == 0) { | |
325 | NEXT_ARG(); | |
326 | if (get_u32(&parm.index, *argv, 10)) { | |
327 | fprintf(stderr, "tunnel_key: Illegal \"index\"\n"); | |
328 | return -1; | |
329 | } | |
330 | ||
331 | NEXT_ARG_FWD(); | |
332 | } | |
333 | } | |
334 | ||
335 | if (action == TCA_TUNNEL_KEY_ACT_SET && | |
dc0332b1 | 336 | (!has_src_ip || !has_dst_ip)) { |
d57639a4 AV |
337 | fprintf(stderr, "set needs tunnel_key parameters\n"); |
338 | explain(); | |
339 | return -1; | |
340 | } | |
341 | ||
342 | parm.t_action = action; | |
343 | addattr_l(n, MAX_MSG, TCA_TUNNEL_KEY_PARMS, &parm, sizeof(parm)); | |
c14f9d92 | 344 | addattr_nest_end(n, tail); |
d57639a4 AV |
345 | |
346 | *argc_p = argc; | |
347 | *argv_p = argv; | |
348 | ||
349 | return 0; | |
350 | } | |
351 | ||
352 | static void tunnel_key_print_ip_addr(FILE *f, const char *name, | |
353 | struct rtattr *attr) | |
354 | { | |
355 | int family; | |
356 | size_t len; | |
357 | ||
358 | if (!attr) | |
359 | return; | |
360 | ||
361 | len = RTA_PAYLOAD(attr); | |
362 | ||
363 | if (len == 4) | |
364 | family = AF_INET; | |
365 | else if (len == 16) | |
366 | family = AF_INET6; | |
367 | else | |
368 | return; | |
369 | ||
8feb516b RM |
370 | print_string(PRINT_FP, NULL, "%s", _SL_); |
371 | if (matches(name, "src_ip") == 0) | |
372 | print_string(PRINT_ANY, "src_ip", "\tsrc_ip %s", | |
373 | rt_addr_n2a_rta(family, attr)); | |
374 | else if (matches(name, "dst_ip") == 0) | |
375 | print_string(PRINT_ANY, "dst_ip", "\tdst_ip %s", | |
376 | rt_addr_n2a_rta(family, attr)); | |
d57639a4 AV |
377 | } |
378 | ||
379 | static void tunnel_key_print_key_id(FILE *f, const char *name, | |
380 | struct rtattr *attr) | |
381 | { | |
382 | if (!attr) | |
383 | return; | |
8feb516b RM |
384 | print_string(PRINT_FP, NULL, "%s", _SL_); |
385 | print_uint(PRINT_ANY, "key_id", "\tkey_id %u", rta_getattr_be32(attr)); | |
d57639a4 AV |
386 | } |
387 | ||
449c709c HHZ |
388 | static void tunnel_key_print_dst_port(FILE *f, char *name, |
389 | struct rtattr *attr) | |
390 | { | |
391 | if (!attr) | |
392 | return; | |
8feb516b RM |
393 | print_string(PRINT_FP, NULL, "%s", _SL_); |
394 | print_uint(PRINT_ANY, "dst_port", "\tdst_port %u", | |
395 | rta_getattr_be16(attr)); | |
449c709c HHZ |
396 | } |
397 | ||
59eb271d JB |
398 | static void tunnel_key_print_flag(FILE *f, const char *name_on, |
399 | const char *name_off, | |
400 | struct rtattr *attr) | |
401 | { | |
402 | if (!attr) | |
403 | return; | |
8feb516b RM |
404 | print_string(PRINT_FP, NULL, "%s", _SL_); |
405 | print_string(PRINT_ANY, "flag", "\t%s", | |
406 | rta_getattr_u8(attr) ? name_on : name_off); | |
59eb271d JB |
407 | } |
408 | ||
6217917a SH |
409 | static void tunnel_key_print_geneve_options(const char *name, |
410 | struct rtattr *attr) | |
411 | { | |
412 | struct rtattr *tb[TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX + 1]; | |
413 | struct rtattr *i = RTA_DATA(attr); | |
414 | int ii, data_len = 0, offset = 0; | |
415 | int rem = RTA_PAYLOAD(attr); | |
416 | char strbuf[rem * 2 + 1]; | |
417 | char data[rem * 2 + 1]; | |
418 | uint8_t data_r[rem]; | |
419 | uint16_t clss; | |
420 | uint8_t type; | |
421 | ||
422 | open_json_array(PRINT_JSON, name); | |
423 | print_string(PRINT_FP, name, "\n\t%s ", "geneve_opt"); | |
424 | ||
425 | while (rem) { | |
426 | parse_rtattr(tb, TCA_TUNNEL_KEY_ENC_OPT_GENEVE_MAX, i, rem); | |
427 | clss = rta_getattr_be16(tb[TCA_TUNNEL_KEY_ENC_OPT_GENEVE_CLASS]); | |
428 | type = rta_getattr_u8(tb[TCA_TUNNEL_KEY_ENC_OPT_GENEVE_TYPE]); | |
429 | data_len = RTA_PAYLOAD(tb[TCA_TUNNEL_KEY_ENC_OPT_GENEVE_DATA]); | |
430 | hexstring_n2a(RTA_DATA(tb[TCA_TUNNEL_KEY_ENC_OPT_GENEVE_DATA]), | |
431 | data_len, data, sizeof(data)); | |
432 | hex2mem(data, data_r, data_len); | |
433 | offset += data_len + 20; | |
434 | rem -= data_len + 20; | |
435 | i = RTA_DATA(attr) + offset; | |
436 | ||
437 | open_json_object(NULL); | |
438 | print_uint(PRINT_JSON, "class", NULL, clss); | |
439 | print_uint(PRINT_JSON, "type", NULL, type); | |
440 | open_json_array(PRINT_JSON, "data"); | |
441 | for (ii = 0; ii < data_len; ii++) | |
442 | print_uint(PRINT_JSON, NULL, NULL, data_r[ii]); | |
443 | close_json_array(PRINT_JSON, "data"); | |
444 | close_json_object(); | |
445 | ||
446 | sprintf(strbuf, "%04x:%02x:%s", clss, type, data); | |
447 | if (rem) | |
448 | print_string(PRINT_FP, NULL, "%s,", strbuf); | |
449 | else | |
450 | print_string(PRINT_FP, NULL, "%s", strbuf); | |
451 | } | |
452 | ||
453 | close_json_array(PRINT_JSON, name); | |
454 | } | |
455 | ||
456 | static void tunnel_key_print_key_opt(const char *name, struct rtattr *attr) | |
457 | { | |
458 | struct rtattr *tb[TCA_TUNNEL_KEY_ENC_OPTS_MAX + 1]; | |
459 | ||
460 | if (!attr) | |
461 | return; | |
462 | ||
463 | parse_rtattr_nested(tb, TCA_TUNNEL_KEY_ENC_OPTS_MAX, attr); | |
464 | tunnel_key_print_geneve_options(name, | |
465 | tb[TCA_TUNNEL_KEY_ENC_OPTS_GENEVE]); | |
466 | } | |
467 | ||
9f89b0cc OG |
468 | static void tunnel_key_print_tos_ttl(FILE *f, char *name, |
469 | struct rtattr *attr) | |
470 | { | |
471 | if (!attr) | |
472 | return; | |
473 | ||
474 | if (matches(name, "tos") == 0 && rta_getattr_u8(attr) != 0) { | |
475 | print_string(PRINT_FP, NULL, "%s", _SL_); | |
476 | print_uint(PRINT_ANY, "tos", "\ttos 0x%x", | |
477 | rta_getattr_u8(attr)); | |
478 | } else if (matches(name, "ttl") == 0 && rta_getattr_u8(attr) != 0) { | |
479 | print_string(PRINT_FP, NULL, "%s", _SL_); | |
480 | print_uint(PRINT_ANY, "ttl", "\tttl %u", | |
481 | rta_getattr_u8(attr)); | |
482 | } | |
483 | } | |
484 | ||
d57639a4 AV |
485 | static int print_tunnel_key(struct action_util *au, FILE *f, struct rtattr *arg) |
486 | { | |
487 | struct rtattr *tb[TCA_TUNNEL_KEY_MAX + 1]; | |
488 | struct tc_tunnel_key *parm; | |
489 | ||
490 | if (!arg) | |
491 | return -1; | |
492 | ||
493 | parse_rtattr_nested(tb, TCA_TUNNEL_KEY_MAX, arg); | |
494 | ||
495 | if (!tb[TCA_TUNNEL_KEY_PARMS]) { | |
d5ddb441 | 496 | fprintf(stderr, "Missing tunnel_key parameters\n"); |
d57639a4 AV |
497 | return -1; |
498 | } | |
499 | parm = RTA_DATA(tb[TCA_TUNNEL_KEY_PARMS]); | |
500 | ||
8feb516b | 501 | print_string(PRINT_ANY, "kind", "%s ", "tunnel_key"); |
d57639a4 AV |
502 | |
503 | switch (parm->t_action) { | |
504 | case TCA_TUNNEL_KEY_ACT_RELEASE: | |
8feb516b | 505 | print_string(PRINT_ANY, "mode", " %s", "unset"); |
d57639a4 AV |
506 | break; |
507 | case TCA_TUNNEL_KEY_ACT_SET: | |
8feb516b | 508 | print_string(PRINT_ANY, "mode", " %s", "set"); |
d57639a4 AV |
509 | tunnel_key_print_ip_addr(f, "src_ip", |
510 | tb[TCA_TUNNEL_KEY_ENC_IPV4_SRC]); | |
511 | tunnel_key_print_ip_addr(f, "dst_ip", | |
512 | tb[TCA_TUNNEL_KEY_ENC_IPV4_DST]); | |
513 | tunnel_key_print_ip_addr(f, "src_ip", | |
514 | tb[TCA_TUNNEL_KEY_ENC_IPV6_SRC]); | |
515 | tunnel_key_print_ip_addr(f, "dst_ip", | |
516 | tb[TCA_TUNNEL_KEY_ENC_IPV6_DST]); | |
517 | tunnel_key_print_key_id(f, "key_id", | |
518 | tb[TCA_TUNNEL_KEY_ENC_KEY_ID]); | |
449c709c HHZ |
519 | tunnel_key_print_dst_port(f, "dst_port", |
520 | tb[TCA_TUNNEL_KEY_ENC_DST_PORT]); | |
6217917a SH |
521 | tunnel_key_print_key_opt("geneve_opts", |
522 | tb[TCA_TUNNEL_KEY_ENC_OPTS]); | |
59eb271d JB |
523 | tunnel_key_print_flag(f, "nocsum", "csum", |
524 | tb[TCA_TUNNEL_KEY_NO_CSUM]); | |
9f89b0cc OG |
525 | tunnel_key_print_tos_ttl(f, "tos", |
526 | tb[TCA_TUNNEL_KEY_ENC_TOS]); | |
527 | tunnel_key_print_tos_ttl(f, "ttl", | |
528 | tb[TCA_TUNNEL_KEY_ENC_TTL]); | |
d57639a4 AV |
529 | break; |
530 | } | |
e67aba55 | 531 | print_action_control(f, " ", parm->action, ""); |
d57639a4 | 532 | |
8feb516b RM |
533 | print_string(PRINT_FP, NULL, "%s", _SL_); |
534 | print_uint(PRINT_ANY, "index", "\t index %u", parm->index); | |
535 | print_int(PRINT_ANY, "ref", " ref %d", parm->refcnt); | |
536 | print_int(PRINT_ANY, "bind", " bind %d", parm->bindcnt); | |
d57639a4 AV |
537 | |
538 | if (show_stats) { | |
539 | if (tb[TCA_TUNNEL_KEY_TM]) { | |
540 | struct tcf_t *tm = RTA_DATA(tb[TCA_TUNNEL_KEY_TM]); | |
541 | ||
542 | print_tm(f, tm); | |
543 | } | |
544 | } | |
545 | ||
8feb516b | 546 | print_string(PRINT_FP, NULL, "%s", _SL_); |
d57639a4 AV |
547 | |
548 | return 0; | |
549 | } | |
550 | ||
551 | struct action_util tunnel_key_action_util = { | |
552 | .id = "tunnel_key", | |
553 | .parse_aopt = parse_tunnel_key, | |
554 | .print_aopt = print_tunnel_key, | |
555 | }; |