paradrop.lib.config package¶
Submodules¶
paradrop.lib.config.configservice module¶
- configservice module:
- This module is responsible for “poking” the proper host OS services to change the host OS config. This would include things like changing the networking, DHCP server settings, wifi, etc..
paradrop.lib.config.devices module¶
Detect physical devices that can be used by chutes.
This module detects physical devices (for now just network interfaces) that can be used by chutes. This includes WAN interfaces for Internet connectivity and WiFi interfaces which can host APs.
It also makes sure certain entries exist in the system UCI files for these devices, for example “wifi-device” sections. These are shared between chutes, so they only need to be added when missing.
-
getSystemDevices
(update)[source]¶ Detect devices on the system.
Store device information in cache key “networkDevices”.
paradrop.lib.config.dhcp module¶
paradrop.lib.config.firewall module¶
-
findMatchingInterface
(iface_name, interfaces)[source]¶ Search an interface list for one matching a given name.
iface_name can contain shell-style wildcards (* and ?).
-
getDeveloperFirewallRules
(update)[source]¶ Generate other firewall rules requested by the developer such as redirects. The object returned is a list of tuples (config, options).
paradrop.lib.config.network module¶
-
getNetworkConfig
(update)[source]¶ For the Chute provided, return the dict object of a 100% filled out configuration set of network configuration. This would include determining what the IP addresses, interfaces names, etc...
-
getOSNetworkConfig
(update)[source]¶ Takes the network interface obj created by NetworkManager.getNetworkConfiguration and returns a properly formatted object to be passed to the OpenWrtConfig class. The object returned is a list of tuples (config, options).
-
reclaimNetworkResources
(chute)[source]¶ Reclaim network resources for a previously running chute.
This function only applies to the special case in which pd starts up and loads a list of chutes that were running. This function marks their IP addresses and interface names as taken so that new chutes will not use the same values.
paradrop.lib.config.osconfig module¶
- osconfig module:
- This module is in charge of changing configuration files for pdfcd on the host OS. This relates to things like network, dhcp, wifi, firewall changes. Pdfcd should be able to make simple abstracted calls into this module so that if we need to change what type of OS config we need to support only this module would change.
paradrop.lib.config.pool module¶
paradrop.lib.config.uciutils module¶
-
appendListItem
(options, name, value)[source]¶ Add a list item to UCI options.
The way we store lists for UCI options is rather bizarre, so this function takes care of that.
options: dictionary of options for a UCI section name: string name of the list option value: string value to append
-
removeConfigs
(chute, cacheKeys, filepath)[source]¶ used to modify config file of each various setting in /etc/config/
-
restoreConfigFile
(chute, configname)[source]¶ Restore a system config file from backup.
This can only be used during a chute update operation to revert changes that were made during that update operation.
configname: name of configuration file (“network”, “wireless”, etc.)