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:
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 \
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 \
+++ /dev/null
-/*
- * 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
#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"
*gw = p->gw;
return true;
}
- return false;
+ return route_table_fallback_lookup(ip_dst, output_bridge, gw);
}
static void
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
#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;
void
route_table_init(void)
{
+ ovs_router_init();
}
void
route_table_wait(void)
{
}
-
-void
-ovs_router_init(void)
-{
-}
#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)
{
void
route_table_init(void)
{
+ ovs_router_init();
}
void
#include "netlink-socket.h"
#include "ofpbuf.h"
#include "ovs-router.h"
-#include "ovs-router-linux.h"
#include "rtnetlink-link.h"
#include "vlog.h"
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;
+}
+
\f
/* name_table . */
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 */
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 \