summaryrefslogtreecommitdiffstats
path: root/include/sysutils
Commit message (Collapse)AuthorAgeFilesLines
* set /proc/sys/net/unix/max_dgram_qlen to large valueMark Salyzyn2014-03-031-0/+1
| | | | | | | | - init: set /proc/sys/net/unix/max_dgram_qlen to 300 - libsysutils: Add listen backlog argument to startListener - logd: set listen backlog to 300 Change-Id: Id6d37d6c937ba2d221e76258d89c9516619caeec
* libsysutils: SocketListener export releaseMark Salyzyn2014-01-271-0/+3
| | | | | | | | | | | | * Foreground thread (legacy) closes connection by reporting false return value for onDataAvailable. * Background thread can choose instead to close the connection asynchronously by calling release, must return true for the onDataAvailable method. (cherry picked from commit d7ad4e409eaac53db3a9789060097b712850b337) Change-Id: I70ab37d5c22b02804aa3b4dfb26cc9b75291f8b6
* libsysutils: Add iovec/runOnEachSocketMark Salyzyn2014-01-273-13/+48
| | | | | | | | | | | | | | | | | | | | SocketClient: * Replace sendDataLocked with sendDataLockedv which takes an iovec. * Add a version of sendData, sendDatav, which takes an iovec. * do not preserve iovec content through sendDatav SocketListener: * Add runOnEachSocket, which allows to to specify a SocketClientCommand to run individually on each socket. This allows you to do broadcast-like actions customized for each individual socket. * Client safe list reference counting for sendBroadcast & runOnEach Socket (cherry picked from commit a6e965578e44f8ae5f98de822ba5decec381d5fc) Signed-off-by: Nick Kralevich <nnk@google.com> Signed-off-by: Mark Salyzyn <salyzyn@google.com> Change-Id: I716f89c01b4cb7af900045c7e41fac1492defb06
* Merge "Force alignment of data buffer used to process netlink messages"Elliott Hughes2013-12-141-1/+1
|\
| * Force alignment of data buffer used to process netlink messagesChris Dearman2013-10-301-1/+1
| | | | | | | | | | | | | | This avoids any overhead associated with accessing unaligned data while processing netlink messages. Change-Id: I1ea13051816ef46b6627594121d98cda130ac609
* | Support parsing RDNSS ND options from netlink.Lorenzo Colitti2013-11-201-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Switch back to subsystem "net" for netlink events.Lorenzo Colitti2013-11-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change to enable address tracking via netlink incorrectly changed the subsystem of rtnetlink events from "net" to "interface". This broke interface add/delete notifications, which come from the kernel with subsystem "net". Switch back to "net" and deal with address tracking via new action codes instead of a new subsystem. [Cherry-pick of f34861346d5c207912075fba9874090e4c947869] Bug: 10433320 Change-Id: Ibf30efb426949dfd02304cc1d9adb1c005a539a6
* | Parse IP address changes in NetlinkEvent.Lorenzo Colitti2013-11-201-0/+1
|/ | | | | | | | | | | | | | | This adds support for parsing RTM_NEWADDR and RTM_DELADDR netlink messages received on netd's netlink socket and formatting them them so NetlinkHandler can process them. Address changes are notified in subsystem "address". Interface changes, which used to be notified in subsystem "net", are now notified in subsystem "interface" to avoid confusion. [Cherry-pick of a4b4e9ad8e35ab424e61d76ebe6654445fc61e63] Bug: 10232006 Change-Id: I93a50e8de17014e118a42f5cc0eb90a0cbfa73cc
* libsysutils: Increase command buffersize and command argsJosef Kindberg2012-11-121-1/+2
| | | | | | | Needed to support tethering of multiple remote Bluetooth devices. Change-Id: I9f736affd83226e8b2fa4f0faacd3654175dd8c9 Signed-off-by: Patrik Ryd <patrik.ryd@stericsson.com>
* Revert "libsysutils: NetlinkEvent: add support for interface xt_IDLETIMER ↵JP Abgrall2012-04-261-2/+0
| | | | | | | | | events." This reverts commit 731d831e91d5d9f8b15ca95367977abe35967166. Now that the xt_IDLETIMER uses the KOBJECT_UEVENT netlink, this change is not needed anymore.
* Add ability to quote responses as needed.Robert Greenwalt2012-04-201-0/+3
| | | | | | | | It's up to the protocol to know when quotes are required. In the future the response should probably all be binary blobs with lengths. bug:6353048 Change-Id: I3f9b48ab0f4e6746d75cdc9c0c84d33f38f63661
* libsysutils: NetlinkEvent: add support for interface xt_IDLETIMER events.Ashish Sharma2012-04-111-0/+2
| | | | | | | xt_IDLETIMER events are used to infer the interface (radio) state based on a inactivity timeout value. Change-Id: I755eb54a048ca1c6ce0c646564d61188d8241851
* Fix pointer arith.Robert Greenwalt2012-03-091-6/+4
| | | | | | | | | Sending 3digit code, null, binary-length and data. Current code sends 3digit code, space, null, binary-length, binary-data. The space should not be sent. Change-Id: I1df00a3e70805b39b6105966c7f3c613461a6858
* Add a utility function to send a code + binary msgSelim Gurun2012-03-071-1/+18
| | | | | | | | | Add a utility function to SocketClient to send a c-string code prepended to a binary message. This is necessary to be able to send a binary message while keeping compatible with underlying text-based protocol. Change-Id: Ifc6562003a687577d7deb50260533a5147ae4f97
* Merge "New NativeDaemonConnector protocol adds a seqnum."Robert Greenwalt2012-03-063-5/+27
|\
| * New NativeDaemonConnector protocol adds a seqnum.Robert Greenwalt2012-03-053-5/+27
| | | | | | | | | | | | | | | | | | | | Allows for one socket to be multiplexed for multiple requests. Doesn't use command sequence numbers for broadcasts - would make no sense. Doesn't alter current default behavior so OEM's using these classes won't notice a difference. bug:5864209 Change-Id: Ie3b19c4f81eea868569229a365c8cb7de249c2dd
* | remove dependency on utils/List.hMathias Agopian2012-03-054-6/+340
|/ | | | Change-Id: I9a1e996be645520d1d5a056337303a6e5ed646e9
* Revert "New NativeDaemonConnector protocol adds a seqnum."Guang Zhu2012-02-073-14/+3
| | | | | | | | Reverting because it seems to break `adb reboot` This reverts commit dc58e73071aa829a5038caf37211f6b3e2d7b275. Change-Id: Ib8cc4379254694398cbb7f3e7a64c20e1ed8c1ba
* New NativeDaemonConnector protocol adds a seqnum.Robert Greenwalt2012-02-073-3/+14
| | | | | | | Allows for one socket to be multiplexed for multiple requests. bug:5864209 Change-Id: I934c88da25d95e093371f455442bdf2f0ed7a4f4
* Fix SocketListener socket leak issue.Xianzhu Wang2011-09-291-2/+3
| | | | | | | | | | | | The problem was: if a socket is shared between SocketListener and another thread, only if the last reference is removed by SocketListener can the socket be closed, otherwise the socket will leak. This sometimes happens in netd's dnsproxyd. This change let the SocketClient own the socket and close the socket when the SocketClient is destructed. Change-Id: I2865fbfe9ee4d8b3e43d7e02919dbb2d261f70de
* Workaround Motorola ril.so incompatiblity with Netlink changesMike J. Chen2011-06-231-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | To workaround a binary incompatiblity with Motorola's ril.so, I had to temporarily provide the old constructor for NetlinkListener as well as a new contructor that takes an additional format argument. There's still a slight chance of a problem because the size of the NetlinkListener has changed with the addition of the mFormat member, but so far I've not seen any obvious problem with that incompatiblity. Another way we could have worked around the incompatiblity is to have netd (the main user of the new format argument to NetlinkListener) keep track of the format itself in it's NetlinkHandler (derived from NetlinkListener) and supply it's own version of onDataAvailable() that's almost 100% identical to NetlinkListener's except for the decode() call. That would allow us not to modify NetlinkListener at all. Worth considering but I think it's more properly divided right now and we just have to make Motorola fix their code (and ideally not use our private APIs). This change should be reverted when Motorola's has fixed their ril to either not use our private APIs or to use our updated ones. Change-Id: I255cca6908444e56cbbbed7eef1fa0cf1d8f0918 Signed-off-by: Mike J. Chen <mjchen@google.com>
* Cleanup NetlinkListener and NetlinkEventMike J. Chen2011-06-232-2/+5
| | | | | | | | | | | | | To make it easier to be compatible with older existing code, use default parameters instead of separate functions for setting. Also, reintroduce the const usage that was not in the original changes by Stan. Also fix some indent spacing. Change-Id: Ice9ec7f0d5c4a0673037e2e04a764d88a98f68eb Signed-off-by: Mike J. Chen <mjchen@google.com>
* Revert "Revert "Add NETLINK_ROUTE processing to the netlink client code, so ↵Mike J. Chen2011-06-232-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | that Ethernet"" This reverts commit 1d504eeb50d980c222572629383bb76315f32ca0. Conflicts: libsysutils/src/NetlinkEvent.cpp Bring back the changes from Stan Chesnutt regarding adding NETLINK_ROUTE processing. The original commit message description was: Add NETLINK_ROUTE processing to the netlink client code, so that Ethernet physical-layer up/down events can be tracked. Upper layers will use these events to enable/disable Ethernet connectivity. The original change was reverted due to an incompatiblity with Motorola's ril.so binary. I'll submit a patch to workaround that incompatiblity separately. Change-Id: I4e97ac98833b10543e654c63ecae3b9b8c7db44f Signed-off-by: Mike J. Chen <mjchen@google.com>
* Fix potential race introduced in Icd7f5f03Brad Fitzpatrick2011-03-171-1/+1
| | | | | | | | | | | | Digit wrote: "You probably don't want to close the socket here without updating c->socket as well. Otherwise, another thread holding a handle to the client after the c->decRef() could end up sending a message to a different socket, if the file descriptor index is reused by another client in the meantime." Change-Id: Icdefb5ffc0c7607325d7db761e1f04e5d868bfb7
* SocketClient: add optional reference countingBrad Fitzpatrick2011-03-171-0/+11
| | | | | | | Needed to fix a race in netd. Bug: 3438459 Change-Id: Icd7f5f035510235f733a25c0621479d3e644b152
* libsysutils: Fix race condition in SocketListener thread.David 'Digit' Turner2011-01-191-1/+1
| | | | | | | | + Handle EINTR in accept(), write() and select() + Fix a memory leak when deleting the mClients list + Fix typo in SocketListener.h Change-Id: Ie68bb3e2dbefe0dfdaa22a5cd06a42dbc4c0f8aa
* Let SocketClient users write binary data to clients.Brad Fitzpatrick2010-10-271-0/+4
| | | | | | | | | | This is a dependency for the DNS proxy CLs. This CL also adds a new socket for the netd process to inherit which is owned by the inet group. (so only apps with the INTERNET permission can use the DNS proxy...) Change-Id: Ic3475c697913ba85805b4e49801b65e7a1d59289
* Fetch peer credentials for local socketsKenny Root2010-09-141-0/+13
| | | | | | | Fetch the PID, UID, and GID of the remote side of a local socket connection in case any users of this library class want to check it. Change-Id: Ia3230e6bc68ab6f93160df9f5996d2bf744b872c
* sysutils: Increase number of command arguments to 16Dmitry Shmidt2010-03-091-1/+1
| | | | | Change-Id: I0bba579634b334d24645c2af55ab3fab6da03fc6 Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* sysutils: Add dump() to NetlinkEventSan Mehat2009-12-241-0/+2
| | | | Signed-off-by: San Mehat <san@google.com>
* merge from open-source masterJean-Baptiste Queru2009-10-141-0/+2
|\
| * libsysutils: Fix some bugs in NetlinkListener and NetlinkEventSan Mehat2009-10-101-0/+2
| | | | | | | | Signed-off-by: San Mehat <san@android.com>
* | nexus: Rollup update for nexusSan Mehat2009-07-101-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nexus: Change field separator from : to ' ' Signed-off-by: San Mehat <san@google.com> nexus: Add some prototypes for stuff to come Signed-off-by: San Mehat <san@google.com> nexus: Add some TODOs Signed-off-by: San Mehat <san@google.com> libsysutils: Put a proper token parser into the FrameworkListener which supports minimal \ escapes and quotes Signed-off-by: San Mehat <san@google.com> nexus: Fix a lot of bugs Signed-off-by: San Mehat <san@google.com> libsysutils: Remove some debugging Signed-off-by: San Mehat <san@google.com> nexus: Send broadcasts for supplicant state changes Signed-off-by: San Mehat <san@google.com> nexus: Plumb DHCP listener state changes to NetworkManager Signed-off-by: San Mehat <san@google.com> nexus: Make the SupplicantState strings more parsable Signed-off-by: San Mehat <san@google.com> nexus: Broadcast a message when dhcp state changes. Signed-off-by: San Mehat <san@google.com> nexus: Add a few new response codes Signed-off-by: San Mehat <san@google.com> nexus: Rename ErrorCode -> ResponseCode Signed-off-by: San Mehat <san@google.com> nexus: Add DHCP event broadcasting. Also adds the framework for tracking supplicant 'searching-for-AP' state Signed-off-by: San Mehat <san@google.com> nexus: REmove WifiScanner Signed-off-by: San Mehat <san@google.com> nexus: Change the way scanning works. scanmode can now be selected independantly of triggering a scan. Also adds rxfilter support Signed-off-by: San Mehat <san@google.com> nexus: Add support for configuring bluetooth coexistence scanning and modes Signed-off-by: San Mehat <san@google.com> nexus: use case insensitive match for property names Signed-off-by: San Mehat <san@google.com> nexus: Rollup of a bunch of stuff: - 'list' command now takes an argument to match against - InterfaceConfig has been moved into the Controller base (for now) - DhcpClient now has some rudimentry locking - process 'ADDRINFO' messages from dhcpcd - Drop tertiary dns Signed-off-by: San Mehat <san@google.com> nexus: Clean up some of the supplicant variable parsing and add 'wifi.current' Signed-off-by: San Mehat <san@google.com> nexus: Add driver-stop/start, initial suspend support Signed-off-by: San Mehat <san@google.com> nexus: Add Controller suspend/resume callbacks, as well as locking Signed-off-by: San Mehat <san@google.com> nexus: Make ARP probing configurable for DhcpClient Signed-off-by: San Mehat <san@google.com> nexus: Add linkspeed / rssi retrieval Signed-off-by: San Mehat <san@google.com> nexus: Add WifiStatusPoller to track RSSI/linkspeed when associated Signed-off-by: San Mehat <san@google.com> nexus: Disable some debugging and add 'wifi.netcount' property Signed-off-by: San Mehat <san@google.com> nexus: Replace the hackish property system with something more flexible with namespaces Signed-off-by: San Mehat <san@google.com> libsysutils: Fix a few bugs in SocketListener Signed-off-by: San Mehat <san@google.com> nexus: PropertyManager: Add array support Signed-off-by: San Mehat <san@google.com> nexus: Clean up properties Signed-off-by: San Mehat <san@google.com> nexus: WifiController: Change name of 'CurrentNetwork' property Signed-off-by: San Mehat <san@google.com>
* libsysutils: Move to a null terminated string protocol using space as a ↵San Mehat2009-06-152-2/+4
| | | | | | | | field separator. Also removes some debugging Signed-off-by: San Mehat <san@google.com>
* libsysutils: const correctness fixes + remove some debuggingSan Mehat2009-05-203-6/+6
| | | | Signed-off-by: San Mehat <san@google.com>
* libsysutils: Introduce 'ServiceManager', for starting/stopping init servicesSan Mehat2009-05-151-0/+30
| | | | Signed-off-by: San Mehat <san@google.com>
* libsysutils: Tweak SocketListener and friendsSan Mehat2009-05-122-2/+2
| | | | Signed-off-by: San Mehat <san@google.com>
* libsysutils: Add multiple client support and fix some bugsSan Mehat2009-05-107-52/+74
|
* libsysutils: New C++ system convenience librarySan Mehat2009-05-066-0/+225
This library contains re-usable classes for common system level daemons. Initial consumers of this library are 'nexus' and 'vold2' Signed-off-by: San Mehat <san@google.com>