summaryrefslogtreecommitdiff
path: root/src/systemd
Commit message (Collapse)AuthorAge
...
* rtnl: simplify link_new()Tom Gundersen2013-12-16
| | | | Drop most of the arguments and instead introduce link_set_{flags,type}.
* journal: downgrade comments about sd_journal_print_with_location()Lennart Poettering2013-12-13
| | | | | | Effectviely these calls are ABI anyway, so downgrade the comments a bit, since it might actually be useful for language bindings to make use of them.
* event: add ability to change fd of an active event sourceLennart Poettering2013-12-13
|
* event: allow to query userdata and watchdog stateLennart Poettering2013-12-13
|
* event: rework sd-event exit logicLennart Poettering2013-12-13
| | | | | | | | | | | | | With this change a failing event source handler will not cause the entire event loop to fail. Instead, we just disable the specific event source, log a message at debug level and go on. This also introduces a new concept of "exit code" which can be stored in the event loop and is returned by sd_event_loop(). We also rename "quit" to "exit" everywhere else. Altogether this should make things more robus and keep errors local while still providing a way to return event loop errors in a clear way.
* dhcp: Add function to free DHCP client dataPatrik Flykt2013-12-12
|
* dhcp: Add notification callbackPatrik Flykt2013-12-12
| | | | | Define a notification callback and events for stopping and client lease expiry. Add functions to fetch IP parameters from a lease.
* dhcp: Process DHCP Ack/Nak messagePatrik Flykt2013-12-12
| | | | | | | Process a DHCP Ack/Nak in much the same way as an DHCP Offer. Factor out header verification and process options sent. Add notification functionality with discrete values for the outcome of the DHCP Ack/ Nak processing.
* dhcp: Add timeout and main loop supportPatrik Flykt2013-12-12
| | | | | | | Require a main loop to be set when creating a DHCP client. Set up a timer to resend DHCP Discover messages and add a 0-2 second delay to the timeout value. Move to state Selecting after successful sending of a Discover message.
* dhcp: Add function to stop the DHCP clientPatrik Flykt2013-12-12
| | | | The client is stopped and brought back to its initial state.
* dhcp: Add DHCP discover sendingPatrik Flykt2013-12-12
| | | | | | | | | | | | | | | | On starting the client, use the supplied interface mac address and create a transaction id. Puzzle together an IP/UDP/DHCP Discover message, compute checksums and send it out as a raw packet. Create an additional function that constructs default options common to all DHCP messages. Set the DHCP Client ID option as noticed by Grant Erickson in ConnMan commit b18d9798b3a0ae46ed87d6d2be8d5a474bf3ab1e: "Some Internet gateways and Wi-Fi access points are unhappy when the DHCPv4 client-id option (61) is missing and will refuse to issue a DHCP lease."
* dhcp: Add DHCP client initializationPatrik Flykt2013-12-12
| | | | | | Provide functionality for initializing a DHCP client struct, setting interface index, last used address and additional options to request. On initialization the most useful options are added by default.
* bus: instead of exposing the dbus1 flags when acquiring a name use our own ↵Lennart Poettering2013-12-12
| | | | | | | that are closer to kdbus This turns around DO_NOT_QUEUE into QUEUE which implies a more useful default. (And negative options are awful anyway.)
* journal: add ability to browse journals of running OS containersLennart Poettering2013-12-11
| | | | | | | This adds the new library call sd_journal_open_container() and a new "-M" switch to journalctl. Particular care is taken that journalctl's "-b" switch resolves to the current boot ID of the container, not the host.
* event: hook up sd-event with the service watchdog logicLennart Poettering2013-12-11
| | | | | | | | | | | | | Adds a new call sd_event_set_watchdog() that can be used to hook up the event loop with the watchdog supervision logic of systemd. If enabled and $WATCHDOG_USEC is set the event loop will ping the invoking systemd daemon right after coming back from epoll_wait() but not more often than $WATCHDOG_USEC/4. The epoll_wait() will sleep no longer than $WATCHDOG_USEC/4*3, to make sure the service manager is called in time. This means that setting WatchdogSec= in a .service file and calling sd_event_set_watchdog() in your daemon is enough to hook it up with the watchdog logic.
* bus: introduce new SD_BUS_VTABLE_HIDDEN flag for vtable membersLennart Poettering2013-12-10
| | | | | | When this flag is set then its member will not be shown in the introspection data. Also, properties with this flag set will not be included in GetAll() responses.
* bus: introduce "trusted" bus concept and encode access control in object vtablesLennart Poettering2013-12-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces a new concept of "trusted" vs. "untrusted" busses. For the latter libsystemd-bus will automatically do per-method access control, for the former all access is automatically granted. Per-method access control is encoded in the vtables: by default all methods are only accessible to privileged clients. If the SD_BUS_VTABLE_UNPRIVILEGED flag is set for a method it is accessible to unprivileged clients too. By default whether a client is privileged is determined via checking for its CAP_SYS_ADMIN capability, but this can be altered via the SD_BUS_VTABLE_CAPABILITY() macro that can be ORed into the flags field of the method. Writable properties are also subject to SD_BUS_VTABLE_UNPRIVILEGED and SD_BUS_VTABLE_CAPABILITY() for controlling write access to them. Note however that read access is unrestricted, as PropertiesChanged messages might send out the values anyway as an unrestricted broadcast. By default the system bus is set to "untrusted" and the user bus is "trusted" since per-method access control on the latter is unnecessary. On dbus1 busses we check the UID of the caller rather than the configured capability since the capability cannot be determined without race. On kdbus the capability is checked if possible from the attached meta-data of a message and otherwise queried from the sending peer. This also decorates the vtables of the various daemons we ship with these flags.
* rtnl: add link_get_flagsTom Gundersen2013-12-04
|
* rtnl: add callback supportTom Gundersen2013-12-04
| | | | | sd_rtnl_add_match allows you to add a callback function for when given types of messages are received.
* bus: rework sd_bus_list_names() to return two lists for acquired and ↵Lennart Poettering2013-12-03
| | | | activatable names
* bus: internalize a lot of protocol definitionsLennart Poettering2013-12-03
| | | | | | We shouldn export what isn't necessary or useful to clients, so let's add the protocol definitions we only need internally into a private header.
* bus: make sd_bus_request_name() and sd_bus_release_name() behave more like ↵Lennart Poettering2013-12-03
| | | | | | | | | | | | other calls Instead of returning an enum of return codes, make them return error codes like kdbus does internally. Also, document this behaviour so that clients can stick to it. (Also rework bus-control.c to always have to functions for dbus1 vs. kernel implementation of the various calls.)
* busctl: add command to dump creds of a peer or pidLennart Poettering2013-12-02
| | | | | | (also, rename _SD_BUS_CREDS_MAX to _SD_BUX_CRED_ALL, since "MAX" so far was used to indicate one higher than the highest valid value, and this is not correct here.)
* bus: support temporarily const errors that don't need to be freed but ↵Lennart Poettering2013-11-30
| | | | | | | | | require deep copies This should fix issues with incorrectly copying bus error messages out of sd_bus_message objects. Original bug found by: Djalal Harouni
* bus: include unique and well known names in credentials objectLennart Poettering2013-11-30
|
* bus: merge sd_bus_get_owner() and sd_bus_get_owner_creds() into one callLennart Poettering2013-11-28
| | | | | Since the backing ioctl for this on kdbus is the same we retain atomicity this way.
* bus: add new sd_bus_creds object to encapsulate process credentialsLennart Poettering2013-11-28
| | | | | | | | | | | | | This way we can unify handling of credentials that are attached to messages, or can be queried for bus name owners or connection peers. This also adds the ability to extend incomplete credential information with data from /proc, Also, provide a convenience call that will automatically determine the most appropriate credential object for an incoming message, by using the the attached information if possible, the sending name information if available and otherwise the peer's credentials.
* rtnl: add preliminary support for containersTom Gundersen2013-11-26
| | | | | For now, we only support one container type IFLA_LINKINFO, and we still lack support for parsing the containers again.
* event: rename sd_event_get() to sd_event_source_get_event()Lennart Poettering2013-11-22
|
* bus: add calls to query attached objectsLennart Poettering2013-11-22
|
* bus: also add error parameter to object find and enumerator callbacksLennart Poettering2013-11-22
| | | | | Just in order to bring things inline with the method and property callbacks.
* bus: rework message handlers to always take an error argumentLennart Poettering2013-11-21
| | | | | | | | | | | | | | | | | | | | Message handler callbacks can be simplified drastically if the dispatcher automatically replies to method calls if errors are returned. Thus: add an sd_bus_error argument to all message handlers. When we dispatch a message handler and it returns negative or a set sd_bus_error we send this as message error back to the client. This means errors returned by handlers by default are given back to clients instead of rippling all the way up to the event loop, which is desirable to make things robust. As a side-effect we can now easily turn the SELinux checks into normal function calls, since the method call dispatcher will generate the right error replies automatically now. Also, make sure we always pass the error structure to all property and method handlers as last argument to follow the usual style of passing variables for return values as last argument.
* bus: rename SD_BUS_ERROR_MAKE to SD_BUS_ERROR_MAKE_CONST to indicate it only ↵Lennart Poettering2013-11-21
| | | | works for const strings
* bus: let's simplify things by getting rid of unnecessary bus parametersLennart Poettering2013-11-21
|
* bus: add API calls to escape string components of objects pathsLennart Poettering2013-11-21
|
* core: convert PID 1 to libsystemd-busLennart Poettering2013-11-20
| | | | | | | | | | | | | | | | | | | | | | This patch converts PID 1 to libsystemd-bus and thus drops the dependency on libdbus. The only remaining code using libdbus is a test case that validates our bus marshalling against libdbus' marshalling, and this dependency can be turned off. This patch also adds a couple of things to libsystem-bus, that are necessary to make the port work: - Synthesizing of "Disconnected" messages when bus connections are severed. - Support for attaching multiple vtables for the same interface on the same path. This patch also fixes the SetDefaultTarget() and GetDefaultTarget() bus calls which used an inappropriate signature. As a side effect we will now generate PropertiesChanged messages which carry property contents, rather than just invalidation information.
* bus: add sd_bus_send_to() API callLennart Poettering2013-11-20
|
* include: make direct includion of _sd-common.h harderLennart Poettering2013-11-20
|
* bus: TIMESTAMP is optional kdbus metadata now, NAMES are always addedKay Sievers2013-11-18
|
* bus: CREDS and NAMES are optional kdbus metadata nowKay Sievers2013-11-17
|
* rtnl: add event loop integrationTom Gundersen2013-11-14
|
* rtnl: add call_async and call_async_cancelTom Gundersen2013-11-14
| | | | They work in the same way as the sd-bus equivalents.
* rtnl: start adding support for asynchronous messagingTom Gundersen2013-11-13
| | | | | | | | | | Similarly to sd-bus, add: sd_rtnl_wait sd_rtnl_process sd_rtnl_send and adapt sd_rtnl_call accordingly.
* rtnl: rename rtnl_bus_send_with_reply_and_block() to rtnl_bus_call()Tom Gundersen2013-11-13
| | | | Follow the equivalent rename in sd-bus to stay as similar as possible.
* bus: add api to control auto start message flagLennart Poettering2013-11-12
|
* id128: introduce SD_ID128_STRING_MAX consant for sizing id128 stringsLennart Poettering2013-11-12
|
* bus: export utf8 validator calls as pure functionsLennart Poettering2013-11-12
|
* bus: introduce concept of a default bus for each thread and make use of it ↵Lennart Poettering2013-11-12
| | | | | | | | everywhere We want to emphasize bus connections as per-thread communication primitives, hence introduce a concept of a per-thread default bus, and make use of it everywhere.
* bus: introduce concept of a "default" event loop per-thread and make use of ↵Lennart Poettering2013-11-12
| | | | | | | | | it everywhere Try to emphasize a bit that there should be a mapping between event loops and threads, hence introduce a logic that there's one "default" event loop for each thread, that can be queried via "sd_event_default()".
* bus: rename sd_bus_send_with_reply_and_block() to sd_bus_call()Lennart Poettering2013-11-12
| | | | | | The call is one of the most important ones we expose, where we place major emphasis on. We should make sure to give it a short, memorable name.