summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README-native-tunneling.md2
-rw-r--r--lib/automake.mk3
-rw-r--r--lib/ovs-router-linux.h40
-rw-r--r--lib/ovs-router.c4
-rw-r--r--lib/ovs-router.h3
-rw-r--r--lib/route-table-bsd.c8
-rw-r--r--lib/route-table-stub.c11
-rw-r--r--lib/route-table.c10
-rw-r--r--lib/route-table.h1
-rw-r--r--tests/tunnel-push-pop.at4
10 files changed, 22 insertions, 64 deletions
diff --git a/README-native-tunneling.md b/README-native-tunneling.md
index 7666dcc77..0ffd82b92 100644
--- a/README-native-tunneling.md
+++ b/README-native-tunneling.md
@@ -51,8 +51,6 @@ There are following commands that shows internal tables:
Tunneling related commands:
===========================
Tunnel routing table:
- These commands are only available on Linux platform.
-
To Add route:
ovs-appctl ovs/route/add <IP address>/<prefix length> <output-bridge-name> <gw>
To see all routes configured:
diff --git a/lib/automake.mk b/lib/automake.mk
index 0b2d8233c..a98f7cc64 100644
--- a/lib/automake.mk
+++ b/lib/automake.mk
@@ -163,6 +163,7 @@ lib_libopenvswitch_la_SOURCES = \
lib/ovs-rcu.c \
lib/ovs-rcu.h \
lib/ovs-router.h \
+ lib/ovs-router.c \
lib/ovs-thread.c \
lib/ovs-thread.h \
lib/ovsdb-data.c \
@@ -331,8 +332,6 @@ lib_libopenvswitch_la_SOURCES += \
lib/netlink-socket.h \
lib/ovs-numa.c \
lib/ovs-numa.h \
- lib/ovs-router.c \
- lib/ovs-router-linux.h \
lib/rtnetlink-link.c \
lib/rtnetlink-link.h \
lib/route-table.c \
diff --git a/lib/ovs-router-linux.h b/lib/ovs-router-linux.h
deleted file mode 100644
index f60f4034a..000000000
--- a/lib/ovs-router-linux.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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 OVS_TNL_ROUTER_LINUX_H
-#define OVS_TNL_ROUTER_LINUX_H 1
-
-#include <stddef.h>
-#include <stdint.h>
-#include <net/if.h>
-
-#include "packets.h"
-#include "timeval.h"
-#include "unixctl.h"
-#include "util.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void ovs_router_insert(ovs_be32 ip_dst, uint8_t plen, const char output_bridge[],
- ovs_be32 gw);
-void ovs_router_flush(void);
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/lib/ovs-router.c b/lib/ovs-router.c
index e4f8a089e..b095f681e 100644
--- a/lib/ovs-router.c
+++ b/lib/ovs-router.c
@@ -35,8 +35,8 @@
#include "packets.h"
#include "seq.h"
#include "ovs-router.h"
-#include "ovs-router-linux.h"
#include "ovs-thread.h"
+#include "route-table.h"
#include "unixctl.h"
#include "util.h"
@@ -76,7 +76,7 @@ ovs_router_lookup(ovs_be32 ip_dst, char output_bridge[], ovs_be32 *gw)
*gw = p->gw;
return true;
}
- return false;
+ return route_table_fallback_lookup(ip_dst, output_bridge, gw);
}
static void
diff --git a/lib/ovs-router.h b/lib/ovs-router.h
index b0042ccc3..cc0ebc2ba 100644
--- a/lib/ovs-router.h
+++ b/lib/ovs-router.h
@@ -25,6 +25,9 @@ extern "C" {
bool ovs_router_lookup(ovs_be32 ip_dst, char out_dev[], ovs_be32 *gw);
void ovs_router_init(void);
+void ovs_router_insert(ovs_be32 ip_dst, uint8_t plen,
+ const char output_bridge[], ovs_be32 gw);
+void ovs_router_flush(void);
#ifdef __cplusplus
}
#endif
diff --git a/lib/route-table-bsd.c b/lib/route-table-bsd.c
index 6d5fe5c93..09f9894a7 100644
--- a/lib/route-table-bsd.c
+++ b/lib/route-table-bsd.c
@@ -33,7 +33,7 @@
#include "util.h"
bool
-ovs_router_lookup(ovs_be32 ip, char name[], ovs_be32 *gw)
+route_table_fallback_lookup(ovs_be32 ip, char name[], ovs_be32 *gw)
{
struct {
struct rt_msghdr rtm;
@@ -116,6 +116,7 @@ route_table_get_change_seq(void)
void
route_table_init(void)
{
+ ovs_router_init();
}
void
@@ -127,8 +128,3 @@ void
route_table_wait(void)
{
}
-
-void
-ovs_router_init(void)
-{
-}
diff --git a/lib/route-table-stub.c b/lib/route-table-stub.c
index afbd79d5d..70b1a3d1c 100644
--- a/lib/route-table-stub.c
+++ b/lib/route-table-stub.c
@@ -19,18 +19,14 @@
#include "route-table.h"
bool
-ovs_router_lookup(ovs_be32 ip_dst OVS_UNUSED, char output_bridge[] OVS_UNUSED,
- ovs_be32 *gw)
+route_table_fallback_lookup(ovs_be32 ip_dst OVS_UNUSED,
+ char output_bridge[] OVS_UNUSED,
+ ovs_be32 *gw)
{
*gw = 0;
return false;
}
-void
-ovs_router_init(void)
-{
-}
-
uint64_t
route_table_get_change_seq(void)
{
@@ -40,6 +36,7 @@ route_table_get_change_seq(void)
void
route_table_init(void)
{
+ ovs_router_init();
}
void
diff --git a/lib/route-table.c b/lib/route-table.c
index a1bc887c3..2c3f64cf1 100644
--- a/lib/route-table.c
+++ b/lib/route-table.c
@@ -30,7 +30,6 @@
#include "netlink-socket.h"
#include "ofpbuf.h"
#include "ovs-router.h"
-#include "ovs-router-linux.h"
#include "rtnetlink-link.h"
#include "vlog.h"
@@ -264,6 +263,15 @@ route_map_clear(void)
ovs_router_flush();
}
+bool
+route_table_fallback_lookup(ovs_be32 ip_dst OVS_UNUSED,
+ char output_bridge[] OVS_UNUSED,
+ ovs_be32 *gw)
+{
+ *gw = 0;
+ return false;
+}
+
/* name_table . */
diff --git a/lib/route-table.h b/lib/route-table.h
index 5dac29e5f..54d77f416 100644
--- a/lib/route-table.h
+++ b/lib/route-table.h
@@ -29,5 +29,6 @@ uint64_t route_table_get_change_seq(void);
void route_table_init(void);
void route_table_run(void);
void route_table_wait(void);
+bool route_table_fallback_lookup(ovs_be32, char [], ovs_be32 *);
#endif /* route-table.h */
diff --git a/tests/tunnel-push-pop.at b/tests/tunnel-push-pop.at
index f9ea4c081..f1fac7f89 100644
--- a/tests/tunnel-push-pop.at
+++ b/tests/tunnel-push-pop.at
@@ -2,10 +2,6 @@ AT_BANNER([tunnel_push_pop])
AT_SETUP([tunnel_push_pop - action])
-dnl ovs router is commands are only supported on Linux for now.
-AT_SKIP_IF([test "$IS_WIN32" = "yes"])
-AT_SKIP_IF([test "$IS_BSD" = "yes"])
-
OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1])
AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
AT_CHECK([ovs-vsctl add-port int-br t2 -- set Interface t2 type=vxlan \