if (iface && flags && scope) {
notifyAddressChanged(action, address, iface, flags, scope);
}
+ } else if (action == evt->NlActionRdnss) {
+ const char *lifetime = evt->findParam("LIFETIME");
+ const char *servers = evt->findParam("SERVERS");
+ if (lifetime && servers) {
+ notifyInterfaceDnsServers(iface, lifetime, servers);
+ }
}
} else if (!strcmp(subsys, "qlog")) {
(action == NetlinkEvent::NlActionAddressUpdated) ?
"updated" : "removed", addr, iface, flags, scope);
}
+
+void NetlinkHandler::notifyInterfaceDnsServers(const char *iface,
+ const char *lifetime,
+ const char *servers) {
+ notify(ResponseCode::InterfaceDnsInfo, "DnsInfo servers %s %s %s",
+ iface, lifetime, servers);
+}
void notifyInterfaceClassActivity(const char *name, bool isActive);
void notifyAddressChanged(int action, const char *addr, const char *iface,
const char *flags, const char *scope);
+ void notifyInterfaceDnsServers(const char *iface, const char *lifetime,
+ const char *servers);
+
};
#endif
if ((mRouteHandler = setupSocket(&mRouteSock, NETLINK_ROUTE,
RTMGRP_LINK |
RTMGRP_IPV4_IFADDR |
- RTMGRP_IPV6_IFADDR,
+ RTMGRP_IPV6_IFADDR |
+ (1 << (RTNLGRP_ND_USEROPT - 1)),
NetlinkListener::NETLINK_FORMAT_BINARY)) == NULL) {
return -1;
}
static const int ServiceGetAddrInfoSuccess = 612;
static const int InterfaceClassActivity = 613;
static const int InterfaceAddressChange = 614;
+ static const int InterfaceDnsInfo = 615;
};
#endif