]> git.proxmox.com Git - mirror_iproute2.git/blob - ip/tunnel.h
Merge branch 'main' into next
[mirror_iproute2.git] / ip / tunnel.h
1 /*
2 * Copyright (C)2006 USAGI/WIDE Project
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, see <http://www.gnu.org/licenses>.
16 */
17 /*
18 * Author:
19 * Masahide NAKAMURA @USAGI
20 */
21 #ifndef __TUNNEL_H__
22 #define __TUNNEL_H__ 1
23
24 #include <stdbool.h>
25 #include <linux/types.h>
26
27 struct rtattr;
28 struct ifinfomsg;
29
30 extern struct rtnl_handle rth;
31
32 struct tnl_print_nlmsg_info {
33 const struct ifinfomsg *ifi;
34 const void *p1;
35 void *p2;
36
37 void (*init)(const struct tnl_print_nlmsg_info *info);
38 bool (*match)(const struct tnl_print_nlmsg_info *info);
39 void (*print)(const void *t);
40 };
41
42 int do_tunnels_list(struct tnl_print_nlmsg_info *info);
43
44 const char *tnl_strproto(__u8 proto);
45
46 int tnl_get_ioctl(const char *basedev, void *p);
47 int tnl_add_ioctl(int cmd, const char *basedev, const char *name, void *p);
48 int tnl_del_ioctl(const char *basedev, const char *name, void *p);
49 int tnl_prl_ioctl(int cmd, const char *name, void *p);
50 int tnl_6rd_ioctl(int cmd, const char *name, void *p);
51 int tnl_ioctl_get_6rd(const char *name, void *p);
52 __be32 tnl_parse_key(const char *name, const char *key);
53 void tnl_print_encap(struct rtattr *tb[],
54 int encap_type, int encap_flags,
55 int encap_sport, int encap_dport);
56 void tnl_print_endpoint(const char *name,
57 const struct rtattr *rta, int family);
58 void tnl_print_gre_flags(__u8 proto,
59 __be16 i_flags, __be16 o_flags,
60 __be32 i_key, __be32 o_key);
61
62 #endif