Add WakeupController and NFLogListener
These classes work together to parse and dispatch NFLOG messages in
response to inbound packets annotated by the WiFi driver.
Test: as follows
- built
- flashed
- booted
- netd_unit_test passes
Change-Id: Id26d62858bf4bc4186ae66850f08077adf6fc2ac
diff --git a/server/IptablesRestoreController.h b/server/IptablesRestoreController.h
index 4f58461..6850d0d 100644
--- a/server/IptablesRestoreController.h
+++ b/server/IptablesRestoreController.h
@@ -25,17 +25,25 @@
class IptablesProcess;
-class IptablesRestoreController {
-public:
+class IptablesRestoreInterface {
+ public:
+ virtual ~IptablesRestoreInterface() = default;
+
+ // Execute |commands| on the given |target|, and populate |output| with stdout.
+ virtual int execute(const IptablesTarget target, const std::string& commands,
+ std::string* output) = 0;
+};
+
+class IptablesRestoreController final : public IptablesRestoreInterface {
+ public:
// Not for general use. Use gCtls->iptablesRestoreCtrl
// to get an instance of this class.
IptablesRestoreController();
- // Execute |commands| on the given |target|.
- int execute(const IptablesTarget target, const std::string& commands);
+ ~IptablesRestoreController() override;
- // Execute |commands| on the given |target|, and populate |output| with stdout.
- int execute(const IptablesTarget target, const std::string& commands, std::string *output);
+ int execute(const IptablesTarget target, const std::string& commands,
+ std::string* output) override;
enum IptablesProcessType {
IPTABLES_PROCESS,
@@ -47,8 +55,6 @@
// of the forked iptables[6]-restore process has died.
IptablesProcessType notifyChildTermination(pid_t pid);
- virtual ~IptablesRestoreController();
-
protected:
friend class IptablesRestoreControllerTest;
pid_t getIpRestorePid(const IptablesProcessType type);