staticvoid usage(constchar* program) {
ALOGE("Usage: %s [--no-gateway] -i <interface>", program);
ALOGE(" If the optional parameter --no-gateway is specified the client");
ALOGE(" will not configure the default gateway of the system.");
}
for (int i = 1; i < argc; ++i) { if (strcmp(argv[i], "-i") == 0) { if (i + 1 < argc) {
interfaceName = argv[++i];
} else {
ALOGE("ERROR: -i parameter needs an argument");
usage(argv[0]); return1;
}
} elseif (strcmp(argv[i], "--no-gateway") == 0) {
options |= static_cast<uint32_t>(ClientOption::NoGateway);
} else {
ALOGE("ERROR: unknown parameters %s", argv[i]);
usage(argv[0]); return1;
}
} if (interfaceName == nullptr) {
ALOGE("ERROR: No interface specified");
usage(argv[0]); return1;
}
DhcpClient client(options);
Result res = client.init(interfaceName); if (!res) {
ALOGE("Failed to initialize DHCP client: %s\n", res.c_str()); return1;
}
res = client.run(); if (!res) {
ALOGE("DHCP client failed: %s\n", res.c_str()); return1;
} // This is weird and shouldn't happen, the client should run forever. return0;
}
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.