shill: make netlink message creation context-dependent

Provide shill with context when it parses netlink messages received in
NetlinkManager::OnNlMessageReceived using NetlinkMessageFactory::CreateMessage.
Do this by inferring a NetlinkMessage::MessageContext in NetlinkManager
immediately after receiving the message, and then passing this context along
to NetlinkMessageFactory::CreateMessage and any subsequent functions it invokes
that might use this context to decide how to parse the message.

In this CL, we pass this context through to the Nl80211AttributeWowlanTriggers
constructor, which can use this context to decide how to parse the
NL80211_WOWLAN_TRIG_PKT_PATTERN attribute.

In order to reduce the size and impact of this change,
NetlinkMessage::MessageContext is not passed to functions that do not use it.
In the future, function signatures can be modified to accept a MessageContext
(and new members can be added to the MessageContext struct) if it is required
to properly parse a netlink messages/attributes.

BUG=chromium:455435
TEST=Compile shill and run unit tests.

Change-Id: Ib8858a57ec366408dcf5e6211007c8680e45a7f1
Reviewed-on: https://chromium-review.googlesource.com/246364
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
1 file changed