Lines Matching defs:cli

222 int CommandListener::InterfaceCmd::runCommand(SocketClient *cli,
225 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
234 cli->sendMsg(ResponseCode::OperationFailed, "Failed to open sysfs dir", true);
241 cli->sendMsg(ResponseCode::InterfaceListResult, de->d_name, false);
244 cli->sendMsg(ResponseCode::CommandOkay, "Interface list completed", false);
248 cli->sendMsg(ResponseCode::CommandSyntaxError,
254 cli->sendMsg(ResponseCode::OperationFailed, "Failed to read counters", true);
260 cli->sendMsg(ResponseCode::InterfaceRxCounterResult, msg, false);
266 cli->sendMsg(ResponseCode::CommandSyntaxError,
272 cli->sendMsg(ResponseCode::OperationFailed, "Failed to read counters", true);
278 cli->sendMsg(ResponseCode::InterfaceTxCounterResult, msg, false);
283 cli->sendMsg(ResponseCode::CommandSyntaxError,
298 cli->sendMsg(ResponseCode::OperationFailed, "Failed to get throttle", true);
302 cli->sendMsg(voldRc, msg, false);
309 cli->sendMsg(ResponseCode::CommandSyntaxError,
314 cli->sendMsg(ResponseCode::OperationFailed, "Failed to set throttle", true);
316 cli->sendMsg(ResponseCode::CommandOkay, "Interface throttling set", false);
324 cli->sendMsg(ResponseCode::CommandSyntaxError,
330 cli->sendMsg(ResponseCode::OperationFailed, "Failed to execute command", true);
332 cli->sendMsg(ResponseCode::CommandOkay, rbuf, false);
340 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
349 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
353 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid route prefix", false);
359 cli->sendMsg(ResponseCode::OperationFailed,
362 cli->sendMsg(ResponseCode::CommandOkay,
366 return sSecondaryTableCtrl->addRoute(cli, argv[3], argv[5],
369 cli->sendMsg(ResponseCode::CommandParameterError,
376 cli->sendMsg(ResponseCode::OperationFailed,
379 cli->sendMsg(ResponseCode::CommandOkay,
383 return sSecondaryTableCtrl->removeRoute(cli, argv[3], argv[5],
386 cli->sendMsg(ResponseCode::CommandParameterError,
391 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown interface cmd", false);
406 cli->sendMsg(ResponseCode::OperationFailed, "Interface not found", true);
434 cli->sendMsg(ResponseCode::InterfaceGetCfgResult, msg, false);
445 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
461 cli->sendMsg(ResponseCode::OperationFailed, "Failed to set address", true);
468 cli->sendMsg(ResponseCode::OperationFailed, "Failed to set prefixLength", true);
481 cli->sendMsg(ResponseCode::OperationFailed, "Failed to up interface", true);
489 cli->sendMsg(ResponseCode::OperationFailed, "Failed to down interface", true);
504 cli->sendMsg(ResponseCode::CommandParameterError, "Flag unsupported", false);
510 cli->sendMsg(ResponseCode::CommandOkay, "Interface configuration set", false);
519 cli->sendMsg(ResponseCode::CommandOkay, "Interface IP addresses cleared", false);
523 cli->sendMsg(ResponseCode::CommandSyntaxError,
534 cli->sendMsg(ResponseCode::OperationFailed,
540 cli->sendMsg(ResponseCode::CommandOkay, "IPv6 privacy extensions changed", false);
544 cli->sendMsg(ResponseCode::CommandSyntaxError,
555 cli->sendMsg(ResponseCode::OperationFailed,
561 cli->sendMsg(ResponseCode::CommandOkay, "IPv6 state changed", false);
564 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown interface cmd", false);
576 int CommandListener::ListTtysCmd::runCommand(SocketClient *cli,
582 cli->sendMsg(ResponseCode::TtyListResult, *it, false);
585 cli->sendMsg(ResponseCode::CommandOkay, "Ttys listed.", false);
593 int CommandListener::IpFwdCmd::runCommand(SocketClient *cli,
598 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
606 cli->sendMsg(ResponseCode::IpFwdStatusResult, tmp, false);
614 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown ipfwd cmd", false);
619 cli->sendMsg(ResponseCode::CommandOkay, "ipfwd operation succeeded", false);
621 cli->sendMsg(ResponseCode::OperationFailed, "ipfwd operation failed", true);
631 int CommandListener::TetherCmd::runCommand(SocketClient *cli,
636 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
653 cli->sendMsg(ResponseCode::TetherStatusResult, tmp, false);
661 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
667 cli->sendMsg(ResponseCode::CommandSyntaxError, "Bad number of arguments", false);
677 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid address", false);
694 cli->sendMsg(ResponseCode::TetherInterfaceListResult, *it, false);
697 cli->sendMsg(ResponseCode::CommandParameterError,
709 cli->sendMsg(ResponseCode::TetherDnsFwdTgtListResult, inet_ntoa(*it), false);
712 cli->sendMsg(ResponseCode::CommandParameterError,
717 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown tether cmd", false);
723 cli->sendMsg(ResponseCode::CommandOkay, "Tether operation succeeded", false);
725 cli->sendMsg(ResponseCode::OperationFailed, "Tether operation failed", true);
735 int CommandListener::NatCmd::runCommand(SocketClient *cli,
740 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
755 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown nat cmd", false);
760 cli->sendMsg(ResponseCode::CommandOkay, "Nat operation succeeded", false);
762 cli->sendMsg(ResponseCode::OperationFailed, "Nat operation failed", true);
772 int CommandListener::PppdCmd::runCommand(SocketClient *cli,
777 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
788 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid local address", false);
792 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid remote address", false);
796 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid dns1 address", false);
800 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid dns2 address", false);
807 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown pppd cmd", false);
812 cli->sendMsg(ResponseCode::CommandOkay, "Pppd operation succeeded", false);
814 cli->sendMsg(ResponseCode::OperationFailed, "Pppd operation failed", true);
824 int CommandListener::SoftapCmd::runCommand(SocketClient *cli,
830 cli->sendMsg(ResponseCode::CommandSyntaxError, "Softap Missing argument", false);
843 cli->sendMsg(ResponseCode::CommandOkay, retbuf, false);
850 cli->sendMsg(ResponseCode::SoftapStatusResult, retbuf, false);
856 cli->sendMsg(ResponseCode::CommandSyntaxError, "Softap Unknown cmd", false);
861 cli->sendMsg(ResponseCode::CommandOkay, "Softap operation succeeded", false);
863 cli->sendMsg(ResponseCode::OperationFailed, "Softap operation failed", true);
873 int CommandListener::ResolverCmd::runCommand(SocketClient *cli, int argc, char **argv) {
878 cli->sendMsg(ResponseCode::CommandSyntaxError, "Resolver missing arguments", false);
886 cli->sendMsg(ResponseCode::CommandSyntaxError,
894 cli->sendMsg(ResponseCode::CommandSyntaxError,
912 cli->sendMsg(ResponseCode::CommandSyntaxError,
920 cli->sendMsg(ResponseCode::CommandSyntaxError,
925 cli->sendMsg(ResponseCode::CommandSyntaxError,"Resolver unknown command", false);
930 cli->sendMsg(ResponseCode::CommandOkay, "Resolver command succeeded", false);
932 cli->sendMsg(ResponseCode::OperationFailed, "Resolver command failed", true);
983 void CommandListener::BandwidthControlCmd::sendGenericSyntaxError(SocketClient *cli, const char *usageMsg) {
986 cli->sendMsg(ResponseCode::CommandSyntaxError, msg, false);
990 void CommandListener::BandwidthControlCmd::sendGenericOkFail(SocketClient *cli, int cond) {
992 cli->sendMsg(ResponseCode::CommandOkay, "Bandwidth command succeeeded", false);
994 cli->sendMsg(ResponseCode::OperationFailed, "Bandwidth command failed", false);
998 void CommandListener::BandwidthControlCmd::sendGenericOpFailed(SocketClient *cli, const char *errMsg) {
999 cli->sendMsg(ResponseCode::OperationFailed, errMsg, false);
1002 int CommandListener::BandwidthControlCmd::runCommand(SocketClient *cli, int argc, char **argv) {
1004 sendGenericSyntaxError(cli, "<cmds> <args...>");
1012 sendGenericOkFail(cli, rc);
1018 sendGenericOkFail(cli, rc);
1024 sendGenericSyntaxError(cli, "removequota <interface>");
1028 sendGenericOkFail(cli, rc);
1035 sendGenericSyntaxError(cli, "getquota");
1040 sendGenericOpFailed(cli, "Failed to get quota");
1046 cli->sendMsg(ResponseCode::QuotaCounterResult, msg, false);
1054 sendGenericSyntaxError(cli, "getiquota <iface>");
1060 sendGenericOpFailed(cli, "Failed to get quota");
1065 cli->sendMsg(ResponseCode::QuotaCounterResult, msg, false);
1072 sendGenericSyntaxError(cli, "setquota <interface> <bytes>");
1076 sendGenericOkFail(cli, rc);
1082 sendGenericSyntaxError(cli, "setquotas <bytes> <interface> ...");
1091 cli->sendMsg(ResponseCode::OperationFailed,
1097 sendGenericOkFail(cli, rc);
1104 sendGenericSyntaxError(cli, "removequotas <interface> ...");
1113 cli->sendMsg(ResponseCode::OperationFailed,
1119 sendGenericOkFail(cli, rc);
1125 sendGenericSyntaxError(cli, "removeiquota <interface>");
1129 sendGenericOkFail(cli, rc);
1135 sendGenericSyntaxError(cli, "setiquota <interface> <bytes>");
1139 sendGenericOkFail(cli, rc);
1145 sendGenericSyntaxError(cli, "addnaughtyapps <appUid> ...");
1149 sendGenericOkFail(cli, rc);
1156 sendGenericSyntaxError(cli, "removenaughtyapps <appUid> ...");
1160 sendGenericOkFail(cli, rc);
1166 sendGenericSyntaxError(cli, "setglobalalert <bytes>");
1170 sendGenericOkFail(cli, rc);
1176 sendGenericSyntaxError(cli, "debugsettetherglobalalert <interface0> <interface1>");
1181 sendGenericOkFail(cli, rc);
1187 sendGenericSyntaxError(cli, "removeglobalalert");
1191 sendGenericOkFail(cli, rc);
1197 sendGenericSyntaxError(cli, "debugremovetetherglobalalert <interface0> <interface1>");
1202 sendGenericOkFail(cli, rc);
1208 sendGenericSyntaxError(cli, "setsharedalert <bytes>");
1212 sendGenericOkFail(cli, rc);
1218 sendGenericSyntaxError(cli, "removesharedalert");
1222 sendGenericOkFail(cli, rc);
1228 sendGenericSyntaxError(cli, "setinterfacealert <interface> <bytes>");
1232 sendGenericOkFail(cli, rc);
1238 sendGenericSyntaxError(cli, "removeinterfacealert <interface>");
1242 sendGenericOkFail(cli, rc);
1250 sendGenericSyntaxError(cli, "gettetherstats <interface0> <interface1>");
1259 sendGenericOpFailed(cli, extraProcessingInfo.c_str());
1264 cli->sendMsg(ResponseCode::TetheringStatsResult, msg, false);
1270 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown bandwidth cmd", false);
1278 int CommandListener::IdletimerControlCmd::runCommand(SocketClient *cli, int argc, char **argv) {
1281 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1289 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1291 cli->sendMsg(ResponseCode::CommandOkay, "Enable success", false);
1298 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1300 cli->sendMsg(ResponseCode::CommandOkay, "Disable success", false);
1306 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1311 cli->sendMsg(ResponseCode::OperationFailed, "Failed to add interface", false);
1313 cli->sendMsg(ResponseCode::CommandOkay, "Add success", false);
1319 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1325 cli->sendMsg(ResponseCode::OperationFailed, "Failed to remove interface", false);
1327 cli->sendMsg(ResponseCode::CommandOkay, "Remove success", false);
1332 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown idletimer cmd", false);
1340 int CommandListener::FirewallCmd::sendGenericOkFail(SocketClient *cli, int cond) {
1342 cli->sendMsg(ResponseCode::CommandOkay, "Firewall command succeeded", false);
1344 cli->sendMsg(ResponseCode::OperationFailed, "Firewall command failed", false);
1357 int CommandListener::FirewallCmd::runCommand(SocketClient *cli, int argc,
1360 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing command", false);
1366 return sendGenericOkFail(cli, res);
1370 return sendGenericOkFail(cli, res);
1374 return sendGenericOkFail(cli, res);
1379 cli->sendMsg(ResponseCode::CommandSyntaxError,
1388 return sendGenericOkFail(cli, res);
1393 cli->sendMsg(ResponseCode::CommandSyntaxError,
1403 return sendGenericOkFail(cli, res);
1408 cli->sendMsg(ResponseCode::CommandSyntaxError,
1421 return sendGenericOkFail(cli, res);
1426 cli->sendMsg(ResponseCode::CommandSyntaxError,
1436 return sendGenericOkFail(cli, res);
1439 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown command", false);