summaryrefslogtreecommitdiff
path: root/src/systemd/sd-bus.h
Commit message (Collapse)AuthorAge
* bus: add sd_bus_emit_object_{added/removed}()David Herrmann2014-12-30
| | | | | | | | | | | | | | | | | | | | | | | | | | This implements two new helpers, discussed on systemd-devel about 1 year ago: sd_bus_emit_object_added() sd_bus_emit_object_removed() Both calls are equivalent to their respective counterpart sd_bus_emit_interfaces_{added/removed}(), but can figure out the list of interfaces themselves, instead of requiring the caller to provide them. Furthermore, both calls properly deal with builtin interfaces provided via org.freedesktop.DBus.* and alike. Both calls simply traverse a node and all its parent nodes to figure out a list of all interfaces registered as vtable or fallback. It then appends each of them, similar to the interfaces_{added/removed}() helpers. Note that interfaces_{added/removed}() runs a parent traversal for *each* passed interface. Therefore, it can simply bail out, once it found a parent node that implements a given interface. With object_{added/removed}() we cannot know the registered interfaces in advance, thus, we cannot run one traversal per node. Instead, we run a single traversal and remember all interfaces that we added. Therefore, a child-interface overrides all conflicting parent-interfaces. We keep a "Set *s" context to track those while climbing up the tree.
* sd-bus: rename sd_bus_open_system_container() to sd_bus_open_system_machine()Lennart Poettering2014-12-24
| | | | | | | Pretty much everywhere else we use the generic term "machine" when referring to containers in API, so let's do though in sd-bus too. In particular, since the concept of a "container" exists in sd-bus too, but as part of the marshalling system.
* sd-bus: get rid of PID starttime conceptLennart Poettering2014-12-09
| | | | As kdbus no longer exports this, remove all traces from sd-bus too
* sd-bus: properly support passing memfds around with offset/size parametersLennart Poettering2014-12-09
|
* sd-bus: rework ELF error mapping table magicLennart Poettering2014-12-08
| | | | | | | The ELF magic cannot work for consumers of our shard library, since they are in a different module. Hence make all the ELF magic private, and instead introduce a public function to register additional static mapping table.
* sd-bus: make more connection properties readableLennart Poettering2014-11-28
|
* sd-bus: add new sd_bus_get_address() for querying the current bus addressLennart Poettering2014-11-28
| | | | Also, update "busctl" to show this in its output.
* sd-bus: rename sd_bus_get_owner_id() → sd_bus_get_bus_id()Lennart Poettering2014-11-28
| | | | | | | The ID returned really doesn't identify the owner, but the bus instance, hence fix this misnaming. Also, update "busctl status" to show the ID in its output.
* sd-bus: add new call sd_bus_get_scope() for querying whether one is ↵Lennart Poettering2014-11-28
| | | | connected to a system or a user bus
* bus-proxy: check passed parameter signature of all driver method callsLennart Poettering2014-11-27
|
* sd-bus: add suppot for renegotiating message credential attach flagsLennart Poettering2014-11-26
|
* sd-bus: add supplementary groups list to creds objectLennart Poettering2014-11-25
|
* sd-bus: update to current kernel version, by splitting off the extended ↵Lennart Poettering2014-11-25
| | | | | | | | | | | | | | | | | | | | | | KDBUS_ITEM_PIDS structure from KDBUS_ITEM_CREDS Also: - adds support for euid, suid, fsuid, egid, sgid, fsgid fields. - makes augmentation of creds with data from /proc explicitly controllable to give apps better control over this, given that this is racy. - enables augmentation for kdbus connections (previously we only did it for dbus1). This is useful since with recent kdbus versions it is possible for clients to control the metadata they want to send. - changes sd_bus_query_sender_privilege() to take the euid of the client into consideration, if known - when we don't have permissions to read augmentation data from /proc, don't fail, just don't add the data in
* sd-bus: add sd_bus_message_is_empty() for checking whether a message carries ↵Lennart Poettering2014-11-14
| | | | any body
* sd-bus: rename sd_bus_get_server_id() to sd_bus_get_owner_id()Lennart Poettering2014-11-04
| | | | | | | In kdbus a "server id" is mostly a misnomer, as there isn't any "server" involved anymore. Let's rename this to "owner" id hence, since it is an ID that is picked by the owner of a bus or direct connection. This matches nicely the sd_bus_get_owner_creds() call we already have.
* sd-bus: also allow setting descriptions on bus slotsLennart Poettering2014-11-04
|
* sd-bus: rename "connection name" to "description" for the sd-bus API tooLennart Poettering2014-11-04
| | | | | kdbus recently renamed this concept, and so should we in what we expose in userspace.
* Make bus errno mappings non-staticZbigniew Jędrzejewski-Szmek2014-10-31
| | | | | | | | | | | | | | | __attribute__((used)) is not enough to force static variables to be carried over to a compiled program from a library. Mappings defined in libsystemd-shared.a were not visible in the compiled binaries. To ensure that the mappings are present in the final binary, the tables are made non-static and are given a real unique name by which they can be referenced. To use a mapping defined not in the local compilation unit (e.g. in a library) a reference to the mapping table is added. This is done by including a declaration in the header file. Expected values in test-engine are fixed to reflect the new mappings.
* bus: add sd_bus_errnomap sectionZbigniew Jędrzejewski-Szmek2014-10-30
| | | | | This allows custom "name" ↔ errno mappings to be registered. Tables from all compilation units are concatenated.
* sd-bus: rename sd_bus_get_owner_uid(), sd_bus_get_owner_machine_id() and ↵Daniel Mack2014-10-22
| | | | | | | | | | sd_bus_get_peer_creds() Clean up the function namespace by renaming the following: sd_bus_get_owner_uid() → sd_bus_get_name_creds_uid() sd_bus_get_owner_machine_id() → sd_bus_get_name_machine_id() sd_bus_get_peer_creds() → sd_bus_get_owner_creds()
* sd-bus: add support for new allow-interactive-authorization message header flagLennart Poettering2014-10-13
|
* sd-bus: don't include internal header memfd.h in public header sd-bus.hHristo Venev2014-08-26
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=83097
* Merge remote-tracking branch 'origin/master'Lennart Poettering2014-08-18
|\
| * memfd: internalize functions, drop sd_memfd typeDaniel Mack2014-08-18
| | | | | | | | | | | | Remove the sd_ prefix from internal functions and get rid of the sd_memfd type. As a memfd is now just a native file descriptor, we can get rid of our own wrapper type, and also use close() and dup() on them directly.
| * memfd: move code from public library to src/sharedDaniel Mack2014-08-18
| | | | | | | | | | Don't expose generic kernel API via libsystemd, but keep the code internal for our own usage.
* | sd-bus: add API to query which handler/callback is currently being dispatchedLennart Poettering2014-08-18
|/
* sd-bus: add API to check if a client has privilegesLennart Poettering2014-08-15
| | | | | | | | | | | | | This is a generalization of the vtable privilege check we already have, but exported, and hence useful when preparing for a polkit change. This will deal with the complexity that on dbus1 one cannot trust the capability field we retrieve via the bus, since it is read via /proc/$$/stat (and thus might be out-of-date) rather than directly from the message (like on kdbus) or bus connection (as for uid creds on dbus1). Also, port over all code to this new API.
* sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables ↵Lennart Poettering2014-05-15
| | | | | | | | | | | attached to a bus connection This makes callback behaviour more like sd-event or sd-resolve, and creates proper object for unregistering callbacks. Taking the refernce to the slot is optional. If not taken life time of the slot will be bound to the underlying bus object (or in the case of an async call until the reply has been recieved).
* bus: add userdata API for bus name tracker objectsLennart Poettering2014-05-14
|
* sd-bus: add proper monitoring APILennart Poettering2014-03-19
|
* bus: replace sd_bus_label_{escape,unescape}() by new ↵Lennart Poettering2014-03-11
| | | | | | | | | | | sd_bus_path_{encode,decode}() The new calls work similarly, but enforce a that a common, fixed bus path prefix is used. This follows discussions with Simon McVittie on IRC that it should be a good idea to make sure that people don't use the escaping applied here too wildly as anything other than the last label of a bus path.
* bus: add sd_bus_track object for tracking peers, and port core over to itLennart Poettering2014-03-03
| | | | | | | | | | | | | | | | | | | This is primarily useful for services that need to track clients which reference certain objects they maintain, or which explicitly want to subscribe to certain events. Something like this is done in a large number of services, and not trivial to do. Hence, let's unify this at one place. This also ports over PID 1 to use this to ensure that subscriptions to job and manager events are correctly tracked. As a side-effect this makes sure we properly serialize and restore the track list across daemon reexec/reload, which didn't work correctly before. This also simplifies how we distribute messages to broadcast to the direct busses: we only track subscriptions for the API bus and implicitly assume that all direct busses are subscribed. This should be a pretty OK simplification since clients connected via direct bus connections are shortlived anyway.
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
* sd-bus: the bus returned should be the first argJason A. Donenfeld2014-02-20
| | | | This matches the API of previous headers, such as sd-journal.h.
* bus: reorder a few thingsLennart Poettering2014-01-28
|
* bus: add API calls for connecting to starter busLennart Poettering2014-01-27
| | | | | | | Add new calls sd_bus_open() and sd_bus_default() for connecting to the starter bus a service was invoked for, or -- if the process is not a bus-activated service -- the appropriate bus for the scope the process has been started in.
* bus: change API to expose "inverted" no_reply and no_auto_start message ↵Lennart Poettering2014-01-22
| | | | flags non-inverted
* bus: add sd_bus_process_priority() to support prioq mode of kdbusLennart Poettering2014-01-22
|
* bus: expose priority field of messages, in preparation for prioq supportLennart Poettering2014-01-22
|
* bus: include connection name in credentials structureLennart Poettering2014-01-22
|
* bus: add support for attaching name to bus connections for debugging purposesLennart Poettering2014-01-22
|
* bus: rename sd_bus_get_realtime_timestamp() to sd_bus_get_realtime_usec()Lennart Poettering2014-01-22
| | | | | | This brings the calls into similar style as the respective functions in libsystemd-journal, and also is a bi shorter and more descriptive since it clarifies the time unit used.
* bus: simplify naming of feature negotation callsLennart Poettering2014-01-22
| | | | Two verbs in a function name suck, so let's simplify this a bit.
* bus: add API for querying the kdbus message sequence numberLennart Poettering2014-01-22
|
* man: document some more bus functionsZbigniew Jędrzejewski-Szmek2014-01-05
|
* man: document a batch of bus functionsZbigniew Jędrzejewski-Szmek2014-01-04
|
* bus: correct a number of gcc format string attribute usagesLennart Poettering2013-12-28
|
* journalctl: make sure -b --foobar cannot be misunderstood as --boot=--foobarLennart Poettering2013-12-26
|
* bus: rename message "serial" to "cookie"Lennart Poettering2013-12-25
| | | | | | Even if the lower-leveld dbus1 protocol calls it "serial", let's expose the word "cookie" for this instead, as this is what kdbus uses and since it doesn't imply monotonicity the same way "serial" does.
* bus: wrap KDBUS_CMD_BYEBYE with a high-level call sd_bus_try_close()Lennart Poettering2013-12-20
|