Add binder IPCs to add and remove downstream IPv6 tethering rules
Test: None
Change-Id: Idcb6b9c80de499fafb29e4e8b9202d7b7386340c
diff --git a/server/TetherController.h b/server/TetherController.h
index f129335..7bf8d32 100644
--- a/server/TetherController.h
+++ b/server/TetherController.h
@@ -26,7 +26,9 @@
#include <sysutils/SocketClient.h>
#include "NetdConstants.h"
-
+#include "android-base/result.h"
+#include "bpf/BpfMap.h"
+#include "netdbpf/bpf_shared.h"
namespace android {
namespace net {
@@ -68,6 +70,9 @@
int sendAllState(int daemonFd) const;
} mDnsmasqState{};
+ bpf::BpfMap<TetherIngressKey, TetherIngressValue> mBpfIngressMap;
+ bpf::BpfMap<uint32_t, TetherStatsValue> mBpfStatsMap;
+
public:
TetherController();
~TetherController() = default;
@@ -96,6 +101,14 @@
int disableNat(const char* intIface, const char* extIface);
int setupIptablesHooks();
+ base::Result<void> addDownstreamIpv6Rule(int intIfaceIndex, int extIfaceIndex,
+ const std::vector<uint8_t>& ipAddress,
+ const std::vector<uint8_t>& srcL2Address,
+ const std::vector<uint8_t>& dstL2Address);
+
+ base::Result<void> removeDownstreamIpv6Rule(int extifaceIndex,
+ const std::vector<uint8_t>& ipAddress);
+
class TetherStats {
public:
TetherStats() = default;
@@ -148,6 +161,7 @@
void dump(netdutils::DumpWriter& dw);
void dumpIfaces(netdutils::DumpWriter& dw);
+ void dumpBpf(netdutils::DumpWriter& dw);
private:
bool setIpFwdEnabled();