Commit Graph

89 Commits

Author SHA1 Message Date
Dan Winship
a52ebc74b5 libnm-glib: add nm_remote_settings_load_connections()
https://bugzilla.gnome.org/show_bug.cgi?id=709830
2013-11-15 13:38:48 -05:00
Dan Winship
47cc8b25f2 libnm-glib: add NMDevice:physical-port-id property
Add the physical-port-id property to NMDevice so that clients can
recognize NPAR/SR-IOV devices.
2013-11-06 10:26:16 -05:00
Dan Winship
f668423832 libnm-glib: Add NMClient:primary-connection and :activating-connection
https://bugzilla.gnome.org/show_bug.cgi?id=704841
2013-08-28 11:01:43 -04:00
Dan Winship
84919405e1 libnm-glib: support new connectivity property/methods 2013-08-28 10:54:09 -04:00
Giovanni Campagna
36963d6381 libnm-glib: add missing symbol
The symbol is part of the public API (included in the GIR file),
and gjs complains loudly if a defined symbol is not found.

https://bugzilla.gnome.org/show_bug.cgi?id=706259

Acked-by: Pavel Šimerda <psimerda@redhat.com>
2013-08-19 12:18:34 +02:00
Dan Winship
4d8063cd78 libnm-glib: add NMClient:startup, nm_client_get_startup()
Expose the new NMManager:startup property on NMClient.
2013-08-16 17:27:34 -04:00
Jiri Pirko
c4eade715f libnm-glib: add support for team device
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
2013-08-15 10:54:15 -05:00
Dan Williams
e7dbe20526 libnm-glib: add support for agent capabilities during registration
Tries the new RegisterWithCapabilities method first, and falls back
to the old Register method for compatibility with older NetworkManager.
2013-07-31 08:16:40 -05:00
Dan Winship
1f81851017 core: add monitor-connection-files=false and ReloadConnections
Add a "monitor-connection-files" config option, which can be set to
"false" to disable automatic reloading of connections on file change.

To go with this, add a new ReloadConnections method on
o.fd.NM.Settings that can be used to manually reload connections, and
add an nm-cli command to call it.
2013-06-14 12:57:47 -03:00
Dan Williams
c41bd34570 libnm-glib: add support for new connection unsaved functionality 2013-05-28 12:26:56 -05:00
Dan Winship
ae9a389f83 libnm-glib, cli: add nm_device_get_type_description
Add a new libnm-glib method to get the type description for a device,
and use it in nmcli. For most types, the type description is based on
the class name, but for NMDeviceGeneric, it comes from the
:type-description property.
2013-05-07 12:46:56 -04:00
Dan Winship
ce4f2a4bd6 core, libnm-glib: add NMDeviceGeneric
Add NMDeviceGeneric, to provide generic support for unknown device
types, and create NMDeviceGenerics for those devices that NM
previously was ignoring. Allow NMSettingGeneric connections to be
activated on (managed) NMDeviceGenerics.
2013-05-07 12:46:56 -04:00
Dan Williams
110a40358d libnm-glib: never call NM D-Bus methods if NM isn't running
Though the client shouldn't be calling anything when NM isn't running
(because clients have nm_client_get_manager_running()), make sure
that NMClient never calls a NetworkManager method when NM isn't
on the bus.

Next, ensure NMObject doesn't try to refresh properties when NM isn't
running.  Creating an NMClient may trigger a property refresh request,
but if NM isn't running, defer that until NM starts, to ensure that
we don't D-Bus autostart NM.

Third, ensure NMRemoteSettings doesn't attempt to list connections
unless NM is running.

This prevents service activation of NetworkManager in lieu of dbus-glib
learning about DBUS_HEADER_FLAG_NO_AUTO_START.
2013-04-08 11:30:32 -05:00
Dan Winship
dbbec9b7d7 libnm-glib: match interface name in nm_device_connection_compatible()
Do NMSettingConnection:interface-name matching on the client side as
well, so that, eg, nm-applet does not list connections under the wrong
device.

(Also, move some return-if-fail checks from the subclass method
implementations into the wrapper function.)

