diff options
Diffstat (limited to 'server/TetherController.cpp')
| -rw-r--r-- | server/TetherController.cpp | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/server/TetherController.cpp b/server/TetherController.cpp index 47b620db..fbee5a2f 100644 --- a/server/TetherController.cpp +++ b/server/TetherController.cpp @@ -33,10 +33,8 @@ #include "NetdConstants.h" #include "TetherController.h" -#include "NetworkController.h" -TetherController::TetherController(NetworkController* networkController) : - mNetworkController(networkController) { +TetherController::TetherController() { mInterfaces = new InterfaceCollection(); mDnsForwarders = new NetAddressCollection(); mDaemonFd = -1; @@ -172,17 +170,6 @@ int TetherController::startTethering(int num_addrs, struct in_addr* addrs) { ALOGD("Tethering services running"); } - unsigned netId = mNetworkController->getNetIdForLocalNetwork(); - if (int ret = mNetworkController->createLocalNetwork(netId)) { - return ret; - } - // If any interfaces have already been configured, add them to the local network now. - for (InterfaceCollection::iterator it = mInterfaces->begin(); it != mInterfaces->end(); ++it) { - if (int ret = mNetworkController->addInterfaceToNetwork(netId, *it)) { - return ret; - } - } - return 0; } @@ -195,9 +182,6 @@ int TetherController::stopTethering() { ALOGD("Stopping tethering services"); - // Ignore any error. - (void) mNetworkController->destroyNetwork(mNetworkController->getNetIdForLocalNetwork()); - kill(mDaemonPid, SIGTERM); waitpid(mDaemonPid, NULL, 0); mDaemonPid = 0; @@ -307,10 +291,6 @@ int TetherController::tetherInterface(const char *interface) { } return -1; } else { - if (isTetheringStarted()) { - unsigned netId = mNetworkController->getNetIdForLocalNetwork(); - return mNetworkController->addInterfaceToNetwork(netId, interface); - } return 0; } } @@ -320,12 +300,6 @@ int TetherController::untetherInterface(const char *interface) { ALOGD("untetherInterface(%s)", interface); - if (isTetheringStarted()) { - unsigned netId = mNetworkController->getNetIdForLocalNetwork(); - // Ignore any error. - (void) mNetworkController->removeInterfaceFromNetwork(netId, interface); - } - for (it = mInterfaces->begin(); it != mInterfaces->end(); ++it) { if (!strcmp(interface, *it)) { free(*it); |
