summaryrefslogtreecommitdiffstats
path: root/include/net/udp_tunnel.h
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-07-13 19:49:37 -0700
committerDavid S. Miller <davem@davemloft.net>2014-07-14 16:12:15 -0700
commit8024e02879ddd5042be02c70557f74cdc70b44b4 (patch)
treebd11e8dae8b5d397c4d9e43e0af3c9330de24658 /include/net/udp_tunnel.h
parent39b1c29b7bb932d7c2bd5680a927f269944bdfda (diff)
downloadlinux-stable-8024e02879ddd5042be02c70557f74cdc70b44b4.tar.gz
linux-stable-8024e02879ddd5042be02c70557f74cdc70b44b4.tar.bz2
linux-stable-8024e02879ddd5042be02c70557f74cdc70b44b4.zip
udp: Add udp_sock_create for UDP tunnels to open listener socket
Added udp_tunnel.c which can contain some common functions for UDP tunnels. The first function in this is udp_sock_create which is used to open the listener port for a UDP tunnel. Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/udp_tunnel.h')
-rw-r--r--include/net/udp_tunnel.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/net/udp_tunnel.h b/include/net/udp_tunnel.h
new file mode 100644
index 000000000000..ffd69cbded35
--- /dev/null
+++ b/include/net/udp_tunnel.h
@@ -0,0 +1,32 @@
+#ifndef __NET_UDP_TUNNEL_H
+#define __NET_UDP_TUNNEL_H
+
+struct udp_port_cfg {
+ u8 family;
+
+ /* Used only for kernel-created sockets */
+ union {
+ struct in_addr local_ip;
+#if IS_ENABLED(CONFIG_IPV6)
+ struct in6_addr local_ip6;
+#endif
+ };
+
+ union {
+ struct in_addr peer_ip;
+#if IS_ENABLED(CONFIG_IPV6)
+ struct in6_addr peer_ip6;
+#endif
+ };
+
+ __be16 local_udp_port;
+ __be16 peer_udp_port;
+ unsigned int use_udp_checksums:1,
+ use_udp6_tx_checksums:1,
+ use_udp6_rx_checksums:1;
+};
+
+int udp_sock_create(struct net *net, struct udp_port_cfg *cfg,
+ struct socket **sockp);
+
+#endif