San Mehat | d183042 | 2010-01-15 08:02:39 -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 | |
Lorenzo Colitti | 0b454ea | 2013-10-25 19:53:31 +0900 | [diff] [blame] | 17 | #include <stdarg.h> |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 18 | #include <stdio.h> |
| 19 | #include <stdlib.h> |
Olivier Bailly | ff2c0d8 | 2010-11-17 11:45:07 -0800 | [diff] [blame] | 20 | #include <string.h> |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 21 | #include <errno.h> |
| 22 | |
| 23 | #define LOG_TAG "Netd" |
| 24 | |
Logan Chien | 3f46148 | 2018-04-23 14:31:32 +0800 | [diff] [blame] | 25 | #include <log/log.h> |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 26 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 27 | #include <android-base/parseint.h> |
| 28 | #include <android-base/strings.h> |
Sreeram Ramachandran | af37dd3 | 2014-09-08 16:03:18 -0700 | [diff] [blame] | 29 | #include <netutils/ifc.h> |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 30 | #include <sysutils/NetlinkEvent.h> |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 31 | #include "Controllers.h" |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 32 | #include "NetlinkHandler.h" |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 33 | #include "NetlinkManager.h" |
| 34 | #include "ResponseCode.h" |
Lorenzo Colitti | f32fc59 | 2016-02-15 01:09:14 +0900 | [diff] [blame] | 35 | #include "SockDiag.h" |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 36 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 37 | #include <charconv> |
| 38 | |
| 39 | #define BINDER_RETRY(exp) \ |
| 40 | ({ \ |
| 41 | bool res = true; \ |
| 42 | for (int attempt = 0; /*nop*/; ++attempt) { \ |
| 43 | auto _rc = (exp); \ |
| 44 | if (_rc.exceptionCode() == binder::Status::EX_TRANSACTION_FAILED && \ |
| 45 | attempt < RETRY_ATTEMPTS) { \ |
| 46 | usleep(RETRY_INTERVAL_MICRO_S); \ |
| 47 | } else { \ |
| 48 | res = _rc.isOk(); \ |
| 49 | break; \ |
| 50 | } \ |
| 51 | } \ |
| 52 | res; \ |
| 53 | }) |
| 54 | |
| 55 | #define LOG_EVENT_FUNC(retry, func, ...) \ |
| 56 | do { \ |
| 57 | const auto listenerMap = gCtls->eventReporter.getNetdUnsolicitedEventListenerVec(); \ |
| 58 | for (auto& listener : listenerMap) { \ |
| 59 | auto entry = \ |
| 60 | gUnsolicitedLog.newEntry().function(#func).args(__VA_ARGS__, listener.first); \ |
| 61 | if (retry(listener.second->func(__VA_ARGS__))) { \ |
| 62 | gUnsolicitedLog.log(entry.withAutomaticDuration()); \ |
| 63 | } \ |
| 64 | } \ |
| 65 | } while (0) |
Lorenzo Colitti | bd0f224 | 2014-06-12 13:51:05 +0900 | [diff] [blame] | 66 | |
Lorenzo Colitti | 7035f22 | 2017-02-13 18:29:00 +0900 | [diff] [blame] | 67 | namespace android { |
| 68 | namespace net { |
| 69 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 70 | constexpr int RETRY_ATTEMPTS = 2; |
| 71 | constexpr int RETRY_INTERVAL_MICRO_S = 100000; |
| 72 | |
Mike J. Chen | 564df4e | 2011-06-23 15:07:35 -0700 | [diff] [blame] | 73 | NetlinkHandler::NetlinkHandler(NetlinkManager *nm, int listenerSocket, |
| 74 | int format) : |
| 75 | NetlinkListener(listenerSocket, format) { |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 76 | mNm = nm; |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | NetlinkHandler::~NetlinkHandler() { |
| 80 | } |
| 81 | |
| 82 | int NetlinkHandler::start() { |
| 83 | return this->startListener(); |
| 84 | } |
| 85 | |
| 86 | int NetlinkHandler::stop() { |
| 87 | return this->stopListener(); |
| 88 | } |
| 89 | |
Rubin Xu | 6c00b61 | 2018-04-27 14:27:59 +0100 | [diff] [blame] | 90 | static long parseIfIndex(const char* ifIndex) { |
| 91 | if (ifIndex == nullptr) { |
| 92 | return 0; |
| 93 | } |
Yi Kong | bdfd57e | 2018-07-25 13:26:10 -0700 | [diff] [blame] | 94 | long ifaceIndex = strtol(ifIndex, nullptr, 10); |
Rubin Xu | 6c00b61 | 2018-04-27 14:27:59 +0100 | [diff] [blame] | 95 | // strtol returns 0 on error, which is fine because 0 is not a valid ifindex. |
| 96 | if (errno == ERANGE && (ifaceIndex == LONG_MAX || ifaceIndex == LONG_MIN)) { |
| 97 | return 0; |
| 98 | } |
| 99 | return ifaceIndex; |
| 100 | } |
| 101 | |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 102 | void NetlinkHandler::onEvent(NetlinkEvent *evt) { |
| 103 | const char *subsys = evt->getSubsystem(); |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 104 | if (!subsys) { |
Steve Block | 0e76b76 | 2012-01-05 23:21:51 +0000 | [diff] [blame] | 105 | ALOGW("No subsystem found in netlink event"); |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 106 | return; |
| 107 | } |
Mike J. Chen | 564df4e | 2011-06-23 15:07:35 -0700 | [diff] [blame] | 108 | |
Lorenzo Colitti | 4da12db | 2013-09-03 00:26:23 +0900 | [diff] [blame] | 109 | if (!strcmp(subsys, "net")) { |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 110 | NetlinkEvent::Action action = evt->getAction(); |
Mike J. Chen | 564df4e | 2011-06-23 15:07:35 -0700 | [diff] [blame] | 111 | const char *iface = evt->findParam("INTERFACE"); |
Chenbo Feng | 04f3b17 | 2018-03-20 16:39:43 -0700 | [diff] [blame] | 112 | if ((action == NetlinkEvent::Action::kAdd) || |
| 113 | (action == NetlinkEvent::Action::kLinkUp) || |
| 114 | (action == NetlinkEvent::Action::kLinkDown)) { |
| 115 | const char *ifIndex = evt->findParam("IFINDEX"); |
Rubin Xu | 6c00b61 | 2018-04-27 14:27:59 +0100 | [diff] [blame] | 116 | long ifaceIndex = parseIfIndex(ifIndex); |
| 117 | if (ifaceIndex) { |
| 118 | gCtls->trafficCtrl.addInterface(iface, ifaceIndex); |
| 119 | } else { |
| 120 | ALOGE("invalid interface index: %s(%s)", iface, ifIndex); |
Chenbo Feng | 04f3b17 | 2018-03-20 16:39:43 -0700 | [diff] [blame] | 121 | } |
Chenbo Feng | 7e97405 | 2018-02-28 22:57:21 -0800 | [diff] [blame] | 122 | } |
Mike J. Chen | 564df4e | 2011-06-23 15:07:35 -0700 | [diff] [blame] | 123 | |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 124 | if (action == NetlinkEvent::Action::kAdd) { |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 125 | notifyInterfaceAdded(iface); |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 126 | } else if (action == NetlinkEvent::Action::kRemove) { |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 127 | notifyInterfaceRemoved(iface); |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 128 | } else if (action == NetlinkEvent::Action::kChange) { |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 129 | evt->dump(); |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 130 | notifyInterfaceChanged("nana", true); |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 131 | } else if (action == NetlinkEvent::Action::kLinkUp) { |
Mike J. Chen | 564df4e | 2011-06-23 15:07:35 -0700 | [diff] [blame] | 132 | notifyInterfaceLinkChanged(iface, true); |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 133 | } else if (action == NetlinkEvent::Action::kLinkDown) { |
Mike J. Chen | 564df4e | 2011-06-23 15:07:35 -0700 | [diff] [blame] | 134 | notifyInterfaceLinkChanged(iface, false); |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 135 | } else if (action == NetlinkEvent::Action::kAddressUpdated || |
| 136 | action == NetlinkEvent::Action::kAddressRemoved) { |
Lorenzo Colitti | 4da12db | 2013-09-03 00:26:23 +0900 | [diff] [blame] | 137 | const char *address = evt->findParam("ADDRESS"); |
| 138 | const char *flags = evt->findParam("FLAGS"); |
| 139 | const char *scope = evt->findParam("SCOPE"); |
Rubin Xu | 6c00b61 | 2018-04-27 14:27:59 +0100 | [diff] [blame] | 140 | const char *ifIndex = evt->findParam("IFINDEX"); |
| 141 | char addrstr[INET6_ADDRSTRLEN + strlen("/128")]; |
| 142 | strlcpy(addrstr, address, sizeof(addrstr)); |
| 143 | char *slash = strchr(addrstr, '/'); |
| 144 | if (slash) { |
| 145 | *slash = '\0'; |
| 146 | } |
Lorenzo Colitti | f32fc59 | 2016-02-15 01:09:14 +0900 | [diff] [blame] | 147 | |
Rubin Xu | 6c00b61 | 2018-04-27 14:27:59 +0100 | [diff] [blame] | 148 | long ifaceIndex = parseIfIndex(ifIndex); |
| 149 | if (!ifaceIndex) { |
| 150 | ALOGE("invalid interface index: %s(%s)", iface, ifIndex); |
| 151 | } |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 152 | const bool addrUpdated = (action == NetlinkEvent::Action::kAddressUpdated); |
| 153 | if (addrUpdated) { |
Rubin Xu | 6c00b61 | 2018-04-27 14:27:59 +0100 | [diff] [blame] | 154 | gCtls->netCtrl.addInterfaceAddress(ifaceIndex, address); |
| 155 | } else { // action == NetlinkEvent::Action::kAddressRemoved |
| 156 | bool shouldDestroy = gCtls->netCtrl.removeInterfaceAddress(ifaceIndex, address); |
| 157 | if (shouldDestroy) { |
| 158 | SockDiag sd; |
| 159 | if (sd.open()) { |
| 160 | int ret = sd.destroySockets(addrstr); |
| 161 | if (ret < 0) { |
| 162 | ALOGE("Error destroying sockets: %s", strerror(-ret)); |
| 163 | } |
| 164 | } else { |
| 165 | ALOGE("Error opening NETLINK_SOCK_DIAG socket: %s", strerror(errno)); |
Lorenzo Colitti | f32fc59 | 2016-02-15 01:09:14 +0900 | [diff] [blame] | 166 | } |
Lorenzo Colitti | f32fc59 | 2016-02-15 01:09:14 +0900 | [diff] [blame] | 167 | } |
Sreeram Ramachandran | af37dd3 | 2014-09-08 16:03:18 -0700 | [diff] [blame] | 168 | } |
Rubin Xu | 6c00b61 | 2018-04-27 14:27:59 +0100 | [diff] [blame] | 169 | // Note: if this interface was deleted, iface is "" and we don't notify. |
Lorenzo Colitti | f32fc59 | 2016-02-15 01:09:14 +0900 | [diff] [blame] | 170 | if (iface && iface[0] && address && flags && scope) { |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 171 | if (addrUpdated) { |
| 172 | notifyAddressUpdated(address, iface, std::stoi(flags), std::stoi(scope)); |
| 173 | } else { |
| 174 | notifyAddressRemoved(address, iface, std::stoi(flags), std::stoi(scope)); |
| 175 | } |
Lorenzo Colitti | 4da12db | 2013-09-03 00:26:23 +0900 | [diff] [blame] | 176 | } |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 177 | } else if (action == NetlinkEvent::Action::kRdnss) { |
Lorenzo Colitti | 12acae8 | 2013-10-24 14:51:57 +0900 | [diff] [blame] | 178 | const char *lifetime = evt->findParam("LIFETIME"); |
| 179 | const char *servers = evt->findParam("SERVERS"); |
| 180 | if (lifetime && servers) { |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 181 | notifyInterfaceDnsServers(iface, strtol(lifetime, nullptr, 10), |
| 182 | android::base::Split(servers, ",")); |
Lorenzo Colitti | 12acae8 | 2013-10-24 14:51:57 +0900 | [diff] [blame] | 183 | } |
Jeff Sharkey | 32fa9ba | 2015-03-13 13:35:17 -0700 | [diff] [blame] | 184 | } else if (action == NetlinkEvent::Action::kRouteUpdated || |
| 185 | action == NetlinkEvent::Action::kRouteRemoved) { |
Lorenzo Colitti | bd0f224 | 2014-06-12 13:51:05 +0900 | [diff] [blame] | 186 | const char *route = evt->findParam("ROUTE"); |
| 187 | const char *gateway = evt->findParam("GATEWAY"); |
| 188 | const char *iface = evt->findParam("INTERFACE"); |
| 189 | if (route && (gateway || iface)) { |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 190 | notifyRouteChange((action == NetlinkEvent::Action::kRouteUpdated) ? true : false, |
| 191 | route, (gateway == nullptr) ? "" : gateway, |
| 192 | (iface == nullptr) ? "" : iface); |
Lorenzo Colitti | bd0f224 | 2014-06-12 13:51:05 +0900 | [diff] [blame] | 193 | } |
Lorenzo Colitti | 9b3cd76 | 2013-08-02 05:57:47 +0900 | [diff] [blame] | 194 | } |
| 195 | |
Bryse Flowers | bc5f060 | 2016-06-01 13:00:12 -0700 | [diff] [blame] | 196 | } else if (!strcmp(subsys, "qlog") || !strcmp(subsys, "xt_quota2")) { |
JP Abgrall | e0ebc46 | 2011-07-21 17:21:49 -0700 | [diff] [blame] | 197 | const char *alertName = evt->findParam("ALERT_NAME"); |
| 198 | const char *iface = evt->findParam("INTERFACE"); |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 199 | if (alertName && iface) { |
| 200 | notifyQuotaLimitReached(alertName, iface); |
| 201 | } |
JP Abgrall | e07effe | 2012-04-27 00:02:53 -0700 | [diff] [blame] | 202 | |
Jeff Sharkey | fbe497f | 2014-10-28 16:50:07 -0700 | [diff] [blame] | 203 | } else if (!strcmp(subsys, "strict")) { |
| 204 | const char *uid = evt->findParam("UID"); |
| 205 | const char *hex = evt->findParam("HEX"); |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 206 | if (uid && hex) { |
| 207 | notifyStrictCleartext(strtol(uid, nullptr, 10), hex); |
| 208 | } |
Jeff Sharkey | fbe497f | 2014-10-28 16:50:07 -0700 | [diff] [blame] | 209 | |
JP Abgrall | e07effe | 2012-04-27 00:02:53 -0700 | [diff] [blame] | 210 | } else if (!strcmp(subsys, "xt_idletimer")) { |
Ashish Sharma | c79bcc4 | 2014-02-12 11:53:00 -0800 | [diff] [blame] | 211 | const char *label = evt->findParam("INTERFACE"); |
JP Abgrall | e07effe | 2012-04-27 00:02:53 -0700 | [diff] [blame] | 212 | const char *state = evt->findParam("STATE"); |
Ruchi Kandoi | 27ab7e1 | 2014-03-11 18:00:44 -0700 | [diff] [blame] | 213 | const char *timestamp = evt->findParam("TIME_NS"); |
Ruchi Kandoi | 05c39f0 | 2015-04-23 12:40:56 -0700 | [diff] [blame] | 214 | const char *uid = evt->findParam("UID"); |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 215 | if (state) { |
| 216 | bool isActive = !strcmp("active", state); |
| 217 | int64_t processTimestamp = (timestamp == nullptr) ? 0 : strtoll(timestamp, nullptr, 10); |
| 218 | int intLabel; |
| 219 | // NMS only accepts interface class activity changes with integer labels, and only ever |
| 220 | // creates idletimers with integer labels. |
| 221 | if (android::base::ParseInt(label, &intLabel)) { |
| 222 | const long reportedUid = |
| 223 | (uid != nullptr && isActive) ? strtol(uid, nullptr, 10) : -1; |
| 224 | notifyInterfaceClassActivityChanged(intLabel, isActive, processTimestamp, |
| 225 | reportedUid); |
| 226 | } |
| 227 | } |
JP Abgrall | e0ebc46 | 2011-07-21 17:21:49 -0700 | [diff] [blame] | 228 | |
JP Abgrall | 40baed8 | 2012-05-08 14:48:45 -0700 | [diff] [blame] | 229 | #if !LOG_NDEBUG |
| 230 | } else if (strcmp(subsys, "platform") && strcmp(subsys, "backlight")) { |
| 231 | /* It is not a VSYNC or a backlight event */ |
| 232 | ALOGV("unexpected event from subsystem %s", subsys); |
| 233 | #endif |
Ashish Sharma | 6337b88 | 2012-04-10 19:47:09 -0700 | [diff] [blame] | 234 | } |
San Mehat | d183042 | 2010-01-15 08:02:39 -0800 | [diff] [blame] | 235 | } |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 236 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 237 | void NetlinkHandler::notifyInterfaceAdded(const std::string& ifName) { |
| 238 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceAdded, ifName); |
Lorenzo Colitti | 0b454ea | 2013-10-25 19:53:31 +0900 | [diff] [blame] | 239 | } |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 240 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 241 | void NetlinkHandler::notifyInterfaceRemoved(const std::string& ifName) { |
| 242 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceRemoved, ifName); |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 243 | } |
| 244 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 245 | void NetlinkHandler::notifyInterfaceChanged(const std::string& ifName, bool up) { |
| 246 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceChanged, ifName, up); |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 247 | } |
| 248 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 249 | void NetlinkHandler::notifyInterfaceLinkChanged(const std::string& ifName, bool up) { |
| 250 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceLinkStateChanged, ifName, up); |
Mike J. Chen | 564df4e | 2011-06-23 15:07:35 -0700 | [diff] [blame] | 251 | } |
| 252 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 253 | void NetlinkHandler::notifyQuotaLimitReached(const std::string& labelName, |
| 254 | const std::string& ifName) { |
| 255 | LOG_EVENT_FUNC(BINDER_RETRY, onQuotaLimitReached, labelName, ifName); |
Robert Greenwalt | 67c5753 | 2010-02-17 17:42:37 -0800 | [diff] [blame] | 256 | } |
JP Abgrall | e0ebc46 | 2011-07-21 17:21:49 -0700 | [diff] [blame] | 257 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 258 | void NetlinkHandler::notifyInterfaceClassActivityChanged(int label, bool isActive, |
| 259 | int64_t timestamp, int uid) { |
| 260 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceClassActivityChanged, isActive, label, timestamp, uid); |
JP Abgrall | e0ebc46 | 2011-07-21 17:21:49 -0700 | [diff] [blame] | 261 | } |
Ashish Sharma | 6337b88 | 2012-04-10 19:47:09 -0700 | [diff] [blame] | 262 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 263 | void NetlinkHandler::notifyAddressUpdated(const std::string& addr, const std::string& ifName, |
| 264 | int flags, int scope) { |
| 265 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceAddressUpdated, addr, ifName, flags, scope); |
Ashish Sharma | 6337b88 | 2012-04-10 19:47:09 -0700 | [diff] [blame] | 266 | } |
Lorenzo Colitti | 9b3cd76 | 2013-08-02 05:57:47 +0900 | [diff] [blame] | 267 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 268 | void NetlinkHandler::notifyAddressRemoved(const std::string& addr, const std::string& ifName, |
| 269 | int flags, int scope) { |
| 270 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceAddressRemoved, addr, ifName, flags, scope); |
Lorenzo Colitti | 9b3cd76 | 2013-08-02 05:57:47 +0900 | [diff] [blame] | 271 | } |
Lorenzo Colitti | 12acae8 | 2013-10-24 14:51:57 +0900 | [diff] [blame] | 272 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 273 | void NetlinkHandler::notifyInterfaceDnsServers(const std::string& ifName, int64_t lifetime, |
| 274 | const std::vector<std::string>& servers) { |
| 275 | LOG_EVENT_FUNC(BINDER_RETRY, onInterfaceDnsServerInfo, ifName, lifetime, servers); |
Lorenzo Colitti | 12acae8 | 2013-10-24 14:51:57 +0900 | [diff] [blame] | 276 | } |
Lorenzo Colitti | bd0f224 | 2014-06-12 13:51:05 +0900 | [diff] [blame] | 277 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 278 | void NetlinkHandler::notifyRouteChange(bool updated, const std::string& route, |
| 279 | const std::string& gateway, const std::string& ifName) { |
| 280 | LOG_EVENT_FUNC(BINDER_RETRY, onRouteChanged, updated, route, gateway, ifName); |
Lorenzo Colitti | bd0f224 | 2014-06-12 13:51:05 +0900 | [diff] [blame] | 281 | } |
Jeff Sharkey | fbe497f | 2014-10-28 16:50:07 -0700 | [diff] [blame] | 282 | |
Luke Huang | 528af60 | 2018-08-29 19:06:05 +0800 | [diff] [blame^] | 283 | void NetlinkHandler::notifyStrictCleartext(uid_t uid, const std::string& hex) { |
| 284 | LOG_EVENT_FUNC(BINDER_RETRY, onStrictCleartextDetected, uid, hex); |
Jeff Sharkey | fbe497f | 2014-10-28 16:50:07 -0700 | [diff] [blame] | 285 | } |
Lorenzo Colitti | 7035f22 | 2017-02-13 18:29:00 +0900 | [diff] [blame] | 286 | |
| 287 | } // namespace net |
| 288 | } // namespace android |