Client
Object Hierarchy:
Description:
[ CCode ( type_id = "nm_client_get_type ()" ) ]
public sealed class Client : Object, AsyncInitable, Initable
public sealed class Client : Object, AsyncInitable, Initable
NMClient contains a cache of the objects of NetworkManager's D-Bus API.
It uses MainContext and DBusConnection for that and registers to D-Bus signals. That means, when iterating the associated MainContext, D-Bus signals gets processed and the Client instance updates and emits Object signals.
Namespace: NM
Package: libnm
Content:
Constants:
- public const string ACTIVATING_CONNECTION
- public const string ACTIVE_CONNECTIONS
- public const string ACTIVE_CONNECTION_ADDED
- public const string ACTIVE_CONNECTION_REMOVED
- public const string ALL_DEVICES
- public const string ANY_DEVICE_ADDED
- public const string ANY_DEVICE_REMOVED
- public const string CAN_MODIFY
- public const string CAPABILITIES
- public const string CHECKPOINTS
- public const string CONNECTIONS
- public const string CONNECTION_ADDED
- public const string CONNECTION_REMOVED
- public const string CONNECTIVITY
- public const string CONNECTIVITY_CHECK_AVAILABLE
- public const string CONNECTIVITY_CHECK_ENABLED
- public const string CONNECTIVITY_CHECK_URI
- public const string DBUS_CONNECTION
- public const string DBUS_NAME_OWNER
- public const string DEVICES
- public const string DEVICE_ADDED
- public const string DEVICE_REMOVED
- public const string DNS_CONFIGURATION
- public const string DNS_MODE
- public const string DNS_RC_MANAGER
- public const string HOSTNAME
- public const string INSTANCE_FLAGS
- public const string METERED
- public const string NETWORKING_ENABLED
- public const string NM_RUNNING
- public const string PERMISSIONS_STATE
- public const string PERMISSION_CHANGED
- public const string PRIMARY_CONNECTION
- public const string RADIO_FLAGS
- public const string STARTUP
- public const string STATE
- public const string VERSION
- public const string VERSION_INFO
- public const string WIMAX_ENABLED
- public const string WIMAX_HARDWARE_ENABLED
- public const string WIRELESS_ENABLED
- public const string WIRELESS_HARDWARE_ENABLED
- public const string WWAN_ENABLED
- public const string WWAN_HARDWARE_ENABLED
Properties:
- public ActiveConnection activating_connection { get; }
The ActiveConnection of the activating connection that is likely to become the new primary_connection.
- public GenericArray<ActiveConnection> active_connections { get; }
The active connections.
- public GenericArray<Device> all_devices { get; }
List of both real devices and device placeholders.
- public bool can_modify { get; }
If true, adding and modifying connections is supported.
- public Array<uint32> capabilities { get; }
The list of capabilities numbers as guint32 or null if there are no capabilities.
- public GenericArray<Checkpoint> checkpoints { get; }
The list of active checkpoints.
- public GenericArray<RemoteConnection> connections { get; }
The list of configured connections that are available to the user.
- public ConnectivityState connectivity { get; }
The network connectivity state.
- public bool connectivity_check_available { get; }
- public bool connectivity_check_enabled { get; set; }
- public string connectivity_check_uri { owned get; }
The used URI for connectivity checking.
- public DBusConnection dbus_connection { get; construct; }
The DBusConnection to use.
- public string dbus_name_owner { get; }
The name owner of the NetworkManager D-Bus service.
- public GenericArray<Device> devices { get; }
List of real network devices.
- public GenericArray<DnsEntry> dns_configuration { get; }
The current DNS configuration, represented as an array of DnsEntry objects.
- public string dns_mode { get; }
The current DNS processing mode.
- public string dns_rc_manager { get; }
The current resolv.
- public string hostname { owned get; }
The machine hostname stored in persistent configuration.
- public uint instance_flags { get; set construct; }
ClientInstanceFlags for the instance.
- public uint metered { get; }
Whether the connectivity is metered.
- public bool networking_enabled { get; set; }
Whether networking is enabled.
- public bool nm_running { get; }
Whether the daemon is running.
- public Ternary permissions_state { get; }
The state of the cached permissions.
- public ActiveConnection primary_connection { get; }
The ActiveConnection of the device with the default route; see get_primary_connection for more details.
- public uint radio_flags { get; }
Flags for radio interfaces.
- public bool startup { get; }
Whether the daemon is still starting up.
- public State state { get; }
The current daemon state.
- public string version { get; }
The NetworkManager version.
- public Array<uint32> version_info { get; }
Expose version info and capabilities of NetworkManager.
- public bool wimax_enabled { get; set; }
Whether WiMAX functionality is enabled.
- public bool wimax_hardware_enabled { get; }
Whether the WiMAX hardware is enabled.
- public bool wireless_enabled { get; set; }
Whether wireless is enabled.
- public bool wireless_hardware_enabled { get; }
Whether the wireless hardware is enabled.
- public bool wwan_enabled { get; set; }
Whether WWAN functionality is enabled.
- public bool wwan_hardware_enabled { get; }
Whether the WWAN hardware is enabled.
Creation methods:
- public Client (Cancellable? cancellable = null) throws Error
Creates a new Client synchronously.
- public async Client.async (Cancellable? cancellable) throws Error
Creates a new Client asynchronously.
Methods:
- public async ActiveConnection activate_connection_async (Connection? connection, Device? device, string? specific_object, Cancellable? cancellable) throws Error
Asynchronously starts a connection to a particular network using the configuration settings from
connection
and the network devicedevice
. - public async ActiveConnection add_and_activate_connection2 (Connection? @partial, Device? device, string? specific_object, Variant options, Cancellable? cancellable, out Variant? out_result) throws Error
Adds a new connection using the given details (if any) as a template, automatically filling in missing settings with the capabilities of the given device and specific object.
- public async ActiveConnection add_and_activate_connection_async (Connection? @partial, Device? device, string? specific_object, Cancellable? cancellable) throws Error
Adds a new connection using the given details (if any) as a template, automatically filling in missing settings with the capabilities of the given device and specific object.
- public async RemoteConnection add_connection2 (Variant settings, SettingsAddConnection2Flags flags, Variant? args, bool ignore_out_result, Cancellable? cancellable, out Variant? out_result) throws Error
Call
AddConnection2
D-Bus API asynchronously. - public async RemoteConnection add_connection_async (Connection connection, bool save_to_disk, Cancellable? cancellable) throws Error
Requests that the remote settings service add the given settings to a new connection.
- public ConnectivityState check_connectivity (Cancellable? cancellable = null) throws Error
Updates the network connectivity state and returns the (new) current state.
- public async ConnectivityState check_connectivity_async (Cancellable? cancellable) throws Error
Asynchronously updates the network connectivity state and invokes
callback
when complete. - public async bool checkpoint_adjust_rollback_timeout (string checkpoint_path, uint32 add_timeout, Cancellable? cancellable) throws Error
Resets the timeout for the checkpoint with path
checkpoint_path
totimeout_add
. - public async Checkpoint checkpoint_create (GenericArray<Device> devices, uint32 rollback_timeout, CheckpointCreateFlags flags, Cancellable? cancellable) throws Error
Creates a checkpoint of the current networking configuration for given interfaces.
- public async bool checkpoint_destroy (string checkpoint_path, Cancellable? cancellable) throws Error
Destroys an existing checkpoint without performing a rollback.
- public async HashTable<string,uint32> checkpoint_rollback (string checkpoint_path, Cancellable? cancellable) throws Error
Performs the rollback of a checkpoint before the timeout is reached.
- public bool connectivity_check_get_available ()
Determine whether connectivity checking is available.
- public bool connectivity_check_get_enabled ()
Determine whether connectivity checking is enabled.
- public unowned string connectivity_check_get_uri ()
Get the URI that will be queried to determine if there is internet connectivity.
- public void connectivity_check_set_enabled (bool enabled)
Enable or disable connectivity checking.
- public async Variant dbus_call (string object_path, string interface_name, string method_name, Variant? parameters, VariantType? reply_type, int timeout_msec, Cancellable? cancellable) throws Error
Call call on the current name owner with the specified arguments.
- public async bool dbus_set_property (string object_path, string interface_name, string property_name, Variant value, int timeout_msec, Cancellable? cancellable) throws Error
Like dbus_call but calls "Set" on the standard "org.
- public bool deactivate_connection (ActiveConnection active, Cancellable? cancellable = null) throws Error
Deactivates an active ActiveConnection.
- public async bool deactivate_connection_async (ActiveConnection active, Cancellable? cancellable) throws Error
Asynchronously deactivates an active ActiveConnection.
- public unowned ActiveConnection get_activating_connection ()
Gets the ActiveConnection corresponding to a currently-activating connection that is expected to become the new primary_connection upon successful activation.
- public unowned GenericArray<ActiveConnection> get_active_connections ()
Gets the active connections.
- public unowned GenericArray<Device> get_all_devices ()
Gets both real devices and device placeholders (eg, software devices which do not currently exist, but could be created automatically by NetworkManager if one of their NMDevice:
NMClient:ActivatableConnections
s was activated). - public unowned uint32[] get_capabilities ()
- public unowned GenericArray<Checkpoint> get_checkpoints ()
Gets all the active checkpoints.
- public unowned RemoteConnection get_connection_by_id (string id)
Returns the first matching nmremoteconnection matching a given
id
. - public unowned RemoteConnection get_connection_by_path (string path)
Returns the nmremoteconnection representing the connection at
path
. - public unowned RemoteConnection get_connection_by_uuid (string uuid)
Returns the nmremoteconnection identified by
uuid
. - public unowned GenericArray<RemoteConnection> get_connections ()
- public ConnectivityState get_connectivity ()
Gets the current network connectivity state.
- public unowned Object get_context_busy_watcher ()
- public unowned DBusConnection get_dbus_connection ()
Gets the gdbusconnection of the instance.
- public unowned string get_dbus_name_owner ()
- public unowned Device get_device_by_iface (string iface)
Gets a Device from a Client.
- public unowned Device get_device_by_path (string object_path)
Gets a Device from a Client.
- public unowned GenericArray<Device> get_devices ()
Gets all the known network devices.
- public unowned GenericArray<DnsEntry> get_dns_configuration ()
Gets the current DNS configuration
- public unowned string get_dns_mode ()
Gets the current DNS processing mode.
- public unowned string get_dns_rc_manager ()
Gets the current DNS resolv.
- public ClientInstanceFlags get_instance_flags ()
- public bool get_logging (out string? level, out string? domains) throws Error
Gets NetworkManager current logging level and domains.
- public unowned MainContext get_main_context ()
The Client instance is permanently associated with the current thread default MainContext, referenced the time when the instance was created.
- public Metered get_metered ()
- public bool get_nm_running ()
Determines whether the daemon is running.
- public unowned Object get_object_by_path (string dbus_path)
- public ClientPermissionResult get_permission_result (ClientPermission permission)
Requests the result of a specific permission, which indicates whether the client can or cannot perform the action the permission represents
- public Ternary get_permissions_state ()
- public unowned ActiveConnection get_primary_connection ()
Gets the ActiveConnection corresponding to the primary active network device.
- public RadioFlags get_radio_flags ()
Get radio flags.
- public bool get_startup ()
Tests whether the daemon is still in the process of activating connections at startup.
- public State get_state ()
Gets the current daemon state.
- public unowned string get_version ()
Gets NetworkManager version.
- public unowned uint32[] get_version_info ()
If available, the first element in the array is NM_VERSION which encodes the daemon version as "(major << 16 | minor << 8 | micro)".
- public bool load_connections (string[] filenames, out string failures, Cancellable? cancellable = null) throws Error
Requests that the remote settings service load or reload the given files, adding or updating the connections described within.
- public async bool load_connections_async (string[] filenames, Cancellable? cancellable, out string[] failures) throws Error
Requests that the remote settings service asynchronously load or reload the given files, adding or updating the connections described within.
- public bool networking_get_enabled ()
Whether networking is enabled or disabled.
- public bool networking_set_enabled (bool enabled) throws Error
Enables or disables networking.
- public async bool reload (ManagerReloadFlags flags, Cancellable? cancellable) throws Error
Reload NetworkManager's configuration and perform certain updates, like flushing caches or rewriting external state to disk.
- public bool reload_connections (Cancellable? cancellable = null) throws Error
Requests that the remote settings service reload all connection files from disk, adding, updating, and removing connections until the in-memory state matches the on-disk state.
- public async bool reload_connections_async (Cancellable? cancellable) throws Error
Requests that the remote settings service begin reloading all connection files from disk, adding, updating, and removing connections until the in-memory state matches the on-disk state.
- public bool save_hostname (string? hostname, Cancellable? cancellable = null) throws Error
Requests that the machine's persistent hostname be set to the specified value or cleared.
- public async bool save_hostname_async (string? hostname, Cancellable? cancellable) throws Error
Requests that the machine's persistent hostname be set to the specified value or cleared.
- public bool set_logging (string? level, string? domains) throws Error
Sets NetworkManager logging level and/or domains.
- public async bool wait_shutdown (bool integrate_maincontext, Cancellable? cancellable) throws Error
The way to stop Client is by unrefing it.
- public bool wimax_get_enabled ()
Determines whether WiMAX is enabled.
- public bool wimax_hardware_get_enabled ()
Determines whether the WiMAX hardware is enabled.
- public void wimax_set_enabled (bool enabled)
Enables or disables WiMAX devices.
- public bool wireless_get_enabled ()
Determines whether the wireless is enabled.
- public bool wireless_hardware_get_enabled ()
Determines whether the wireless hardware is enabled.
- public void wireless_set_enabled (bool enabled)
Enables or disables wireless devices.
- public bool wwan_get_enabled ()
Determines whether WWAN is enabled.
- public bool wwan_hardware_get_enabled ()
Determines whether the WWAN hardware is enabled.
- public void wwan_set_enabled (bool enabled)
Enables or disables WWAN devices.
Signals:
- public signal void active_connection_added (ActiveConnection active_connection)
Notifies that a ActiveConnection has been added.
- public signal void active_connection_removed (ActiveConnection active_connection)
Notifies that a ActiveConnection has been removed.
- public signal void any_device_added (Device device)
Notifies that a Device is added.
- public signal void any_device_removed (Device device)
Notifies that a Device is removed.
- public signal void connection_added (RemoteConnection connection)
Notifies that a Connection has been added.
- public signal void connection_removed (RemoteConnection connection)
Notifies that a Connection has been removed.
- public signal void device_added (Device device)
Notifies that a Device is added.
- public signal void device_removed (Device device)
Notifies that a Device is removed.
- public signal void permission_changed (uint permission, uint result)
Notifies that a permission has changed
Inherited Members:
All known members inherited from class GLib.Object
All known members inherited from interface GLib.AsyncInitable
All known members inherited from interface GLib.Initable