Lines Matching defs:bytes
444 LOGE("Invalid bytes value. 1..max_int64.");
548 LOGE("Invalid bytes value. 1..max_int64.");
600 int BandwidthController::getInterfaceSharedQuota(int64_t *bytes) {
601 return getInterfaceQuota("shared", bytes);
604 int BandwidthController::getInterfaceQuota(const char *costName, int64_t *bytes) {
616 scanRes = fscanf(fp, "%lld", bytes);
617 LOGV("Read quota res=%d bytes=%lld", scanRes, *bytes);
655 int BandwidthController::updateQuota(const char *quotaName, int64_t bytes) {
666 fprintf(fp, "%lld\n", bytes);
671 int BandwidthController::runIptablesAlertCmd(IptOp op, const char *alertName, int64_t bytes) {
692 bytes, alertName, alertName);
697 bytes, alertName, alertName);
703 int BandwidthController::runIptablesAlertFwdCmd(IptOp op, const char *alertName, int64_t bytes) {
724 bytes, alertName, alertName);
730 int BandwidthController::setGlobalAlert(int64_t bytes) {
734 if (!bytes) {
735 LOGE("Invalid bytes value. 1..max_int64.");
739 res = updateQuota(alertName, bytes);
741 res = runIptablesAlertCmd(IptOpInsert, alertName, bytes);
744 res |= runIptablesAlertFwdCmd(IptOpInsert, alertName, bytes);
747 globalAlertBytes = bytes;
813 int BandwidthController::setSharedAlert(int64_t bytes) {
818 if (!bytes) {
819 LOGE("Invalid bytes value. 1..max_int64.");
822 return setCostlyAlert("shared", bytes, &sharedAlertBytes);
829 int BandwidthController::setInterfaceAlert(const char *iface, int64_t bytes) {
832 if (!bytes) {
833 LOGE("Invalid bytes value. 1..max_int64.");
846 return setCostlyAlert(iface, bytes, &it->alert);
865 int BandwidthController::setCostlyAlert(const char *costName, int64_t bytes, int64_t *alertBytes) {
871 if (!bytes) {
872 LOGE("Invalid bytes value. 1..max_int64.");
880 asprintf(&alertQuotaCmd, ALERT_IPT_TEMPLATE, "-I", chainNameAndPos, bytes, alertName,
886 *alertBytes = bytes;
915 * Parse the ptks and bytes out of:
916 * Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
917 * pkts bytes target prot opt in out source destination
931 int64_t packets, bytes;
935 iface0[0] = iface1[0] = rest[0] = packets = bytes = 0;
937 &packets, &bytes, iface0, iface1, rest);
938 LOGV("parse res=%d iface0=<%s> iface1=<%s> pkts=%lld bytes=%lld rest=<%s> orig line=<%s>", res,
939 iface0, iface1, packets, bytes, rest, buffPtr);
944 LOGV("iface_in=%s iface_out=%s rx_bytes=%lld rx_packets=%lld ", iface0, iface1, bytes, packets);
946 stats.rxBytes = bytes;
948 LOGV("iface_in=%s iface_out=%s tx_bytes=%lld tx_packets=%lld ", iface1, iface0, bytes, packets);
950 stats.txBytes = bytes;