summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Żenczykowski <maze@google.com>2022-06-13 22:39:12 -0700
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2022-06-15 06:37:52 +0000
commit56ac72641c7bb335b90979e6523da89c21792af6 (patch)
tree9bbd457efd8ffe496630a45eb6d38fb4d2c1f35c
parent429c7fa7779012e2c0ceb5ad604007a3c0e27e5e (diff)
downloadnetd-56ac72641c7bb335b90979e6523da89c21792af6.tar.gz
TcUtils.h - remove most of it - no longer used
Bug: 235778483 Test: TreeHugger Signed-off-by: Maciej Żenczykowski <maze@google.com> Change-Id: I515f5c25d7ef6d0aeed091852e912fc2a334d548 (cherry picked from commit da278449384fbe0ea898ff09cc90f0150d31d1a8) Merged-In: I515f5c25d7ef6d0aeed091852e912fc2a334d548
-rw-r--r--server/TcUtils.h52
1 files changed, 0 insertions, 52 deletions
diff --git a/server/TcUtils.h b/server/TcUtils.h
index d205c04b..4b1b2b9f 100644
--- a/server/TcUtils.h
+++ b/server/TcUtils.h
@@ -26,42 +26,10 @@
#include <string>
#include "bpf/BpfUtils.h"
-#include "bpf_shared.h"
namespace android {
namespace net {
-// For better code clarity - do not change values - used for booleans like
-// with_ethernet_header or isEthernet.
-constexpr bool RAWIP = false;
-constexpr bool ETHER = true;
-
-// For better code clarity when used for 'bool ingress' parameter.
-constexpr bool EGRESS = false;
-constexpr bool INGRESS = true;
-
-// The priority of clat hook - must be after tethering.
-constexpr uint16_t PRIO_CLAT = 4;
-
-inline base::Result<bool> isEthernet(const std::string& interface) {
- bool result = false;
- if (int error = ::android::isEthernet(interface.c_str(), result)) {
- errno = error;
- return ErrnoErrorf("isEthernet failed for interface {}", interface);
- }
- return result;
-}
-
-inline int getClatEgress4MapFd(void) {
- const int fd = bpf::mapRetrieveRW(CLAT_EGRESS4_MAP_PATH);
- return (fd == -1) ? -errno : fd;
-}
-
-inline int getClatIngress6MapFd(void) {
- const int fd = bpf::mapRetrieveRW(CLAT_INGRESS6_MAP_PATH);
- return (fd == -1) ? -errno : fd;
-}
-
inline int tcQdiscAddDevClsact(int ifIndex) {
return doTcQdiscClsact(ifIndex, RTM_NEWQDISC, NLM_F_EXCL | NLM_F_CREATE);
}
@@ -74,25 +42,5 @@ inline int tcQdiscDelDevClsact(int ifIndex) {
return doTcQdiscClsact(ifIndex, RTM_DELQDISC, 0);
}
-// tc filter add dev .. ingress prio 4 protocol ipv6 bpf object-pinned /sys/fs/bpf/... direct-action
-inline int tcFilterAddDevIngressClatIpv6(int ifIndex, const std::string& bpfProgPath) {
- return tcAddBpfFilter(ifIndex, INGRESS, PRIO_CLAT, ETH_P_IPV6, bpfProgPath.c_str());
-}
-
-// tc filter add dev .. egress prio 4 protocol ip bpf object-pinned /sys/fs/bpf/... direct-action
-inline int tcFilterAddDevEgressClatIpv4(int ifIndex, const std::string& bpfProgPath) {
- return tcAddBpfFilter(ifIndex, EGRESS, PRIO_CLAT, ETH_P_IP, bpfProgPath.c_str());
-}
-
-// tc filter del dev .. ingress prio 4 protocol ipv6
-inline int tcFilterDelDevIngressClatIpv6(int ifIndex) {
- return tcDeleteFilter(ifIndex, INGRESS, PRIO_CLAT, ETH_P_IPV6);
-}
-
-// tc filter del dev .. egress prio 4 protocol ip
-inline int tcFilterDelDevEgressClatIpv4(int ifIndex) {
- return tcDeleteFilter(ifIndex, EGRESS, PRIO_CLAT, ETH_P_IP);
-}
-
} // namespace net
} // namespace android