San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #include <stdlib.h> |
| 18 | #include <errno.h> |
San Mehat | 1873784 | 2010-01-21 09:22:43 -0800 | [diff] [blame] | 19 | #include <fcntl.h> |
Olivier Bailly | ff2c0d8 | 2010-11-17 11:45:07 -0800 | [diff] [blame] | 20 | #include <string.h> |
San Mehat | 1873784 | 2010-01-21 09:22:43 -0800 | [diff] [blame] | 21 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 22 | #include <sys/socket.h> |
| 23 | #include <sys/stat.h> |
San Mehat | 1873784 | 2010-01-21 09:22:43 -0800 | [diff] [blame] | 24 | #include <sys/types.h> |
| 25 | #include <sys/wait.h> |
| 26 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 27 | #include <netinet/in.h> |
| 28 | #include <arpa/inet.h> |
| 29 | |
| 30 | #define LOG_TAG "TetherController" |
| 31 | #include <cutils/log.h> |
Kazuhiro Ondo | 6b858eb | 2011-06-24 20:31:03 -0500 | [diff] [blame] | 32 | #include <cutils/properties.h> |
Elliott Hughes | d161406 | 2015-02-02 18:08:59 -0800 | [diff] [blame^] | 33 | #include <utils/file.h> |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 34 | |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 35 | #include "Fwmark.h" |
JP Abgrall | 69261cb | 2014-06-19 18:35:24 -0700 | [diff] [blame] | 36 | #include "NetdConstants.h" |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 37 | #include "Permission.h" |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 38 | #include "TetherController.h" |
| 39 | |
Sreeram Ramachandran | 87475a1 | 2014-07-15 16:20:28 -0700 | [diff] [blame] | 40 | TetherController::TetherController() { |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 41 | mInterfaces = new InterfaceCollection(); |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 42 | mDnsNetId = 0; |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 43 | mDnsForwarders = new NetAddressCollection(); |
| 44 | mDaemonFd = -1; |
| 45 | mDaemonPid = 0; |
| 46 | } |
| 47 | |
| 48 | TetherController::~TetherController() { |
| 49 | InterfaceCollection::iterator it; |
| 50 | |
| 51 | for (it = mInterfaces->begin(); it != mInterfaces->end(); ++it) { |
| 52 | free(*it); |
| 53 | } |
| 54 | mInterfaces->clear(); |
| 55 | |
| 56 | mDnsForwarders->clear(); |
| 57 | } |
| 58 | |
| 59 | int TetherController::setIpFwdEnabled(bool enable) { |
| 60 | |
Steve Block | 7b984e3 | 2011-12-20 16:22:42 +0000 | [diff] [blame] | 61 | ALOGD("Setting IP forward enable = %d", enable); |
Kazuhiro Ondo | 6b858eb | 2011-06-24 20:31:03 -0500 | [diff] [blame] | 62 | |
| 63 | // In BP tools mode, do not disable IP forwarding |
| 64 | char bootmode[PROPERTY_VALUE_MAX] = {0}; |
| 65 | property_get("ro.bootmode", bootmode, "unknown"); |
| 66 | if ((enable == false) && (0 == strcmp("bp-tools", bootmode))) { |
| 67 | return 0; |
| 68 | } |
| 69 | |
Elliott Hughes | d161406 | 2015-02-02 18:08:59 -0800 | [diff] [blame^] | 70 | if (!android::WriteStringToFile(enable ? "1" : "0", "/proc/sys/net/ipv4/ip_forward")) { |
| 71 | ALOGE("Failed to write ip_forward (%s)", strerror(errno)); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 72 | return -1; |
| 73 | } |
| 74 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 75 | return 0; |
| 76 | } |
| 77 | |
| 78 | bool TetherController::getIpFwdEnabled() { |
Elliott Hughes | d161406 | 2015-02-02 18:08:59 -0800 | [diff] [blame^] | 79 | std::string enabled; |
| 80 | if (!android::ReadFileToString("/proc/sys/net/ipv4/ip_forward", &enabled)) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 81 | ALOGE("Failed to read ip_forward (%s)", strerror(errno)); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 82 | return -1; |
| 83 | } |
| 84 | |
Elliott Hughes | d161406 | 2015-02-02 18:08:59 -0800 | [diff] [blame^] | 85 | return (enabled == "1" ? true : false); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 86 | } |
| 87 | |
Dmitry Shmidt | bc775ed | 2013-12-12 16:41:16 -0800 | [diff] [blame] | 88 | #define TETHER_START_CONST_ARG 8 |
| 89 | |
Robert Greenwalt | 3208ea0 | 2010-03-24 16:32:55 -0700 | [diff] [blame] | 90 | int TetherController::startTethering(int num_addrs, struct in_addr* addrs) { |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 91 | if (mDaemonPid != 0) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 92 | ALOGE("Tethering already started"); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 93 | errno = EBUSY; |
| 94 | return -1; |
| 95 | } |
| 96 | |
Steve Block | 7b984e3 | 2011-12-20 16:22:42 +0000 | [diff] [blame] | 97 | ALOGD("Starting tethering services"); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 98 | |
| 99 | pid_t pid; |
| 100 | int pipefd[2]; |
| 101 | |
| 102 | if (pipe(pipefd) < 0) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 103 | ALOGE("pipe failed (%s)", strerror(errno)); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 104 | return -1; |
| 105 | } |
| 106 | |
| 107 | /* |
| 108 | * TODO: Create a monitoring thread to handle and restart |
| 109 | * the daemon if it exits prematurely |
| 110 | */ |
| 111 | if ((pid = fork()) < 0) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 112 | ALOGE("fork failed (%s)", strerror(errno)); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 113 | close(pipefd[0]); |
| 114 | close(pipefd[1]); |
| 115 | return -1; |
| 116 | } |
| 117 | |
| 118 | if (!pid) { |
| 119 | close(pipefd[1]); |
| 120 | if (pipefd[0] != STDIN_FILENO) { |
| 121 | if (dup2(pipefd[0], STDIN_FILENO) != STDIN_FILENO) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 122 | ALOGE("dup2 failed (%s)", strerror(errno)); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 123 | return -1; |
| 124 | } |
| 125 | close(pipefd[0]); |
| 126 | } |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 127 | |
Dmitry Shmidt | bc775ed | 2013-12-12 16:41:16 -0800 | [diff] [blame] | 128 | int num_processed_args = TETHER_START_CONST_ARG + (num_addrs/2) + 1; |
Robert Greenwalt | 3208ea0 | 2010-03-24 16:32:55 -0700 | [diff] [blame] | 129 | char **args = (char **)malloc(sizeof(char *) * num_processed_args); |
| 130 | args[num_processed_args - 1] = NULL; |
| 131 | args[0] = (char *)"/system/bin/dnsmasq"; |
Peter Nilsson | b756f69 | 2011-09-08 09:48:31 -0700 | [diff] [blame] | 132 | args[1] = (char *)"--keep-in-foreground"; |
Robert Greenwalt | 3208ea0 | 2010-03-24 16:32:55 -0700 | [diff] [blame] | 133 | args[2] = (char *)"--no-resolv"; |
| 134 | args[3] = (char *)"--no-poll"; |
Dmitry Shmidt | bc775ed | 2013-12-12 16:41:16 -0800 | [diff] [blame] | 135 | args[4] = (char *)"--dhcp-authoritative"; |
Jeff Sharkey | 6df79da | 2012-04-18 21:53:35 -0700 | [diff] [blame] | 136 | // TODO: pipe through metered status from ConnService |
Dmitry Shmidt | bc775ed | 2013-12-12 16:41:16 -0800 | [diff] [blame] | 137 | args[5] = (char *)"--dhcp-option-force=43,ANDROID_METERED"; |
| 138 | args[6] = (char *)"--pid-file"; |
| 139 | args[7] = (char *)""; |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 140 | |
Dmitry Shmidt | bc775ed | 2013-12-12 16:41:16 -0800 | [diff] [blame] | 141 | int nextArg = TETHER_START_CONST_ARG; |
Robert Greenwalt | 3208ea0 | 2010-03-24 16:32:55 -0700 | [diff] [blame] | 142 | for (int addrIndex=0; addrIndex < num_addrs;) { |
| 143 | char *start = strdup(inet_ntoa(addrs[addrIndex++])); |
| 144 | char *end = strdup(inet_ntoa(addrs[addrIndex++])); |
| 145 | asprintf(&(args[nextArg++]),"--dhcp-range=%s,%s,1h", start, end); |
Jesper Hansson | a9d791f | 2012-04-27 13:54:27 +0200 | [diff] [blame] | 146 | free(start); |
| 147 | free(end); |
Robert Greenwalt | 3208ea0 | 2010-03-24 16:32:55 -0700 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | if (execv(args[0], args)) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 151 | ALOGE("execl failed (%s)", strerror(errno)); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 152 | } |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 153 | ALOGE("Should never get here!"); |
JP Abgrall | ce4f379 | 2012-08-06 13:44:44 -0700 | [diff] [blame] | 154 | _exit(-1); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 155 | } else { |
| 156 | close(pipefd[0]); |
| 157 | mDaemonPid = pid; |
| 158 | mDaemonFd = pipefd[1]; |
Robert Greenwalt | 3d4c758 | 2012-12-11 12:33:37 -0800 | [diff] [blame] | 159 | applyDnsInterfaces(); |
Steve Block | 7b984e3 | 2011-12-20 16:22:42 +0000 | [diff] [blame] | 160 | ALOGD("Tethering services running"); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 161 | } |
| 162 | |
| 163 | return 0; |
| 164 | } |
| 165 | |
| 166 | int TetherController::stopTethering() { |
| 167 | |
| 168 | if (mDaemonPid == 0) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 169 | ALOGE("Tethering already stopped"); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 170 | return 0; |
| 171 | } |
| 172 | |
Steve Block | 7b984e3 | 2011-12-20 16:22:42 +0000 | [diff] [blame] | 173 | ALOGD("Stopping tethering services"); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 174 | |
| 175 | kill(mDaemonPid, SIGTERM); |
San Mehat | 1873784 | 2010-01-21 09:22:43 -0800 | [diff] [blame] | 176 | waitpid(mDaemonPid, NULL, 0); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 177 | mDaemonPid = 0; |
| 178 | close(mDaemonFd); |
| 179 | mDaemonFd = -1; |
Steve Block | 7b984e3 | 2011-12-20 16:22:42 +0000 | [diff] [blame] | 180 | ALOGD("Tethering services stopped"); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 181 | return 0; |
| 182 | } |
Matthew Xie | 1994410 | 2012-07-12 16:42:07 -0700 | [diff] [blame] | 183 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 184 | bool TetherController::isTetheringStarted() { |
| 185 | return (mDaemonPid == 0 ? false : true); |
| 186 | } |
| 187 | |
Kenny Root | cf52faf | 2010-02-18 09:59:55 -0800 | [diff] [blame] | 188 | #define MAX_CMD_SIZE 1024 |
| 189 | |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 190 | int TetherController::setDnsForwarders(unsigned netId, char **servers, int numServers) { |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 191 | int i; |
Kenny Root | cf52faf | 2010-02-18 09:59:55 -0800 | [diff] [blame] | 192 | char daemonCmd[MAX_CMD_SIZE]; |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 193 | |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 194 | Fwmark fwmark; |
| 195 | fwmark.netId = netId; |
| 196 | fwmark.explicitlySelected = true; |
| 197 | fwmark.protectedFromVpn = true; |
| 198 | fwmark.permission = PERMISSION_SYSTEM; |
| 199 | |
| 200 | snprintf(daemonCmd, sizeof(daemonCmd), "update_dns:0x%x", fwmark.intValue); |
Kenny Root | cf52faf | 2010-02-18 09:59:55 -0800 | [diff] [blame] | 201 | int cmdLen = strlen(daemonCmd); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 202 | |
| 203 | mDnsForwarders->clear(); |
| 204 | for (i = 0; i < numServers; i++) { |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 205 | ALOGD("setDnsForwarders(0x%x %d = '%s')", fwmark.intValue, i, servers[i]); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 206 | |
| 207 | struct in_addr a; |
| 208 | |
| 209 | if (!inet_aton(servers[i], &a)) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 210 | ALOGE("Failed to parse DNS server '%s'", servers[i]); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 211 | mDnsForwarders->clear(); |
| 212 | return -1; |
| 213 | } |
Kenny Root | cf52faf | 2010-02-18 09:59:55 -0800 | [diff] [blame] | 214 | |
Nick Kralevich | ad5b41f | 2012-07-19 18:48:05 -0700 | [diff] [blame] | 215 | cmdLen += (strlen(servers[i]) + 1); |
| 216 | if (cmdLen + 1 >= MAX_CMD_SIZE) { |
Steve Block | 7b984e3 | 2011-12-20 16:22:42 +0000 | [diff] [blame] | 217 | ALOGD("Too many DNS servers listed"); |
Kenny Root | cf52faf | 2010-02-18 09:59:55 -0800 | [diff] [blame] | 218 | break; |
| 219 | } |
| 220 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 221 | strcat(daemonCmd, ":"); |
| 222 | strcat(daemonCmd, servers[i]); |
| 223 | mDnsForwarders->push_back(a); |
| 224 | } |
| 225 | |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 226 | mDnsNetId = netId; |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 227 | if (mDaemonFd != -1) { |
Steve Block | 7b984e3 | 2011-12-20 16:22:42 +0000 | [diff] [blame] | 228 | ALOGD("Sending update msg to dnsmasq [%s]", daemonCmd); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 229 | if (write(mDaemonFd, daemonCmd, strlen(daemonCmd) +1) < 0) { |
Steve Block | 5ea0c05 | 2012-01-06 19:18:11 +0000 | [diff] [blame] | 230 | ALOGE("Failed to send update command to dnsmasq (%s)", strerror(errno)); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 231 | mDnsForwarders->clear(); |
| 232 | return -1; |
| 233 | } |
| 234 | } |
| 235 | return 0; |
| 236 | } |
| 237 | |
Lorenzo Colitti | 667c477 | 2014-08-26 14:13:07 -0700 | [diff] [blame] | 238 | unsigned TetherController::getDnsNetId() { |
| 239 | return mDnsNetId; |
| 240 | } |
| 241 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 242 | NetAddressCollection *TetherController::getDnsForwarders() { |
| 243 | return mDnsForwarders; |
| 244 | } |
| 245 | |
Robert Greenwalt | 3d4c758 | 2012-12-11 12:33:37 -0800 | [diff] [blame] | 246 | int TetherController::applyDnsInterfaces() { |
Robert Greenwalt | 3d4c758 | 2012-12-11 12:33:37 -0800 | [diff] [blame] | 247 | char daemonCmd[MAX_CMD_SIZE]; |
| 248 | |
| 249 | strcpy(daemonCmd, "update_ifaces"); |
| 250 | int cmdLen = strlen(daemonCmd); |
| 251 | InterfaceCollection::iterator it; |
| 252 | bool haveInterfaces = false; |
| 253 | |
| 254 | for (it = mInterfaces->begin(); it != mInterfaces->end(); ++it) { |
| 255 | cmdLen += (strlen(*it) + 1); |
| 256 | if (cmdLen + 1 >= MAX_CMD_SIZE) { |
| 257 | ALOGD("Too many DNS ifaces listed"); |
| 258 | break; |
| 259 | } |
| 260 | |
| 261 | strcat(daemonCmd, ":"); |
| 262 | strcat(daemonCmd, *it); |
| 263 | haveInterfaces = true; |
| 264 | } |
| 265 | |
| 266 | if ((mDaemonFd != -1) && haveInterfaces) { |
| 267 | ALOGD("Sending update msg to dnsmasq [%s]", daemonCmd); |
| 268 | if (write(mDaemonFd, daemonCmd, strlen(daemonCmd) +1) < 0) { |
| 269 | ALOGE("Failed to send update command to dnsmasq (%s)", strerror(errno)); |
| 270 | return -1; |
| 271 | } |
| 272 | } |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 273 | return 0; |
| 274 | } |
| 275 | |
Robert Greenwalt | 3d4c758 | 2012-12-11 12:33:37 -0800 | [diff] [blame] | 276 | int TetherController::tetherInterface(const char *interface) { |
| 277 | ALOGD("tetherInterface(%s)", interface); |
JP Abgrall | 69261cb | 2014-06-19 18:35:24 -0700 | [diff] [blame] | 278 | if (!isIfaceName(interface)) { |
| 279 | errno = ENOENT; |
| 280 | return -1; |
| 281 | } |
Robert Greenwalt | 3d4c758 | 2012-12-11 12:33:37 -0800 | [diff] [blame] | 282 | mInterfaces->push_back(strdup(interface)); |
| 283 | |
| 284 | if (applyDnsInterfaces()) { |
| 285 | InterfaceCollection::iterator it; |
| 286 | for (it = mInterfaces->begin(); it != mInterfaces->end(); ++it) { |
| 287 | if (!strcmp(interface, *it)) { |
| 288 | free(*it); |
| 289 | mInterfaces->erase(it); |
| 290 | break; |
| 291 | } |
| 292 | } |
| 293 | return -1; |
| 294 | } else { |
| 295 | return 0; |
| 296 | } |
| 297 | } |
| 298 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 299 | int TetherController::untetherInterface(const char *interface) { |
| 300 | InterfaceCollection::iterator it; |
| 301 | |
Robert Greenwalt | 3d4c758 | 2012-12-11 12:33:37 -0800 | [diff] [blame] | 302 | ALOGD("untetherInterface(%s)", interface); |
| 303 | |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 304 | for (it = mInterfaces->begin(); it != mInterfaces->end(); ++it) { |
| 305 | if (!strcmp(interface, *it)) { |
| 306 | free(*it); |
| 307 | mInterfaces->erase(it); |
Robert Greenwalt | 3d4c758 | 2012-12-11 12:33:37 -0800 | [diff] [blame] | 308 | |
| 309 | return applyDnsInterfaces(); |
San Mehat | 9d10b34 | 2010-01-18 09:51:02 -0800 | [diff] [blame] | 310 | } |
| 311 | } |
| 312 | errno = ENOENT; |
| 313 | return -1; |
| 314 | } |
| 315 | |
| 316 | InterfaceCollection *TetherController::getTetheredInterfaceList() { |
| 317 | return mInterfaces; |
| 318 | } |