https://bugzilla.gnome.org/show_bug.cgi?id=693684
2013-03-13 16:45:19 -04:00
Dan Winship
43f259ee1f libnm-glib: add NMDevice:available-connections
NMDevice has a D-Bus "AvailableConnections" property, but we weren't
exposing it on NMDevice. Fix that.

https://bugzilla.gnome.org/show_bug.cgi?id=693669
2013-02-14 09:31:33 -05:00
Jiří Klimeš
0309bdc2e0 libnm-glib: add nm_client_set_logging() for setting debugging level and domains 2013-01-09 16:47:49 +01:00
Jiří Klimeš
4ce355022c libnm-glib: add nm_client_get_logging() function
to get current logging level and domains.
2013-01-09 16:47:49 +01:00
Jiří Klimeš
e837098b00 libnm-glib: add nm_device_wifi_request_scan_simple() to tell NM to scan for APs
by calling RequestScan() D-Bus call on the Wi-Fi device (without any options).
2013-01-09 16:41:40 +01:00
Jiří Klimeš
1a7f9e661a core,libnm-glib: expose "slaves" property on NMDeviceBridge 2012-11-30 13:21:51 -06:00
Thomas Graf
cfff5a63d9 bridge: add bridge device type
This adds a new device type 'bridge'. Kernel devices are created
on demand.
2012-11-30 13:21:51 -06:00
Dan Winship
ad74379c2c core, libnm-glib: expose "slaves" property on NMDeviceBond
https://bugzilla.gnome.org/show_bug.cgi?id=686367
2012-10-19 12:09:27 -04:00
Jiří Klimeš
434a4f39b5 libnm-glib: add 'driver-version' and 'firmware-version' properties to NMDevice 2012-06-08 08:55:22 +02:00
Jiří Klimeš
e0329b44c4 libnm-glib: add 'autoconnect' property for devices 2012-05-22 18:30:53 +02:00
Pantelis Koukousoulas
8039dd30d8 adsl: add libnm-glib and nmcli code
For the finale, this is the libnm-glib and nmcli part of the support,
with this you can now make a full pppoatm connection from NetworkManager
by configuring it in system scope in a keyfile.

As an example, here is mine:
(password and username snipped for obvious reasons)

[connection]
id=MYISP
uuid=34d04e69-fdd9-4231-af2c-25ed1f34dc1e
type=adsl
timestamp=1304621332

[adsl]
username=user@myisp.com
password=mypassword
vpi=8
vci=35
encapsulation=vcmux
protocol=pppoa

[ipv6]
method=ignore

[ipv4]
method=auto

