]> git.proxmox.com Git - mirror_iproute2.git/blob - ip/link_ip6tnl.c
link_ip6tnl: Use IN6ADDR_ANY_INIT to initialize local/remote endpoints
[mirror_iproute2.git] / ip / link_ip6tnl.c
1 /*
2 * link_ip6tnl.c ip6tnl driver 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: Nicolas Dichtel <nicolas.dichtel@6wind.com>
10 *
11 */
12
13 #include <string.h>
14 #include <net/if.h>
15 #include <sys/types.h>
16 #include <sys/socket.h>
17 #include <arpa/inet.h>
18
19 #include <linux/ip.h>
20 #include <linux/if_tunnel.h>
21 #include <linux/ip6_tunnel.h>
22 #include "rt_names.h"
23 #include "utils.h"
24 #include "ip_common.h"
25 #include "tunnel.h"
26
27 #define IP6_FLOWINFO_TCLASS htonl(0x0FF00000)
28 #define IP6_FLOWINFO_FLOWLABEL htonl(0x000FFFFF)
29
30 #define DEFAULT_TNL_HOP_LIMIT (64)
31
32 static void print_usage(FILE *f)
33 {
34 fprintf(f,
35 "Usage: ... ip6tnl [ mode { ip6ip6 | ipip6 | any } ]\n"
36 " [ remote ADDR ]\n"
37 " [ local ADDR ]\n"
38 " [ dev PHYS_DEV ]\n"
39 " [ encaplimit ELIM ]\n"
40 " [ hoplimit HLIM ]\n"
41 " [ tclass TCLASS ]\n"
42 " [ flowlabel FLOWLABEL ]\n"
43 " [ dscp inherit ]\n"
44 " [ fwmark MARK ]\n"
45 " [ [no]allow-localremote ]\n"
46 " [ noencap ]\n"
47 " [ encap { fou | gue | none } ]\n"
48 " [ encap-sport PORT ]\n"
49 " [ encap-dport PORT ]\n"
50 " [ [no]encap-csum ]\n"
51 " [ [no]encap-csum6 ]\n"
52 " [ [no]encap-remcsum ]\n"
53 " [ external ]\n"
54 "\n"
55 "Where: ADDR := IPV6_ADDRESS\n"
56 " ELIM := { none | 0..255 }(default=%d)\n"
57 " HLIM := 0..255 (default=%d)\n"
58 " TCLASS := { 0x0..0xff | inherit }\n"
59 " FLOWLABEL := { 0x0..0xfffff | inherit }\n"
60 " MARK := { 0x0..0xffffffff | inherit }\n",
61 IPV6_DEFAULT_TNL_ENCAP_LIMIT, DEFAULT_TNL_HOP_LIMIT
62 );
63 }
64
65 static void usage(void) __attribute__((noreturn));
66 static void usage(void)
67 {
68 print_usage(stderr);
69 exit(-1);
70 }
71
72 static int ip6tunnel_parse_opt(struct link_util *lu, int argc, char **argv,
73 struct nlmsghdr *n)
74 {
75 struct ifinfomsg *ifi = (struct ifinfomsg *)(n + 1);
76 struct {
77 struct nlmsghdr n;
78 struct ifinfomsg i;
79 } req = {
80 .n.nlmsg_len = NLMSG_LENGTH(sizeof(*ifi)),
81 .n.nlmsg_flags = NLM_F_REQUEST,
82 .n.nlmsg_type = RTM_GETLINK,
83 .i.ifi_family = preferred_family,
84 .i.ifi_index = ifi->ifi_index,
85 };
86 struct nlmsghdr *answer = NULL;
87 struct rtattr *tb[IFLA_MAX + 1];
88 struct rtattr *linkinfo[IFLA_INFO_MAX+1];
89 struct rtattr *iptuninfo[IFLA_IPTUN_MAX + 1];
90 int len;
91 struct in6_addr laddr = IN6ADDR_ANY_INIT;
92 struct in6_addr raddr = IN6ADDR_ANY_INIT;
93 __u8 hop_limit = DEFAULT_TNL_HOP_LIMIT;
94 __u8 encap_limit = IPV6_DEFAULT_TNL_ENCAP_LIMIT;
95 __u32 flowinfo = 0;
96 __u32 flags = 0;
97 __u32 link = 0;
98 __u8 proto = 0;
99 __u16 encaptype = 0;
100 __u16 encapflags = TUNNEL_ENCAP_FLAG_CSUM6;
101 __u16 encapsport = 0;
102 __u16 encapdport = 0;
103 __u8 metadata = 0;
104 __u32 fwmark = 0;
105
106 if (!(n->nlmsg_flags & NLM_F_CREATE)) {
107 if (rtnl_talk(&rth, &req.n, &answer) < 0) {
108 get_failed:
109 fprintf(stderr,
110 "Failed to get existing tunnel info.\n");
111 free(answer);
112 return -1;
113 }
114
115 len = answer->nlmsg_len;
116 len -= NLMSG_LENGTH(sizeof(*ifi));
117 if (len < 0)
118 goto get_failed;
119
120 parse_rtattr(tb, IFLA_MAX, IFLA_RTA(NLMSG_DATA(answer)), len);
121
122 if (!tb[IFLA_LINKINFO])
123 goto get_failed;
124
125 parse_rtattr_nested(linkinfo, IFLA_INFO_MAX, tb[IFLA_LINKINFO]);
126
127 if (!linkinfo[IFLA_INFO_DATA])
128 goto get_failed;
129
130 parse_rtattr_nested(iptuninfo, IFLA_IPTUN_MAX,
131 linkinfo[IFLA_INFO_DATA]);
132
133 if (iptuninfo[IFLA_IPTUN_LOCAL])
134 memcpy(&laddr, RTA_DATA(iptuninfo[IFLA_IPTUN_LOCAL]),
135 sizeof(laddr));
136
137 if (iptuninfo[IFLA_IPTUN_REMOTE])
138 memcpy(&raddr, RTA_DATA(iptuninfo[IFLA_IPTUN_REMOTE]),
139 sizeof(raddr));
140
141 if (iptuninfo[IFLA_IPTUN_TTL])
142 hop_limit = rta_getattr_u8(iptuninfo[IFLA_IPTUN_TTL]);
143
144 if (iptuninfo[IFLA_IPTUN_ENCAP_LIMIT])
145 encap_limit = rta_getattr_u8(iptuninfo[IFLA_IPTUN_ENCAP_LIMIT]);
146
147 if (iptuninfo[IFLA_IPTUN_FLOWINFO])
148 flowinfo = rta_getattr_u32(iptuninfo[IFLA_IPTUN_FLOWINFO]);
149
150 if (iptuninfo[IFLA_IPTUN_FLAGS])
151 flags = rta_getattr_u32(iptuninfo[IFLA_IPTUN_FLAGS]);
152
153 if (iptuninfo[IFLA_IPTUN_LINK])
154 link = rta_getattr_u32(iptuninfo[IFLA_IPTUN_LINK]);
155
156 if (iptuninfo[IFLA_IPTUN_PROTO])
157 proto = rta_getattr_u8(iptuninfo[IFLA_IPTUN_PROTO]);
158 if (iptuninfo[IFLA_IPTUN_COLLECT_METADATA])
159 metadata = 1;
160
161 if (iptuninfo[IFLA_IPTUN_FWMARK])
162 fwmark = rta_getattr_u32(iptuninfo[IFLA_IPTUN_FWMARK]);
163
164 free(answer);
165 }
166
167 while (argc > 0) {
168 if (matches(*argv, "mode") == 0) {
169 NEXT_ARG();
170 if (strcmp(*argv, "ipv6/ipv6") == 0 ||
171 strcmp(*argv, "ip6ip6") == 0)
172 proto = IPPROTO_IPV6;
173 else if (strcmp(*argv, "ip/ipv6") == 0 ||
174 strcmp(*argv, "ipv4/ipv6") == 0 ||
175 strcmp(*argv, "ipip6") == 0 ||
176 strcmp(*argv, "ip4ip6") == 0)
177 proto = IPPROTO_IPIP;
178 else if (strcmp(*argv, "any/ipv6") == 0 ||
179 strcmp(*argv, "any") == 0)
180 proto = 0;
181 else
182 invarg("Cannot guess tunnel mode.", *argv);
183 } else if (strcmp(*argv, "remote") == 0) {
184 inet_prefix addr;
185
186 NEXT_ARG();
187 get_addr(&addr, *argv, AF_INET6);
188 memcpy(&raddr, addr.data, sizeof(raddr));
189 } else if (strcmp(*argv, "local") == 0) {
190 inet_prefix addr;
191
192 NEXT_ARG();
193 get_addr(&addr, *argv, AF_INET6);
194 memcpy(&laddr, addr.data, sizeof(laddr));
195 } else if (matches(*argv, "dev") == 0) {
196 NEXT_ARG();
197 link = if_nametoindex(*argv);
198 if (link == 0)
199 invarg("\"dev\" is invalid", *argv);
200 } else if (strcmp(*argv, "hoplimit") == 0 ||
201 strcmp(*argv, "ttl") == 0 ||
202 strcmp(*argv, "hlim") == 0) {
203 __u8 uval;
204
205 NEXT_ARG();
206 if (get_u8(&uval, *argv, 0))
207 invarg("invalid HLIM", *argv);
208 hop_limit = uval;
209 } else if (strcmp(*argv, "encaplimit") == 0) {
210 NEXT_ARG();
211 if (strcmp(*argv, "none") == 0) {
212 flags |= IP6_TNL_F_IGN_ENCAP_LIMIT;
213 } else {
214 __u8 uval;
215
216 if (get_u8(&uval, *argv, 0) < -1)
217 invarg("invalid ELIM", *argv);
218 encap_limit = uval;
219 flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT;
220 }
221 } else if (strcmp(*argv, "tclass") == 0 ||
222 strcmp(*argv, "tc") == 0 ||
223 strcmp(*argv, "tos") == 0 ||
224 matches(*argv, "dsfield") == 0) {
225 __u8 uval;
226
227 NEXT_ARG();
228 flowinfo &= ~IP6_FLOWINFO_TCLASS;
229 if (strcmp(*argv, "inherit") == 0)
230 flags |= IP6_TNL_F_USE_ORIG_TCLASS;
231 else {
232 if (get_u8(&uval, *argv, 16))
233 invarg("invalid TClass", *argv);
234 flowinfo |= htonl((__u32)uval << 20) & IP6_FLOWINFO_TCLASS;
235 flags &= ~IP6_TNL_F_USE_ORIG_TCLASS;
236 }
237 } else if (strcmp(*argv, "flowlabel") == 0 ||
238 strcmp(*argv, "fl") == 0) {
239 __u32 uval;
240
241 NEXT_ARG();
242 flowinfo &= ~IP6_FLOWINFO_FLOWLABEL;
243 if (strcmp(*argv, "inherit") == 0)
244 flags |= IP6_TNL_F_USE_ORIG_FLOWLABEL;
245 else {
246 if (get_u32(&uval, *argv, 16))
247 invarg("invalid Flowlabel", *argv);
248 if (uval > 0xFFFFF)
249 invarg("invalid Flowlabel", *argv);
250 flowinfo |= htonl(uval) & IP6_FLOWINFO_FLOWLABEL;
251 flags &= ~IP6_TNL_F_USE_ORIG_FLOWLABEL;
252 }
253 } else if (strcmp(*argv, "dscp") == 0) {
254 NEXT_ARG();
255 if (strcmp(*argv, "inherit") != 0)
256 invarg("not inherit", *argv);
257 flags |= IP6_TNL_F_RCV_DSCP_COPY;
258 } else if (strcmp(*argv, "fwmark") == 0) {
259 NEXT_ARG();
260 if (strcmp(*argv, "inherit") == 0) {
261 flags |= IP6_TNL_F_USE_ORIG_FWMARK;
262 fwmark = 0;
263 } else {
264 if (get_u32(&fwmark, *argv, 0))
265 invarg("invalid fwmark\n", *argv);
266 flags &= ~IP6_TNL_F_USE_ORIG_FWMARK;
267 }
268 } else if (strcmp(*argv, "allow-localremote") == 0) {
269 flags |= IP6_TNL_F_ALLOW_LOCAL_REMOTE;
270 } else if (strcmp(*argv, "noallow-localremote") == 0) {
271 flags &= ~IP6_TNL_F_ALLOW_LOCAL_REMOTE;
272 } else if (strcmp(*argv, "noencap") == 0) {
273 encaptype = TUNNEL_ENCAP_NONE;
274 } else if (strcmp(*argv, "encap") == 0) {
275 NEXT_ARG();
276 if (strcmp(*argv, "fou") == 0)
277 encaptype = TUNNEL_ENCAP_FOU;
278 else if (strcmp(*argv, "gue") == 0)
279 encaptype = TUNNEL_ENCAP_GUE;
280 else if (strcmp(*argv, "none") == 0)
281 encaptype = TUNNEL_ENCAP_NONE;
282 else
283 invarg("Invalid encap type.", *argv);
284 } else if (strcmp(*argv, "encap-sport") == 0) {
285 NEXT_ARG();
286 if (strcmp(*argv, "auto") == 0)
287 encapsport = 0;
288 else if (get_u16(&encapsport, *argv, 0))
289 invarg("Invalid source port.", *argv);
290 } else if (strcmp(*argv, "encap-dport") == 0) {
291 NEXT_ARG();
292 if (get_u16(&encapdport, *argv, 0))
293 invarg("Invalid destination port.", *argv);
294 } else if (strcmp(*argv, "encap-csum") == 0) {
295 encapflags |= TUNNEL_ENCAP_FLAG_CSUM;
296 } else if (strcmp(*argv, "noencap-csum") == 0) {
297 encapflags &= ~TUNNEL_ENCAP_FLAG_CSUM;
298 } else if (strcmp(*argv, "encap-udp6-csum") == 0) {
299 encapflags |= TUNNEL_ENCAP_FLAG_CSUM6;
300 } else if (strcmp(*argv, "noencap-udp6-csum") == 0) {
301 encapflags &= ~TUNNEL_ENCAP_FLAG_CSUM6;
302 } else if (strcmp(*argv, "encap-remcsum") == 0) {
303 encapflags |= TUNNEL_ENCAP_FLAG_REMCSUM;
304 } else if (strcmp(*argv, "noencap-remcsum") == 0) {
305 encapflags |= ~TUNNEL_ENCAP_FLAG_REMCSUM;
306 } else if (strcmp(*argv, "external") == 0) {
307 metadata = 1;
308 } else
309 usage();
310 argc--, argv++;
311 }
312
313 addattr8(n, 1024, IFLA_IPTUN_PROTO, proto);
314 if (metadata) {
315 addattr_l(n, 1024, IFLA_IPTUN_COLLECT_METADATA, NULL, 0);
316 return 0;
317 }
318 addattr_l(n, 1024, IFLA_IPTUN_LOCAL, &laddr, sizeof(laddr));
319 addattr_l(n, 1024, IFLA_IPTUN_REMOTE, &raddr, sizeof(raddr));
320 addattr8(n, 1024, IFLA_IPTUN_TTL, hop_limit);
321 addattr8(n, 1024, IFLA_IPTUN_ENCAP_LIMIT, encap_limit);
322 addattr32(n, 1024, IFLA_IPTUN_FLOWINFO, flowinfo);
323 addattr32(n, 1024, IFLA_IPTUN_FLAGS, flags);
324 addattr32(n, 1024, IFLA_IPTUN_LINK, link);
325 addattr32(n, 1024, IFLA_IPTUN_FWMARK, fwmark);
326
327 addattr16(n, 1024, IFLA_IPTUN_ENCAP_TYPE, encaptype);
328 addattr16(n, 1024, IFLA_IPTUN_ENCAP_FLAGS, encapflags);
329 addattr16(n, 1024, IFLA_IPTUN_ENCAP_SPORT, htons(encapsport));
330 addattr16(n, 1024, IFLA_IPTUN_ENCAP_DPORT, htons(encapdport));
331
332 return 0;
333 }
334
335 static void ip6tunnel_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
336 {
337 char s2[64];
338 int flags = 0;
339 __u32 flowinfo = 0;
340
341 if (!tb)
342 return;
343
344 if (tb[IFLA_IPTUN_COLLECT_METADATA])
345 print_bool(PRINT_ANY, "external", "external ", true);
346
347 if (tb[IFLA_IPTUN_FLAGS])
348 flags = rta_getattr_u32(tb[IFLA_IPTUN_FLAGS]);
349
350 if (tb[IFLA_IPTUN_FLOWINFO])
351 flowinfo = rta_getattr_u32(tb[IFLA_IPTUN_FLOWINFO]);
352
353 if (tb[IFLA_IPTUN_PROTO]) {
354 switch (rta_getattr_u8(tb[IFLA_IPTUN_PROTO])) {
355 case IPPROTO_IPIP:
356 print_string(PRINT_ANY, "proto", "%s ", "ipip6");
357 break;
358 case IPPROTO_IPV6:
359 print_string(PRINT_ANY, "proto", "%s ", "ip6ip6");
360 break;
361 case 0:
362 print_string(PRINT_ANY, "proto", "%s ", "any");
363 break;
364 }
365 }
366
367 if (tb[IFLA_IPTUN_REMOTE]) {
368 print_string(PRINT_ANY,
369 "remote",
370 "remote %s ",
371 rt_addr_n2a_rta(AF_INET6, tb[IFLA_IPTUN_REMOTE]));
372 }
373
374 if (tb[IFLA_IPTUN_LOCAL]) {
375 print_string(PRINT_ANY,
376 "local",
377 "local %s ",
378 rt_addr_n2a_rta(AF_INET6, tb[IFLA_IPTUN_LOCAL]));
379 }
380
381 if (tb[IFLA_IPTUN_LINK] && rta_getattr_u32(tb[IFLA_IPTUN_LINK])) {
382 unsigned int link = rta_getattr_u32(tb[IFLA_IPTUN_LINK]);
383 const char *n = if_indextoname(link, s2);
384
385 if (n)
386 print_string(PRINT_ANY, "link", "dev %s ", n);
387 else
388 print_uint(PRINT_ANY, "link_index", "dev %u ", link);
389 }
390
391 if (flags & IP6_TNL_F_IGN_ENCAP_LIMIT)
392 print_bool(PRINT_ANY,
393 "ip6_tnl_f_ign_encap_limit",
394 "encaplimit none ",
395 true);
396 else if (tb[IFLA_IPTUN_ENCAP_LIMIT])
397 print_uint(PRINT_ANY,
398 "encap_limit",
399 "encaplimit %u ",
400 rta_getattr_u8(tb[IFLA_IPTUN_ENCAP_LIMIT]));
401
402 if (tb[IFLA_IPTUN_TTL])
403 print_uint(PRINT_ANY,
404 "ttl",
405 "hoplimit %u ",
406 rta_getattr_u8(tb[IFLA_IPTUN_TTL]));
407
408 if (flags & IP6_TNL_F_USE_ORIG_TCLASS)
409 print_bool(PRINT_ANY,
410 "ip6_tnl_f_use_orig_tclass",
411 "tclass inherit ",
412 true);
413 else if (tb[IFLA_IPTUN_FLOWINFO]) {
414 __u32 val = ntohl(flowinfo & IP6_FLOWINFO_TCLASS);
415
416 if (is_json_context()) {
417 SPRINT_BUF(b1);
418
419 snprintf(b1, sizeof(b1), "0x%02x", (__u8)(val >> 20));
420 print_string(PRINT_JSON, "flowinfo_tclass", NULL, b1);
421 } else {
422 printf("tclass 0x%02x ", (__u8)(val >> 20));
423 }
424 }
425
426 if (flags & IP6_TNL_F_USE_ORIG_FLOWLABEL) {
427 print_bool(PRINT_ANY,
428 "ip6_tnl_f_use_orig_flowlabel",
429 "flowlabel inherit ",
430 true);
431 } else {
432 if (is_json_context()) {
433 SPRINT_BUF(b1);
434
435 snprintf(b1, sizeof(b1), "0x%05x",
436 ntohl(flowinfo & IP6_FLOWINFO_FLOWLABEL));
437 print_string(PRINT_JSON, "flowlabel", NULL, b1);
438 } else {
439 printf("flowlabel 0x%05x ",
440 ntohl(flowinfo & IP6_FLOWINFO_FLOWLABEL));
441 }
442 }
443
444 if (is_json_context()) {
445 SPRINT_BUF(flwinfo);
446
447 snprintf(flwinfo, sizeof(flwinfo), "0x%08x", ntohl(flowinfo));
448 print_string(PRINT_JSON, "flowinfo", NULL, flwinfo);
449 } else {
450 printf("(flowinfo 0x%08x) ", ntohl(flowinfo));
451
452 }
453
454 if (flags & IP6_TNL_F_RCV_DSCP_COPY)
455 print_bool(PRINT_ANY,
456 "ip6_tnl_f_rcv_dscp_copy",
457 "dscp inherit ",
458 true);
459
460 if (flags & IP6_TNL_F_MIP6_DEV)
461 print_bool(PRINT_ANY, "ip6_tnl_f_mip6_dev", "mip6 ", true);
462
463 if (flags & IP6_TNL_F_USE_ORIG_FWMARK) {
464 print_bool(PRINT_ANY,
465 "ip6_tnl_f_use_orig_fwmark",
466 "fwmark inherit ",
467 true);
468 } else if (tb[IFLA_IPTUN_FWMARK]) {
469 __u32 fwmark = rta_getattr_u32(tb[IFLA_IPTUN_FWMARK]);
470
471 if (fwmark) {
472 SPRINT_BUF(b1);
473
474 snprintf(b1, sizeof(b1), "0x%x", fwmark);
475 print_string(PRINT_ANY, "fwmark", "fwmark %s ", b1);
476 }
477 }
478
479 if (flags & IP6_TNL_F_ALLOW_LOCAL_REMOTE)
480 print_bool(PRINT_ANY,
481 "ip6_tnl_f_allow_local_remote",
482 "allow-localremote ",
483 true);
484
485 if (tb[IFLA_IPTUN_ENCAP_TYPE] &&
486 rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_TYPE]) != TUNNEL_ENCAP_NONE) {
487 __u16 type = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_TYPE]);
488 __u16 flags = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_FLAGS]);
489 __u16 sport = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_SPORT]);
490 __u16 dport = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_DPORT]);
491
492 open_json_object("encap");
493 print_string(PRINT_FP, NULL, "encap ", NULL);
494 switch (type) {
495 case TUNNEL_ENCAP_FOU:
496 print_string(PRINT_ANY, "type", "%s ", "fou");
497 break;
498 case TUNNEL_ENCAP_GUE:
499 print_string(PRINT_ANY, "type", "%s ", "gue");
500 break;
501 default:
502 print_null(PRINT_ANY, "type", "unknown ", NULL);
503 break;
504 }
505
506 if (is_json_context()) {
507 print_uint(PRINT_JSON,
508 "sport",
509 NULL,
510 sport ? ntohs(sport) : 0);
511 print_uint(PRINT_JSON, "dport", NULL, ntohs(dport));
512 print_bool(PRINT_JSON, "csum", NULL,
513 flags & TUNNEL_ENCAP_FLAG_CSUM);
514 print_bool(PRINT_JSON, "csum6", NULL,
515 flags & TUNNEL_ENCAP_FLAG_CSUM6);
516 print_bool(PRINT_JSON, "remcsum", NULL,
517 flags & TUNNEL_ENCAP_FLAG_REMCSUM);
518 close_json_object();
519 } else {
520 if (sport == 0)
521 fputs("encap-sport auto ", f);
522 else
523 fprintf(f, "encap-sport %u", ntohs(sport));
524
525 fprintf(f, "encap-dport %u ", ntohs(dport));
526
527 if (flags & TUNNEL_ENCAP_FLAG_CSUM)
528 fputs("encap-csum ", f);
529 else
530 fputs("noencap-csum ", f);
531
532 if (flags & TUNNEL_ENCAP_FLAG_CSUM6)
533 fputs("encap-csum6 ", f);
534 else
535 fputs("noencap-csum6 ", f);
536
537 if (flags & TUNNEL_ENCAP_FLAG_REMCSUM)
538 fputs("encap-remcsum ", f);
539 else
540 fputs("noencap-remcsum ", f);
541 }
542 }
543 }
544
545 static void ip6tunnel_print_help(struct link_util *lu, int argc, char **argv,
546 FILE *f)
547 {
548 print_usage(f);
549 }
550
551 struct link_util ip6tnl_link_util = {
552 .id = "ip6tnl",
553 .maxattr = IFLA_IPTUN_MAX,
554 .parse_opt = ip6tunnel_parse_opt,
555 .print_opt = ip6tunnel_print_opt,
556 .print_help = ip6tunnel_print_help,
557 };