Lines Matching refs:cli

85 int CommandListener::DumpCmd::runCommand(SocketClient *cli,
87 cli->sendMsg(0, "Dumping loop status", false);
88 if (Loop::dumpState(cli)) {
89 cli->sendMsg(ResponseCode::CommandOkay, "Loop dump failed", true);
91 cli->sendMsg(0, "Dumping DM status", false);
92 if (Devmapper::dumpState(cli)) {
93 cli->sendMsg(ResponseCode::CommandOkay, "Devmapper dump failed", true);
95 cli->sendMsg(0, "Dumping mounted filesystems", false);
101 cli->sendMsg(0, line, false);;
106 cli->sendMsg(ResponseCode::CommandOkay, "dump complete", false);
115 int CommandListener::VolumeCmd::runCommand(SocketClient *cli,
120 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
128 return vm->listVolumes(cli);
131 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume debug <off/on>", false);
137 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume mount <path>", false);
145 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume unmount <path> [force|force_and_revert]", false);
160 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: volume format <path>", false);
166 cli->sendMsg(ResponseCode::CommandSyntaxError,
173 cli->sendMsg(ResponseCode::CommandSyntaxError,
181 cli->sendMsg(ResponseCode::CommandSyntaxError,
187 cli->sendMsg(
190 cli->sendMsg(ResponseCode::ShareEnabledResult,
195 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown volume cmd", false);
199 cli->sendMsg(ResponseCode::CommandOkay, "volume operation succeeded", false);
203 cli->sendMsg(rc, "volume operation failed", true);
213 int CommandListener::StorageCmd::runCommand(SocketClient *cli,
218 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
227 cli->sendMsg(ResponseCode::OperationFailed, "Failed to open /proc", true);
249 cli->sendMsg(ResponseCode::StorageUsersListResult, msg, false);
253 cli->sendMsg(ResponseCode::CommandOkay, "Storage user list complete", false);
255 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown storage cmd", false);
264 void CommandListener::AsecCmd::listAsecsInDirectory(SocketClient *cli, const char *directory) {
268 cli->sendMsg(ResponseCode::OperationFailed, "Failed to open asec dir", true);
277 cli->sendMsg(ResponseCode::OperationFailed, "Failed to allocate memory", true);
294 cli->sendMsg(ResponseCode::AsecListResult, id, false);
302 int CommandListener::AsecCmd::runCommand(SocketClient *cli,
305 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
315 listAsecsInDirectory(cli, Volume::SEC_ASECDIR_EXT);
316 listAsecsInDirectory(cli, Volume::SEC_ASECDIR_INT);
320 cli->sendMsg(ResponseCode::CommandSyntaxError,
332 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: asec finalize <container-id>", false);
339 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: asec fixperms <container-id> <gid> <filename>", false);
346 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: asec fixperms <container-id> <gid> <filename>", false);
354 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: asec destroy <container-id> [force]", false);
365 cli->sendMsg(ResponseCode::CommandSyntaxError,
373 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: asec unmount <container-id> [force]", false);
384 cli->sendMsg(ResponseCode::CommandSyntaxError,
392 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: asec path <container-id>", false);
398 cli->sendMsg(ResponseCode::AsecPathResult, path, false);
404 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: asec fspath <container-id>", false);
410 cli->sendMsg(ResponseCode::AsecPathResult, path, false);
415 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown asec cmd", false);
419 cli->sendMsg(ResponseCode::CommandOkay, "asec operation succeeded", false);
422 cli->sendMsg(rc, "asec operation failed", true);
432 int CommandListener::ObbCmd::runCommand(SocketClient *cli,
435 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
445 rc = vm->listMountedObbs(cli);
449 cli->sendMsg(ResponseCode::CommandSyntaxError,
457 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: obb unmount <source file> [force]", false);
468 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: obb path <source file>", false);
474 cli->sendMsg(ResponseCode::AsecPathResult, path, false);
479 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown obb cmd", false);
483 cli->sendMsg(ResponseCode::CommandOkay, "obb operation succeeded", false);
486 cli->sendMsg(rc, "obb operation failed", true);
496 int CommandListener::XwarpCmd::runCommand(SocketClient *cli,
499 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
505 cli->sendMsg(ResponseCode::OperationFailed, "Failed to enable xwarp", true);
509 cli->sendMsg(ResponseCode::CommandOkay, "Xwarp mirroring started", false);
512 cli->sendMsg(ResponseCode::OperationFailed, "Failed to disable xwarp", true);
516 cli->sendMsg(ResponseCode::CommandOkay, "Xwarp disabled", false);
523 cli->sendMsg(ResponseCode::OperationFailed, "Failed to get xwarp status", true);
527 cli->sendMsg(ResponseCode::XwarpStatusResult, msg, false);
529 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown storage cmd", false);
539 int CommandListener::CryptfsCmd::runCommand(SocketClient *cli,
541 if ((cli->getUid() != 0) && (cli->getUid() != AID_SYSTEM)) {
542 cli->sendMsg(ResponseCode::CommandNoPermission, "No permission to run cryptfs commands", false);
547 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing Argument", false);
555 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs checkpw <passwd>", false);
562 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs restart", false);
569 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs cryptocomplete", false);
576 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs enablecrypto <wipe|inplace> <passwd>", false);
583 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs changepw <newpasswd>", false);
590 cli->sendMsg(ResponseCode::CommandSyntaxError, "Usage: cryptfs verifypw <passwd>", false);
597 cli->sendMsg(ResponseCode::CommandSyntaxError, "Unknown cryptfs cmd", false);
604 cli->sendMsg(ResponseCode::CommandOkay, msg, false);