Closed
Conversation
* This feature is far from being finished, but the code is an attempt to place the foundations for future work.
Pull Request Test Coverage Report for Build 4828497610
💛 - Coveralls |
Contributor
Author
|
Replaced by #272. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
According to our network support design document, we decided to implement our network D-Bus API. The idea is to use the same API from the web UI and the CLI.
Of course, we are not implementing a full solution for network handling but relying on existing stuff, like nmstate.
Implementation
This PR adds a new
networkmodule toagama-lib. It contains:agama-dbus-server(what aboutagama-service?) when it is ready (see Rust locale #533).The D-Bus API
We tried to keep the API as simple as possible. At this point, it publishes an object for each known network device, and another for the DNS settings.
Depending on the type of each device, it would expose a different set of interfaces:
org.opensuse.Agama.Network1.Devicefor all of them containing general information.org.opensuse.Agama.Network1.IPv4for devices that may have an IP configuration.org.opensuse.Agama.Network1.Wirelessfor wireless devices (not implemented yet).The D-Bus architecture
When it comes to the D-Bus service, we are unsure whether the approach is right. Currently, the
NetworkServiceholds the network configuration behind aMutex. Given that the entry point to modify the settings is thenmstate::NetworkStateitself, all D-Bus interfaces have access to that object through an Arc (and use the mutex to avoid any collision).To do