Commit graph

40 commits

Author SHA1 Message Date
Lennart Poettering eba8617efc bus: make sure callback structs are always properly initialized 2013-04-05 14:56:48 +02:00
Lennart Poettering c784c5ce77 bus: use C99 struct construction for error initializers
That way we can allocate an error struct on-the-fly while calling a
function. Nice!
2013-04-05 13:12:11 +02:00
Lennart Poettering 917b5dc707 bus: add convenience functions for constructing and sending method calls/signals in one call 2013-04-05 04:15:39 +02:00
Lennart Poettering 7286037fd4 bus: properly detect and handle if a callback is installed/removed from within a callback 2013-04-05 03:55:58 +02:00
Lennart Poettering 6807947e56 bus: don't allow recursive invocation of sd_bus_process() 2013-04-05 03:15:10 +02:00
Lennart Poettering adee69fa7a bus: always return something in sd_bus_get_timeout() 2013-04-01 03:29:30 +02:00
Lennart Poettering e82c950997 bus: allow two different fds for input/output in sd_bus_set_fd()
This is useful so that we can speak D-Bus over a FIFO pair such as
stdin+stdout.
2013-04-01 03:29:29 +02:00
Lennart Poettering 98178d3947 bus: rename sd_bus_get_peer() to sd_bus_get_server_id()
This function always returns the server side ID. The name suggested it
was actually always the peer's ID, but that's not correct if the call is
called on a server bus context. Hence, let's correct the name a bit.
2013-03-31 16:46:21 +02:00
Lennart Poettering 52f3ba915b bus: s/sd_message_handler_t/sd_bus_message_handler_t/g 2013-03-31 16:26:14 +02:00
Lennart Poettering 392d5b378c bus: parse matches locally and allow registration of callbacks for them
This includes code to parse and split up match strings which will also
be useful to calculate bloom filter masks when the time comes.
2013-03-31 16:16:37 +02:00
Lennart Poettering 2181a7f558 bus: implement server mode, and anonymous authentication 2013-03-30 15:21:55 +01:00
Lennart Poettering 3d339fec29 bus: properly set up bus connections with sd_bus_set_exec() 2013-03-30 15:21:55 +01:00
Lennart Poettering 9d37386224 bus: consider it an error if the first message we get on the bus is not a reply to HELLO 2013-03-30 15:21:54 +01:00
Zbigniew Jędrzejewski-Szmek 8333c77edf Always use errno > 0 to help gcc
gcc thinks that errno might be negative, and functions could return
something positive on error (-errno). Should not matter in practice,
but makes an -O4 build much quieter.
2013-03-29 10:12:41 -04:00
Lukas Nykryn 531991b64d sd-bus: check c->path for null instead of path 2013-03-27 12:01:44 -04:00
Lennart Poettering 5a0f6033be bus: fix missing variable initialization 2013-03-26 03:42:03 +01:00
Lennart Poettering 0a72c2bdef bus: automatically generate minimal introspection data to find installed objects 2013-03-26 02:19:34 +01:00
Lennart Poettering 94bbf1ba6d bus: rename send_hello flag to bus_cient
This way we can hide more than just the hello logic behind this flag,
for example, later on automatic match management.
2013-03-26 02:19:34 +01:00
Lennart Poettering a7e3212d89 bus: split socket related code into bus-socket.[ch], to prepare for kdbus backend 2013-03-25 03:43:19 +01:00
Lennart Poettering 2fd9ae2e9b bus: implement 'unixexec:' protocol 2013-03-25 02:33:35 +01:00
Lennart Poettering 021a1e78d7 bus: make optional whether unix socket passing is negotiated and whether hello is sent
This alos gets rid of explicit sd_open_fd() and sd_open_address()
constructors in favour of sd_new() + sd_new_start() where the
negotiation parameters may be set it in between.
2013-03-25 02:33:35 +01:00
Lennart Poettering 66f931b4c8 bus: properly handle termination of connections 2013-03-25 02:33:35 +01:00
Lennart Poettering 2c93b4efec bus: implement support for FD passing 2013-03-25 02:33:34 +01:00
Zbigniew Jędrzejewski-Szmek 9e1fe7c3db bus: don't free an unallocated var
Also remove unused variable.
2013-03-22 23:08:17 -04:00
Lennart Poettering a652755d2e bus: implement object handler registry 2013-03-22 15:46:49 +01:00
Lennart Poettering 2571ead1a6 bus: implicitly collect ucred/label information 2013-03-22 03:37:10 +01:00
Lennart Poettering 20902f3ec8 bus: also finish connection before returning from sd_bus_get_unique_name() 2013-03-22 03:37:10 +01:00
Lennart Poettering 2bf938c191 bus: fix uninitialized variable 2013-03-22 02:20:39 +01:00
Lennart Poettering dafb75912a bus: validate the hello response properly 2013-03-22 02:20:21 +01:00
Lennart Poettering d728d708c3 bus: rework synchronization logic
Instead of allowing certain actions fail during authentication and
connection setup, implicitly synchronize on the connection to be set up
completely before returning.
2013-03-22 01:49:56 +01:00
Lennart Poettering b9bf7e2be9 bus: implicitly handle peer commands Ping() and GetMachineId() 2013-03-22 00:12:37 +01:00
Lennart Poettering 2522023999 bus: enforce limits on all client influenced data objects 2013-03-22 00:12:37 +01:00
Lennart Poettering 29f6aadd53 bus: implicitly set no_reply flag on outgoing messages if the serial number is not kept
If nobody keeps the serial number of an outgoing message we know that
nobody expects an answer to it, so set the no_reply flag accordingly.
2013-03-22 00:12:37 +01:00
Lennart Poettering e3017af973 bus: implement full method call timeout logic 2013-03-21 22:53:29 +01:00
Lennart Poettering 89ffcd2ad5 bus: hook up client with socket communication 2013-03-20 23:00:10 +01:00
Lennart Poettering fbfa72b0a1 bus: introduce bus_error_is_dirty() independently of sd_bus_error_is_set() 2013-03-20 23:00:10 +01:00
Lennart Poettering 80a46c7313 bus: demarshal header fields properly 2013-03-20 23:00:10 +01:00
Lennart Poettering 9a17484d98 bus: implement demarshaller 2013-03-20 23:00:09 +01:00
Lennart Poettering 5407f2dea3 bus: suppress reply messages to method calls with no_reply set 2013-03-20 23:00:09 +01:00
Lennart Poettering de1c301ed1 bus: add basic implementation of a native bus client library 2013-03-20 23:00:09 +01:00