diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-16 11:54:19 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2015-03-16 11:54:19 +0000 |
commit | e298ded6ade9744f2a79cae045b5c324886262f4 (patch) | |
tree | 0b16bb0fe3430dd224dabf4b3c87176ba1b0f91c | |
parent | a4614fe5bfaafd0ff6be60ddb6fd135f99f5a5a5 (diff) | |
parent | 6066d41889ada93c5312e081d5bdff94fc1fd2af (diff) | |
download | netd-e298ded6ade9744f2a79cae045b5c324886262f4.tar.gz |
resolved conflicts for merge of 6066d418 to master
Change-Id: I2aa9721365e96c363648dd8e9e15718ed50e3c12
-rw-r--r-- | server/Android.mk | 1 | ||||
-rw-r--r-- | server/InterfaceController.cpp | 18 | ||||
-rw-r--r-- | server/RouteController.cpp | 6 | ||||
-rw-r--r-- | server/SoftapController.cpp | 15 | ||||
-rw-r--r-- | server/TetherController.cpp | 5 |
5 files changed, 16 insertions, 29 deletions
diff --git a/server/Android.mk b/server/Android.mk index ecc88294..cdf25994 100644 --- a/server/Android.mk +++ b/server/Android.mk @@ -37,7 +37,6 @@ LOCAL_SHARED_LIBRARIES := \ libnetutils \ libnl \ libsysutils \ - libbase \ libutils \ LOCAL_STATIC_LIBRARIES := \ diff --git a/server/InterfaceController.cpp b/server/InterfaceController.cpp index 76f5e05d..6855bdf7 100644 --- a/server/InterfaceController.cpp +++ b/server/InterfaceController.cpp @@ -19,18 +19,14 @@ #include <malloc.h> #define LOG_TAG "InterfaceController" -#include <base/file.h> -#include <base/stringprintf.h> #include <cutils/log.h> #include <logwrap/logwrap.h> +#include <utils/file.h> +#include <utils/stringprintf.h> #include "InterfaceController.h" #include "RouteController.h" -using android::base::ReadFileToString; -using android::base::StringPrintf; -using android::base::WriteStringToFile; - const char ipv6_proc_path[] = "/proc/sys/net/ipv6/conf"; const char sys_net_path[] = "/sys/class/net"; @@ -59,8 +55,8 @@ int InterfaceController::writeIPv6ProcPath(const char *interface, const char *se errno = ENOENT; return -1; } - std::string path(StringPrintf("%s/%s/%s", ipv6_proc_path, interface, setting)); - return WriteStringToFile(value, path); + std::string path(android::StringPrintf("%s/%s/%s", ipv6_proc_path, interface, setting)); + return android::WriteStringToFile(value, path); } int InterfaceController::setEnableIPv6(const char *interface, const int on) { @@ -137,7 +133,7 @@ void InterfaceController::setAcceptRA(const char *value) { // ID to get the table. If it's set to -1000, routes from interface ID 5 will go into // table 1005, etc. void InterfaceController::setAcceptRARouteTable(int tableOrOffset) { - std::string value(StringPrintf("%d", tableOrOffset)); + std::string value(android::StringPrintf("%d", tableOrOffset)); setOnAllInterfaces("accept_ra_rt_table", value.c_str()); } @@ -147,8 +143,8 @@ int InterfaceController::setMtu(const char *interface, const char *mtu) errno = ENOENT; return -1; } - std::string path(StringPrintf("%s/%s/mtu", sys_net_path, interface)); - return WriteStringToFile(mtu, path); + std::string path(android::StringPrintf("%s/%s/mtu", sys_net_path, interface)); + return android::WriteStringToFile(mtu, path); } void InterfaceController::setIPv6OptimisticMode(const char *value) { diff --git a/server/RouteController.cpp b/server/RouteController.cpp index 889779d8..98a965e7 100644 --- a/server/RouteController.cpp +++ b/server/RouteController.cpp @@ -31,15 +31,13 @@ #include "UidRanges.h" #include "DummyNetwork.h" -#include "base/file.h" #define LOG_TAG "Netd" #include "log/log.h" #include "logwrap/logwrap.h" #include "netutils/ifc.h" +#include "utils/file.h" #include "resolv_netid.h" -using android::base::WriteStringToFile; - namespace { // BEGIN CONSTANTS -------------------------------------------------------------------------------- @@ -170,7 +168,7 @@ void updateTableNamesFile() { addTableName(entry.second, entry.first, &contents); } - if (!WriteStringToFile(contents, RT_TABLES_PATH, RT_TABLES_MODE, AID_SYSTEM, AID_WIFI)) { + if (!android::WriteStringToFile(contents, RT_TABLES_PATH, RT_TABLES_MODE, AID_SYSTEM, AID_WIFI)) { ALOGE("failed to write to %s (%s)", RT_TABLES_PATH, strerror(errno)); return; } diff --git a/server/SoftapController.cpp b/server/SoftapController.cpp index d9e40a43..24655291 100644 --- a/server/SoftapController.cpp +++ b/server/SoftapController.cpp @@ -34,19 +34,16 @@ #include <openssl/sha.h> #define LOG_TAG "SoftapController" -#include <base/file.h> -#include <base/stringprintf.h> #include <cutils/log.h> #include <netutils/ifc.h> #include <private/android_filesystem_config.h> +#include <utils/file.h> +#include <utils/stringprintf.h> #include "wifi.h" #include "ResponseCode.h" #include "SoftapController.h" -using android::base::StringPrintf; -using android::base::WriteStringToFile; - static const char HOSTAPD_CONF_FILE[] = "/data/misc/wifi/hostapd.conf"; static const char HOSTAPD_BIN_FILE[] = "/system/bin/hostapd"; @@ -139,7 +136,7 @@ int SoftapController::setSoftap(int argc, char *argv[]) { channel = AP_CHANNEL_DEFAULT; } - std::string wbuf(StringPrintf("interface=%s\n" + std::string wbuf(android::StringPrintf("interface=%s\n" "driver=nl80211\n" "ctrl_interface=/data/misc/wifi/hostapd\n" "ssid=%s\n" @@ -155,10 +152,10 @@ int SoftapController::setSoftap(int argc, char *argv[]) { char psk_str[2*SHA256_DIGEST_LENGTH+1]; if (!strcmp(argv[6], "wpa-psk")) { generatePsk(argv[3], argv[7], psk_str); - fbuf = StringPrintf("%swpa=3\nwpa_pairwise=TKIP CCMP\nwpa_psk=%s\n", wbuf.c_str(), psk_str); + fbuf = android::StringPrintf("%swpa=3\nwpa_pairwise=TKIP CCMP\nwpa_psk=%s\n", wbuf.c_str(), psk_str); } else if (!strcmp(argv[6], "wpa2-psk")) { generatePsk(argv[3], argv[7], psk_str); - fbuf = StringPrintf("%swpa=2\nrsn_pairwise=CCMP\nwpa_psk=%s\n", wbuf.c_str(), psk_str); + fbuf = android::StringPrintf("%swpa=2\nrsn_pairwise=CCMP\nwpa_psk=%s\n", wbuf.c_str(), psk_str); } else if (!strcmp(argv[6], "open")) { fbuf = wbuf; } @@ -170,7 +167,7 @@ int SoftapController::setSoftap(int argc, char *argv[]) { fbuf = wbuf; } - if (!WriteStringToFile(fbuf, HOSTAPD_CONF_FILE, 0660, AID_SYSTEM, AID_WIFI)) { + if (!android::WriteStringToFile(fbuf, HOSTAPD_CONF_FILE, 0660, AID_SYSTEM, AID_WIFI)) { ALOGE("Cannot write to \"%s\": %s", HOSTAPD_CONF_FILE, strerror(errno)); return ResponseCode::OperationFailed; } diff --git a/server/TetherController.cpp b/server/TetherController.cpp index 092d4566..5a08ed21 100644 --- a/server/TetherController.cpp +++ b/server/TetherController.cpp @@ -27,19 +27,16 @@ #include <netinet/in.h> #include <arpa/inet.h> -#include <base/file.h> #define LOG_TAG "TetherController" #include <cutils/log.h> #include <cutils/properties.h> +#include <utils/file.h> #include "Fwmark.h" #include "NetdConstants.h" #include "Permission.h" #include "TetherController.h" -using android::base::ReadFileToString; -using android::base::WriteStringToFile; - namespace { static const char BP_TOOLS_MODE[] = "bp-tools"; |