Convert tethering offload IPCs from primitive args to a parcel.
Defining stable AIDL IPCs with primitive args is not future-proof
because AIDL does not support method overloading, so any time a
parameter is added a new method needs to be created.
It's better to use parcelables for parameters instead, because
parcelables can be extended in subsequent version.
Define a TetherOffloadRuleParcel data structure to represent
tethering offload rules, and switch the tethering offload IPCs to
it before we freeze the INetd AIDL.
Bug: 140541991
Test: atest netd_integration_test
Merged-In: I6e84b14872d38a897eb6a10fd37d816ec7e6da64
Change-Id: I6e84b14872d38a897eb6a10fd37d816ec7e6da64
diff --git a/server/TetherController.h b/server/TetherController.h
index 7835cf6..7fd7166 100644
--- a/server/TetherController.h
+++ b/server/TetherController.h
@@ -30,6 +30,8 @@
#include "bpf/BpfMap.h"
#include "netdbpf/bpf_shared.h"
+#include "android/net/TetherOffloadRuleParcel.h"
+
namespace android {
namespace net {
@@ -103,13 +105,8 @@
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);
+ base::Result<void> addOffloadRule(const TetherOffloadRuleParcel& rule);
+ base::Result<void> removeOffloadRule(const TetherOffloadRuleParcel& rule);
class TetherStats {
public: