summaryrefslogtreecommitdiff
path: root/tools/dbus-monitor.c
Commit message (Collapse)AuthorAgeFilesLines
* dbus-monitor: handle default case for binary mode headerSimon McVittie2017-04-071-0/+2
| | | | | | | | | | | | | Also comment why it's OK to not do anything for the modes that don't have a header. We are effectively treating the default case as one of those, on the assumption that future modes are more likely to lack a header than to have one. Based on part of a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* test, tools: assert impossible values of local enums are not reachedSimon McVittie2017-04-071-2/+8
| | | | | | | | Based on part of a patch from Thomas Zimmermann. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Philip Withnall <withnall@endlessm.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98191
* Add missing function attributes suggested by clang (but not by gcc)Simon McVittie2016-10-131-0/+2
| | | | | | clang is a little more enthusiastic about suggesting these. Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: disable automatic handling of o.fd.Peer messagesSimon McVittie2015-07-211-0/+5
| | | | | | | | | | | | | | | A normal DBusConnection will automatically reply to o.fd.Peer messages such as Ping. We don't want this: if we are using traditional eavesdropping with an older dbus-daemon, we'll confuse everyone else by replying to messages that weren't intended for us. If we are using the new Monitoring interface (since 1.9.12), the same still applies, but in addition, the dbus-daemon will disconnect us for not being a well-behaved monitor. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90952 Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk> Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* dbus-monitor: use _dbus_get_real_time instead of gettimeofdaySimon McVittie2015-03-051-10/+4
| | | | | | | | | gettimeofday is implicitly declared (i.e. not in our #include'd header files) when cross-compiling for on Windows. Now that fd.o#83115 has been fixed, using _dbus functions is not a problem. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89428 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* dbus-monitor: Add timestamp to --monitor mode.Ralf Habacker2015-02-241-56/+15
| | | | | | | | | | | Use cross platform function _dbus_get_real_time() for fetching current time. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=88896 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk> [smcv: use %ld to avoid needing casts; reinstate printing the timestamp; libdbus-1 is sufficient now that fd.o#83115 is fixed; print timestamp for non-literal dbus-send replies too] Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* dbus-monitor: Remove empty column in --profile mode.Ralf Habacker2015-02-161-3/+1
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89165 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: Combine sec and usec columns into one timestamp column and ↵Ralf Habacker2015-02-161-12/+4
| | | | | | | unify platform related format string. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89165 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: whitespaceSimon McVittie2015-02-161-1/+1
|
* dbus-monitor: clarify column headersSimon McVittie2015-02-161-2/+2
| | | | | | | | | - change "ref serial" to "in_reply_to" (avoiding whitespace for easy visual parsing) - prefix with # to clarify that these are not part of the data Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89165 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* dbus-monitor.c: unify columns format in --profile mode and display column ↵Ralf Habacker2015-02-161-3/+24
| | | | | | | | header. [rebase onto correctly indented version -smcv] Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89165 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* dbus-monitor: convert remaining hard tabs to 8 spacesSimon McVittie2015-02-161-38/+38
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89165 Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
* dbus-monitor: add options to log binary data with or without pcap framingSimon McVittie2015-02-041-5/+146
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* dbus-monitor: add support for using BecomeMonitor to be a read-only monitorSimon McVittie2015-02-041-9/+75
| | | | | | | | | Move the dbus_connection_add_filter() call further up as a precaution, because it isn't safe for a monitor to not have a filter that swallows all messages. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall <philip.withnall@collabora.co.uk>
* dbus-monitor: use common code from dbus-test-toolSimon McVittie2015-02-041-9/+3
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=46787 Reviewed-by: Philip Withnall [also sync up the cmake build system -smcv]
* dbus-monitor: keep backwards compatibilityChengwei Yang2013-10-091-6/+25
| | | | | | | | | | | | | | | | eavesdropping as a match rule key introduced in DBus 1.5.6, and the privous implementation doesn't keep backwards compatibility with older dbus-daemon. And the reference dbus-daemon implementation just fail if unknwon key found in match rule, this is undefined hehavior in DBus Sepcification. Also there is a feature request for change this hehavior to "ignore unknown key in match rule", See https://bugs.freedesktop.org/show_bug.cgi?id=66114 Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: remove redundant match rulesChengwei Yang2013-10-081-16/+1
| | | | | | | | | | Currently, DBus Specification only consists of four message types, so to monitor all the types of message, no need to match all of them but just left it empty is OK. Signed-off-by: Chengwei Yang <chengwei.yang@intel.com> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=66107 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix build on NetBSD 6.1.1 with gcc 4.5.3Chengwei Yang2013-10-081-0/+3
| | | | | | | | | | There are two build failure on NetBSD 6.1.1 with gcc 4.5.3, the first one is char to int, warning treated as error. The second one is a mismatch between format string and arguments. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69842 [adjusted commit message -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix an incorrect sizeof.Sviatoslav Chagaev2013-09-161-1/+1
| | | | | | | | | Fix an incorrect sizeof which leads to allocation of more memory than actually needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329 [elide redundant "* sizeof (char)" which is 1 by definition -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Revert "Fix an incorrect sizeof." to fix attributionSimon McVittie2013-09-161-1/+1
| | | | This reverts commit 3c1938180bdca8fc658907f6f692186be2b81b77.
* Fix an incorrect sizeof.Simon McVittie2013-09-161-1/+1
| | | | | | | | | Fix an incorrect sizeof which leads to allocation of more memory than actually needed. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=69329 [elide redundant "* sizeof (char)" which is 1 by definition -smcv] Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* dbus-monitor: remove unused SIGINT handlerSimon McVittie2011-08-051-8/+0
| | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=39231 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
* Fix dbus-monitor using eavesdrop=true when no filters are passedCosimo Alfarano2011-07-121-4/+4
| | | | Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Add "eavesdrop=true" as constant match rule for dbus-monitorCosimo Alfarano2011-07-111-5/+24
| | | | | | Bug: https://bugs.freedesktop.org/show_bug.cgi?id=37890 Bug-NB: NB#269748 Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* minotaur: bail if asked to monitor >1 busWill Thompson2011-04-291-11/+35
| | | | | | | | | | A coworker was just tripped up by `dbus-monitor --session --system` only monitoring the system bus. This patch would have saved him reproducing a tricky bug several times! Bug: https://bugs.freedesktop.org/show_bug.cgi?id=26548 Reviewed-by: Colin Walters <walters@verbum.org> Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
* Fix PROFILE_TIMED_FORMAT printf warning on OSX.Mike McQuaid2010-12-041-0/+4
|
* Fix _IOLBF for Windows CE and also define _IONBF if needed.Marcus Brinkmann2010-05-121-1/+4
|
* Fixed assert raised with msvc 2008 on windows.Ralf Habacker2010-05-101-0/+5
|
* Port dbus tools to Windows CE.Marcus Brinkmann2010-04-131-0/+15
|
* dbus-monitor: use unbuffered stdout instead of handling SIGINTLennart Poettering2009-07-311-6/+8
| | | | | | | | | | | | | | | | | | The current SIGINT handling of dbus-monitor ain't making too many people happy since it defers the exit to the next msg received -- which might be quite some time away often enough. This patch replaces the SIGINT handling by simply enabling line-buffered IO for STDOUT so that even if you redirect dbus-monitor into a file no lines get accidently lost and the effect of C-c is still immediate. halfline came up with the great idea to use setvbuf here instead of fflush()ing after each printf(). (Oh and the old signal handler was broken anyway, the flag should have been of type sigatomic_t and be marked volatile) Signed-off-by: Colin Walters <walters@verbum.org>
* Bug 2432 - Support --address option for dbus-monitorDaniel Reed2009-07-141-5/+49
| | | | | Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit e4b271e2425a36884b5e3e70e6a32d440b41d145)
* Bug 21161 - Update the FSF addressTobias Mueller2009-07-141-1/+1
| | | | | | | No comment. Signed-off-by: Colin Walters <walters@verbum.org> (cherry picked from commit 5baf2f856a9c6625993234855b07680da1c8916f)
* Bug 19502 - Sparse warning cleanupsKjartan Maraas2009-05-061-1/+1
| | | | | | | This patch makes various things that should be static static, corrects some "return FALSE" where it should be NULL, etc. Signed-off-by: Colin Walters <walters@verbum.org>
* take out trailing comma inside an enum so non gcc compilers don't error outJohn (J5) Palmieri2008-04-161-1/+1
| | | | | | * tools/dbus-monitor.c: take out the trailing comma in the ProfileAttributeFlags enum as it isn't in our style guides and causes some compilers to error out
* 2007-07-13 Havoc Pennington <hp@redhat.com>Havoc Pennington2007-07-141-1/+1
| | | | * Add indent-tabs-mode: nil to all file headers.
* * tools/dbus-monitor.c: gettimeofday() is not availableRalf Habacker2006-12-311-0/+29
| | | | | on windows so we have to provide our own. It's taken from lgpl'd kdewin32 package. - Patches from Christian Ehrlicher
* win32 compile fixRalf Habacker2006-12-311-0/+1
|
* * tools/dbus-monitor.c: Handle sigint so we flush stdoutJohn (J5) Palmieri2006-11-081-1/+15
| | | | (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
* * tools/dbus-monitor.c: add profiling tools to dbus-monitorJohn (J5) Palmieri2006-11-081-4/+122
| | | | (Patch from Olli Salli <olli dot salli at collabora dot co dot uk>)
* 2006-06-14 Ross Burton <ross@openedhand.com>Ross Burton2006-06-141-10/+3
| | | | | | | * tools/Makefile.am: * tools/dbus-monitor.c: Don't use the GLib bindings in dbus-monitor (patch from Ralf Habacker).
* 2005-10-29 Robert McQueen <robot101@debian.org>Robert McQueen2005-10-291-27/+50
| | | | | | | | | | | | * glib/Makefile.am, glib/examples/Makefile.am, glib/examples/statemachine/Makefile.am: Merge patch from Ubuntu by Daniel Stone to replace explicit calls to libtool with $(LIBTOOL). * test/python/.cvsignore: Add run-with-tmp-session-bus.conf. * tools/dbus-monitor.1, tools/dbus-monitor.c: Merge dbus-monitor patch from Ubuntu by Daniel Silverstone to allow specifying match rules on the command line.
* 2005-07-06 Colin Walters <walters@verbum.org>Colin Walters2005-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-glib.h (DBusGPendingCall, DBusGPendingCallNotify) (DBUS_TYPE_G_PENDING_CALL, dbus_g_pending_call_get_g_type) (dbus_g_pending_call_ref, dbus_g_pending_call_unref): Delete. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete in favor of dbus_g_proxy_begin_call and dbus_g_proxy_cancel_call. (DBusGProxyCall, DBusGProxyCallNotify): New. (dbus_g_proxy_begin_call): Change prototype to take callback, user data, and destroy function. This replaces dbus_g_pending_call_set_notify. (dbus_g_proxy_cancel_call): Prototype. (DBusGAsyncData): Delete, shouldn't be needed anymore. * glib/dbus-gproxy.c (struct _DBusGProxy): Add call_id_counter and pending_calls map. (struct _DBusGProxyManager): Add bus_proxy member, which is an internal proxy for calls to the bus. Remove pending_nameowner_calls, now the internal proxy keeps track. (dbus_g_proxy_manager_unref): Unref bus proxy, remove reference to pending_nameowner_calls. (got_name_owner_cb): Update prototype, and use dbus_g_proxy_end_call. (got_name_owner_cb): Remove reference to pending_nameowner_calls. (dbus_g_proxy_manager_register): Delete directly libdbus code in favor of using internal proxy. (dbus_g_proxy_manager_unregister): Update to use dbus_g_proxy_cancel_call for any pending GetNameOwner call. (dbus_g_proxy_init): Initialize pending calls map. (dbus_g_proxy_constructor): New. (dbus_g_proxy_class_init): Add get/set property functions, constructor, and add NAME, PATH, and INTERFACE properties. (cancel_pending_call): New function. (dbus_g_proxy_dispose): Iterate over any outstanding calls and cancel them. (dbus_g_proxy_set_property, dbus_g_proxy_get_property): New. (GPendingNotifyClosure): New structure. (d_pending_call_notify, d_pending_call_free): Moved here from dbus-glib.c. (DBUS_G_VALUE_ARRAY_COLLECT_ALL): Moved around to satisfy function ordering. (manager_begin_bus_call): New internal function for talking to internal bus proxy. (dbus_g_proxy_new): Construct object using GObjet properties. (dbus_g_proxy_begin_call_internal): Update to take user data, etc. Create closure of same, and insert call into map of pending calls. (dbus_g_proxy_end_call_internal): Take call id instead of pending call. Look up pending call in current set. Remove it when we've completed. (dbus_g_pending_call_end, dbus_g_proxy_end_call_internal): Delete. (dbus_g_proxy_begin_call): Change API to take callback, user data, and destroy function directly. (dbus_g_proxy_end_call): Update to take DBusGProxyCall. (dbus_g_proxy_call): Invoke with NULL callback. (dbus_g_proxy_cancel_call): New function, replaces dbus_g_pending_call_cancel. * glib/dbus-gparser.c (validate_signature): Fix call to dbus_set_g_error. * glib/dbus-gobject.c (dbus_g_object_type_dbus_metadata_quark): New quark for attaching metadata to GType. (info_hash): Delete. (lookup_object_info): Look up using quark. (dbus_g_object_type_install_info): Check that a type is classed, not that it's an object. Also just install type data using quark instead of using global hash. * glib/dbus-glib.c (dbus_g_pending_call_ref) (dbus_g_pending_call_unref, dbus_pending_call_get_g_type) (GPendingNotifyClosure): Delete. (d_pending_call_notify, d_pending_call_free): Move to dbus-gproxy.c. (dbus_g_pending_call_set_notify, dbus_g_pending_call_cancel): Delete. * glib/dbus-binding-tool-glib.c (generate_client_glue): Disable async client method generation until we can fix it... * tools/dbus-viewer.c (load_child_nodes): Use dbus_g_proxy_call. (load_from_service_thread_func): Ditto. * tools/dbus-names-model.c (struct NamesModel): Hold DBusGProxyCall. (have_names_notify): Update prototype, use dbus_g_proxy_cancel_call. (names_model_reload): Update for new dbus_g_proxy_begin_call API. * tools/dbus-monitor.c (filter_func): Update for print_message API change. * test/glib/test-dbus-glib.c: Add more tests for async invocations. Update many begin_call/end_call pairs to just use dbus_g_proxy_call. * tools/dbus-send.c (main): Add --print-reply=literal mode. This allows us to dump print-introspect.c. * tools/dbus-print-message.h (print_message): Add literal argument to print_message which is intended to allow printing arguments without metadata like "string=". * tools/dbus-print-message.c (print_iter): Add literal argument. (print_message): Allow printing string messages literally.
* 2005-02-17 Colin Walters <walters@verbum.org>Colin Walters2005-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-protocol.h (DBUS_SERVICE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_SERVICE_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_DBUS): Rename to DBUS_PATH_DBUS. (DBUS_PATH_ORG_FREEDESKTOP_LOCAL): Rename to DBUS_PATH_LOCAL. (DBUS_INTERFACE_ORG_FREEDESKTOP_DBUS): Rename to DBUS_INTERFACE_DBUS. (DBUS_INTERFACE_ORG_FREEDESKTOP_INTROSPECTABLE): Rename to DBUS_INTERFACE_INTROSPECTABLE. (DBUS_INTERFACE_ORG_FREEDESKTOP_PROPERTIES): Rename to DBUS_INTERFACE_PROPERTIES. (DBUS_INTERFACE_ORG_FREEDESKTOP_PEER): Rename to DBUS_INTERFACE_PEER. (DBUS_INTERFACE_ORG_FREEDESKTOP_LOCAL): DBUS_INTERFACE_LOCAL. All other users of those constants have been changed. * bus/driver.c (bus_driver_handle_introspect): Use constants. * glib/dbus-gobject.c (handle_introspect): Use constants. * doc/dbus-faq.xml, doc/dbus-specification.xml: Update for rename.
* Add comment about workaround.Colin Walters2004-10-291-0/+4
|
* 2004-10-29 Colin Walters <walters@redhat.com>Colin Walters2004-10-291-1/+1
| | | | | | | * tools/dbus-monitor.c (filter_func): Return DBUS_HANDLER_RESULT_HANDLED in filter function for now. See: http://freedesktop.org/pipermail/dbus/2004-August/001433.html
* 2004-06-20 Havoc Pennington <hp@redhat.com>Havoc Pennington2004-06-201-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-glib-error-enum.h: autogenerate the GError enum codes from the dbus error names * glib/dbus-glib.h: move to subdir dbus/ since it's included as dbus/dbus-glib.h and that breakage is now visible due to including dbus/dbus-glib.h in dbus-glib-lowlevel.h * glib/dbus-glib.h: s/gproxy/g_proxy/ * dbus/dbus-shared.h: new header to hold stuff shared with binding APIs * dbus/dbus-protocol.h (DBUS_ERROR_*): move errors here rather than dbus-errors.h * glib/dbus-glib.h (dbus_set_g_error): move to dbus-glib-lowlevel.h * glib/dbus-glib.h: remove dbus/dbus.h from here; change a bunch of stuff to enable this * dbus/dbus-glib-lowlevel.h: put dbus/dbus.h here * a bunch of other changes with the same basic "separate glib bindings from dbus.h" theme
* monitor all types of messagesColin Walters2004-05-251-1/+27
|
* 2003-08-30 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-08-311-7/+4
| | | | | | | * dbus/dbus-connection.c: purge DBusMessageHandler * dbus/dbus-message-handler.c: remove DBusMessageHandler, just use callbacks everywhere
* 2003-08-18 Havoc Pennington <hp@redhat.com>Havoc Pennington2003-08-181-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | * dbus/dbus-hash.c (_dbus_hash_table_insert_two_strings): fix * dbus/dbus-message.c (_dbus_message_loader_queue_messages): fix dumb bug created earlier (wrong order of args to decode_header_data()) * tools/dbus-send.c: port * tools/dbus-print-message.c (print_message): port * test/data/*messages: port all messages over * dbus/dbus-message-builder.c: support including message type * bus/driver.c: port over * bus/dispatch.c: port over to new stuff * dbus/dbus-connection.c (_dbus_connection_new_for_transport): rename disconnect signal to "Disconnected"
* 2003-08-11 Havoc Pennington <hp@pobox.com>Havoc Pennington2003-08-121-1/+1
| | | | | | | | | | * bus/test.c (client_disconnect_handler): change to return HANDLED (would have been REMOVE_MESSAGE) * dbus/dbus-object.h (enum DBusHandlerResult): rename to HANDLED/NOT_YET_HANDLED instead of REMOVE_MESSAGE/ALLOW_MORE_HANDLERS to make it clearer how it should be used.