History log of /system/connectivity/shill/net/netlink_manager_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
858fd4c3a24e7206c46c85702b6e40e098a1d68d 22-Sep-2015 Samuel Tan <samueltan@google.com> shill: cancel resend dump message task on dump reply timeout

Cancel the delayed message loop task to resend a pending
dump message when we timeout waiting for replies to the
pending dump message. Achieve this by wrapping this task
in a CancelableClosure, and canceling it in
OnPendingDumpComplete(), which is called by
OnPendingDumpTimeout().

This prevents NetlinkManager::ResendPendingDumpMessage from
running for a dump message that has already timed out.

While there, add an extra check in
NetlinkManager::ResendPendingDumpMessage to make sure we
do not attempt to send a non-null message.

BUG: 24300540
Change-Id: Ib34f6083da249dd8bec5e85d6c35484759bd9928
TEST: Compile shill and run unit tests.
/system/connectivity/shill/net/netlink_manager_unittest.cc
ff0702dc1853ae4d09e4d72d2ebbc26d200d10f6 22-Sep-2015 Samuel Tan <samueltan@google.com> shill: make all calls to NetlinkManager::OnPendingDumpComplete synchronous

Make all calls to NetlinkManager::OnPendingDumpComplete synchronous.
This eliminate edge cases where a synchronous call to
OnPendingDumpComplete() gets executed before message-loop-dispatched
call to the same function, even though the latter was meant to
run first.

Previously, OnPendingDumpComplete() was posted to the message loop
a precaution to prevent shill from blocking on the sending of the
next queued dump message (via RegisterHandlersAndSendMessage).
However, blocking on the sending of the next message should is not
an issue as the handler-registration and message-sending routines
are minimal and straightforward. Moreover, we already block
shill on the sending of netlink messages in SendOrPostMessage().

BUG=chrome-os-partner:45626
TEST=Compile shill and run unit tests.

Change-Id: Ifdd302527f95be2d63db9af3292429168526489f
/system/connectivity/shill/net/netlink_manager_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_manager_unittest.cc
57282d5403b23162de1ded91ec8d73bdc19c922a 29-Jul-2015 Paul Stewart <pstew@chromium.org> shill: netlink: Remove libgenl / libnl dependencies

shill no longer depends on libgenl / libnl in any meaningful
ways. This CL removes the last incidental dependencies and
removes the link line for it:

- Use of nla_total_len / nla_attr_size can be restated
trivially using constants from linux/netlink.h.
- The NLA_* type values no longer need to match up with
libnl, since we don't use this for policy anymore.
The NetlinkAttribute::Type is actually marginally more
descriptive.
- Remove defunct includes, references and comments.

BUG=chromium:512152
TEST=Unit tests

Change-Id: I8cb7d28f8382a0cfac0a3fe82acb1736ba321e27
Reviewed-on: https://chromium-review.googlesource.com/289236
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/net/netlink_manager_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_manager_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_manager_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_manager_unittest.cc
228b2aafbb644e29294f84e60e66bdd0c9f86bf2 04-May-2015 Samuel Tan <samueltan@chromium.org> shill: add unit test for NetlinkManager error handling

Add a unit test that verifies that we properly handle error message replies to
netlink messages sent by NetlinkManager.

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

Change-Id: Ia4c381a31844509ff0d444824b4abcc578fcc7e9
Reviewed-on: https://chromium-review.googlesource.com/268998
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/net/netlink_manager_unittest.cc
a599b9bee6c4319500905acf8dc6a22d73de452a 24-Apr-2015 Samuel Tan <samueltan@chromium.org> shill: resend dump messages if kernel responds with EBUSY

Resend netlink dump request messages up to one time if the kernel responds
with an EBUSY error. Upon receiving the EBUSY error, we wait 300ms before
sending the netlink dump request message again.

BUG=chromium:477090
TEST=Compile shill and run unittests.

Change-Id: Ia2f9abd6076bc64bb299cddf8cafe477da7ff605
Reviewed-on: https://chromium-review.googlesource.com/267083
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/net/netlink_manager_unittest.cc
cd796167bce99078f749a59fb50ad8ed274c8457 18-Apr-2015 Samuel Tan <samueltan@chromium.org> shill: wait for netlink dump message replies

Modify NetlinkManager so that if a netlink dump message (i.e. messages
with the NLM_F_DUMP flag set) was sent, wait until all replies to that message
have been received (or until a timeout) before sending any further netlink dump
message. This change only affects netlink dump messages--all other types of
netlink messages will still be sent immediately.

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

Change-Id: I2f5ff2803c094732a3d123611079282eaa49acec
Reviewed-on: https://chromium-review.googlesource.com/266764
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/net/netlink_manager_unittest.cc
37ce542707775fa0c29096129826a93a8e6fbdbb 14-Jan-2015 Aaron Kemp <kemp@google.com> shill: handle NLMSG_DONE properly

Previously, NLMSG_DONE was causing NetlinkManager to emit errors about a
message type mismatch.

This change allows an AuxilliarlyMessageHandler to be notified when
receiving NLMSG_DONE

BUG=none
TEST=ran unittests

Change-Id: Ie788dd21aea202fb93e93bb2583dba52cf429760
Reviewed-on: https://chromium-review.googlesource.com/241000
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Aaron Kemp <kemp@google.com>
Tested-by: Aaron Kemp <kemp@google.com>
/system/connectivity/shill/net/netlink_manager_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_manager_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_manager_unittest.cc