nm: uses alias for 'ethernet', 'wifi' and 'wifi-security'
NetworkManager writes the alias for 'ethernet' (802-3-ethernet), 'wifi' (802-11-wireless) and 'wifi-security' (802-11-wireless-security) settings by default since a long time, we should do so as well. Especially we should not mix and match.
Implement netplan_generate and netplan_delete_connection APIs (#182)
This is 2nd in a series of pull request implementing the functionality in libnetplan to provide a NetworkManager YAML backend. It builds upon #181
* It improves the netplan set CLI a bit, to delete a file, if only network: {version: 2} is left.
* It implements a netplan_generate function, which will call netplan generate in the background by spawning another process.
* At some point the generate binary should be refactored, to call functions of libnetplan instead, so we could use this same (refactored) functionality inside the library directly
* But for now this is as good as it gets...
* It implements a netplan_delete_connection function, which will delete a connection from the YAML structure of a file (or potentially the whole file, if it is empty afterwards), by utilizing the netplan set network.TYPE.IFNAME=NULL functionality by spawning another process.
* At some point we should get rid of this Python/C split of the YAML parsers, to have all the functionality available inside the C library.
* But for now this is as good as it gets, without duplicating any logic...
Prepare for NetworkManager YAML backend functionality (#181)
This is the first in a series of pull request to be prepared for setting up the functionality for a NetworkManager YAML/netplan backend, to be merged into slyon/networkmanager-yaml-backend before it will collectively be merged into master.
This PR refactors some of the YAML processing logic into libnetplan (from the generate binary), keeps track of the filename (absolute path) of the YAML file for each NetplanNetDefinition and implements a first additional library function netplan_get_id_from_nm_filename, which will output the NetplanNetDefinition ID given a path to a netplan generated .nmconnection keyfile in /run/NetworkManager/system-connections/.
The netplan ID is not stored inside NM's data structures, therefore we need a way to gain netplan's identifier for any given connection profile.
Commits:
* parse:generate: refactor process_yaml_hierarchy
* parse: track filename of netdefs
* parse: add netplan_get_id_from_filename library function
* parse: fix typo
* generate: some stylistic cleanup
* util: move netplan_get_id_from_nm_filename from parse.c
parse: fix 'networkmanager:' backend options for modem connections (#179)
The COMMON_BACKEND_HANDLERS have been forgotten for modem connections apparently. Add them to allow the definition of the special networkmanager: mapping, used for NetworkManager integration. We do not (yet) use that information (like uuid) in the current implementation. But reading YAML via NetworkManager will be broken if the networkmanager: mapping is not accepted.