You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by ji...@apache.org on 2015/05/08 22:56:51 UTC
[2/2] mesos git commit: Moved ARP filter implementation onto basic
filter.
Moved ARP filter implementation onto basic filter.
Review: https://reviews.apache.org/r/33963
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/72c1fb3c
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/72c1fb3c
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/72c1fb3c
Branch: refs/heads/master
Commit: 72c1fb3c2fc742ae67198a3b4a2737ae4bf7caac
Parents: 7edd573
Author: Cong Wang <cw...@twopensource.com>
Authored: Fri May 8 13:43:13 2015 -0700
Committer: Jie Yu <yu...@gmail.com>
Committed: Fri May 8 13:55:20 2015 -0700
----------------------------------------------------------------------
src/Makefile.am | 2 -
src/linux/routing/filter/arp.cpp | 189 -------------------
src/linux/routing/filter/arp.hpp | 96 ----------
src/linux/routing/filter/basic.cpp | 77 ++++++--
src/linux/routing/filter/basic.hpp | 88 +++++++--
.../isolators/network/port_mapping.cpp | 19 +-
src/tests/routing_tests.cpp | 44 +++--
7 files changed, 175 insertions(+), 340 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/72c1fb3c/src/Makefile.am
----------------------------------------------------------------------
diff --git a/src/Makefile.am b/src/Makefile.am
index 84e5446..54271f7 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -473,7 +473,6 @@ if WITH_NETWORK_ISOLATOR
linux/routing/route.cpp \
linux/routing/utils.cpp \
linux/routing/diagnosis/diagnosis.cpp \
- linux/routing/filter/arp.cpp \
linux/routing/filter/basic.cpp \
linux/routing/filter/icmp.cpp \
linux/routing/filter/ip.cpp \
@@ -488,7 +487,6 @@ if WITH_NETWORK_ISOLATOR
linux/routing/utils.hpp \
linux/routing/diagnosis/diagnosis.hpp \
linux/routing/filter/action.hpp \
- linux/routing/filter/arp.hpp \
linux/routing/filter/basic.hpp \
linux/routing/filter/filter.hpp \
linux/routing/filter/handle.hpp \
http://git-wip-us.apache.org/repos/asf/mesos/blob/72c1fb3c/src/linux/routing/filter/arp.cpp
----------------------------------------------------------------------
diff --git a/src/linux/routing/filter/arp.cpp b/src/linux/routing/filter/arp.cpp
deleted file mode 100644
index 8c49766..0000000
--- a/src/linux/routing/filter/arp.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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.
- */
-
-#include <netlink/errno.h>
-
-#include <netlink/route/tc.h>
-
-#include <netlink/route/cls/basic.h>
-
-#include <stout/error.hpp>
-#include <stout/none.hpp>
-
-#include "linux/routing/internal.hpp"
-
-#include "linux/routing/filter/action.hpp"
-#include "linux/routing/filter/arp.hpp"
-#include "linux/routing/filter/filter.hpp"
-#include "linux/routing/filter/internal.hpp"
-#include "linux/routing/filter/priority.hpp"
-
-#include "linux/routing/queueing/handle.hpp"
-
-using std::string;
-
-namespace routing {
-namespace filter {
-namespace arp {
-
-// The classifier for ARP packet filters contains nothing and is not
-// exposed to the user as we don't care about the content in the ARP
-// packet.
-struct Classifier
-{
- bool operator == (const Classifier& that) const
- {
- return true;
- }
-};
-
-} // namespace arp {
-
-/////////////////////////////////////////////////
-// Filter specific pack/unpack functions.
-/////////////////////////////////////////////////
-
-namespace internal {
-
-// This is a work around. Including <linux/if_ether.h> causes
-// duplicated definitions on some platforms with old glibc.
-#ifndef ETH_P_ARP
-#define ETH_P_ARP 0x0806
-#endif
-
-
-// Encodes the ARP classifier into the libnl filter 'cls'. Each type
-// of classifier needs to implement this function.
-template <>
-Try<Nothing> encode<arp::Classifier>(
- const Netlink<struct rtnl_cls>& cls,
- const arp::Classifier& classifier)
-{
- rtnl_cls_set_protocol(cls.get(), ETH_P_ARP);
-
- int error = rtnl_tc_set_kind(TC_CAST(cls.get()), "basic");
- if (error != 0) {
- return Error(
- "Failed to set the kind of the classifier: " +
- string(nl_geterror(error)));
- }
-
- return Nothing();
-}
-
-// Decodes the ARP classifier from the libnl filter 'cls'. Each type
-// of classifier needs to implement this function. Returns None if the
-// libnl filter is not an ARP packet filter.
-template <>
-Result<arp::Classifier> decode<arp::Classifier>(
- const Netlink<struct rtnl_cls>& cls)
-{
- if (rtnl_cls_get_protocol(cls.get()) == ETH_P_ARP &&
- rtnl_tc_get_kind(TC_CAST(cls.get())) == string("basic")) {
- return arp::Classifier();
- }
-
- return None();
-}
-
-} // namespace internal {
-
-
-namespace arp {
-
-Try<bool> exists(const string& link, const queueing::Handle& parent)
-{
- return internal::exists(link, parent, Classifier());
-}
-
-
-Try<bool> create(
- const string& link,
- const queueing::Handle& parent,
- const Option<Priority>& priority,
- const action::Redirect& redirect)
-{
- return internal::create(
- link,
- Filter<Classifier>(
- parent,
- Classifier(),
- priority,
- None(),
- redirect));
-}
-
-
-Try<bool> create(
- const string& link,
- const queueing::Handle& parent,
- const Option<Priority>& priority,
- const action::Mirror& mirror)
-{
- return internal::create(
- link,
- Filter<Classifier>(
- parent,
- Classifier(),
- priority,
- None(),
- mirror));
-}
-
-
-Try<bool> create(
- const string& link,
- const queueing::Handle& parent,
- const Option<Priority>& priority,
- const Option<queueing::Handle>& classid)
-{
- return internal::create(
- link,
- Filter<Classifier>(
- parent,
- Classifier(),
- priority,
- None(),
- classid));
-}
-
-
-Try<bool> remove(const string& link, const queueing::Handle& parent)
-{
- return internal::remove(link, parent, Classifier());
-}
-
-
-Try<bool> update(
- const string& link,
- const queueing::Handle& parent,
- const action::Mirror& mirror)
-{
- return internal::update(
- link,
- Filter<Classifier>(
- parent,
- Classifier(),
- None(),
- None(),
- mirror));
-}
-
-} // namespace arp {
-} // namespace filter {
-} // namespace routing {
http://git-wip-us.apache.org/repos/asf/mesos/blob/72c1fb3c/src/linux/routing/filter/arp.hpp
----------------------------------------------------------------------
diff --git a/src/linux/routing/filter/arp.hpp b/src/linux/routing/filter/arp.hpp
deleted file mode 100644
index 819e814..0000000
--- a/src/linux/routing/filter/arp.hpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you 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 __LINUX_ROUTING_FILTER_ARP_HPP__
-#define __LINUX_ROUTING_FILTER_ARP_HPP__
-
-#include <string>
-
-#include <stout/option.hpp>
-#include <stout/try.hpp>
-
-#include "linux/routing/filter/action.hpp"
-#include "linux/routing/filter/filter.hpp"
-#include "linux/routing/filter/priority.hpp"
-
-#include "linux/routing/queueing/handle.hpp"
-
-namespace routing {
-namespace filter {
-namespace arp {
-
-// Returns true if an ARP packet filter attached to the given parent
-// exists on the link.
-Try<bool> exists(const std::string& link, const queueing::Handle& parent);
-
-
-// Creates an ARP packet filter attached to the given parent on the
-// link which will redirect all ARP packets to the target link.
-// Returns false if an ARP packet filter attached to the given parent
-// already exists on the link. The user can choose to specify an
-// optional priority for the filter.
-Try<bool> create(
- const std::string& link,
- const queueing::Handle& parent,
- const Option<Priority>& priority,
- const action::Redirect& redirect);
-
-
-// Creates an ARP packet filter attached to the given parent on the
-// link which will mirror all ARP packets to a set of links (specified
-// in the mirror action). Returns false if an ARP packet filter
-// attached to the given parent already exists on the link. The user
-// can choose to specify an optional priority for the filter.
-Try<bool> create(
- const std::string& link,
- const queueing::Handle& parent,
- const Option<Priority>& priority,
- const action::Mirror& mirror);
-
-
-// Creates an ARP packet filter attached to the given parent on the
-// link which will set the classid for packets. Returns false if an
-// ARP packet filter attached to the given parent already exists on
-// the link. The user can choose to specify an optional priority for
-// the filter.
-Try<bool> create(
- const std::string& link,
- const queueing::Handle& parent,
- const Option<Priority>& priority,
- const Option<queueing::Handle>& classid);
-
-
-// Removes the ARP packet filter attached to the parent from the link.
-// Returns false if no ARP packet filter attached to the given parent
-// is found on the link.
-Try<bool> remove(const std::string& link, const queueing::Handle& parent);
-
-
-// Updates the action of the APR packet filter attached to the given
-// parent on the link. Returns false if no ARP packet filter attached
-// to the parent is found on the link.
-Try<bool> update(
- const std::string& link,
- const queueing::Handle& parent,
- const action::Mirror& mirror);
-
-} // namespace arp {
-} // namespace filter {
-} // namespace routing {
-
-#endif // __LINUX_ROUTING_FILTER_ARP_HPP__
http://git-wip-us.apache.org/repos/asf/mesos/blob/72c1fb3c/src/linux/routing/filter/basic.cpp
----------------------------------------------------------------------
diff --git a/src/linux/routing/filter/basic.cpp b/src/linux/routing/filter/basic.cpp
index 76db082..755be7d 100644
--- a/src/linux/routing/filter/basic.cpp
+++ b/src/linux/routing/filter/basic.cpp
@@ -46,13 +46,6 @@ namespace filter {
namespace internal {
-// This is a work around. Including <linux/if_ether.h> causes
-// duplicated definitions on some platforms with old glibc.
-#ifndef ETH_P_ALL
-#define ETH_P_ALL 0x0003
-#endif
-
-
// Encodes the basic classifier into the libnl filter 'cls'. Each type
// of classifier needs to implement this function.
template <>
@@ -92,15 +85,19 @@ Result<basic::Classifier> decode<basic::Classifier>(
namespace basic {
-Try<bool> exists(const string& link, const queueing::Handle& parent)
+Try<bool> exists(
+ const string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol)
{
- return internal::exists(link, parent, Classifier(ETH_P_ALL));
+ return internal::exists(link, parent, Classifier(protocol));
}
Try<bool> create(
const string& link,
const queueing::Handle& parent,
+ uint16_t protocol,
const Option<Priority>& priority,
const Option<queueing::Handle>& classid)
{
@@ -108,16 +105,72 @@ Try<bool> create(
link,
Filter<Classifier>(
parent,
- Classifier(ETH_P_ALL),
+ Classifier(protocol),
priority,
None(),
classid));
}
-Try<bool> remove(const string& link, const queueing::Handle& parent)
+Try<bool> create(
+ const string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol,
+ const Option<Priority>& priority,
+ const action::Redirect& redirect)
{
- return internal::remove(link, parent, Classifier(ETH_P_ALL));
+ return internal::create(
+ link,
+ Filter<Classifier>(
+ parent,
+ Classifier(protocol),
+ priority,
+ None(),
+ redirect));
+}
+
+
+Try<bool> create(
+ const string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol,
+ const Option<Priority>& priority,
+ const action::Mirror& mirror)
+{
+ return internal::create(
+ link,
+ Filter<Classifier>(
+ parent,
+ Classifier(protocol),
+ priority,
+ None(),
+ mirror));
+}
+
+
+Try<bool> remove(
+ const string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol)
+{
+ return internal::remove(link, parent, Classifier(protocol));
+}
+
+
+Try<bool> update(
+ const string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol,
+ const action::Mirror& mirror)
+{
+ return internal::update(
+ link,
+ Filter<Classifier>(
+ parent,
+ Classifier(protocol),
+ None(),
+ None(),
+ mirror));
}
} // namespace basic {
http://git-wip-us.apache.org/repos/asf/mesos/blob/72c1fb3c/src/linux/routing/filter/basic.hpp
----------------------------------------------------------------------
diff --git a/src/linux/routing/filter/basic.hpp b/src/linux/routing/filter/basic.hpp
index cc82e97..99b0b05 100644
--- a/src/linux/routing/filter/basic.hpp
+++ b/src/linux/routing/filter/basic.hpp
@@ -19,6 +19,8 @@
#ifndef __LINUX_ROUTING_FILTER_BASIC_HPP__
#define __LINUX_ROUTING_FILTER_BASIC_HPP__
+#include <stdint.h>
+
#include <string>
#include <stout/option.hpp>
@@ -30,17 +32,24 @@
#include "linux/routing/queueing/handle.hpp"
+// This is a work around. Including <linux/if_ether.h> causes
+// duplicated definitions on some platforms with old glibc.
+#ifndef ETH_P_ALL
+#define ETH_P_ALL 0x0003
+#endif
+#ifndef ETH_P_ARP
+#define ETH_P_ARP 0x0806
+#endif
+
namespace routing {
namespace filter {
namespace basic {
-// The classifier for the basic filter contains only protocol.
-//
-// TODO(cwang): ARP filter implementation can base on basic filter.
+// The classifier for the basic filter only contains a protocol.
class Classifier
{
public:
- explicit Classifier(const uint16_t _protocol)
+ explicit Classifier(uint16_t _protocol)
: protocol_(_protocol) {}
bool operator == (const Classifier& that) const
@@ -58,27 +67,74 @@ private:
};
-// Returns true if a basic packet filter attached to the given parent
-// exists on the link.
-Try<bool> exists(const std::string& link, const queueing::Handle& parent);
+// Returns true if a basic packet filter with given protocol attached
+// to the given parent exists on the link.
+Try<bool> exists(
+ const std::string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol);
-// Creates a basic packet filter attached to the given parent on the
-// link which will set the classid for packets. Returns false if a
-// basic packet filter attached to the given parent already exists
-// on the link. The user can choose to specify an optional priority
-// for the filter.
+// Creates a basic packet filter with given protocol attached to the
+// given parent on the link which will set the classid for packets.
+// Returns false if a basic packet filter with the given protocol
+// attached to the given parent already exists on the link. The user
+// can choose to specify an optional priority for the filter.
Try<bool> create(
const std::string& link,
const queueing::Handle& parent,
+ uint16_t protocol,
const Option<Priority>& priority,
const Option<queueing::Handle>& classid);
-// Removes the basic packet filter attached to the parent from the
-// link. Returns false if no basic packet filter attached to the
-// given parent is found on the link.
-Try<bool> remove(const std::string& link, const queueing::Handle& parent);
+// Creates a basic packet filter with given protocol attached to the
+// given parent on the link which will redirect all matched packets to
+// the target link. Returns false if a basic packet filter with the
+// given protocol attached to the given parent already exists on the
+// link. The user can choose to specify an optional priority for the
+// filter.
+Try<bool> create(
+ const std::string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol,
+ const Option<Priority>& priority,
+ const action::Redirect& redirect);
+
+
+// Creates a basic packet filter with given protocol attached to the
+// given parent on the link which will mirror all matched packets to a
+// set of links (specified in the mirror action). Returns false if a
+// basic packet filter with the give protocol attached to the given
+// parent already exists on the link. The user can choose to specify
+// an optional priority for the filter.
+Try<bool> create(
+ const std::string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol,
+ const Option<Priority>& priority,
+ const action::Mirror& mirror);
+
+
+// Removes the basic packet filter with given protocol attached to
+// the parent from the link. Returns false if no basic packet filter
+// with the given protocol attached to the given parent is found on
+// the link.
+Try<bool> remove(
+ const std::string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol);
+
+
+// Updates the action of a basic packet filter with give protocol
+// attached to the given parent on the link. Returns false if no
+// basic packet filter with the given protocol attached to the parent
+// is found on the link.
+Try<bool> update(
+ const std::string& link,
+ const queueing::Handle& parent,
+ uint16_t protocol,
+ const action::Mirror& mirror);
} // namespace basic {
} // namespace filter {
http://git-wip-us.apache.org/repos/asf/mesos/blob/72c1fb3c/src/slave/containerizer/isolators/network/port_mapping.cpp
----------------------------------------------------------------------
diff --git a/src/slave/containerizer/isolators/network/port_mapping.cpp b/src/slave/containerizer/isolators/network/port_mapping.cpp
index fc0fa4c..a4abaff 100644
--- a/src/slave/containerizer/isolators/network/port_mapping.cpp
+++ b/src/slave/containerizer/isolators/network/port_mapping.cpp
@@ -63,7 +63,7 @@
#include "linux/routing/diagnosis/diagnosis.hpp"
-#include "linux/routing/filter/arp.hpp"
+#include "linux/routing/filter/basic.hpp"
#include "linux/routing/filter/icmp.hpp"
#include "linux/routing/filter/ip.hpp"
@@ -1991,9 +1991,10 @@ Future<Nothing> PortMappingIsolatorProcess::isolate(
}
// Relay ARP packets from veth of the container to host eth0.
- Try<bool> arpVethToEth0 = filter::arp::create(
+ Try<bool> arpVethToEth0 = filter::basic::create(
veth(pid),
ingress::HANDLE,
+ ETH_P_ARP,
Priority(ARP_FILTER_PRIORITY, NORMAL),
action::Redirect(eth0));
@@ -2043,9 +2044,10 @@ Future<Nothing> PortMappingIsolatorProcess::isolate(
}
// Create a new ARP filter on host eth0.
- Try<bool> arpEth0ToVeth = filter::arp::create(
+ Try<bool> arpEth0ToVeth = filter::basic::create(
eth0,
ingress::HANDLE,
+ ETH_P_ARP,
Priority(ARP_FILTER_PRIORITY, NORMAL),
action::Mirror(targets));
@@ -2083,9 +2085,10 @@ Future<Nothing> PortMappingIsolatorProcess::isolate(
}
// Update the ARP filter on host eth0.
- Try<bool> arpEth0ToVeth = filter::arp::update(
+ Try<bool> arpEth0ToVeth = filter::basic::update(
eth0,
ingress::HANDLE,
+ ETH_P_ARP,
action::Mirror(targets));
if (arpEth0ToVeth.isError()) {
@@ -2647,9 +2650,10 @@ Try<Nothing> PortMappingIsolatorProcess::_cleanup(
}
// Remove the ARP filter on host eth0.
- Try<bool> arpEth0ToVeth = filter::arp::remove(
+ Try<bool> arpEth0ToVeth = filter::basic::remove(
eth0,
- ingress::HANDLE);
+ ingress::HANDLE,
+ ETH_P_ARP);
if (arpEth0ToVeth.isError()) {
++metrics.removing_eth0_arp_filters_errors;
@@ -2688,9 +2692,10 @@ Try<Nothing> PortMappingIsolatorProcess::_cleanup(
"The ICMP packet filter on host " + eth0 + " does not exist");
}
- Try<bool> arpEth0ToVeth = filter::arp::update(
+ Try<bool> arpEth0ToVeth = filter::basic::update(
eth0,
ingress::HANDLE,
+ ETH_P_ARP,
action::Mirror(targets));
if (arpEth0ToVeth.isError()) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/72c1fb3c/src/tests/routing_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/routing_tests.cpp b/src/tests/routing_tests.cpp
index dd5ecb5..6bf5e63 100644
--- a/src/tests/routing_tests.cpp
+++ b/src/tests/routing_tests.cpp
@@ -42,7 +42,6 @@
#include "linux/routing/diagnosis/diagnosis.hpp"
-#include "linux/routing/filter/arp.hpp"
#include "linux/routing/filter/basic.hpp"
#include "linux/routing/filter/icmp.hpp"
#include "linux/routing/filter/ip.hpp"
@@ -439,14 +438,16 @@ TEST_F(RoutingVethTest, ROOT_FqCodelClassifier)
EXPECT_SOME_TRUE(basic::create(
TEST_VETH_LINK,
fq_codel::HANDLE,
+ ETH_P_ALL,
None(),
queueing::Handle(fq_codel::HANDLE, 0)));
- EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, fq_codel::HANDLE));
+ EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, fq_codel::HANDLE, ETH_P_ALL));
- EXPECT_SOME_TRUE(arp::create(
+ EXPECT_SOME_TRUE(basic::create(
TEST_VETH_LINK,
fq_codel::HANDLE,
+ ETH_P_ARP,
None(),
queueing::Handle(fq_codel::HANDLE, 0)));
@@ -455,7 +456,7 @@ TEST_F(RoutingVethTest, ROOT_FqCodelClassifier)
// b057df24a7536cce6c372efe9d0e3d1558afedf4
// (https://git.kernel.org/cgit/linux/kernel/git/davem/net.git).
// Please fix your kernel if you see this failure.
- EXPECT_SOME_TRUE(arp::exists(TEST_VETH_LINK, fq_codel::HANDLE));
+ EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, fq_codel::HANDLE, ETH_P_ARP));
EXPECT_SOME_TRUE(icmp::create(
TEST_VETH_LINK,
@@ -509,13 +510,14 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterCreate)
ASSERT_SOME_TRUE(ingress::create(TEST_VETH_LINK));
- EXPECT_SOME_TRUE(arp::create(
+ EXPECT_SOME_TRUE(basic::create(
TEST_VETH_LINK,
ingress::HANDLE,
+ ETH_P_ARP,
None(),
action::Redirect(TEST_PEER_LINK)));
- EXPECT_SOME_TRUE(arp::exists(TEST_VETH_LINK, ingress::HANDLE));
+ EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, ingress::HANDLE, ETH_P_ARP));
}
@@ -531,17 +533,19 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterCreateDuplicated)
set<string> links;
links.insert(TEST_PEER_LINK);
- EXPECT_SOME_TRUE(arp::create(
+ EXPECT_SOME_TRUE(basic::create(
TEST_VETH_LINK,
ingress::HANDLE,
+ ETH_P_ARP,
None(),
action::Mirror(links)));
- EXPECT_SOME_TRUE(arp::exists(TEST_VETH_LINK, ingress::HANDLE));
+ EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, ingress::HANDLE, ETH_P_ARP));
- EXPECT_SOME_FALSE(arp::create(
+ EXPECT_SOME_FALSE(basic::create(
TEST_VETH_LINK,
ingress::HANDLE,
+ ETH_P_ARP,
None(),
action::Redirect(TEST_PEER_LINK)));
}
@@ -559,15 +563,16 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterRemove)
set<string> links;
links.insert(TEST_PEER_LINK);
- EXPECT_SOME_TRUE(arp::create(
+ EXPECT_SOME_TRUE(basic::create(
TEST_VETH_LINK,
ingress::HANDLE,
+ ETH_P_ARP,
None(),
action::Mirror(links)));
- EXPECT_SOME_TRUE(arp::exists(TEST_VETH_LINK, ingress::HANDLE));
- EXPECT_SOME_TRUE(arp::remove(TEST_VETH_LINK, ingress::HANDLE));
- EXPECT_SOME_FALSE(arp::exists(TEST_VETH_LINK, ingress::HANDLE));
+ EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, ingress::HANDLE, ETH_P_ARP));
+ EXPECT_SOME_TRUE(basic::remove(TEST_VETH_LINK, ingress::HANDLE, ETH_P_ARP));
+ EXPECT_SOME_FALSE(basic::exists(TEST_VETH_LINK, ingress::HANDLE, ETH_P_ARP));
}
@@ -583,25 +588,28 @@ TEST_F(RoutingVethTest, ROOT_ARPFilterUpdate)
set<string> links;
links.insert(TEST_PEER_LINK);
- EXPECT_SOME_FALSE(arp::update(
+ EXPECT_SOME_FALSE(basic::update(
TEST_VETH_LINK,
ingress::HANDLE,
+ ETH_P_ARP,
action::Mirror(links)));
- EXPECT_SOME_TRUE(arp::create(
+ EXPECT_SOME_TRUE(basic::create(
TEST_VETH_LINK,
ingress::HANDLE,
+ ETH_P_ARP,
None(),
action::Redirect(TEST_PEER_LINK)));
- EXPECT_SOME_TRUE(arp::exists(TEST_VETH_LINK, ingress::HANDLE));
+ EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, ingress::HANDLE, ETH_P_ARP));
- EXPECT_SOME_TRUE(arp::update(
+ EXPECT_SOME_TRUE(basic::update(
TEST_VETH_LINK,
ingress::HANDLE,
+ ETH_P_ARP,
action::Mirror(links)));
- EXPECT_SOME_TRUE(arp::exists(TEST_VETH_LINK, ingress::HANDLE));
+ EXPECT_SOME_TRUE(basic::exists(TEST_VETH_LINK, ingress::HANDLE, ETH_P_ARP));
}