Home | History | Annotate | Download | only in netd

Lines Matching refs:cmd

46 int NatController::runCmd(const char *path, const char *cmd) {
48 size_t len = strnlen(cmd, 255);
57 asprintf(&buffer, "%s %s", path, cmd);
104 char cmd[255];
127 snprintf(cmd, sizeof(cmd), "%s rule add from %s table %d", getVersion(argv[5+i]),
129 ret |= runCmd(IP_PATH, cmd);
130 if (ret) LOGE("IP rule %s got %d", cmd, ret);
132 snprintf(cmd, sizeof(cmd), "route add %s dev %s table %d", argv[5+i], intIface,
134 ret |= runCmd(IP_PATH, cmd);
135 if (ret) LOGE("IP route %s got %d", cmd, ret);
143 snprintf(cmd, sizeof(cmd), "route del %s dev %s table %d", argv[5+i], intIface,
145 runCmd(IP_PATH, cmd);
147 snprintf(cmd, sizeof(cmd), "%s rule del from %s table %d", getVersion(argv[5+i]),
149 runCmd(IP_PATH, cmd);
161 snprintf(cmd, sizeof(cmd), "-t nat -A POSTROUTING -o %s -j MASQUERADE", extIface);
162 if (runCmd(IPTABLES_PATH, cmd)) {
163 LOGE("Error seting postroute rule: %s", cmd);
166 snprintf(cmd, sizeof(cmd), "route del %s dev %s table %d", argv[5+i], intIface,
168 runCmd(IP_PATH, cmd);
179 char cmd[255];
181 snprintf(cmd, sizeof(cmd),
185 if (runCmd(IPTABLES_PATH, cmd) && add) {
189 snprintf(cmd, sizeof(cmd),
193 if (runCmd(IPTABLES_PATH, cmd) && add) {
195 snprintf(cmd, sizeof(cmd),
199 runCmd(IPTABLES_PATH, cmd);
203 snprintf(cmd, sizeof(cmd), "-%s FORWARD -i %s -o %s -j ACCEPT", (add ? "A" : "D"),
205 if (runCmd(IPTABLES_PATH, cmd) && add) {
207 snprintf(cmd, sizeof(cmd),
211 runCmd(IPTABLES_PATH, cmd);
213 snprintf(cmd, sizeof(cmd),
217 runCmd(IPTABLES_PATH, cmd);
227 char cmd[255];
251 snprintf(cmd, sizeof(cmd), "route del %s dev %s table %d", argv[5+i], intIface,
255 runCmd(IP_PATH, cmd);
257 snprintf(cmd, sizeof(cmd), "%s rule del from %s table %d", getVersion(argv[5+i]),
259 runCmd(IP_PATH, cmd);