Keep better tabs on secondary tables.
We had some places (NatController) where routes were being set
but not accounted for in the number-of-routes talley so we
could end up thinking the table was empty and not clean up
after ourselves properly.
Also consolidated constants.
bug:5917475
Change-Id: I98a41d433e1d4b4ca6692fb2328e2c9afc828145
diff --git a/SecondaryTableController.h b/SecondaryTableController.h
index 0051f7f..259ab43 100644
--- a/SecondaryTableController.h
+++ b/SecondaryTableController.h
@@ -33,13 +33,18 @@
int addRoute(SocketClient *cli, char *iface, char *dest, int prefixLen, char *gateway);
int removeRoute(SocketClient *cli, char *iface, char *dest, int prefixLen, char *gateway);
int findTableNumber(const char *iface);
+ int modifyFromRule(int tableIndex, const char *action, const char *addr);
+ int modifyLocalRoute(int tableIndex, const char *action, const char *iface, const char *addr);
private:
- int modifyRoute(SocketClient *cli, char *action, char *iface, char *dest, int prefix,
+ int modifyRoute(SocketClient *cli, const char *action, char *iface, char *dest, int prefix,
char *gateway, int tableIndex);
char mInterfaceTable[INTERFACES_TRACKED][MAX_IFACE_LENGTH];
int mInterfaceRuleCount[INTERFACES_TRACKED];
+ void modifyRuleCount(int tableIndex, const char *action);
+ int verifyTableIndex(int tableIndex);
+ const char *getVersion(const char *addr);
int runAndFree(SocketClient *cli, char *cmd);
};