Extract from logs:
NetworkManager[29155]: <info> Activation (ueagle-atm0) starting connection 'MYISP'
NetworkManager[29155]: <info> (ueagle-atm0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) started...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) starting...
NetworkManager[29155]: <info> (ueagle-atm0): device state change: prepare -> config (reason 'none') [40 50 0]
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) successful.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) scheduled.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) started...
NetworkManager[29155]: <info> (ueagle-atm0): device state change: config -> ip-config (reason 'none') [50 70 0]
NetworkManager[29155]: <info> starting PPP connection
NetworkManager[29155]: <debug> [1304671146.590156] [nm-ppp-manager.c:1047] nm_ppp_manager_start(): command line: /usr/sbin/pppd nodetach lock nodefaultroute user user@myisp.com plugin pppoatm.so 8.35 noipdefault noauth usepeerdns lcp-echo-failure 0 lcp-echo-interval 0 ipparam /org/freedesktop/NetworkManager/PPP/0 plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so
NetworkManager[29155]: <info> pppd started with pid 29175
NetworkManager[29155]: <debug> [1304671146.591235] [NetworkManagerUtils.c:816] nm_utils_get_proc_sys_net_value(): (ueagle-atm0): error reading /proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra: (4) Failed to open file '/proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra': No such file or directory
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) complete.
Plugin pppoatm.so loaded.
Plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so loaded.
** Message: nm-ppp-plugin: (plugin_init): initializing
** Message: nm-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
NetworkManager[29155]: <debug> [1304671146.612937] [nm-udev-manager.c:621] handle_uevent(): UDEV event: action 'add' subsys 'net' device 'ppp0'
NetworkManager[29155]: <debug> [1304671146.613134] [nm-udev-manager.c:525] net_add(): ignoring interface with type 512
NetworkManager[29155]: <debug> [1304671146.617308] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x1090
Using interface ppp0
Connect: ppp0 <--> 8.35
** Message: nm-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
** Message: nm-ppp-plugin: (nm_phasechange): status 6 / phase 'authenticate'
** Message: nm-ppp-plugin: (get_credentials): passwd-hook, requesting credentials...
NetworkManager[29155]: <debug> [1304671149.639511] [nm-agent-manager.c:1044] nm_agent_manager_get_secrets(): Secrets requested for connection /org/freedesktop/NetworkManager/Settings/0 (adsl)
NetworkManager[29155]: <debug> [1304671149.639684] [nm-settings-connection.c:717] nm_settings_connection_get_secrets(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets requested flags 0x1 hint 'password'
NetworkManager[29155]: <debug> [1304671149.640950] [nm-agent-manager.c:959] get_start(): (0x9b4ad10/adsl) system settings secrets sufficient
NetworkManager[29155]: <debug> [1304671149.641332] [nm-settings-connection.c:573] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) existing secrets returned
NetworkManager[29155]: <debug> [1304671149.641541] [nm-settings-connection.c:579] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets request completed
NetworkManager[29155]: <debug> [1304671149.643074] [nm-settings-connection.c:618] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) new agent secrets processed
** Message: nm-ppp-plugin: (get_credentials): got credentials from NetworkManager
PAP authentication succeeded
** Message: nm-ppp-plugin: (nm_phasechange): status 8 / phase 'network'
local  IP address 94.70.90.201
remote IP address 80.106.108.12
primary   DNS address 195.170.0.1
secondary DNS address 195.170.2.2
** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
NetworkManager[29155]: <debug> [1304671150.607440] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x110D1
NetworkManager[29155]: <info> PPP manager(IP Config Get) reply received.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) started...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) scheduled...
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) complete.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) started...
NetworkManager[29155]: <debug> [1304671150.608918] [nm-system.c:222] sync_addresses(): (ppp0): syncing addresses (family 2)
NetworkManager[29155]: <info> (ueagle-atm0): device state change: ip-config -> activated (reason 'none') [70 100 0]
NetworkManager[29155]: <info> Policy set 'MYISP' (ppp0) as default for IPv4 routing and DNS.
NetworkManager[29155]: <info> Activation (ueagle-atm0) successful, device activated.
NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) complete.

Signed-off-by: Pantelis Koukousoulas <pktoss@gmail.com>
2012-05-18 15:42:56 -05:00
Dan Williams
51f37ca8d5 trivial: fix distcheck in libnm-glib 2012-04-30 16:19:46 -05:00
Jiří Klimeš
7c7e8dc692 libnm-glib: add "object-creation-failed" signal to NMObject
The signal is private for libnm-glib and should not be used externally.
It is emitted when there's an error while creating an object.
In addition, this commit makes use of the signal in NMClient to ensure
that the callbacks are always called for nm_client_activate_connection()
and nm_client_add_and_activate_connection().
2012-04-25 16:39:17 +02:00
Dan Williams
1da9738f1b libnm-glib: add 'registered' property for NMSecretAgent
So clients can track when the agent is actually registered and when
it's registration state changes.
2012-03-19 13:24:28 -05:00
Jiří Klimeš
a11067f584 libnm-glib: add errors to device classes and nm_device_connection_compatible()
Add nm_device_connection_compatible() that returns an error when it fails.
nm_device_connection_valid() does the same work except it doesn't set GError.
2012-03-16 09:54:36 +01:00
Dan Williams
c02702e574 libnm-glib: add NMDeviceVlan
And fix a small bug with bond devices too if their device type
isnt' set at construction time.
2012-03-07 11:45:25 -06:00
Dan Winship
6c38f0cfd1 libnm-glib: add NMDeviceBond
it exists on the server/D-Bus side, so it should exist in libnm-glib too
2012-03-05 15:55:43 -05:00
Jiří Klimeš
ff249e871f libnm-glib: add NMDeviceOlpcMesh 2012-02-28 10:29:03 +01:00
Dan Williams
7b48862ef6 build: fix distcheck 2012-02-15 19:38:18 -06:00
Dan Winship
839eab5564 Use glib-mkenums to generate enum types
Rather than generating enum classes by hand (and complaining in each
file that "this should really be standard"), use glib-mkenums.

