Support parsing RDNSS ND options from netlink.
The RDNSS options (RFC 6106) used to configure DNS servers via
router advertisements are passed from the kernel to userspace via
RTM_NEWNDUSEROPT netlink messages. Add code to NetlinkEvent to
parse them.
Also fix a compiler warning and a couple of style issues.
[Cherry-pick of b185e90dcc6ac111bff908edcc6d89fd6b37dc11]
Bug: 9180552
Change-Id: I6c532c8f0ceef3afdc977a431a036df398013e1a
diff --git a/include/sysutils/NetlinkEvent.h b/include/sysutils/NetlinkEvent.h
index f3501cf..c0a9418 100644
--- a/include/sysutils/NetlinkEvent.h
+++ b/include/sysutils/NetlinkEvent.h
@@ -36,6 +36,7 @@
const static int NlActionLinkUp;
const static int NlActionAddressUpdated;
const static int NlActionAddressRemoved;
+ const static int NlActionRdnss;
NetlinkEvent();
virtual ~NetlinkEvent();
@@ -49,9 +50,10 @@
void dump();
protected:
- bool parseIfAddrMessage(int type, struct ifaddrmsg *ifaddr, int rtasize);
bool parseBinaryNetlinkMessage(char *buffer, int size);
bool parseAsciiNetlinkMessage(char *buffer, int size);
+ bool parseIfAddrMessage(int type, struct ifaddrmsg *ifaddr, int rtasize);
+ bool parseNdUserOptMessage(struct nduseroptmsg *msg, int optsize);
};
#endif