Delete dead codes within TrafficController in mainline module
Delete tagSocket(), privilegedTagSocket() and untagSocket() since
they are moved out of TrafficController in aosp/1849156.
Test: m
Change-Id: I6162c758446f597eb79734e00348dc8b1fe2d422
diff --git a/service/native/include/TrafficController.h b/service/native/include/TrafficController.h
index 2f38f6c..3e98b68 100644
--- a/service/native/include/TrafficController.h
+++ b/service/native/include/TrafficController.h
@@ -19,9 +19,8 @@
#include <linux/bpf.h>
-#include "Network.h"
+#include "NetlinkListener.h"
#include "android-base/thread_annotations.h"
-#include "android-base/unique_fd.h"
#include "bpf/BpfMap.h"
#include "bpf_shared.h"
#include "netdutils/DumpWriter.h"
@@ -34,34 +33,10 @@
class TrafficController {
public:
- TrafficController();
/*
* Initialize the whole controller
*/
netdutils::Status start();
- /*
- * Tag the socket with the specified tag and uid. In the qtaguid module, the
- * first tag request that grab the spinlock of rb_tree can update the tag
- * information first and other request need to wait until it finish. All the
- * tag request will be addressed in the order of they obtaining the spinlock.
- * In the eBPF implementation, the kernel will try to update the eBPF map
- * entry with the tag request. And the hashmap update process is protected by
- * the spinlock initialized with the map. So the behavior of two modules
- * should be the same. No additional lock needed.
- */
- int tagSocket(int sockFd, uint32_t tag, uid_t uid, uid_t callingUid) EXCLUDES(mMutex);
-
- /*
- * Similar as tagSocket, but skip UPDATE_DEVICE_STATS permission check.
- */
- int privilegedTagSocket(int sockFd, uint32_t tag, uid_t uid) EXCLUDES(mMutex);
-
- /*
- * The untag process is similiar to tag socket and both old qtaguid module and
- * new eBPF module have spinlock inside the kernel for concurrent update. No
- * external lock is required.
- */
- int untagSocket(int sockFd);
/*
* Similiar as above, no external lock required.
@@ -229,18 +204,6 @@
// read the map that system_server is cleaning up.
std::mutex mMutex;
- // The limit on the number of stats entries a uid can have in the per uid stats map.
- // TrafficController will block that specific uid from tagging new sockets after the limit is
- // reached.
- const uint32_t mPerUidStatsEntriesLimit;
-
- // The limit on the total number of stats entries in the per uid stats map. TrafficController
- // will block all tagging requests after the limit is reached.
- const uint32_t mTotalUidStatsEntriesLimit;
-
- netdutils::Status loadAndAttachProgram(bpf_attach_type type, const char* path, const char* name,
- base::unique_fd& cg_fd);
-
netdutils::Status initMaps() EXCLUDES(mMutex);
// Keep track of uids that have permission UPDATE_DEVICE_STATS so we don't
@@ -249,11 +212,6 @@
bool hasUpdateDeviceStatsPermission(uid_t uid) REQUIRES(mMutex);
- int privilegedTagSocketLocked(int sockFd, uint32_t tag, uid_t uid) REQUIRES(mMutex);
-
- // For testing
- TrafficController(uint32_t perUidLimit, uint32_t totalLimit);
-
// For testing
friend class TrafficControllerTest;
};