Lines Matching refs:tableIndex
64 int tableIndex = findTableNumber(iface);
65 if (tableIndex == -1) {
66 tableIndex = findTableNumber(""); // look for an empty slot
67 if (tableIndex == -1) {
73 strncpy(mInterfaceTable[tableIndex], iface, IFNAMSIZ);
75 mInterfaceTable[tableIndex][IFNAMSIZ] = 0;
78 return modifyRoute(cli, ADD, iface, dest, prefix, gateway, tableIndex);
82 char *dest, int prefix, char *gateway, int tableIndex) {
89 snprintf(tableIndex_str, sizeof(tableIndex_str), "%d", tableIndex + BASE_TABLE_NUMBER);
121 IP_PATH, action, dest, prefix, gateway, iface, tableIndex+BASE_TABLE_NUMBER);
128 mInterfaceRuleCount[tableIndex]++;
130 if (--mInterfaceRuleCount[tableIndex] < 1) {
131 mInterfaceRuleCount[tableIndex] = 0;
132 mInterfaceTable[tableIndex][0] = 0;
135 modifyRuleCount(tableIndex, action);
140 void SecondaryTableController::modifyRuleCount(int tableIndex, const char *action) {
142 mInterfaceRuleCount[tableIndex]++;
144 if (--mInterfaceRuleCount[tableIndex] < 1) {
145 mInterfaceRuleCount[tableIndex] = 0;
146 mInterfaceTable[tableIndex][0] = 0;
151 int SecondaryTableController::verifyTableIndex(int tableIndex) {
152 if ((tableIndex < 0) ||
153 (tableIndex >= INTERFACES_TRACKED) ||
154 (mInterfaceTable[tableIndex][0] == 0)) {
171 int tableIndex = findTableNumber(iface);
172 if (tableIndex == -1) {
179 return modifyRoute(cli, DEL, iface, dest, prefix, gateway, tableIndex);
182 int SecondaryTableController::modifyFromRule(int tableIndex, const char *action,
186 if (verifyTableIndex(tableIndex)) {
190 snprintf(tableIndex_str, sizeof(tableIndex_str), "%d", tableIndex +
206 modifyRuleCount(tableIndex, action);
210 int SecondaryTableController::modifyLocalRoute(int tableIndex, const char *action,
214 if (verifyTableIndex(tableIndex)) {
218 modifyRuleCount(tableIndex, action); // some del's will fail as the iface is already gone.
220 snprintf(tableIndex_str, sizeof(tableIndex_str), "%d", tableIndex +