History log of /system/connectivity/shill/net/netlink_message_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fa1eb722d0742d89c26b9c5c81d02ef2a138cbf2 21-Dec-2015 Alex Vakulenko <avakulenko@google.com> shill: Disable RTTI

There is no longer a reliance on RTTI in libbrillo, so disable RTTI
in the rest of Brillo codebase.

Shill also used dynamic_cast<> in many places but it looks like there
is no reason for that. Using static_cast<> in those places seems to
work just as well and doesn't require RTTI.

Bug: 26292405, chromium:220387
TEST: Compiles, all unit tests pass on Dragonboard
Was able to bootstrap a device from scratch and networking
seems to work fine.

Change-Id: Id0c47168e634e354b4279f613246e6667df6fb5f
/system/connectivity/shill/net/netlink_message_unittest.cc
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

This patch automatically replaced the license on all text files from
Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as
a reference.

The license header was added to .gyp and .gypi, the NOTICE was added with a copy
of the Apache2 license and MODULE_LICENSE_* file was added.

BUG=23587594
TEST=grep 'Chromium OS Authors' doesn't find anything.

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/net/netlink_message_unittest.cc
979f851096ba2e4251d8beba2f7fc20d27a0cac3 28-Jul-2015 Paul Stewart <pstew@chromium.org> shill: NetlinkAttribute: Parse nlattr values

Parse netlink attributes directly in NetlinkAttribute and
NetlinkAttributeList. Packing and unpacking "tb" and "policy"
data structures and calling nla_parse() and friends doesn't
add any value, since NetlinkAttribute already has its own
scheme (NestedData) for specifying type validation and custom
decoding.

The back-end for this refactor is a new IterateAttributes
method written in AttributeList that walks an incoming
payload to present each nlattr type and a ByteString
containing the attribute payload. This means that all
NetlinkAttribute types needed to be refactored to use
"const ByteString&" for initialization.

This CL also contains a few small fix-ups to unit tests
(a couple missing ResetConsumedBytes() calls) and adds
unit tests for IterateAttributes and the refactor of string
validation over to NetlinkStringAttribute.

CQ-DEPEND=CL:*224915
BUG=chromium:512152
TEST=Unit tests

Change-Id: I416464dd928a4c8e024267d2e20234190995771b
Reviewed-on: https://chromium-review.googlesource.com/289228
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/net/netlink_message_unittest.cc
b5b41b5ce5d06e9df1dbd7f319cc49ff982eb84e 24-Jul-2015 Paul Stewart <pstew@chromium.org> shill: NetlinkManager: Use NetlinkPacket for incoming data

Create NetlinkPacket instances for dispatching incoming netlink
frames. As opposed to raw nlmsghdr pointers, NetlinkPacket
objects can persistently contain both the bounds of the packet
(since it is contained in a ByteString) as well as a counter
for the data consumed from the payload so far.

Use of this new data structure also resolves some tricky issues
about "constness" with regards to the data passed to the
NetlinkMessage. Previously, the code had a number of instances
of "const_cast". Although NetlinkPacket objects are passed via
non-const pointer, the class itself does not provide any
non-const methods apart from those related to the consumption
of data out of the payload. As a result, we have a reasonable
guarantee that there will not be any non-obvious modification
of either headers or payload as it is being processed.

For purposes of unit tests which do have cases for header and
payload modification, a MutableNetlinkPacket object is
introduced to supply those needs in a manner that does not
expose NetlinkPacket further.

All NetlinkMessage objects have been converted to use this new
datatype.

BUG=chromium:512152
TEST=Unit tests

Change-Id: I07180d8dcc70852998920fdbe97f9ef1511c1b2b
Reviewed-on: https://chromium-review.googlesource.com/287913
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/net/netlink_message_unittest.cc
e67a78539a05ea7fc68ed5ca18f6d1de333a3086 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: net: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: Ice57438655da8f177e5a8aa6fd602779ba21c357
Reviewed-on: https://chromium-review.googlesource.com/278075
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/net/netlink_message_unittest.cc
81448bf3aa239726099874f0dff5c2b293873aca 23-Mar-2015 Aaron Kemp <kemp@google.com> shill: add Nl80211Frame accessor for frame_type

This allows code that uses the netlink manager to determine the frame
type of 80211 Management Frames without parsing the type out of the raw
frame data.

BUG=chrome-os-partner:38163
TEST=ran unit tests

Change-Id: I23de4ccdbd66e553397a56fec291513139e74238
Reviewed-on: https://chromium-review.googlesource.com/261951
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Aaron Kemp <kemp@google.com>
Commit-Queue: Aaron Kemp <kemp@google.com>
/system/connectivity/shill/net/netlink_message_unittest.cc
900ab5eff3f23a18feb955210e8acc9fb5cfa292 04-Feb-2015 Samuel Tan <samueltan@chromium.org> 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>
/system/connectivity/shill/net/netlink_message_unittest.cc
ba24e6fd0f0f2b974e0e73039d7d92bb475f6857 17-Nov-2014 Peter Qiu <zqiu@chromium.org> shill: Disable automatic symbol exports from libshill-net

Using -fvisibility=default flag in libshill-net causes a lot of uneeded
symbols to be exported from the shared library.

Removed the flag from the GYP file for libshill-net and instead added
SHILL_EXPORT macro to be added to classes, variables and methods to be
exported from the libraries explicitly.

Also added SHILL_PRIVATE attribute to explicitly hide a symbol which
can be used on some member of a class that is otherwise exported.

BUG=chromium:433600
TEST=USE="clang asan" FEATURES=test emerge-$BOARD shill

Change-Id: I16928737dde6bc5b97785773f6ed0f940f301f62
Reviewed-on: https://chromium-review.googlesource.com/230220
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/net/netlink_message_unittest.cc
02e3dc3bc6e9fdb475bd13944f1c6764c921abbb 31-Oct-2014 Peter Qiu <zqiu@chromium.org> shill: Move netlink functionality to libshill-net shared library

By exporting netlink functionality to a shared library, other
applications can use the interfaces provided by this library
to communicate with the cfg80211 kernel module and mac80211 drivers.

To use this library, add dependency for libshill-net-<(libbase_ver) in
your gyp file, and include the headers from <shill/net/*>

BUG=chromium:427982
TEST=unittests, run wifi_matfunc suite for shill regression test

Change-Id: Ia8ea063daaa63de27fe81e153458e149586086ec
Reviewed-on: https://chromium-review.googlesource.com/226830
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/net/netlink_message_unittest.cc