diff options
author | Susant Sahani <susant@redhat.com> | 2014-05-12 10:48:24 +0530 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-05-12 17:37:12 +0200 |
commit | 7951dea20911969287878e6897b3eca348721ade (patch) | |
tree | 420a101f2a4e3912b9d078bcf16bf06e8ff94742 /src/network/networkd.h | |
parent | 1727a595225132eb73ec134b6979d9c713b42e8c (diff) |
networkd: introduce ipip tunnel
This patch enables basic ipip tunnel support.
It works with kernel module ipip
example conf:
file: ipip.netdev
[NetDev]
Name=ipip-tun
Kind=ipip
MTUBytes=1480
[Tunnel]
Local=192.168.223.238
Remote=192.169.224.239
TTL=64
file: ipip.network
[Match]
Name=em1
[Network]
Tunnel=ipip-tun
[tomegun:
- drop unused variable
- take ref when enslaving]
Diffstat (limited to 'src/network/networkd.h')
-rw-r--r-- | src/network/networkd.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/network/networkd.h b/src/network/networkd.h index ec2e111a7b..e32cf5d9b2 100644 --- a/src/network/networkd.h +++ b/src/network/networkd.h @@ -68,6 +68,9 @@ typedef enum NetDevKind { NETDEV_KIND_BOND, NETDEV_KIND_VLAN, NETDEV_KIND_MACVLAN, + NETDEV_KIND_IPIP, + NETDEV_KIND_GRE, + NETDEV_KIND_SIT, _NETDEV_KIND_MAX, _NETDEV_KIND_INVALID = -1 } NetDevKind; @@ -95,6 +98,7 @@ struct NetDev { char *description; char *name; + size_t mtu; NetDevKind kind; uint64_t vlanid; @@ -103,6 +107,11 @@ struct NetDev { int ifindex; NetDevState state; + unsigned tunnel_ttl; + unsigned tunnel_tos; + struct in_addr tunnel_local; + struct in_addr tunnel_remote; + LIST_HEAD(netdev_enslave_callback, callbacks); }; @@ -124,6 +133,7 @@ struct Network { char *description; NetDev *bridge; NetDev *bond; + NetDev *tunnel; Hashmap *vlans; Hashmap *macvlans; bool dhcp; @@ -246,6 +256,7 @@ struct Manager { LIST_HEAD(Network, networks); usec_t network_dirs_ts_usec; + struct kmod_ctx *kmod_ctx; }; extern const char* const network_dirs[]; @@ -266,6 +277,7 @@ int manager_bus_listen(Manager *m); int manager_update_resolv_conf(Manager *m); int manager_save(Manager *m); +int manager_init_kmod_ctx(Manager *m); DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free); #define _cleanup_manager_free_ _cleanup_(manager_freep) @@ -284,6 +296,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(NetDev*, netdev_unref); int netdev_get(Manager *manager, const char *name, NetDev **ret); int netdev_set_ifindex(NetDev *netdev, sd_rtnl_message *newlink); int netdev_enslave(NetDev *netdev, Link *link, sd_rtnl_message_handler_t cb); +int netdev_create_tunnel(Link *link, sd_rtnl_message_handler_t callback); const char *netdev_kind_to_string(NetDevKind d) _const_; NetDevKind netdev_kind_from_string(const char *d) _pure_; @@ -316,6 +329,28 @@ int config_parse_netdev(const char *unit, const char *filename, unsigned line, const char *section, unsigned section_line, const char *lvalue, int ltype, const char *rvalue, void *data, void *userdata); +int config_parse_tunnel(const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata); + +int config_parse_tunnel_address(const char *unit, + const char *filename, + unsigned line, + const char *section, + unsigned section_line, + const char *lvalue, + int ltype, + const char *rvalue, + void *data, + void *userdata); + /* gperf */ const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, unsigned length); |