summaryrefslogtreecommitdiff
path: root/lib/tnl-ports.h
diff options
context:
space:
mode:
authorPravin B Shelar <pshelar@nicira.com>2014-11-11 11:53:47 -0800
committerPravin B Shelar <pshelar@nicira.com>2014-11-12 15:08:33 -0800
commita36de779d739cdcd72c65c67a547a786798b595a (patch)
tree736331a0c51ec85f22fe982b18135d7f9d9131ca /lib/tnl-ports.h
parent0746a84f3916193c0704e94a4c214f672c5c542e (diff)
downloadopenvswitch-a36de779d739cdcd72c65c67a547a786798b595a.tar.gz
openvswitch: Userspace tunneling.
Following patch adds support for userspace tunneling. Tunneling needs three more component first is routing table which is configured by caching kernel routes and second is ARP cache which build automatically by snooping arp. And third is tunnel protocol table which list all listening protocols which is populated by vswitchd as tunnel ports are added. GRE and VXLAN protocol support is added in this patch. Tunneling works as follows: On packet receive vswitchd check if this packet is targeted to tunnel port. If it is then vswitchd inserts tunnel pop action which pops header and sends packet to tunnel port. On packet xmit rather than generating Set tunnel action it generate tunnel push action which has tunnel header data. datapath can use tunnel-push action data to generate header for each packet and forward this packet to output port. Since tunnel-push action contains most of packet header vswitchd needs to lookup routing table and arp table to build this action. Signed-off-by: Pravin B Shelar <pshelar@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com> Acked-by: Thomas Graf <tgraf@noironetworks.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'lib/tnl-ports.h')
-rw-r--r--lib/tnl-ports.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/tnl-ports.h b/lib/tnl-ports.h
new file mode 100644
index 000000000..0597afa2e
--- /dev/null
+++ b/lib/tnl-ports.h
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2014 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TNL_PORT_H
+#define TNL_PORT_H 1
+
+#include <net/if.h>
+#include <sys/socket.h>
+
+#include "flow.h"
+#include "packets.h"
+#include "util.h"
+
+odp_port_t tnl_port_map_lookup(const struct flow *flow,
+ struct flow_wildcards *wc);
+
+void tnl_port_map_insert(odp_port_t port, ovs_be32 ip_dst, ovs_be16 udp_port,
+ const char dev_name[]);
+
+void tnl_port_map_delete(ovs_be32 ip_dst, ovs_be16 udp_port);
+
+void tnl_port_map_init(void);
+
+#endif