2 * link_gre6.c gre driver module
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.
9 * Authors: Dmitry Kozlov <xeb@mail.ru>
15 #include <sys/types.h>
16 #include <sys/socket.h>
17 #include <arpa/inet.h>
20 #include <linux/if_tunnel.h>
21 #include <linux/ip6_tunnel.h>
25 #include "ip_common.h"
28 #define IP6_FLOWINFO_TCLASS htonl(0x0FF00000)
29 #define IP6_FLOWINFO_FLOWLABEL htonl(0x000FFFFF)
31 #define DEFAULT_TNL_HOP_LIMIT (64)
33 static void print_usage(FILE *f
)
36 "Usage: ... { ip6gre | ip6gretap | ip6erspan} [ remote ADDR ]\n"
42 " [ encaplimit ELIM ]\n"
43 " [ tclass TCLASS ]\n"
44 " [ flowlabel FLOWLABEL ]\n"
49 " [ encap { fou | gue | none } ]\n"
50 " [ encap-sport PORT ]\n"
51 " [ encap-dport PORT ]\n"
52 " [ [no]encap-csum ]\n"
53 " [ [no]encap-csum6 ]\n"
54 " [ [no]encap-remcsum ]\n"
57 "Where: ADDR := IPV6_ADDRESS\n"
58 " TTL := { 0..255 } (default=%d)\n"
59 " KEY := { DOTTED_QUAD | NUMBER }\n"
60 " ELIM := { none | 0..255 }(default=%d)\n"
61 " TCLASS := { 0x0..0xff | inherit }\n"
62 " FLOWLABEL := { 0x0..0xfffff | inherit }\n"
63 " MARK := { 0x0..0xffffffff | inherit }\n",
64 DEFAULT_TNL_HOP_LIMIT
, IPV6_DEFAULT_TNL_ENCAP_LIMIT
68 static void usage(void) __attribute__((noreturn
));
69 static void usage(void)
75 static int gre_parse_opt(struct link_util
*lu
, int argc
, char **argv
,
78 struct ifinfomsg
*ifi
= (struct ifinfomsg
*)(n
+ 1);
83 .n
.nlmsg_len
= NLMSG_LENGTH(sizeof(*ifi
)),
84 .n
.nlmsg_flags
= NLM_F_REQUEST
,
85 .n
.nlmsg_type
= RTM_GETLINK
,
86 .i
.ifi_family
= preferred_family
,
87 .i
.ifi_index
= ifi
->ifi_index
,
89 struct nlmsghdr
*answer
;
90 struct rtattr
*tb
[IFLA_MAX
+ 1];
91 struct rtattr
*linkinfo
[IFLA_INFO_MAX
+1];
92 struct rtattr
*greinfo
[IFLA_GRE_MAX
+ 1];
97 struct in6_addr raddr
= IN6ADDR_ANY_INIT
;
98 struct in6_addr laddr
= IN6ADDR_ANY_INIT
;
99 unsigned int link
= 0;
100 unsigned int flowinfo
= 0;
101 unsigned int flags
= 0;
102 __u8 hop_limit
= DEFAULT_TNL_HOP_LIMIT
;
103 __u8 encap_limit
= IPV6_DEFAULT_TNL_ENCAP_LIMIT
;
105 __u16 encapflags
= TUNNEL_ENCAP_FLAG_CSUM6
;
106 __u16 encapsport
= 0;
107 __u16 encapdport
= 0;
110 __u32 erspan_idx
= 0;
112 if (!(n
->nlmsg_flags
& NLM_F_CREATE
)) {
113 if (rtnl_talk(&rth
, &req
.n
, &answer
) < 0) {
116 "Failed to get existing tunnel info.\n");
120 len
= answer
->nlmsg_len
;
121 len
-= NLMSG_LENGTH(sizeof(*ifi
));
125 parse_rtattr(tb
, IFLA_MAX
, IFLA_RTA(NLMSG_DATA(answer
)), len
);
127 if (!tb
[IFLA_LINKINFO
])
130 parse_rtattr_nested(linkinfo
, IFLA_INFO_MAX
, tb
[IFLA_LINKINFO
]);
132 if (!linkinfo
[IFLA_INFO_DATA
])
135 parse_rtattr_nested(greinfo
, IFLA_GRE_MAX
,
136 linkinfo
[IFLA_INFO_DATA
]);
138 if (greinfo
[IFLA_GRE_IKEY
])
139 ikey
= rta_getattr_u32(greinfo
[IFLA_GRE_IKEY
]);
141 if (greinfo
[IFLA_GRE_OKEY
])
142 okey
= rta_getattr_u32(greinfo
[IFLA_GRE_OKEY
]);
144 if (greinfo
[IFLA_GRE_IFLAGS
])
145 iflags
= rta_getattr_u16(greinfo
[IFLA_GRE_IFLAGS
]);
147 if (greinfo
[IFLA_GRE_OFLAGS
])
148 oflags
= rta_getattr_u16(greinfo
[IFLA_GRE_OFLAGS
]);
150 if (greinfo
[IFLA_GRE_LOCAL
])
151 memcpy(&laddr
, RTA_DATA(greinfo
[IFLA_GRE_LOCAL
]), sizeof(laddr
));
153 if (greinfo
[IFLA_GRE_REMOTE
])
154 memcpy(&raddr
, RTA_DATA(greinfo
[IFLA_GRE_REMOTE
]), sizeof(raddr
));
156 if (greinfo
[IFLA_GRE_TTL
])
157 hop_limit
= rta_getattr_u8(greinfo
[IFLA_GRE_TTL
]);
159 if (greinfo
[IFLA_GRE_LINK
])
160 link
= rta_getattr_u32(greinfo
[IFLA_GRE_LINK
]);
162 if (greinfo
[IFLA_GRE_ENCAP_LIMIT
])
163 encap_limit
= rta_getattr_u8(greinfo
[IFLA_GRE_ENCAP_LIMIT
]);
165 if (greinfo
[IFLA_GRE_FLOWINFO
])
166 flowinfo
= rta_getattr_u32(greinfo
[IFLA_GRE_FLOWINFO
]);
168 if (greinfo
[IFLA_GRE_FLAGS
])
169 flags
= rta_getattr_u32(greinfo
[IFLA_GRE_FLAGS
]);
171 if (greinfo
[IFLA_GRE_ENCAP_TYPE
])
172 encaptype
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_TYPE
]);
174 if (greinfo
[IFLA_GRE_ENCAP_FLAGS
])
175 encapflags
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_FLAGS
]);
177 if (greinfo
[IFLA_GRE_ENCAP_SPORT
])
178 encapsport
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_SPORT
]);
180 if (greinfo
[IFLA_GRE_ENCAP_DPORT
])
181 encapdport
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_DPORT
]);
183 if (greinfo
[IFLA_GRE_FWMARK
])
184 fwmark
= rta_getattr_u32(greinfo
[IFLA_GRE_FWMARK
]);
186 if (greinfo
[IFLA_GRE_ERSPAN_INDEX
])
187 erspan_idx
= rta_getattr_u32(greinfo
[IFLA_GRE_ERSPAN_INDEX
]);
193 if (!matches(*argv
, "key")) {
197 ikey
= okey
= tnl_parse_key("key", *argv
);
198 } else if (!matches(*argv
, "ikey")) {
201 ikey
= tnl_parse_key("ikey", *argv
);
202 } else if (!matches(*argv
, "okey")) {
205 okey
= tnl_parse_key("okey", *argv
);
206 } else if (!matches(*argv
, "seq")) {
209 } else if (!matches(*argv
, "iseq")) {
211 } else if (!matches(*argv
, "oseq")) {
213 } else if (!matches(*argv
, "csum")) {
216 } else if (!matches(*argv
, "icsum")) {
218 } else if (!matches(*argv
, "ocsum")) {
220 } else if (!matches(*argv
, "remote")) {
224 get_addr(&addr
, *argv
, AF_INET6
);
225 memcpy(&raddr
, &addr
.data
, sizeof(raddr
));
226 } else if (!matches(*argv
, "local")) {
230 get_addr(&addr
, *argv
, AF_INET6
);
231 memcpy(&laddr
, &addr
.data
, sizeof(laddr
));
232 } else if (!matches(*argv
, "dev")) {
234 link
= if_nametoindex(*argv
);
236 fprintf(stderr
, "Cannot find device \"%s\"\n",
240 } else if (!matches(*argv
, "ttl") ||
241 !matches(*argv
, "hoplimit")) {
245 if (get_u8(&uval
, *argv
, 0))
246 invarg("invalid TTL", *argv
);
248 } else if (!matches(*argv
, "tos") ||
249 !matches(*argv
, "tclass") ||
250 !matches(*argv
, "dsfield")) {
254 flowinfo
&= ~IP6_FLOWINFO_TCLASS
;
255 if (strcmp(*argv
, "inherit") == 0)
256 flags
|= IP6_TNL_F_USE_ORIG_TCLASS
;
258 if (get_u8(&uval
, *argv
, 16))
259 invarg("invalid TClass", *argv
);
260 flowinfo
|= htonl((__u32
)uval
<< 20) & IP6_FLOWINFO_TCLASS
;
261 flags
&= ~IP6_TNL_F_USE_ORIG_TCLASS
;
263 } else if (strcmp(*argv
, "flowlabel") == 0 ||
264 strcmp(*argv
, "fl") == 0) {
268 flowinfo
&= ~IP6_FLOWINFO_FLOWLABEL
;
269 if (strcmp(*argv
, "inherit") == 0)
270 flags
|= IP6_TNL_F_USE_ORIG_FLOWLABEL
;
272 if (get_u32(&uval
, *argv
, 16))
273 invarg("invalid Flowlabel", *argv
);
275 invarg("invalid Flowlabel", *argv
);
276 flowinfo
|= htonl(uval
) & IP6_FLOWINFO_FLOWLABEL
;
277 flags
&= ~IP6_TNL_F_USE_ORIG_FLOWLABEL
;
279 } else if (strcmp(*argv
, "dscp") == 0) {
281 if (strcmp(*argv
, "inherit") != 0)
282 invarg("not inherit", *argv
);
283 flags
|= IP6_TNL_F_RCV_DSCP_COPY
;
284 } else if (strcmp(*argv
, "noencap") == 0) {
285 encaptype
= TUNNEL_ENCAP_NONE
;
286 } else if (strcmp(*argv
, "encap") == 0) {
288 if (strcmp(*argv
, "fou") == 0)
289 encaptype
= TUNNEL_ENCAP_FOU
;
290 else if (strcmp(*argv
, "gue") == 0)
291 encaptype
= TUNNEL_ENCAP_GUE
;
292 else if (strcmp(*argv
, "none") == 0)
293 encaptype
= TUNNEL_ENCAP_NONE
;
295 invarg("Invalid encap type.", *argv
);
296 } else if (strcmp(*argv
, "encap-sport") == 0) {
298 if (strcmp(*argv
, "auto") == 0)
300 else if (get_u16(&encapsport
, *argv
, 0))
301 invarg("Invalid source port.", *argv
);
302 } else if (strcmp(*argv
, "encap-dport") == 0) {
304 if (get_u16(&encapdport
, *argv
, 0))
305 invarg("Invalid destination port.", *argv
);
306 } else if (strcmp(*argv
, "encap-csum") == 0) {
307 encapflags
|= TUNNEL_ENCAP_FLAG_CSUM
;
308 } else if (strcmp(*argv
, "noencap-csum") == 0) {
309 encapflags
&= ~TUNNEL_ENCAP_FLAG_CSUM
;
310 } else if (strcmp(*argv
, "encap-udp6-csum") == 0) {
311 encapflags
|= TUNNEL_ENCAP_FLAG_CSUM6
;
312 } else if (strcmp(*argv
, "noencap-udp6-csum") == 0) {
313 encapflags
&= ~TUNNEL_ENCAP_FLAG_CSUM6
;
314 } else if (strcmp(*argv
, "encap-remcsum") == 0) {
315 encapflags
|= TUNNEL_ENCAP_FLAG_REMCSUM
;
316 } else if (strcmp(*argv
, "noencap-remcsum") == 0) {
317 encapflags
&= ~TUNNEL_ENCAP_FLAG_REMCSUM
;
318 } else if (strcmp(*argv
, "fwmark") == 0) {
320 if (strcmp(*argv
, "inherit") == 0) {
321 flags
|= IP6_TNL_F_USE_ORIG_FWMARK
;
324 if (get_u32(&fwmark
, *argv
, 0))
325 invarg("invalid fwmark\n", *argv
);
326 flags
&= ~IP6_TNL_F_USE_ORIG_FWMARK
;
328 } else if (strcmp(*argv
, "encaplimit") == 0) {
330 if (strcmp(*argv
, "none") == 0) {
331 flags
|= IP6_TNL_F_IGN_ENCAP_LIMIT
;
335 if (get_u8(&uval
, *argv
, 0))
336 invarg("invalid ELIM", *argv
);
338 flags
&= ~IP6_TNL_F_IGN_ENCAP_LIMIT
;
340 } else if (strcmp(*argv
, "erspan") == 0) {
342 if (get_u32(&erspan_idx
, *argv
, 0))
343 invarg("invalid erspan index\n", *argv
);
344 if (erspan_idx
& ~((1<<20) - 1) || erspan_idx
== 0)
345 invarg("erspan index must be > 0 and <= 20-bit\n", *argv
);
351 addattr32(n
, 1024, IFLA_GRE_IKEY
, ikey
);
352 addattr32(n
, 1024, IFLA_GRE_OKEY
, okey
);
353 addattr_l(n
, 1024, IFLA_GRE_IFLAGS
, &iflags
, 2);
354 addattr_l(n
, 1024, IFLA_GRE_OFLAGS
, &oflags
, 2);
355 addattr_l(n
, 1024, IFLA_GRE_LOCAL
, &laddr
, sizeof(laddr
));
356 addattr_l(n
, 1024, IFLA_GRE_REMOTE
, &raddr
, sizeof(raddr
));
358 addattr32(n
, 1024, IFLA_GRE_LINK
, link
);
359 addattr_l(n
, 1024, IFLA_GRE_TTL
, &hop_limit
, 1);
360 addattr_l(n
, 1024, IFLA_GRE_ENCAP_LIMIT
, &encap_limit
, 1);
361 addattr_l(n
, 1024, IFLA_GRE_FLOWINFO
, &flowinfo
, 4);
362 addattr32(n
, 1024, IFLA_GRE_FLAGS
, flags
);
363 addattr32(n
, 1024, IFLA_GRE_FWMARK
, fwmark
);
365 addattr32(n
, 1024, IFLA_GRE_ERSPAN_INDEX
, erspan_idx
);
367 addattr16(n
, 1024, IFLA_GRE_ENCAP_TYPE
, encaptype
);
368 addattr16(n
, 1024, IFLA_GRE_ENCAP_FLAGS
, encapflags
);
369 addattr16(n
, 1024, IFLA_GRE_ENCAP_SPORT
, htons(encapsport
));
370 addattr16(n
, 1024, IFLA_GRE_ENCAP_DPORT
, htons(encapdport
));
375 static void gre_print_opt(struct link_util
*lu
, FILE *f
, struct rtattr
*tb
[])
378 const char *local
= "any";
379 const char *remote
= "any";
380 unsigned int iflags
= 0;
381 unsigned int oflags
= 0;
382 unsigned int flags
= 0;
384 struct in6_addr in6_addr_any
= IN6ADDR_ANY_INIT
;
389 if (tb
[IFLA_GRE_FLAGS
])
390 flags
= rta_getattr_u32(tb
[IFLA_GRE_FLAGS
]);
392 if (tb
[IFLA_GRE_FLOWINFO
])
393 flowinfo
= rta_getattr_u32(tb
[IFLA_GRE_FLOWINFO
]);
395 if (tb
[IFLA_GRE_REMOTE
]) {
396 struct in6_addr addr
;
398 memcpy(&addr
, RTA_DATA(tb
[IFLA_GRE_REMOTE
]), sizeof(addr
));
400 if (memcmp(&addr
, &in6_addr_any
, sizeof(addr
)))
401 remote
= format_host(AF_INET6
, sizeof(addr
), &addr
);
404 print_string(PRINT_ANY
, "remote", "remote %s ", remote
);
406 if (tb
[IFLA_GRE_LOCAL
]) {
407 struct in6_addr addr
;
409 memcpy(&addr
, RTA_DATA(tb
[IFLA_GRE_LOCAL
]), sizeof(addr
));
411 if (memcmp(&addr
, &in6_addr_any
, sizeof(addr
)))
412 local
= format_host(AF_INET6
, sizeof(addr
), &addr
);
415 print_string(PRINT_ANY
, "local", "local %s ", local
);
417 if (tb
[IFLA_GRE_LINK
] && rta_getattr_u32(tb
[IFLA_GRE_LINK
])) {
418 unsigned int link
= rta_getattr_u32(tb
[IFLA_GRE_LINK
]);
419 const char *n
= if_indextoname(link
, s2
);
422 print_string(PRINT_ANY
, "link", "dev %s ", n
);
424 print_uint(PRINT_ANY
, "link_index", "dev %u ", link
);
427 if (tb
[IFLA_GRE_TTL
]) {
428 __u8 ttl
= rta_getattr_u8(tb
[IFLA_GRE_TTL
]);
431 print_int(PRINT_ANY
, "ttl", "hoplimit %d ", ttl
);
433 print_int(PRINT_JSON
, "ttl", NULL
, ttl
);
436 if (flags
& IP6_TNL_F_IGN_ENCAP_LIMIT
) {
437 print_bool(PRINT_ANY
,
438 "ip6_tnl_f_ign_encap_limit",
441 } else if (tb
[IFLA_GRE_ENCAP_LIMIT
]) {
442 __u8 val
= rta_getattr_u8(tb
[IFLA_GRE_ENCAP_LIMIT
]);
444 print_uint(PRINT_ANY
, "encap_limit", "encaplimit %u ", val
);
447 if (flags
& IP6_TNL_F_USE_ORIG_FLOWLABEL
) {
448 print_bool(PRINT_ANY
,
449 "ip6_tnl_f_use_orig_flowlabel",
450 "flowlabel inherit ",
452 } else if (tb
[IFLA_GRE_FLOWINFO
]) {
453 __u32 val
= ntohl(flowinfo
& IP6_FLOWINFO_FLOWLABEL
);
455 snprintf(s2
, sizeof(s2
), "0x%05x", val
);
456 print_string(PRINT_ANY
, "flowlabel", "flowlabel %s ", s2
);
459 if (flags
& IP6_TNL_F_USE_ORIG_TCLASS
) {
460 print_bool(PRINT_ANY
,
461 "ip6_tnl_f_use_orig_tclass",
464 } else if (tb
[IFLA_GRE_FLOWINFO
]) {
465 __u32 val
= ntohl(flowinfo
& IP6_FLOWINFO_TCLASS
) >> 20;
467 snprintf(s2
, sizeof(s2
), "0x%02x", val
);
468 print_string(PRINT_ANY
, "tclass", "tclass %s ", s2
);
471 if (flags
& IP6_TNL_F_RCV_DSCP_COPY
)
472 print_bool(PRINT_ANY
,
473 "ip6_tnl_f_rcv_dscp_copy",
477 if (tb
[IFLA_GRE_IFLAGS
])
478 iflags
= rta_getattr_u16(tb
[IFLA_GRE_IFLAGS
]);
480 if (tb
[IFLA_GRE_OFLAGS
])
481 oflags
= rta_getattr_u16(tb
[IFLA_GRE_OFLAGS
]);
483 if ((iflags
& GRE_KEY
) && tb
[IFLA_GRE_IKEY
]) {
484 inet_ntop(AF_INET
, RTA_DATA(tb
[IFLA_GRE_IKEY
]), s2
, sizeof(s2
));
485 print_string(PRINT_ANY
, "ikey", "ikey %s ", s2
);
488 if ((oflags
& GRE_KEY
) && tb
[IFLA_GRE_OKEY
]) {
489 inet_ntop(AF_INET
, RTA_DATA(tb
[IFLA_GRE_OKEY
]), s2
, sizeof(s2
));
490 print_string(PRINT_ANY
, "okey", "okey %s ", s2
);
493 if (iflags
& GRE_SEQ
)
494 print_bool(PRINT_ANY
, "iseq", "iseq ", true);
495 if (oflags
& GRE_SEQ
)
496 print_bool(PRINT_ANY
, "oseq", "oseq ", true);
497 if (iflags
& GRE_CSUM
)
498 print_bool(PRINT_ANY
, "icsum", "icsum ", true);
499 if (oflags
& GRE_CSUM
)
500 print_bool(PRINT_ANY
, "ocsum", "ocsum ", true);
502 if (flags
& IP6_TNL_F_USE_ORIG_FWMARK
)
503 print_bool(PRINT_ANY
,
504 "ip6_tnl_f_use_orig_fwmark",
507 else if (tb
[IFLA_GRE_FWMARK
]) {
508 __u32 fwmark
= rta_getattr_u32(tb
[IFLA_GRE_FWMARK
]);
511 snprintf(s2
, sizeof(s2
), "0x%x", fwmark
);
513 print_string(PRINT_ANY
, "fwmark", "fwmark %s ", s2
);
517 if (tb
[IFLA_GRE_ERSPAN_INDEX
]) {
518 __u32 erspan_idx
= rta_getattr_u32(tb
[IFLA_GRE_ERSPAN_INDEX
]);
519 fprintf(f
, "erspan_index %u ", erspan_idx
);
522 if (tb
[IFLA_GRE_ENCAP_TYPE
] &&
523 rta_getattr_u16(tb
[IFLA_GRE_ENCAP_TYPE
]) != TUNNEL_ENCAP_NONE
) {
524 __u16 type
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_TYPE
]);
525 __u16 flags
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_FLAGS
]);
526 __u16 sport
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_SPORT
]);
527 __u16 dport
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_DPORT
]);
529 open_json_object("encap");
531 print_string(PRINT_FP
, NULL
, "encap ", NULL
);
533 case TUNNEL_ENCAP_FOU
:
534 print_string(PRINT_ANY
, "type", "%s ", "fou");
536 case TUNNEL_ENCAP_GUE
:
537 print_string(PRINT_ANY
, "type", "%s ", "gue");
540 print_null(PRINT_ANY
, "type", "unknown ", NULL
);
544 if (is_json_context()) {
545 print_uint(PRINT_JSON
,
548 sport
? ntohs(sport
) : 0);
549 print_uint(PRINT_JSON
, "dport", NULL
, ntohs(dport
));
550 print_bool(PRINT_JSON
, "csum", NULL
,
551 flags
& TUNNEL_ENCAP_FLAG_CSUM
);
552 print_bool(PRINT_JSON
, "csum6", NULL
,
553 flags
& TUNNEL_ENCAP_FLAG_CSUM6
);
554 print_bool(PRINT_JSON
, "remcsum", NULL
,
555 flags
& TUNNEL_ENCAP_FLAG_REMCSUM
);
559 fputs("encap-sport auto ", f
);
561 fprintf(f
, "encap-sport %u", ntohs(sport
));
563 fprintf(f
, "encap-dport %u ", ntohs(dport
));
565 if (flags
& TUNNEL_ENCAP_FLAG_CSUM
)
566 fputs("encap-csum ", f
);
568 fputs("noencap-csum ", f
);
570 if (flags
& TUNNEL_ENCAP_FLAG_CSUM6
)
571 fputs("encap-csum6 ", f
);
573 fputs("noencap-csum6 ", f
);
575 if (flags
& TUNNEL_ENCAP_FLAG_REMCSUM
)
576 fputs("encap-remcsum ", f
);
578 fputs("noencap-remcsum ", f
);
583 static void gre_print_help(struct link_util
*lu
, int argc
, char **argv
,
589 struct link_util ip6gre_link_util
= {
591 .maxattr
= IFLA_GRE_MAX
,
592 .parse_opt
= gre_parse_opt
,
593 .print_opt
= gre_print_opt
,
594 .print_help
= gre_print_help
,
597 struct link_util ip6gretap_link_util
= {
599 .maxattr
= IFLA_GRE_MAX
,
600 .parse_opt
= gre_parse_opt
,
601 .print_opt
= gre_print_opt
,
602 .print_help
= gre_print_help
,
605 struct link_util ip6erspan_link_util
= {
607 .maxattr
= IFLA_GRE_MAX
,
608 .parse_opt
= gre_parse_opt
,
609 .print_opt
= gre_print_opt
,
610 .print_help
= gre_print_help
,