libink: a message bus is not a peer

libink was written against the only bus it had, its own, where the
peer on the other end is the client.  A broker is not: it routes for
senders it names itself, expects a DESTINATION on anything addressed
through it, and answers on its own schedule rather than next.

Runlevels go on the wire as S and N rather than the digits Finit
keeps internally, since that is what a caller outside Finit means by
one.

The library stays a convenience library, linked into finit and
initctl and installed nowhere: the ABI promise waits until libink is
its own project.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2026-08-13 09:28:26 +02:00
1 parent 6310d9e760
commit b55dada80b
16 files changed
+340 -250

No files matched your search

+7
View File
@@ -226,6 +226,13 @@ link_client_t *link_client_open_timeout(const char *path, int timeout_ms);
void link_client_close(link_client_t *c);
/* Address subsequent calls on `c` to a well-known name. Needed when
* a broker routes the message, e.g. "org.freedesktop.DBus" to reach
* the bus driver itself; a brokerless link has a single peer and
* needs no destination, which is the default. `destination` is not
* copied, so it must outlive the client. */
void link_client_set_destination(link_client_t *c, const char *destination);
/* Detach the authenticated socket from the client and return the raw
* fd; subsequent link_client_close on `c` is invalid because the
* structure has already been freed. Used by callers (e.g. system-bus