]> git.proxmox.com Git - mirror_iproute2.git/blob - ip/link_gre.c
Merge branch 'iproute2-master' into iproute2-next
[mirror_iproute2.git] / ip / link_gre.c
1 /*
2 * link_gre.c gre 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: Herbert Xu <herbert@gondor.apana.org.au>
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 "rt_names.h"
22 #include "utils.h"
23 #include "ip_common.h"
24 #include "tunnel.h"
25
26 static void print_usage(FILE *f)
27 {
28 fprintf(f,
29 "Usage: ... { gre | gretap | erspan } [ remote ADDR ]\n"
30 " [ local ADDR ]\n"
31 " [ [i|o]seq ]\n"
32 " [ [i|o]key KEY ]\n"
33 " [ [i|o]csum ]\n"
34 " [ ttl TTL ]\n"
35 " [ tos TOS ]\n"
36 " [ [no]pmtudisc ]\n"
37 " [ [no]ignore-df ]\n"
38 " [ dev PHYS_DEV ]\n"
39 " [ noencap ]\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"
46 " [ external ]\n"
47 " [ fwmark MARK ]\n"
48 " [ erspan_ver version ]\n"
49 " [ erspan IDX ]\n"
50 " [ erspan_dir { ingress | egress } ]\n"
51 " [ erspan_hwid hwid ]\n"
52 " [ external ]\n"
53 "\n"
54 "Where: ADDR := { IP_ADDRESS | any }\n"
55 " TOS := { NUMBER | inherit }\n"
56 " TTL := { 1..255 | inherit }\n"
57 " KEY := { DOTTED_QUAD | NUMBER }\n"
58 " MARK := { 0x0..0xffffffff }\n"
59 );
60 }
61
62 static void usage(void) __attribute__((noreturn));
63 static void usage(void)
64 {
65 print_usage(stderr);
66 exit(-1);
67 }
68
69 static int gre_parse_opt(struct link_util *lu, int argc, char **argv,
70 struct nlmsghdr *n)
71 {
72 struct ifinfomsg *ifi = (struct ifinfomsg *)(n + 1);
73 struct {
74 struct nlmsghdr n;
75 struct ifinfomsg i;
76 } req = {
77 .n.nlmsg_len = NLMSG_LENGTH(sizeof(*ifi)),
78 .n.nlmsg_flags = NLM_F_REQUEST,
79 .n.nlmsg_type = RTM_GETLINK,
80 .i.ifi_family = preferred_family,
81 .i.ifi_index = ifi->ifi_index,
82 };
83 struct nlmsghdr *answer;
84 struct rtattr *tb[IFLA_MAX + 1];
85 struct rtattr *linkinfo[IFLA_INFO_MAX+1];
86 struct rtattr *greinfo[IFLA_GRE_MAX + 1];
87 __u16 iflags = 0;
88 __u16 oflags = 0;
89 __be32 ikey = 0;
90 __be32 okey = 0;
91 unsigned int saddr = 0;
92 unsigned int daddr = 0;
93 unsigned int link = 0;
94 __u8 pmtudisc = 1;
95 __u8 ttl = 0;
96 __u8 tos = 0;
97 int len;
98 __u16 encaptype = 0;
99 __u16 encapflags = 0;
100 __u16 encapsport = 0;
101 __u16 encapdport = 0;
102 __u8 metadata = 0;
103 __u8 ignore_df = 0;
104 __u32 fwmark = 0;
105 __u32 erspan_idx = 0;
106 __u8 erspan_ver = 0;
107 __u8 erspan_dir = 0;
108 __u16 erspan_hwid = 0;
109
110 if (!(n->nlmsg_flags & NLM_F_CREATE)) {
111 if (rtnl_talk(&rth, &req.n, &answer) < 0) {
112 get_failed:
113 fprintf(stderr,
114 "Failed to get existing tunnel info.\n");
115 return -1;
116 }
117
118 len = answer->nlmsg_len;
119 len -= NLMSG_LENGTH(sizeof(*ifi));
120 if (len < 0)
121 goto get_failed;
122
123 parse_rtattr(tb, IFLA_MAX, IFLA_RTA(NLMSG_DATA(answer)), len);
124
125 if (!tb[IFLA_LINKINFO])
126 goto get_failed;
127
128 parse_rtattr_nested(linkinfo, IFLA_INFO_MAX, tb[IFLA_LINKINFO]);
129
130 if (!linkinfo[IFLA_INFO_DATA])
131 goto get_failed;
132
133 parse_rtattr_nested(greinfo, IFLA_GRE_MAX,
134 linkinfo[IFLA_INFO_DATA]);
135
136 if (greinfo[IFLA_GRE_IKEY])
137 ikey = rta_getattr_u32(greinfo[IFLA_GRE_IKEY]);
138
139 if (greinfo[IFLA_GRE_OKEY])
140 okey = rta_getattr_u32(greinfo[IFLA_GRE_OKEY]);
141
142 if (greinfo[IFLA_GRE_IFLAGS])
143 iflags = rta_getattr_u16(greinfo[IFLA_GRE_IFLAGS]);
144
145 if (greinfo[IFLA_GRE_OFLAGS])
146 oflags = rta_getattr_u16(greinfo[IFLA_GRE_OFLAGS]);
147
148 if (greinfo[IFLA_GRE_LOCAL])
149 saddr = rta_getattr_u32(greinfo[IFLA_GRE_LOCAL]);
150
151 if (greinfo[IFLA_GRE_REMOTE])
152 daddr = rta_getattr_u32(greinfo[IFLA_GRE_REMOTE]);
153
154 if (greinfo[IFLA_GRE_PMTUDISC])
155 pmtudisc = rta_getattr_u8(
156 greinfo[IFLA_GRE_PMTUDISC]);
157
158 if (greinfo[IFLA_GRE_TTL])
159 ttl = rta_getattr_u8(greinfo[IFLA_GRE_TTL]);
160
161 if (greinfo[IFLA_GRE_TOS])
162 tos = rta_getattr_u8(greinfo[IFLA_GRE_TOS]);
163
164 if (greinfo[IFLA_GRE_LINK])
165 link = rta_getattr_u32(greinfo[IFLA_GRE_LINK]);
166
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]);
175
176 if (greinfo[IFLA_GRE_COLLECT_METADATA])
177 metadata = 1;
178
179 if (greinfo[IFLA_GRE_IGNORE_DF])
180 ignore_df =
181 !!rta_getattr_u8(greinfo[IFLA_GRE_IGNORE_DF]);
182
183 if (greinfo[IFLA_GRE_FWMARK])
184 fwmark = rta_getattr_u32(greinfo[IFLA_GRE_FWMARK]);
185
186 if (greinfo[IFLA_GRE_ERSPAN_INDEX])
187 erspan_idx = rta_getattr_u32(greinfo[IFLA_GRE_ERSPAN_INDEX]);
188
189 if (greinfo[IFLA_GRE_ERSPAN_VER])
190 erspan_ver = rta_getattr_u8(greinfo[IFLA_GRE_ERSPAN_VER]);
191
192 if (greinfo[IFLA_GRE_ERSPAN_DIR])
193 erspan_dir = rta_getattr_u8(greinfo[IFLA_GRE_ERSPAN_DIR]);
194
195 if (greinfo[IFLA_GRE_ERSPAN_HWID])
196 erspan_hwid = rta_getattr_u16(greinfo[IFLA_GRE_ERSPAN_HWID]);
197
198 free(answer);
199 }
200
201 while (argc > 0) {
202 if (!matches(*argv, "key")) {
203 NEXT_ARG();
204 iflags |= GRE_KEY;
205 oflags |= GRE_KEY;
206 ikey = okey = tnl_parse_key("key", *argv);
207 } else if (!matches(*argv, "ikey")) {
208 NEXT_ARG();
209 iflags |= GRE_KEY;
210 ikey = tnl_parse_key("ikey", *argv);
211 } else if (!matches(*argv, "okey")) {
212 NEXT_ARG();
213 oflags |= GRE_KEY;
214 okey = tnl_parse_key("okey", *argv);
215 } else if (!matches(*argv, "seq")) {
216 iflags |= GRE_SEQ;
217 oflags |= GRE_SEQ;
218 } else if (!matches(*argv, "iseq")) {
219 iflags |= GRE_SEQ;
220 } else if (!matches(*argv, "oseq")) {
221 oflags |= GRE_SEQ;
222 } else if (!matches(*argv, "csum")) {
223 iflags |= GRE_CSUM;
224 oflags |= GRE_CSUM;
225 } else if (!matches(*argv, "icsum")) {
226 iflags |= GRE_CSUM;
227 } else if (!matches(*argv, "ocsum")) {
228 oflags |= GRE_CSUM;
229 } else if (!matches(*argv, "nopmtudisc")) {
230 pmtudisc = 0;
231 } else if (!matches(*argv, "pmtudisc")) {
232 pmtudisc = 1;
233 } else if (!matches(*argv, "remote")) {
234 NEXT_ARG();
235 daddr = get_addr32(*argv);
236 } else if (!matches(*argv, "local")) {
237 NEXT_ARG();
238 saddr = get_addr32(*argv);
239 } else if (!matches(*argv, "dev")) {
240 NEXT_ARG();
241 link = ll_name_to_index(*argv);
242 if (link == 0) {
243 fprintf(stderr, "Cannot find device \"%s\"\n",
244 *argv);
245 exit(-1);
246 }
247 } else if (!matches(*argv, "ttl") ||
248 !matches(*argv, "hoplimit") ||
249 !matches(*argv, "hlim")) {
250 NEXT_ARG();
251 if (strcmp(*argv, "inherit") != 0) {
252 if (get_u8(&ttl, *argv, 0))
253 invarg("invalid TTL\n", *argv);
254 } else
255 ttl = 0;
256 } else if (!matches(*argv, "tos") ||
257 !matches(*argv, "tclass") ||
258 !matches(*argv, "dsfield")) {
259 __u32 uval;
260
261 NEXT_ARG();
262 if (strcmp(*argv, "inherit") != 0) {
263 if (rtnl_dsfield_a2n(&uval, *argv))
264 invarg("bad TOS value", *argv);
265 tos = uval;
266 } else
267 tos = 1;
268 } else if (strcmp(*argv, "noencap") == 0) {
269 encaptype = TUNNEL_ENCAP_NONE;
270 } else if (strcmp(*argv, "encap") == 0) {
271 NEXT_ARG();
272 if (strcmp(*argv, "fou") == 0)
273 encaptype = TUNNEL_ENCAP_FOU;
274 else if (strcmp(*argv, "gue") == 0)
275 encaptype = TUNNEL_ENCAP_GUE;
276 else if (strcmp(*argv, "none") == 0)
277 encaptype = TUNNEL_ENCAP_NONE;
278 else
279 invarg("Invalid encap type.", *argv);
280 } else if (strcmp(*argv, "encap-sport") == 0) {
281 NEXT_ARG();
282 if (strcmp(*argv, "auto") == 0)
283 encapsport = 0;
284 else if (get_u16(&encapsport, *argv, 0))
285 invarg("Invalid source port.", *argv);
286 } else if (strcmp(*argv, "encap-dport") == 0) {
287 NEXT_ARG();
288 if (get_u16(&encapdport, *argv, 0))
289 invarg("Invalid destination port.", *argv);
290 } else if (strcmp(*argv, "encap-csum") == 0) {
291 encapflags |= TUNNEL_ENCAP_FLAG_CSUM;
292 } else if (strcmp(*argv, "noencap-csum") == 0) {
293 encapflags &= ~TUNNEL_ENCAP_FLAG_CSUM;
294 } else if (strcmp(*argv, "encap-udp6-csum") == 0) {
295 encapflags |= TUNNEL_ENCAP_FLAG_CSUM6;
296 } else if (strcmp(*argv, "noencap-udp6-csum") == 0) {
297 encapflags &= ~TUNNEL_ENCAP_FLAG_CSUM6;
298 } else if (strcmp(*argv, "encap-remcsum") == 0) {
299 encapflags |= TUNNEL_ENCAP_FLAG_REMCSUM;
300 } else if (strcmp(*argv, "noencap-remcsum") == 0) {
301 encapflags &= ~TUNNEL_ENCAP_FLAG_REMCSUM;
302 } else if (strcmp(*argv, "external") == 0) {
303 metadata = 1;
304 } else if (strcmp(*argv, "ignore-df") == 0) {
305 ignore_df = 1;
306 } else if (strcmp(*argv, "noignore-df") == 0) {
307 /*
308 *only the lsb is significant, use 2 for presence
309 */
310 ignore_df = 2;
311 } else if (strcmp(*argv, "fwmark") == 0) {
312 NEXT_ARG();
313 if (get_u32(&fwmark, *argv, 0))
314 invarg("invalid fwmark\n", *argv);
315 } else if (strcmp(*argv, "erspan") == 0) {
316 NEXT_ARG();
317 if (get_u32(&erspan_idx, *argv, 0))
318 invarg("invalid erspan index\n", *argv);
319 if (erspan_idx & ~((1<<20) - 1) || erspan_idx == 0)
320 invarg("erspan index must be > 0 and <= 20-bit\n", *argv);
321 } else if (strcmp(*argv, "erspan_ver") == 0) {
322 NEXT_ARG();
323 if (get_u8(&erspan_ver, *argv, 0))
324 invarg("invalid erspan version\n", *argv);
325 if (erspan_ver != 1 && erspan_ver != 2)
326 invarg("erspan version must be 1 or 2\n", *argv);
327 } else if (strcmp(*argv, "erspan_dir") == 0) {
328 NEXT_ARG();
329 if (matches(*argv, "ingress") == 0)
330 erspan_dir = 0;
331 else if (matches(*argv, "egress") == 0)
332 erspan_dir = 1;
333 else
334 invarg("Invalid erspan direction.", *argv);
335 } else if (strcmp(*argv, "erspan_hwid") == 0) {
336 NEXT_ARG();
337 if (get_u16(&erspan_hwid, *argv, 0))
338 invarg("invalid erspan hwid\n", *argv);
339 } else
340 usage();
341 argc--; argv++;
342 }
343
344 if (!ikey && IN_MULTICAST(ntohl(daddr))) {
345 ikey = daddr;
346 iflags |= GRE_KEY;
347 }
348 if (!okey && IN_MULTICAST(ntohl(daddr))) {
349 okey = daddr;
350 oflags |= GRE_KEY;
351 }
352 if (IN_MULTICAST(ntohl(daddr)) && !saddr) {
353 fprintf(stderr, "A broadcast tunnel requires a source address.\n");
354 return -1;
355 }
356
357 if (!metadata) {
358 addattr32(n, 1024, IFLA_GRE_IKEY, ikey);
359 addattr32(n, 1024, IFLA_GRE_OKEY, okey);
360 addattr_l(n, 1024, IFLA_GRE_IFLAGS, &iflags, 2);
361 addattr_l(n, 1024, IFLA_GRE_OFLAGS, &oflags, 2);
362 addattr_l(n, 1024, IFLA_GRE_LOCAL, &saddr, 4);
363 addattr_l(n, 1024, IFLA_GRE_REMOTE, &daddr, 4);
364 addattr_l(n, 1024, IFLA_GRE_PMTUDISC, &pmtudisc, 1);
365 if (link)
366 addattr32(n, 1024, IFLA_GRE_LINK, link);
367 addattr_l(n, 1024, IFLA_GRE_TTL, &ttl, 1);
368 addattr_l(n, 1024, IFLA_GRE_TOS, &tos, 1);
369 addattr32(n, 1024, IFLA_GRE_FWMARK, fwmark);
370 if (erspan_ver) {
371 addattr8(n, 1024, IFLA_GRE_ERSPAN_VER, erspan_ver);
372 if (erspan_ver == 1 && erspan_idx != 0) {
373 addattr32(n, 1024, IFLA_GRE_ERSPAN_INDEX, erspan_idx);
374 } else if (erspan_ver == 2) {
375 addattr8(n, 1024, IFLA_GRE_ERSPAN_DIR, erspan_dir);
376 addattr16(n, 1024, IFLA_GRE_ERSPAN_HWID, erspan_hwid);
377 }
378 }
379 } else {
380 addattr_l(n, 1024, IFLA_GRE_COLLECT_METADATA, NULL, 0);
381 }
382
383 addattr16(n, 1024, IFLA_GRE_ENCAP_TYPE, encaptype);
384 addattr16(n, 1024, IFLA_GRE_ENCAP_FLAGS, encapflags);
385 addattr16(n, 1024, IFLA_GRE_ENCAP_SPORT, htons(encapsport));
386 addattr16(n, 1024, IFLA_GRE_ENCAP_DPORT, htons(encapdport));
387
388 if (ignore_df)
389 addattr8(n, 1024, IFLA_GRE_IGNORE_DF, ignore_df & 1);
390
391 return 0;
392 }
393
394 static void gre_print_direct_opt(FILE *f, struct rtattr *tb[])
395 {
396 char s2[64];
397 const char *local = "any";
398 const char *remote = "any";
399 unsigned int iflags = 0;
400 unsigned int oflags = 0;
401 __u8 ttl = 0;
402 __u8 tos = 0;
403
404 if (tb[IFLA_GRE_REMOTE]) {
405 unsigned int addr = rta_getattr_u32(tb[IFLA_GRE_REMOTE]);
406
407 if (addr)
408 remote = format_host(AF_INET, 4, &addr);
409 }
410
411 print_string(PRINT_ANY, "remote", "remote %s ", remote);
412
413 if (tb[IFLA_GRE_LOCAL]) {
414 unsigned int addr = rta_getattr_u32(tb[IFLA_GRE_LOCAL]);
415
416 if (addr)
417 local = format_host(AF_INET, 4, &addr);
418 }
419
420 print_string(PRINT_ANY, "local", "local %s ", local);
421
422 if (tb[IFLA_GRE_LINK]) {
423 unsigned int link = rta_getattr_u32(tb[IFLA_GRE_LINK]);
424
425 if (link) {
426 print_string(PRINT_ANY, "link", "dev %s ",
427 ll_index_to_name(link));
428 }
429 }
430
431 if (tb[IFLA_GRE_TTL])
432 ttl = rta_getattr_u8(tb[IFLA_GRE_TTL]);
433 if (is_json_context() || ttl)
434 print_uint(PRINT_ANY, "ttl", "ttl %u ", ttl);
435 else
436 print_string(PRINT_FP, NULL, "ttl %s ", "inherit");
437
438 if (tb[IFLA_GRE_TOS])
439 tos = rta_getattr_u8(tb[IFLA_GRE_TOS]);
440 if (tos) {
441 if (is_json_context() || tos != 1)
442 print_0xhex(PRINT_ANY, "tos", "tos 0x%x ", tos);
443 else
444 print_string(PRINT_FP, NULL, "tos %s ", "inherit");
445 }
446
447 if (tb[IFLA_GRE_PMTUDISC]) {
448 if (!rta_getattr_u8(tb[IFLA_GRE_PMTUDISC]))
449 print_bool(PRINT_ANY, "pmtudisc", "nopmtudisc ", false);
450 else
451 print_bool(PRINT_JSON, "pmtudisc", NULL, true);
452 }
453
454 if (tb[IFLA_GRE_IFLAGS])
455 iflags = rta_getattr_u16(tb[IFLA_GRE_IFLAGS]);
456
457 if (tb[IFLA_GRE_OFLAGS])
458 oflags = rta_getattr_u16(tb[IFLA_GRE_OFLAGS]);
459
460 if ((iflags & GRE_KEY) && tb[IFLA_GRE_IKEY]) {
461 inet_ntop(AF_INET, RTA_DATA(tb[IFLA_GRE_IKEY]), s2, sizeof(s2));
462 print_string(PRINT_ANY, "ikey", "ikey %s ", s2);
463 }
464
465 if ((oflags & GRE_KEY) && tb[IFLA_GRE_OKEY]) {
466 inet_ntop(AF_INET, RTA_DATA(tb[IFLA_GRE_OKEY]), s2, sizeof(s2));
467 print_string(PRINT_ANY, "okey", "okey %s ", s2);
468 }
469
470 if (iflags & GRE_SEQ)
471 print_bool(PRINT_ANY, "iseq", "iseq ", true);
472 if (oflags & GRE_SEQ)
473 print_bool(PRINT_ANY, "oseq", "oseq ", true);
474 if (iflags & GRE_CSUM)
475 print_bool(PRINT_ANY, "icsum", "icsum ", true);
476 if (oflags & GRE_CSUM)
477 print_bool(PRINT_ANY, "ocsum", "ocsum ", true);
478
479 if (tb[IFLA_GRE_FWMARK]) {
480 __u32 fwmark = rta_getattr_u32(tb[IFLA_GRE_FWMARK]);
481
482 if (fwmark) {
483 print_0xhex(PRINT_ANY,
484 "fwmark", "fwmark 0x%x ", fwmark);
485 }
486 }
487 }
488
489 static void gre_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[])
490 {
491 if (!tb)
492 return;
493
494 if (!tb[IFLA_GRE_COLLECT_METADATA])
495 gre_print_direct_opt(f, tb);
496 else
497 print_bool(PRINT_ANY, "external", "external ", true);
498
499 if (tb[IFLA_GRE_IGNORE_DF] && rta_getattr_u8(tb[IFLA_GRE_IGNORE_DF]))
500 print_bool(PRINT_ANY, "ignore_df", "ignore-df ", true);
501
502 if (tb[IFLA_GRE_ERSPAN_INDEX]) {
503 __u32 erspan_idx = rta_getattr_u32(tb[IFLA_GRE_ERSPAN_INDEX]);
504
505 print_uint(PRINT_ANY,
506 "erspan_index", "erspan_index %u ", erspan_idx);
507 }
508
509 if (tb[IFLA_GRE_ERSPAN_VER]) {
510 __u8 erspan_ver = rta_getattr_u8(tb[IFLA_GRE_ERSPAN_VER]);
511
512 print_uint(PRINT_ANY, "erspan_ver", "erspan_ver %u ", erspan_ver);
513 }
514
515 if (tb[IFLA_GRE_ERSPAN_DIR]) {
516 __u8 erspan_dir = rta_getattr_u8(tb[IFLA_GRE_ERSPAN_DIR]);
517
518 if (erspan_dir == 0)
519 print_string(PRINT_ANY, "erspan_dir",
520 "erspan_dir ingress ", NULL);
521 else
522 print_string(PRINT_ANY, "erspan_dir",
523 "erspan_dir egress ", NULL);
524 }
525
526 if (tb[IFLA_GRE_ERSPAN_HWID]) {
527 __u16 erspan_hwid = rta_getattr_u16(tb[IFLA_GRE_ERSPAN_HWID]);
528
529 print_hex(PRINT_ANY, "erspan_hwid", "erspan_hwid 0x%x ", erspan_hwid);
530 }
531
532 tnl_print_encap(tb,
533 IFLA_GRE_ENCAP_TYPE,
534 IFLA_GRE_ENCAP_FLAGS,
535 IFLA_GRE_ENCAP_SPORT,
536 IFLA_GRE_ENCAP_DPORT);
537 }
538
539 static void gre_print_help(struct link_util *lu, int argc, char **argv,
540 FILE *f)
541 {
542 print_usage(f);
543 }
544
545 struct link_util gre_link_util = {
546 .id = "gre",
547 .maxattr = IFLA_GRE_MAX,
548 .parse_opt = gre_parse_opt,
549 .print_opt = gre_print_opt,
550 .print_help = gre_print_help,
551 };
552
553 struct link_util gretap_link_util = {
554 .id = "gretap",
555 .maxattr = IFLA_GRE_MAX,
556 .parse_opt = gre_parse_opt,
557 .print_opt = gre_print_opt,
558 .print_help = gre_print_help,
559 };
560
561 struct link_util erspan_link_util = {
562 .id = "erspan",
563 .maxattr = IFLA_GRE_MAX,
564 .parse_opt = gre_parse_opt,
565 .print_opt = gre_print_opt,
566 .print_help = gre_print_help,
567 };