Lines Matching defs:cli

133 int CommandListener::InterfaceCmd::runCommand(SocketClient *cli,
136 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
145 cli->sendMsg(ResponseCode::OperationFailed, "Failed to open sysfs dir", true);
152 cli->sendMsg(ResponseCode::InterfaceListResult, de->d_name, false);
155 cli->sendMsg(ResponseCode::CommandOkay, "Interface list completed", false);
159 cli->sendMsg(ResponseCode::CommandSyntaxError,
165 cli->sendMsg(ResponseCode::OperationFailed, "Failed to read counters", true);
171 cli->sendMsg(ResponseCode::InterfaceRxCounterResult, msg, false);
177 cli->sendMsg(ResponseCode::CommandSyntaxError,
183 cli->sendMsg(ResponseCode::OperationFailed, "Failed to read counters", true);
189 cli->sendMsg(ResponseCode::InterfaceTxCounterResult, msg, false);
194 cli->sendMsg(ResponseCode::CommandSyntaxError,
209 cli->sendMsg(ResponseCode::OperationFailed, "Failed to get throttle", true);
213 cli->sendMsg(voldRc, msg, false);
220 cli->sendMsg(ResponseCode::CommandSyntaxError,
225 cli->sendMsg(ResponseCode::OperationFailed, "Failed to set throttle", true);
227 cli->sendMsg(ResponseCode::CommandOkay, "Interface throttling set", false);
235 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
244 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
248 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid route prefix", false);
254 cli->sendMsg(ResponseCode::OperationFailed,
257 cli->sendMsg(ResponseCode::CommandOkay,
261 return sSecondaryTableCtrl->addRoute(cli, argv[3], argv[5],
264 cli->sendMsg(ResponseCode::CommandParameterError,
271 cli->sendMsg(ResponseCode::OperationFailed,
274 cli->sendMsg(ResponseCode::CommandOkay,
278 return sSecondaryTableCtrl->removeRoute(cli, argv[3], argv[5],
281 cli->sendMsg(ResponseCode::CommandParameterError,
286 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown interface cmd", false);
301 cli->sendMsg(ResponseCode::OperationFailed, "Interface not found", true);
329 cli->sendMsg(ResponseCode::InterfaceGetCfgResult, msg, false);
340 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
349 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid address", false);
355 cli->sendMsg(ResponseCode::OperationFailed, "Failed to set address", true);
362 cli->sendMsg(ResponseCode::OperationFailed, "Failed to set prefixLength", true);
374 cli->sendMsg(ResponseCode::OperationFailed, "Failed to up interface", true);
382 cli->sendMsg(ResponseCode::OperationFailed, "Failed to down interface", true);
397 cli->sendMsg(ResponseCode::CommandParameterError, "Flag unsupported", false);
403 cli->sendMsg(ResponseCode::CommandOkay, "Interface configuration set", false);
412 cli->sendMsg(ResponseCode::CommandOkay, "Interface IP addresses cleared", false);
416 cli->sendMsg(ResponseCode::CommandSyntaxError,
427 cli->sendMsg(ResponseCode::OperationFailed,
433 cli->sendMsg(ResponseCode::CommandOkay, "IPv6 privacy extensions changed", false);
437 cli->sendMsg(ResponseCode::CommandSyntaxError,
448 cli->sendMsg(ResponseCode::OperationFailed,
454 cli->sendMsg(ResponseCode::CommandOkay, "IPv6 state changed", false);
457 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown interface cmd", false);
469 int CommandListener::ListTtysCmd::runCommand(SocketClient *cli,
475 cli->sendMsg(ResponseCode::TtyListResult, *it, false);
478 cli->sendMsg(ResponseCode::CommandOkay, "Ttys listed.", false);
486 int CommandListener::IpFwdCmd::runCommand(SocketClient *cli,
491 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
499 cli->sendMsg(ResponseCode::IpFwdStatusResult, tmp, false);
507 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown ipfwd cmd", false);
512 cli->sendMsg(ResponseCode::CommandOkay, "ipfwd operation succeeded", false);
514 cli->sendMsg(ResponseCode::OperationFailed, "ipfwd operation failed", true);
524 int CommandListener::TetherCmd::runCommand(SocketClient *cli,
529 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
540 cli->sendMsg(ResponseCode::TetherStatusResult, tmp, false);
548 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
554 cli->sendMsg(ResponseCode::CommandSyntaxError, "Bad number of arguments", false);
564 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid address", false);
581 cli->sendMsg(ResponseCode::TetherInterfaceListResult, *it, false);
584 cli->sendMsg(ResponseCode::CommandParameterError,
596 cli->sendMsg(ResponseCode::TetherDnsFwdTgtListResult, inet_ntoa(*it), false);
599 cli->sendMsg(ResponseCode::CommandParameterError,
604 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown tether cmd", false);
610 cli->sendMsg(ResponseCode::CommandOkay, "Tether operation succeeded", false);
612 cli->sendMsg(ResponseCode::OperationFailed, "Tether operation failed", true);
622 int CommandListener::NatCmd::runCommand(SocketClient *cli,
627 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
642 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown nat cmd", false);
647 cli->sendMsg(ResponseCode::CommandOkay, "Nat operation succeeded", false);
649 cli->sendMsg(ResponseCode::OperationFailed, "Nat operation failed", true);
659 int CommandListener::PppdCmd::runCommand(SocketClient *cli,
664 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
675 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid local address", false);
679 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid remote address", false);
683 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid dns1 address", false);
687 cli->sendMsg(ResponseCode::CommandParameterError, "Invalid dns2 address", false);
694 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown pppd cmd", false);
699 cli->sendMsg(ResponseCode::CommandOkay, "Pppd operation succeeded", false);
701 cli->sendMsg(ResponseCode::OperationFailed, "Pppd operation failed", true);
711 int CommandListener::PanCmd::runCommand(SocketClient *cli,
716 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
729 cli->sendMsg(ResponseCode::PanStatusResult, tmp, false);
733 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown pan cmd", false);
738 cli->sendMsg(ResponseCode::CommandOkay, "Pan operation succeeded", false);
740 cli->sendMsg(ResponseCode::OperationFailed, "Pan operation failed", true);
750 int CommandListener::SoftapCmd::runCommand(SocketClient *cli,
756 cli->sendMsg(ResponseCode::CommandSyntaxError, "Softap Missing argument", false);
773 cli->sendMsg(ResponseCode::CommandOkay, retbuf, false);
780 cli->sendMsg(ResponseCode::SoftapStatusResult, retbuf, false);
786 cli->sendMsg(ResponseCode::CommandSyntaxError, "Softap Unknown cmd", false);
791 cli->sendMsg(ResponseCode::CommandOkay, "Softap operation succeeded", false);
793 cli->sendMsg(ResponseCode::OperationFailed, "Softap operation failed", true);
803 int CommandListener::ResolverCmd::runCommand(SocketClient *cli, int argc, char **argv) {
808 cli->sendMsg(ResponseCode::CommandSyntaxError, "Resolver missing arguments", false);
816 cli->sendMsg(ResponseCode::CommandSyntaxError,
824 cli->sendMsg(ResponseCode::CommandSyntaxError,
842 cli->sendMsg(ResponseCode::CommandSyntaxError,
850 cli->sendMsg(ResponseCode::CommandSyntaxError,
855 cli->sendMsg(ResponseCode::CommandSyntaxError,"Resolver unknown command", false);
860 cli->sendMsg(ResponseCode::CommandOkay, "Resolver command succeeded", false);
862 cli->sendMsg(ResponseCode::OperationFailed, "Resolver command failed", true);
913 void CommandListener::BandwidthControlCmd::sendGenericSyntaxError(SocketClient *cli, const char *usageMsg) {
916 cli->sendMsg(ResponseCode::CommandSyntaxError, msg, false);
920 void CommandListener::BandwidthControlCmd::sendGenericOkFail(SocketClient *cli, int cond) {
922 cli->sendMsg(ResponseCode::CommandOkay, "Bandwidth command succeeeded", false);
924 cli->sendMsg(ResponseCode::OperationFailed, "Bandwidth command failed", false);
928 void CommandListener::BandwidthControlCmd::sendGenericOpFailed(SocketClient *cli, const char *errMsg) {
929 cli->sendMsg(ResponseCode::OperationFailed, errMsg, false);
932 int CommandListener::BandwidthControlCmd::runCommand(SocketClient *cli, int argc, char **argv) {
934 sendGenericSyntaxError(cli, "<cmds> <args...>");
942 sendGenericOkFail(cli, rc);
948 sendGenericOkFail(cli, rc);
954 sendGenericSyntaxError(cli, "removequota <interface>");
958 sendGenericOkFail(cli, rc);
965 sendGenericSyntaxError(cli, "getquota");
970 sendGenericOpFailed(cli, "Failed to get quota");
976 cli->sendMsg(ResponseCode::QuotaCounterResult, msg, false);
984 sendGenericSyntaxError(cli, "getiquota <iface>");
990 sendGenericOpFailed(cli, "Failed to get quota");
995 cli->sendMsg(ResponseCode::QuotaCounterResult, msg, false);
1002 sendGenericSyntaxError(cli, "setquota <interface> <bytes>");
1006 sendGenericOkFail(cli, rc);
1012 sendGenericSyntaxError(cli, "setquotas <bytes> <interface> ...");
1021 cli->sendMsg(ResponseCode::OperationFailed,
1027 sendGenericOkFail(cli, rc);
1034 sendGenericSyntaxError(cli, "removequotas <interface> ...");
1043 cli->sendMsg(ResponseCode::OperationFailed,
1049 sendGenericOkFail(cli, rc);
1055 sendGenericSyntaxError(cli, "removeiquota <interface>");
1059 sendGenericOkFail(cli, rc);
1065 sendGenericSyntaxError(cli, "setiquota <interface> <bytes>");
1069 sendGenericOkFail(cli, rc);
1075 sendGenericSyntaxError(cli, "addnaughtyapps <appUid> ...");
1079 sendGenericOkFail(cli, rc);
1086 sendGenericSyntaxError(cli, "removenaughtyapps <appUid> ...");
1090 sendGenericOkFail(cli, rc);
1096 sendGenericSyntaxError(cli, "setglobalalert <bytes>");
1100 sendGenericOkFail(cli, rc);
1106 sendGenericSyntaxError(cli, "debugsettetherglobalalert <interface0> <interface1>");
1111 sendGenericOkFail(cli, rc);
1117 sendGenericSyntaxError(cli, "removeglobalalert");
1121 sendGenericOkFail(cli, rc);
1127 sendGenericSyntaxError(cli, "debugremovetetherglobalalert <interface0> <interface1>");
1132 sendGenericOkFail(cli, rc);
1138 sendGenericSyntaxError(cli, "setsharedalert <bytes>");
1142 sendGenericOkFail(cli, rc);
1148 sendGenericSyntaxError(cli, "removesharedalert");
1152 sendGenericOkFail(cli, rc);
1158 sendGenericSyntaxError(cli, "setinterfacealert <interface> <bytes>");
1162 sendGenericOkFail(cli, rc);
1168 sendGenericSyntaxError(cli, "removeinterfacealert <interface>");
1172 sendGenericOkFail(cli, rc);
1180 sendGenericSyntaxError(cli, "gettetherstats <interface0> <interface1>");
1189 sendGenericOpFailed(cli, extraProcessingInfo.c_str());
1194 cli->sendMsg(ResponseCode::TetheringStatsResult, msg, false);
1200 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown bandwidth cmd", false);
1208 int CommandListener::IdletimerControlCmd::runCommand(SocketClient *cli, int argc, char **argv) {
1211 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1219 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1221 cli->sendMsg(ResponseCode::CommandOkay, "Enable success", false);
1228 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1230 cli->sendMsg(ResponseCode::CommandOkay, "Disable success", false);
1236 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1240 cli->sendMsg(ResponseCode::OperationFailed, "Failed to add interface", false);
1242 cli->sendMsg(ResponseCode::CommandOkay, "Add success", false);
1248 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false);
1253 cli->sendMsg(ResponseCode::OperationFailed, "Failed to remove interface", false);
1255 cli->sendMsg(ResponseCode::CommandOkay, "Remove success", false);
1260 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown idletimer cmd", false);