OpenVPN
sitnl.h
Go to the documentation of this file.
1 /*
2  * Simplified Interface To NetLink
3  *
4  * Copyright (C) 2016-2021 Antonio Quartulli <a@unstable.cc>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2
8  * as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program (see the file COPYING included with this
17  * distribution); if not, write to the Free Software Foundation, Inc.,
18  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */
20 
21 #ifndef SITNL_H_
22 #define SITNL_H_
23 
24 #ifdef TARGET_LINUX
25 
26 #include <stdbool.h>
27 #include <netinet/in.h>
28 
37 int sitnl_iface_up(const char *iface, bool up);
38 
47 int sitnl_iface_mtu_set(const char *iface, uint32_t mtu);
48 
59 int sitnl_addr_v4_add(const char *iface, const in_addr_t *addr, int prefixlen,
60  const in_addr_t *broadcast);
61 
72 int sitnl_addr_v6_add(const char *iface, const struct in6_addr *addr,
73  int prefixlen);
74 
83 int sitnl_addr_v4_del(const char *iface, const in_addr_t *addr, int prefixlen);
84 
93 int sitnl_addr_v6_del(const char *iface, const struct in6_addr *addr,
94  int prefixlen);
95 
105 int sitnl_addr_ptp_v4_add(const char *iface, const in_addr_t *local,
106  const in_addr_t *remote);
107 
116 int sitnl_addr_ptp_v4_del(const char *iface, const in_addr_t *local);
117 
118 
132 int sitnl_route_v4_add(const in_addr_t *dst, int prefixlen,
133  const in_addr_t *gw, const char *iface, uint32_t table,
134  int metric);
135 
149 int sitnl_route_v6_add(const struct in6_addr *dst, int prefixlen,
150  const struct in6_addr *gw, const char *iface,
151  uint32_t table, int metric);
152 
166 int sitnl_route_v4_del(const in_addr_t *dst, int prefixlen,
167  const in_addr_t *gw, const char *iface, uint32_t table,
168  int metric);
169 
183 int sitnl_route_v6_del(const struct in6_addr *dst, int prefixlen,
184  const struct in6_addr *gw, const char *iface,
185  uint32_t table, int metric);
186 
198 int sitnl_route_v4_best_gw(const in_addr_t *dst, int prefixlen,
199  in_addr_t *best_gw, char *best_iface);
200 
212 int sitnl_route_v6_best_gw(const struct in6_addr *dst, int prefixlen,
213  struct in6_addr *best_gw, char *best_iface);
214 
215 #endif /* TARGET_LINUX */
216 
217 #endif /* SITNL_H_ */
static char * iface
#define in_addr_t
Definition: config-msvc.h:103