2 * link_gre.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: Herbert Xu <herbert@gondor.apana.org.au>
15 #include <sys/types.h>
16 #include <sys/socket.h>
17 #include <arpa/inet.h>
20 #include <linux/if_tunnel.h>
23 #include "ip_common.h"
26 static void print_usage(FILE *f
)
29 "Usage: ... { gre | gretap | erspan } [ remote ADDR ]\n"
37 " [ [no]ignore-df ]\n"
40 " [ encap { fou | gue | none } ]\n"
41 " [ encap-sport PORT ]\n"
42 " [ encap-dport PORT ]\n"
43 " [ [no]encap-csum ]\n"
44 " [ [no]encap-csum6 ]\n"
45 " [ [no]encap-remcsum ]\n"
47 " [ erspan_ver version ]\n"
49 " [ erspan_dir { ingress | egress } ]\n"
50 " [ erspan_hwid hwid ]\n"
53 "Where: ADDR := { IP_ADDRESS | any }\n"
54 " TOS := { NUMBER | inherit }\n"
55 " TTL := { 1..255 | inherit }\n"
56 " KEY := { DOTTED_QUAD | NUMBER }\n"
57 " MARK := { 0x0..0xffffffff }\n"
61 static void usage(void) __attribute__((noreturn
));
62 static void usage(void)
68 static int gre_parse_opt(struct link_util
*lu
, int argc
, char **argv
,
71 struct ifinfomsg
*ifi
= (struct ifinfomsg
*)(n
+ 1);
76 .n
.nlmsg_len
= NLMSG_LENGTH(sizeof(*ifi
)),
77 .n
.nlmsg_flags
= NLM_F_REQUEST
,
78 .n
.nlmsg_type
= RTM_GETLINK
,
79 .i
.ifi_family
= preferred_family
,
80 .i
.ifi_index
= ifi
->ifi_index
,
82 struct nlmsghdr
*answer
= NULL
;
83 struct rtattr
*tb
[IFLA_MAX
+ 1];
84 struct rtattr
*linkinfo
[IFLA_INFO_MAX
+1];
85 struct rtattr
*greinfo
[IFLA_GRE_MAX
+ 1];
88 unsigned int ikey
= 0;
89 unsigned int okey
= 0;
90 unsigned int saddr
= 0;
91 unsigned int daddr
= 0;
92 unsigned int link
= 0;
100 __u16 encapdport
= 0;
104 __u32 erspan_idx
= 0;
107 __u16 erspan_hwid
= 0;
109 if (!(n
->nlmsg_flags
& NLM_F_CREATE
)) {
110 if (rtnl_talk(&rth
, &req
.n
, &answer
) < 0) {
113 "Failed to get existing tunnel info.\n");
118 len
= answer
->nlmsg_len
;
119 len
-= NLMSG_LENGTH(sizeof(*ifi
));
123 parse_rtattr(tb
, IFLA_MAX
, IFLA_RTA(NLMSG_DATA(answer
)), len
);
125 if (!tb
[IFLA_LINKINFO
])
128 parse_rtattr_nested(linkinfo
, IFLA_INFO_MAX
, tb
[IFLA_LINKINFO
]);
130 if (!linkinfo
[IFLA_INFO_DATA
])
133 parse_rtattr_nested(greinfo
, IFLA_GRE_MAX
,
134 linkinfo
[IFLA_INFO_DATA
]);
136 if (greinfo
[IFLA_GRE_IKEY
])
137 ikey
= rta_getattr_u32(greinfo
[IFLA_GRE_IKEY
]);
139 if (greinfo
[IFLA_GRE_OKEY
])
140 okey
= rta_getattr_u32(greinfo
[IFLA_GRE_OKEY
]);
142 if (greinfo
[IFLA_GRE_IFLAGS
])
143 iflags
= rta_getattr_u16(greinfo
[IFLA_GRE_IFLAGS
]);
145 if (greinfo
[IFLA_GRE_OFLAGS
])
146 oflags
= rta_getattr_u16(greinfo
[IFLA_GRE_OFLAGS
]);
148 if (greinfo
[IFLA_GRE_LOCAL
])
149 saddr
= rta_getattr_u32(greinfo
[IFLA_GRE_LOCAL
]);
151 if (greinfo
[IFLA_GRE_REMOTE
])
152 daddr
= rta_getattr_u32(greinfo
[IFLA_GRE_REMOTE
]);
154 if (greinfo
[IFLA_GRE_PMTUDISC
])
155 pmtudisc
= rta_getattr_u8(
156 greinfo
[IFLA_GRE_PMTUDISC
]);
158 if (greinfo
[IFLA_GRE_TTL
])
159 ttl
= rta_getattr_u8(greinfo
[IFLA_GRE_TTL
]);
161 if (greinfo
[IFLA_GRE_TOS
])
162 tos
= rta_getattr_u8(greinfo
[IFLA_GRE_TOS
]);
164 if (greinfo
[IFLA_GRE_LINK
])
165 link
= rta_getattr_u8(greinfo
[IFLA_GRE_LINK
]);
167 if (greinfo
[IFLA_GRE_ENCAP_TYPE
])
168 encaptype
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_TYPE
]);
169 if (greinfo
[IFLA_GRE_ENCAP_FLAGS
])
170 encapflags
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_FLAGS
]);
171 if (greinfo
[IFLA_GRE_ENCAP_SPORT
])
172 encapsport
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_SPORT
]);
173 if (greinfo
[IFLA_GRE_ENCAP_DPORT
])
174 encapdport
= rta_getattr_u16(greinfo
[IFLA_GRE_ENCAP_DPORT
]);
176 if (greinfo
[IFLA_GRE_COLLECT_METADATA
])
179 if (greinfo
[IFLA_GRE_IGNORE_DF
])
181 !!rta_getattr_u8(greinfo
[IFLA_GRE_IGNORE_DF
]);
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
]);
189 if (greinfo
[IFLA_GRE_ERSPAN_VER
])
190 erspan_ver
= rta_getattr_u8(greinfo
[IFLA_GRE_ERSPAN_VER
]);
192 if (greinfo
[IFLA_GRE_ERSPAN_DIR
])
193 erspan_dir
= rta_getattr_u8(greinfo
[IFLA_GRE_ERSPAN_DIR
]);
195 if (greinfo
[IFLA_GRE_ERSPAN_HWID
])
196 erspan_hwid
= rta_getattr_u16(greinfo
[IFLA_GRE_ERSPAN_HWID
]);
202 if (!matches(*argv
, "key")) {
208 if (strchr(*argv
, '.'))
209 uval
= get_addr32(*argv
);
211 if (get_unsigned(&uval
, *argv
, 0) < 0) {
213 "Invalid value for \"key\": \"%s\"; it should be an unsigned integer\n", *argv
);
220 } else if (!matches(*argv
, "ikey")) {
225 if (strchr(*argv
, '.'))
226 uval
= get_addr32(*argv
);
228 if (get_unsigned(&uval
, *argv
, 0) < 0) {
229 fprintf(stderr
, "invalid value for \"ikey\": \"%s\"; it should be an unsigned integer\n", *argv
);
235 } else if (!matches(*argv
, "okey")) {
240 if (strchr(*argv
, '.'))
241 uval
= get_addr32(*argv
);
243 if (get_unsigned(&uval
, *argv
, 0) < 0) {
244 fprintf(stderr
, "invalid value for \"okey\": \"%s\"; it should be an unsigned integer\n", *argv
);
250 } else if (!matches(*argv
, "seq")) {
253 } else if (!matches(*argv
, "iseq")) {
255 } else if (!matches(*argv
, "oseq")) {
257 } else if (!matches(*argv
, "csum")) {
260 } else if (!matches(*argv
, "icsum")) {
262 } else if (!matches(*argv
, "ocsum")) {
264 } else if (!matches(*argv
, "nopmtudisc")) {
266 } else if (!matches(*argv
, "pmtudisc")) {
268 } else if (!matches(*argv
, "remote")) {
270 if (strcmp(*argv
, "any"))
271 daddr
= get_addr32(*argv
);
272 } else if (!matches(*argv
, "local")) {
274 if (strcmp(*argv
, "any"))
275 saddr
= get_addr32(*argv
);
276 } else if (!matches(*argv
, "dev")) {
278 link
= if_nametoindex(*argv
);
280 fprintf(stderr
, "Cannot find device \"%s\"\n",
284 } else if (!matches(*argv
, "ttl") ||
285 !matches(*argv
, "hoplimit")) {
289 if (strcmp(*argv
, "inherit") != 0) {
290 if (get_unsigned(&uval
, *argv
, 0))
291 invarg("invalid TTL\n", *argv
);
293 invarg("TTL must be <= 255\n", *argv
);
297 } else if (!matches(*argv
, "tos") ||
298 !matches(*argv
, "tclass") ||
299 !matches(*argv
, "dsfield")) {
303 if (strcmp(*argv
, "inherit") != 0) {
304 if (rtnl_dsfield_a2n(&uval
, *argv
))
305 invarg("bad TOS value", *argv
);
309 } else if (strcmp(*argv
, "noencap") == 0) {
310 encaptype
= TUNNEL_ENCAP_NONE
;
311 } else if (strcmp(*argv
, "encap") == 0) {
313 if (strcmp(*argv
, "fou") == 0)
314 encaptype
= TUNNEL_ENCAP_FOU
;
315 else if (strcmp(*argv
, "gue") == 0)
316 encaptype
= TUNNEL_ENCAP_GUE
;
317 else if (strcmp(*argv
, "none") == 0)
318 encaptype
= TUNNEL_ENCAP_NONE
;
320 invarg("Invalid encap type.", *argv
);
321 } else if (strcmp(*argv
, "encap-sport") == 0) {
323 if (strcmp(*argv
, "auto") == 0)
325 else if (get_u16(&encapsport
, *argv
, 0))
326 invarg("Invalid source port.", *argv
);
327 } else if (strcmp(*argv
, "encap-dport") == 0) {
329 if (get_u16(&encapdport
, *argv
, 0))
330 invarg("Invalid destination port.", *argv
);
331 } else if (strcmp(*argv
, "encap-csum") == 0) {
332 encapflags
|= TUNNEL_ENCAP_FLAG_CSUM
;
333 } else if (strcmp(*argv
, "noencap-csum") == 0) {
334 encapflags
&= ~TUNNEL_ENCAP_FLAG_CSUM
;
335 } else if (strcmp(*argv
, "encap-udp6-csum") == 0) {
336 encapflags
|= TUNNEL_ENCAP_FLAG_CSUM6
;
337 } else if (strcmp(*argv
, "noencap-udp6-csum") == 0) {
338 encapflags
|= ~TUNNEL_ENCAP_FLAG_CSUM6
;
339 } else if (strcmp(*argv
, "encap-remcsum") == 0) {
340 encapflags
|= TUNNEL_ENCAP_FLAG_REMCSUM
;
341 } else if (strcmp(*argv
, "noencap-remcsum") == 0) {
342 encapflags
|= ~TUNNEL_ENCAP_FLAG_REMCSUM
;
343 } else if (strcmp(*argv
, "external") == 0) {
345 } else if (strcmp(*argv
, "ignore-df") == 0) {
347 } else if (strcmp(*argv
, "noignore-df") == 0) {
349 *only the lsb is significant, use 2 for presence
352 } else if (strcmp(*argv
, "fwmark") == 0) {
354 if (get_u32(&fwmark
, *argv
, 0))
355 invarg("invalid fwmark\n", *argv
);
356 } else if (strcmp(*argv
, "erspan") == 0) {
358 if (get_u32(&erspan_idx
, *argv
, 0))
359 invarg("invalid erspan index\n", *argv
);
360 if (erspan_idx
& ~((1<<20) - 1) || erspan_idx
== 0)
361 invarg("erspan index must be > 0 and <= 20-bit\n", *argv
);
362 } else if (strcmp(*argv
, "erspan_ver") == 0) {
364 if (get_u8(&erspan_ver
, *argv
, 0))
365 invarg("invalid erspan version\n", *argv
);
366 if (erspan_ver
!= 1 && erspan_ver
!= 2)
367 invarg("erspan version must be 1 or 2\n", *argv
);
368 } else if (strcmp(*argv
, "erspan_dir") == 0) {
370 if (matches(*argv
, "ingress") == 0)
372 else if (matches(*argv
, "egress") == 0)
375 invarg("Invalid erspan direction.", *argv
);
376 } else if (strcmp(*argv
, "erspan_hwid") == 0) {
378 if (get_u16(&erspan_hwid
, *argv
, 0))
379 invarg("invalid erspan hwid\n", *argv
);
385 if (!ikey
&& IN_MULTICAST(ntohl(daddr
))) {
389 if (!okey
&& IN_MULTICAST(ntohl(daddr
))) {
393 if (IN_MULTICAST(ntohl(daddr
)) && !saddr
) {
394 fprintf(stderr
, "A broadcast tunnel requires a source address.\n");
399 addattr32(n
, 1024, IFLA_GRE_IKEY
, ikey
);
400 addattr32(n
, 1024, IFLA_GRE_OKEY
, okey
);
401 addattr_l(n
, 1024, IFLA_GRE_IFLAGS
, &iflags
, 2);
402 addattr_l(n
, 1024, IFLA_GRE_OFLAGS
, &oflags
, 2);
403 addattr_l(n
, 1024, IFLA_GRE_LOCAL
, &saddr
, 4);
404 addattr_l(n
, 1024, IFLA_GRE_REMOTE
, &daddr
, 4);
405 addattr_l(n
, 1024, IFLA_GRE_PMTUDISC
, &pmtudisc
, 1);
407 addattr32(n
, 1024, IFLA_GRE_LINK
, link
);
408 addattr_l(n
, 1024, IFLA_GRE_TTL
, &ttl
, 1);
409 addattr_l(n
, 1024, IFLA_GRE_TOS
, &tos
, 1);
410 addattr32(n
, 1024, IFLA_GRE_FWMARK
, fwmark
);
412 addattr8(n
, 1024, IFLA_GRE_ERSPAN_VER
, erspan_ver
);
413 if (erspan_ver
== 1 && erspan_idx
!= 0) {
414 addattr32(n
, 1024, IFLA_GRE_ERSPAN_INDEX
, erspan_idx
);
415 } else if (erspan_ver
== 2) {
416 addattr8(n
, 1024, IFLA_GRE_ERSPAN_DIR
, erspan_dir
);
417 addattr16(n
, 1024, IFLA_GRE_ERSPAN_HWID
, erspan_hwid
);
421 addattr_l(n
, 1024, IFLA_GRE_COLLECT_METADATA
, NULL
, 0);
424 addattr16(n
, 1024, IFLA_GRE_ENCAP_TYPE
, encaptype
);
425 addattr16(n
, 1024, IFLA_GRE_ENCAP_FLAGS
, encapflags
);
426 addattr16(n
, 1024, IFLA_GRE_ENCAP_SPORT
, htons(encapsport
));
427 addattr16(n
, 1024, IFLA_GRE_ENCAP_DPORT
, htons(encapdport
));
430 addattr8(n
, 1024, IFLA_GRE_IGNORE_DF
, ignore_df
& 1);
435 static void gre_print_direct_opt(FILE *f
, struct rtattr
*tb
[])
438 const char *local
= "any";
439 const char *remote
= "any";
440 unsigned int iflags
= 0;
441 unsigned int oflags
= 0;
443 if (tb
[IFLA_GRE_REMOTE
]) {
444 unsigned int addr
= rta_getattr_u32(tb
[IFLA_GRE_REMOTE
]);
447 remote
= format_host(AF_INET
, 4, &addr
);
450 print_string(PRINT_ANY
, "remote", "remote %s ", remote
);
452 if (tb
[IFLA_GRE_LOCAL
]) {
453 unsigned int addr
= rta_getattr_u32(tb
[IFLA_GRE_LOCAL
]);
456 local
= format_host(AF_INET
, 4, &addr
);
459 print_string(PRINT_ANY
, "local", "local %s ", local
);
461 if (tb
[IFLA_GRE_LINK
] && rta_getattr_u32(tb
[IFLA_GRE_LINK
])) {
462 unsigned int link
= rta_getattr_u32(tb
[IFLA_GRE_LINK
]);
463 const char *n
= if_indextoname(link
, s2
);
466 print_string(PRINT_ANY
, "link", "dev %s ", n
);
468 print_uint(PRINT_ANY
, "link_index", "dev %u ", link
);
471 if (tb
[IFLA_GRE_TTL
]) {
472 __u8 ttl
= rta_getattr_u8(tb
[IFLA_GRE_TTL
]);
475 print_int(PRINT_ANY
, "ttl", "ttl %d ", ttl
);
477 print_int(PRINT_JSON
, "ttl", NULL
, ttl
);
479 print_string(PRINT_FP
, NULL
, "ttl %s ", "inherit");
482 if (tb
[IFLA_GRE_TOS
] && rta_getattr_u8(tb
[IFLA_GRE_TOS
])) {
483 int tos
= rta_getattr_u8(tb
[IFLA_GRE_TOS
]);
485 if (is_json_context()) {
488 snprintf(b1
, sizeof(b1
), "0x%x", tos
);
489 print_string(PRINT_JSON
, "tos", NULL
, b1
);
493 fputs("inherit ", f
);
495 fprintf(f
, "0x%x ", tos
);
499 if (tb
[IFLA_GRE_PMTUDISC
]) {
500 if (!rta_getattr_u8(tb
[IFLA_GRE_PMTUDISC
]))
501 print_bool(PRINT_ANY
, "pmtudisc", "nopmtudisc ", false);
503 print_bool(PRINT_JSON
, "pmtudisc", NULL
, true);
506 if (tb
[IFLA_GRE_IFLAGS
])
507 iflags
= rta_getattr_u16(tb
[IFLA_GRE_IFLAGS
]);
509 if (tb
[IFLA_GRE_OFLAGS
])
510 oflags
= rta_getattr_u16(tb
[IFLA_GRE_OFLAGS
]);
512 if ((iflags
& GRE_KEY
) && tb
[IFLA_GRE_IKEY
]) {
513 inet_ntop(AF_INET
, RTA_DATA(tb
[IFLA_GRE_IKEY
]), s2
, sizeof(s2
));
514 print_string(PRINT_ANY
, "ikey", "ikey %s ", s2
);
517 if ((oflags
& GRE_KEY
) && tb
[IFLA_GRE_OKEY
]) {
518 inet_ntop(AF_INET
, RTA_DATA(tb
[IFLA_GRE_OKEY
]), s2
, sizeof(s2
));
519 print_string(PRINT_ANY
, "okey", "okey %s ", s2
);
522 if (iflags
& GRE_SEQ
)
523 print_bool(PRINT_ANY
, "iseq", "iseq ", true);
524 if (oflags
& GRE_SEQ
)
525 print_bool(PRINT_ANY
, "oseq", "oseq ", true);
526 if (iflags
& GRE_CSUM
)
527 print_bool(PRINT_ANY
, "icsum", "icsum ", true);
528 if (oflags
& GRE_CSUM
)
529 print_bool(PRINT_ANY
, "ocsum", "ocsum ", true);
531 if (tb
[IFLA_GRE_FWMARK
]) {
532 __u32 fwmark
= rta_getattr_u32(tb
[IFLA_GRE_FWMARK
]);
535 snprintf(s2
, sizeof(s2
), "0x%x", fwmark
);
537 print_string(PRINT_ANY
, "fwmark", "fwmark %s ", s2
);
542 static void gre_print_opt(struct link_util
*lu
, FILE *f
, struct rtattr
*tb
[])
547 if (!tb
[IFLA_GRE_COLLECT_METADATA
])
548 gre_print_direct_opt(f
, tb
);
550 print_bool(PRINT_ANY
, "external", "external ", true);
552 if (tb
[IFLA_GRE_IGNORE_DF
] && rta_getattr_u8(tb
[IFLA_GRE_IGNORE_DF
]))
553 print_bool(PRINT_ANY
, "ignore_df", "ignore-df ", true);
555 if (tb
[IFLA_GRE_ERSPAN_INDEX
]) {
556 __u32 erspan_idx
= rta_getattr_u32(tb
[IFLA_GRE_ERSPAN_INDEX
]);
558 print_uint(PRINT_ANY
, "erspan_index", "erspan_index %u ", erspan_idx
);
561 if (tb
[IFLA_GRE_ERSPAN_VER
]) {
562 __u8 erspan_ver
= rta_getattr_u8(tb
[IFLA_GRE_ERSPAN_VER
]);
564 print_uint(PRINT_ANY
, "erspan_ver", "erspan_ver %u ", erspan_ver
);
567 if (tb
[IFLA_GRE_ERSPAN_DIR
]) {
568 __u8 erspan_dir
= rta_getattr_u8(tb
[IFLA_GRE_ERSPAN_DIR
]);
571 print_string(PRINT_ANY
, "erspan_dir",
572 "erspan_dir ingress ", NULL
);
574 print_string(PRINT_ANY
, "erspan_dir",
575 "erspan_dir egress ", NULL
);
578 if (tb
[IFLA_GRE_ERSPAN_HWID
]) {
579 __u16 erspan_hwid
= rta_getattr_u16(tb
[IFLA_GRE_ERSPAN_HWID
]);
581 print_hex(PRINT_ANY
, "erspan_hwid", "erspan_hwid 0x%x ", erspan_hwid
);
584 if (tb
[IFLA_GRE_ENCAP_TYPE
] &&
585 rta_getattr_u16(tb
[IFLA_GRE_ENCAP_TYPE
]) != TUNNEL_ENCAP_NONE
) {
586 __u16 type
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_TYPE
]);
587 __u16 flags
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_FLAGS
]);
588 __u16 sport
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_SPORT
]);
589 __u16 dport
= rta_getattr_u16(tb
[IFLA_GRE_ENCAP_DPORT
]);
592 open_json_object("encap");
593 print_string(PRINT_FP
, NULL
, "encap ", NULL
);
596 case TUNNEL_ENCAP_FOU
:
597 print_string(PRINT_ANY
, "type", "%s ", "fou");
599 case TUNNEL_ENCAP_GUE
:
600 print_string(PRINT_ANY
, "type", "%s ", "gue");
603 print_null(PRINT_ANY
, "type", "%s ", "unknown");
607 if (is_json_context()) {
608 print_uint(PRINT_JSON
,
611 sport
? ntohs(sport
) : 0);
612 print_uint(PRINT_JSON
, "dport", NULL
, ntohs(dport
));
614 print_bool(PRINT_JSON
,
617 flags
& TUNNEL_ENCAP_FLAG_CSUM
);
619 print_bool(PRINT_JSON
,
622 flags
& TUNNEL_ENCAP_FLAG_CSUM6
);
624 print_bool(PRINT_JSON
,
627 flags
& TUNNEL_ENCAP_FLAG_REMCSUM
);
632 fputs("encap-sport auto ", f
);
634 fprintf(f
, "encap-sport %u", ntohs(sport
));
636 fprintf(f
, "encap-dport %u ", ntohs(dport
));
638 if (flags
& TUNNEL_ENCAP_FLAG_CSUM
)
639 fputs("encap-csum ", f
);
641 fputs("noencap-csum ", f
);
643 if (flags
& TUNNEL_ENCAP_FLAG_CSUM6
)
644 fputs("encap-csum6 ", f
);
646 fputs("noencap-csum6 ", f
);
648 if (flags
& TUNNEL_ENCAP_FLAG_REMCSUM
)
649 fputs("encap-remcsum ", f
);
651 fputs("noencap-remcsum ", f
);
656 static void gre_print_help(struct link_util
*lu
, int argc
, char **argv
,
662 struct link_util gre_link_util
= {
664 .maxattr
= IFLA_GRE_MAX
,
665 .parse_opt
= gre_parse_opt
,
666 .print_opt
= gre_print_opt
,
667 .print_help
= gre_print_help
,
670 struct link_util gretap_link_util
= {
672 .maxattr
= IFLA_GRE_MAX
,
673 .parse_opt
= gre_parse_opt
,
674 .print_opt
= gre_print_opt
,
675 .print_help
= gre_print_help
,
678 struct link_util erspan_link_util
= {
680 .maxattr
= IFLA_GRE_MAX
,
681 .parse_opt
= gre_parse_opt
,
682 .print_opt
= gre_print_opt
,
683 .print_help
= gre_print_help
,