Home
last modified time | relevance | path

Searched refs:cli (Results 1 – 25 of 25) sorted by relevance

/system/netd/server/
DNdcDispatcher.cpp53 #define PARSE_INT_RETURN_IF_FAIL(cli, label, intLabel, errMsg, addErrno) \ argument
57 (cli)->sendMsg(ResponseCode::OperationFailed, (errMsg), (addErrno)); \
62 #define PARSE_UINT_RETURN_IF_FAIL(cli, label, intLabel, errMsg, addErrno) \ argument
66 (cli)->sendMsg(ResponseCode::OperationFailed, (errMsg), (addErrno)); \
166 int NdcDispatcher::InterfaceCmd::runCommand(NdcClient* cli, int argc, char** argv) const { in runCommand() argument
168 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false); in runCommand()
178 cli->sendMsg(ResponseCode::OperationFailed, "Failed to get interface list", true); in runCommand()
182 cli->sendMsg(ResponseCode::InterfaceListResult, iface.c_str(), false); in runCommand()
185 cli->sendMsg(ResponseCode::CommandOkay, "Interface list completed", false); in runCommand()
192 cli->sendMsg(ResponseCode::CommandSyntaxError, "Missing argument", false); in runCommand()
[all …]
DNdcDispatcher.h84 int runCommand(NdcClient* cli, int argc, char** argv) const;
91 int runCommand(NdcClient* cli, int argc, char** argv) const;
98 int runCommand(NdcClient* cli, int argc, char** argv) const;
105 int runCommand(NdcClient* cli, int argc, char** argv) const;
112 int runCommand(NdcClient* cli, int argc, char** argv) const;
115 void sendGenericOkFail(NdcClient* cli, int cond) const;
116 void sendGenericOpFailed(NdcClient* cli, const char* errMsg) const;
117 void sendGenericSyntaxError(NdcClient* cli, const char* usageMsg) const;
124 int runCommand(NdcClient* cli, int argc, char** argv) const;
131 int runCommand(NdcClient* cli, int argc, char** argv) const;
[all …]
/system/logging/logd/
DCommandListener.cpp69 static int LogIdCommand(SocketClient* cli, int argc, char** argv, F&& function) { in LogIdCommand() argument
72 cli->sendMsg("Missing Argument"); in LogIdCommand()
79 cli->sendMsg("Range Error"); in LogIdCommand()
87 int CommandListener::ClearCmd::runCommand(SocketClient* cli, int argc, char** argv) { in runCommand() argument
88 uid_t uid = cli->getUid(); in runCommand()
89 if (clientHasLogCredentials(cli)) { in runCommand()
93 return LogIdCommand(cli, argc, argv, [&](log_id_t id) { in runCommand()
94 cli->sendMsg(buf()->Clear(id, uid) ? "success" : "busy"); in runCommand()
99 static int LogSizeCommand(SocketClient* cli, int argc, char** argv, F&& size_function) { in LogSizeCommand() argument
100 return LogIdCommand(cli, argc, argv, [&](log_id_t log_id) { in LogSizeCommand()
[all …]
DLogReader.cpp107 bool LogReader::onDataAvailable(SocketClient* cli) { in onDataAvailable() argument
116 int len = read(cli->getSocket(), buffer, sizeof(buffer) - 1); in onDataAvailable()
118 DoSocketDelete(cli); in onDataAvailable()
124 if (DoSocketDelete(cli)) { in onDataAvailable()
188 bool privileged = clientHasLogCredentials(cli); in onDataAvailable()
189 bool can_read_security = CanReadSecurityLogs(cli); in onDataAvailable()
194 std::unique_ptr<LogWriter> socket_log_writer(new SocketLogWriter(this, cli, privileged)); in onDataAvailable()
236 cli->getUid(), cli->getGid(), cli->getPid(), nonBlock ? 'n' : 'b', tail, logMask, in onDataAvailable()
248 cli->incRef(); in onDataAvailable()
250 entry->set_pending_reader_thread_key(cli->getUid(), cli->getGid(), cli->getPid(), in onDataAvailable()
[all …]
DLogPermissions.cpp145 bool clientHasLogCredentials(SocketClient* cli) { in clientHasLogCredentials() argument
146 if (UserIsPrivileged(cli->getUid()) || UserIsPrivileged(cli->getGid())) { in clientHasLogCredentials()
158 int result = getsockopt(cli->getSocket(), SOL_SOCKET, SO_PEERGROUPS, supplemental_groups.data(), in clientHasLogCredentials()
163 return clientHasLogCredentials(cli->getUid(), cli->getGid(), cli->getPid()); in clientHasLogCredentials()
167 result = getsockopt(cli->getSocket(), SOL_SOCKET, SO_PEERGROUPS, supplemental_groups.data(), in clientHasLogCredentials()
172 return clientHasLogCredentials(cli->getUid(), cli->getGid(), cli->getPid()); in clientHasLogCredentials()
186 bool clientIsExemptedFromUserConsent(SocketClient* cli) { in clientIsExemptedFromUserConsent() argument
187 return cli->getUid() < AID_APP_START; in clientIsExemptedFromUserConsent()
DLogPermissions.h24 bool clientHasLogCredentials(SocketClient* cli);
26 bool clientIsExemptedFromUserConsent(SocketClient* cli);
DLogReader.h30 virtual bool onDataAvailable(SocketClient* cli);
35 bool DoSocketDelete(SocketClient* cli);
DTrustyLog.cpp73 bool TrustyLog::onDataAvailable(SocketClient* cli) { in onDataAvailable() argument
81 read(cli->getSocket(), buffer + len, sizeof(buffer) - 1 - len)); in onDataAvailable()
DTrustyLog.h37 virtual bool onDataAvailable(SocketClient* cli);
DLogAudit.h38 virtual bool onDataAvailable(SocketClient* cli);
DLogKlog.h49 virtual bool onDataAvailable(SocketClient* cli);
DLogAudit.cpp82 bool LogAudit::onDataAvailable(SocketClient* cli) { in onDataAvailable() argument
94 if (audit_get_reply(cli->getSocket(), &rep, GET_REPLY_BLOCKING, 0) < 0) { in onDataAvailable()
DLogKlog.cpp220 bool LogKlog::onDataAvailable(SocketClient* cli) { in onDataAvailable() argument
234 read(cli->getSocket(), buffer + len, sizeof(buffer) - 1 - len); in onDataAvailable()
/system/security/keystore/tests/
Dlist_auth_bound_keys_test.sh30 function cli { function
39 cli $USER1_ID "delete --name=no_auth_key" || true
40 cli $USER1_ID "generate --name=no_auth_key"
41 cli $USER2_ID "delete --name=auth_key" || true
42 if ! cli $USER2_ID "generate --name=auth_key --auth_bound"; then
49 if cli $USER2_ID list-apps-with-keys; then
55 if cli $ROOT_ID "list-apps-with-keys"; then
71 done <<< $(cli $SYSTEM_ID "list-apps-with-keys")
/system/core/libsysutils/src/
DFrameworkListener.cpp94 void FrameworkListener::dispatchCommand(SocketClient *cli, char *data) { in dispatchCommand() argument
128 cli->sendMsg(500, "Unsupported escape sequence", false); in dispatchCommand()
154 cli->sendMsg(500, "Invalid sequence number", false); in dispatchCommand()
157 cli->setCmdNum(cmdNum); in dispatchCommand()
182 cli->sendMsg(500, "Unclosed quotes error", false); in dispatchCommand()
194 if (c->runCommand(cli, argc, argv)) { in dispatchCommand()
200 cli->sendMsg(500, "Command not recognized", false); in dispatchCommand()
208 cli->sendMsg(500, "Command too long", false); in dispatchCommand()
DNetlinkListener.cpp46 bool NetlinkListener::onDataAvailable(SocketClient *cli) in onDataAvailable() argument
48 int socket = cli->getSocket(); in onDataAvailable()
DSocketListener_test.cpp105 int runCommand(SocketClient* cli, int argc, char** argv) { in runCommand() argument
108 cli->sendMsg(42, reply.c_str(), /*addErrno=*/false, /*useCmdNum=*/false); in runCommand()
/system/libziparchive/
Drun-ziptool-tests-on-android.sh7 adb push cli-tests/ "$test_dir"
15 exec adb shell "$dash_t" "${test_dir}"/cli-test "${test_dir}"/cli-tests/*.test
DAndroid.bp292 data: ["cli-tests/**/*"],
293 target_required: ["cli-test", "ziptool"],
294 data_device_bins: ["cli-test"],
/system/tools/xsdc/src/main/java/com/android/xsdc/
DMain.java32 import org.apache.commons.cli.CommandLine;
33 import org.apache.commons.cli.CommandLineParser;
34 import org.apache.commons.cli.GnuParser;
35 import org.apache.commons.cli.HelpFormatter;
36 import org.apache.commons.cli.Option;
37 import org.apache.commons.cli.OptionBuilder;
38 import org.apache.commons.cli.OptionGroup;
39 import org.apache.commons.cli.Options;
40 import org.apache.commons.cli.ParseException;
/system/core/cli-test/
DAndroid.bp6 name: "cli-test",
8 srcs: ["cli-test.cpp"],
DREADME.md1 # cli-test
5 `cli-test` makes integration testing of command-line tools easier.
/system/tools/xsdc/
DAndroid.bp11 "commons-cli-1.2",
22 "commons-cli-1.2",
/system/security/prng_seeder/src/
Dmain.rs72 let cli = Cli::try_parse()?; in setup() localVariable
76 let listener = match cli.socket { in setup()
81 let hwrng = std::fs::File::open(&cli.source) in setup()
82 .with_context(|| format!("Unable to open hwrng {}", cli.source.display()))?; in setup()
/system/core/libsysutils/include/sysutils/
DNetlinkListener.h45 virtual bool onDataAvailable(SocketClient *cli);