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