Unfortunately, we need a very new version of glib-mkenums in order to
deal with NM's naming conventions and to fix a few other bugs, so just
import that into the source tree temporarily.

Also, to simplify the use of glib-mkenums, import Makefile.glib from
https://bugzilla.gnome.org/654395.

To avoid having to run glib-mkenums for every subdirectory of src/,
add a new "generated" directory, and put the generated enums files
there.

Finally, use Makefile.glib for marshallers too, and generate separate
ones for libnm-glib and NetworkManager.
2012-02-15 11:42:15 -05:00
Jiří Klimeš
39d25c2abb libnm-glib: add nm_device_get_state_reason() to libnm-glib.ver to export it
It was forgotten in the previous commit
2012-02-09 15:34:19 +01:00
Dan Winship
c619365ee3 libnm-glib: asyncify NMRemoteSettings
Add nm_remote_settings_new_async/_finish, and misc other fixes
2012-02-03 10:33:44 -06:00
Dan Winship
7844ead116 libnm-glib: nm_client_new_async, fix up NMClient asynchrony issues 2012-02-03 10:33:43 -06:00
Thomas Graf
1ba50e2f1b bonding: export path of master device property over DBUS
Adds a new "master" property to NMActiveConnection containing the path
of the master NMDevice if the connection has a master.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-25 11:12:43 -06:00
Dan Winship
e9cd59b654 libnm-glib: add NMDeviceInfiniband 2011-12-02 13:09:16 -06:00
Dan Williams
538cef0805 libnm-glib: fix make distcheck 2011-06-20 11:40:04 -05:00
Jiří Klimeš
8d43875cbe libnm-glib: add nm_client_get_device_by_iface() for NMClient 2011-06-15 14:58:04 +02:00
Dan Williams
0e7b71102b libnm-glib: add support for the "active-connection" device property 2011-05-26 19:39:12 -05:00
Dan Williams
1e5cff5fa2 libnm-glib: export nm_device_get_ip_iface()
This got forgotten somehow.
2011-05-05 12:59:45 -05:00
Dan Williams
b0f831ab0a Revert "libnm-glib: export nm_device_get_iface()"
This reverts commit 3116e3c980.

Commit message is wrong.
2011-05-05 12:58:45 -05:00
Dan Williams
3116e3c980 libnm-glib: export nm_device_get_iface()
This got forgotten somehow.
2011-05-05 12:38:29 -05:00
Dan Williams
779215c742 libnm-glib: add *_connection_valid() utility functions
Like the *_filter_connections() functions, but for just one connection,
and now the *_filter_connections() functions call these new ones so
it's really just moving code around and not anything new.

These new functions more closely match the usage I've seen from
gnome-shell's network.js and elsewhere.
2011-04-25 17:07:38 -05:00
Dan Williams
4cae0bb0fa settings: add a GetConnectionByUuid method
If the client knows the UUID, add a convenience function to get
the connection path directly, instead of having to iterate the
whole connection list and get each connection's details and then
check the UUID.
2011-04-22 12:29:07 -05:00
Dan Williams
bb8e9a0b18 api: add "Uuid" property to ActiveConnection interface
A convenience so that clients which might key certain operations off
which connections are active (checking work mail only when on VPN for
example) can more easily get which connections are active.  This would
allow those apps to store the UUID (which they would already be doing)
and not have to create a Connection proxy and then get the connection
properties just to retrieve the UUID of the connection.  Instead they
can now get it from GetAll of the ActiveConnection object, which they
would already be doing.
2011-04-22 12:29:07 -05:00
Dan Williams
435db3cb3d libnm-glib: test symbol exports against .ver file 2011-03-21 12:25:28 -05:00
Dan Williams
16948ce927 libnm-glib: add nm_wimax_nsp_filter_connections() 2011-03-11 10:09:19 -06:00
Dan Williams
f30e15a04d libnm-glib: add nm_access_point_filter_connections() 2011-03-11 09:36:41 -06:00