OSDN Git Service

am 54b75b4e: Use CCMP for WPA2 mode
authorIrfan Sheriff <isheriff@google.com>
Wed, 26 Oct 2011 15:22:47 +0000 (15:22 +0000)
committerAndroid Git Automerger <android-git-automerger@android.com>
Wed, 26 Oct 2011 15:22:47 +0000 (15:22 +0000)
* commit '54b75b4e772ac77df141ab077be074bc1c098987':
  Use CCMP for WPA2 mode

BandwidthController.cpp
CommandListener.cpp
logwrapper.c

index f0a856e..bb088a9 100644 (file)
@@ -145,7 +145,7 @@ BandwidthController::BandwidthController(void) {
 int BandwidthController::runIpxtablesCmd(const char *cmd, IptRejectOp rejectHandling) {
     int res = 0;
 
-    LOGV("runIpxtablesCmd(cmd=%s)", cmd);
+    ALOGV("runIpxtablesCmd(cmd=%s)", cmd);
     res |= runIptablesCmd(cmd, rejectHandling, IptIpV4);
     res |= runIptablesCmd(cmd, rejectHandling, IptIpV6);
     return res;
@@ -244,7 +244,7 @@ int BandwidthController::disableBandwidthControl(void) {
 int BandwidthController::runCommands(int numCommands, const char *commands[],
                                      RunCmdErrHandling cmdErrHandling) {
     int res = 0;
-    LOGV("runCommands(): %d commands", numCommands);
+    ALOGV("runCommands(): %d commands", numCommands);
     for (int cmdNum = 0; cmdNum < numCommands; cmdNum++) {
         res = runIpxtablesCmd(commands[cmdNum], IptRejectNoAdd);
         if (res && cmdErrHandling != RunCmdFailureBad)
@@ -333,7 +333,7 @@ std::string BandwidthController::makeIptablesQuotaCmd(IptOp op, const char *cost
     char *buff;
     const char *opFlag;
 
-    LOGV("makeIptablesQuotaCmd(%d, %lld)", op, quota);
+    ALOGV("makeIptablesQuotaCmd(%d, %lld)", op, quota);
 
     switch (op) {
     case IptOpInsert:
@@ -614,7 +614,7 @@ int BandwidthController::getInterfaceQuota(const char *costName, int64_t *bytes)
         return -1;
     }
     scanRes = fscanf(fp, "%lld", bytes);
-    LOGV("Read quota res=%d bytes=%lld", scanRes, *bytes);
+    ALOGV("Read quota res=%d bytes=%lld", scanRes, *bytes);
     fclose(fp);
     return scanRes == 1 ? 0 : -1;
 }
@@ -740,7 +740,7 @@ int BandwidthController::setGlobalAlert(int64_t bytes) {
     } else {
         res = runIptablesAlertCmd(IptOpInsert, alertName, bytes);
         if (globalAlertTetherCount) {
-            LOGV("setGlobalAlert for %d tether", globalAlertTetherCount);
+            ALOGV("setGlobalAlert for %d tether", globalAlertTetherCount);
             res |= runIptablesAlertFwdCmd(IptOpInsert, alertName, bytes);
         }
     }
@@ -753,7 +753,7 @@ int BandwidthController::setGlobalAlertInForwardChain(void) {
     int res = 0;
 
     globalAlertTetherCount++;
-    LOGV("setGlobalAlertInForwardChain(): %d tether", globalAlertTetherCount);
+    ALOGV("setGlobalAlertInForwardChain(): %d tether", globalAlertTetherCount);
 
     /*
      * If there is no globalAlert active we are done.
@@ -935,17 +935,17 @@ int BandwidthController::parseForwardChainStats(TetherStats &stats, FILE *fp) {
         iface0[0] = iface1[0] = rest[0] = packets = bytes = 0;
         res = sscanf(buffPtr, "%lld %lld ACCEPT all -- %s %s 0.%s",
                 &packets, &bytes, iface0, iface1, rest);
-        LOGV("parse res=%d iface0=<%s> iface1=<%s> pkts=%lld bytes=%lld rest=<%s> orig line=<%s>", res,
+        ALOGV("parse res=%d iface0=<%s> iface1=<%s> pkts=%lld bytes=%lld rest=<%s> orig line=<%s>", res,
              iface0, iface1, packets, bytes, rest, buffPtr);
         if (res != 5) {
             continue;
         }
         if ((stats.ifaceIn == iface0) && (stats.ifaceOut == iface1)) {
-            LOGV("iface_in=%s iface_out=%s rx_bytes=%lld rx_packets=%lld ", iface0, iface1, bytes, packets);
+            ALOGV("iface_in=%s iface_out=%s rx_bytes=%lld rx_packets=%lld ", iface0, iface1, bytes, packets);
             stats.rxPackets = packets;
             stats.rxBytes = bytes;
         } else if ((stats.ifaceOut == iface0) && (stats.ifaceIn == iface1)) {
-            LOGV("iface_in=%s iface_out=%s tx_bytes=%lld tx_packets=%lld ", iface1, iface0, bytes, packets);
+            ALOGV("iface_in=%s iface_out=%s tx_bytes=%lld tx_packets=%lld ", iface1, iface0, bytes, packets);
             stats.txPackets = packets;
             stats.txBytes = bytes;
         }
index 21efadd..9091fad 100644 (file)
@@ -889,7 +889,7 @@ int CommandListener::BandwidthControlCmd::runCommand(SocketClient *cli, int argc
         return 0;
     }
 
-    LOGV("bwctrlcmd: argc=%d %s %s ...", argc, argv[0], argv[1]);
+    ALOGV("bwctrlcmd: argc=%d %s %s ...", argc, argv[0], argv[1]);
 
     if (!strcmp(argv[1], "enable")) {
         int rc = sBandwidthCtrl->enableBandwidthControl();
index 739f141..56f3bd8 100644 (file)
@@ -43,7 +43,7 @@ int parent(const char *tag, int parent_read) {
             } else if (buffer[b] == '\n') {
                 buffer[b] = '\0';
 
-                LOG(LOG_INFO, tag, "%s", &buffer[a]);
+                ALOG(LOG_INFO, tag, "%s", &buffer[a]);
                 a = b + 1;
             }
         }
@@ -51,7 +51,7 @@ int parent(const char *tag, int parent_read) {
         if (a == 0 && b == sizeof(buffer) - 1) {
             // buffer is full, flush
             buffer[b] = '\0';
-            LOG(LOG_INFO, tag, "%s", &buffer[a]);
+            ALOG(LOG_INFO, tag, "%s", &buffer[a]);
             b = 0;
         } else if (a != b) {
             // Keep left-overs
@@ -67,24 +67,24 @@ int parent(const char *tag, int parent_read) {
     // Flush remaining data
     if (a != b) {
         buffer[b] = '\0';
-        LOG(LOG_INFO, tag, "%s", &buffer[a]);
+        ALOG(LOG_INFO, tag, "%s", &buffer[a]);
     }
     status = 0xAAAA;
     if (wait(&status) != -1) {  // Wait for child
         if (WIFEXITED(status)) {
             if (WEXITSTATUS(status) != 0) {
-                LOG(LOG_INFO, "logwrapper", "%s terminated by exit(%d)", tag,
+                ALOG(LOG_INFO, "logwrapper", "%s terminated by exit(%d)", tag,
                         WEXITSTATUS(status));
             }
             return WEXITSTATUS(status);
         } else if (WIFSIGNALED(status))
-            LOG(LOG_INFO, "logwrapper", "%s terminated by signal %d", tag,
+            ALOG(LOG_INFO, "logwrapper", "%s terminated by signal %d", tag,
                     WTERMSIG(status));
         else if (WIFSTOPPED(status))
-            LOG(LOG_INFO, "logwrapper", "%s stopped by signal %d", tag,
+            ALOG(LOG_INFO, "logwrapper", "%s stopped by signal %d", tag,
                     WSTOPSIG(status));
     } else
-        LOG(LOG_INFO, "logwrapper", "%s wait() failed: %s (%d)", tag,
+        ALOG(LOG_INFO, "logwrapper", "%s wait() failed: %s (%d)", tag,
                 strerror(errno), errno);
     return -EAGAIN;
 }
@@ -97,7 +97,7 @@ void child(int argc, const char**argv) {
 
     // XXX: PROTECT FROM VIKING KILLER
     if (execv(argv_child[0], argv_child)) {
-        LOG(LOG_ERROR, "logwrapper",
+        ALOG(LOG_ERROR, "logwrapper",
             "executing %s failed: %s", argv_child[0], strerror(errno));
     }
     _exit(1);
@@ -114,21 +114,21 @@ int logwrap(int argc, const char* argv[], int background)
     /* Use ptty instead of socketpair so that STDOUT is not buffered */
     parent_ptty = open("/dev/ptmx", O_RDWR);
     if (parent_ptty < 0) {
-       LOG(LOG_ERROR, "logwrapper", "Cannot create parent ptty");
-       return -errno;
+        ALOG(LOG_ERROR, "logwrapper", "Cannot create parent ptty");
+        return -errno;
     }
 
     if (grantpt(parent_ptty) || unlockpt(parent_ptty) ||
             ptsname_r(parent_ptty, child_devname, sizeof(child_devname))) {
         close(parent_ptty);
-       LOG(LOG_ERROR, "logwrapper", "Problem with /dev/ptmx");
-       return -1;
+        ALOG(LOG_ERROR, "logwrapper", "Problem with /dev/ptmx");
+        return -1;
     }
 
     pid = fork();
     if (pid < 0) {
         close(parent_ptty);
-       LOG(LOG_ERROR, "logwrapper", "Failed to fork");
+        ALOG(LOG_ERROR, "logwrapper", "Failed to fork");
         return -errno;
     } else if (pid == 0) {
         /*
@@ -137,7 +137,7 @@ int logwrap(int argc, const char* argv[], int background)
         child_ptty = open(child_devname, O_RDWR);
         if (child_ptty < 0) {
             close(parent_ptty);
-           LOG(LOG_ERROR, "logwrapper", "Problem with child ptty");
+            ALOG(LOG_ERROR, "logwrapper", "Problem with child ptty");
             _exit(errno < 128 ? errno : 1);  // XXX lame
         }
 
@@ -153,12 +153,12 @@ int logwrap(int argc, const char* argv[], int background)
                 char text[64];
                 sprintf(text, "%d", getpid());
                 if (write(fd, text, strlen(text)) < 0) {
-                    LOG(LOG_WARN, "logwrapper",
+                    ALOG(LOG_WARN, "logwrapper",
                         "Unable to background process (%s)", strerror(errno));
                 }
                 close(fd);
             } else {
-                LOG(LOG_WARN, "logwrapper",
+                ALOG(LOG_WARN, "logwrapper",
                     "Unable to background process (%s)", strerror(errno));
             }
         }