Add VTI Netlink Interface in NetD
Includes the logic to add / update / remove Virtual Tunnel Inteface
in RouteController.
Bug: 63589711
Test: Ran runtest -x "system/netd/tests/netd_integration_test.cpp"
Change-Id: I49a86f2eceecaf34fbb1e5dc05a888447437bef0
diff --git a/server/XfrmController.h b/server/XfrmController.h
index 2dc8406..298fae6 100644
--- a/server/XfrmController.h
+++ b/server/XfrmController.h
@@ -22,12 +22,15 @@
#include <string>
#include <utility> // for pair
+#include <linux/if_link.h>
+#include <linux/if_tunnel.h>
#include <linux/netlink.h>
#include <linux/udp.h>
#include <linux/xfrm.h>
#include <sysutils/SocketClient.h>
#include "NetdConstants.h"
+#include "netdutils/Slice.h"
#include "netdutils/Status.h"
namespace android {
@@ -167,6 +170,13 @@
const std::string& destinationAddress,
int32_t markValue, int32_t markMask);
+ int addVirtualTunnelInterface(const std::string& deviceName,
+ const std::string& localAddress,
+ const std::string& remoteAddress,
+ int32_t ikey, int32_t okey, bool isUpdate);
+
+ int removeVirtualTunnelInterface(const std::string& deviceName);
+
// Some XFRM netlink attributes comprise a header, a struct, and some data
// after the struct. We wrap all of those in one struct for easier
// marshalling. The structs below must be ABI compatible with the kernel and
@@ -323,7 +333,6 @@
static netdutils::Status deleteTunnelModeSecurityPolicy(const XfrmSaInfo& record,
const XfrmSocket& sock,
XfrmDirection direction);
-
// END TODO(messagerefactor)
};