Commit Graph

18 Commits

Author SHA1 Message Date
Dan Winship
cb7e1893e7 libnm-util, libnm-glib: standardize copyright/license headers
- Remove list of authors from files that had them; these serve no
  purpose except to quickly get out of date (and were only used in
  libnm-util and not libnm-glib anyway).

- Just say "Copyright", not "(C) Copyright" or "Copyright (C)"

- Put copyright statement after the license, not before

- Remove "NetworkManager - Network link manager" from the few files
  that contained it, and "libnm_glib -- Access network status &
  information from glib applications" from the many files that
  contained it.

- Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline
  to files that were missing it.
2014-07-15 09:44:54 -04:00
Dan Winship
9c4d86ee80 libnm-util, libnm-glib: add versioned deprecation/availability macros
Add versioned NM_DEPRECATED_IN_* and NM_AVAILABLE_IN_* macros, and tag
new/deprecated functions accordingly. (All currently-deprecated
functions are assumed to have been deprecated in 0.9.10.)

Add NM_VERSION_MIN_REQUIRED and NM_VERSION_MAX_ALLOWED macros which
can be set to determine which versions will cause warnings.

With the current settings, external consumers of the
libnm-util/libnm-glib APIs will have MIN_REQUIRED and MAX_ALLOWED both
set to NM_VERSION_0_9_8 by default, meaning they will get warnings
about functions added in 0.9.10. NM internally sets
NM_VERSION_MAX_ALLOWED to NM_VERSION_NEXT_STABLE to ensure that it is
always allowed to use all APIs.
2014-02-13 11:24:37 -05:00
Thomas Haller
db9b7e10ac core: update existing IP[46]Config of device instead of replacing it (bgo #707617)
When the IP[46]Config changes, a new configuration gets assembled.
Before, whenever the new configuration was different than the current
one, the IP[46]Config of the device was completely replaced. This also
meant, that the old dbus IP[46]Config object was removed and the new one
was exported.

Now instead of recreating a new configuration, it updates the existing
(already exported) configuration in-place.

Also, add new gobject properties 'gateway' and 'searches' to the config class,
they will be exported over dbus.

Also, whenever any of the exported properties changes, make sure that a
notify signal gets emitted.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-25 23:12:37 +02:00
Jiří Klimeš
edb85e9720 core: fix NM_IS_*_CLASS(klass) macros
The argument is 'klass' not 'obj'.
2012-07-27 13:15:54 +02:00
Dan Williams
0ae870bf09 libnm-glib: remove deprecated nm_ip4_config_get_hostname() function
Deprecated since 0.7 days; it always returned NULL anyway.
2011-03-10 11:48:22 -06:00
Dan Williams
866d48bb9b libnm-glib: add class padding for future expansion 2009-09-30 09:21:32 -07:00
Przemysław Grzegorczyk
bac45aa0d5 clean up glib includes (bgo #564376)
Only <glib.h> and <gtk/gtk.h> need to be included.
2009-01-19 00:16:40 -05:00
Dan Williams
a10775c928 Merge branch wins-in-ip4-config 2009-01-04 19:15:03 -05:00
Dan Williams
80686bc181 [libnm-glib] Deprecate the NMIP4Config 'hostname' property
NM doesn't implement it, but we forgot about it for 0.7 and now we
have to live with it, so just deprecate it and make it return NULL.
2008-12-19 21:19:09 -05:00
Dan Williams
a020ed21da Re-add WINS support to the IPv4 config
Don't do anything with WINS servers (dispatcher scripts installed with
samba could certainly update samba's idea of WINS servers), but at least
provide them so that the VPNs that can get upstream WINS servers can
at least make other stuff aware of them.
2008-12-19 17:01:06 -05:00
Dan Williams
7118676968 2008-11-14 Dan Williams <dcbw@redhat.com>
Relicense libnm-glib to LGPLv2+ with agreement from contributors



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4285 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-11-14 17:41:16 +00:00
Dan Williams
bcae312905 2008-08-07 Dan Williams <dcbw@redhat.com>
* introspection/nm-ip4-config.xml
	  libnm-glib/libnm-glib-test.c
	  libnm-glib/nm-ip4-config.c
	  libnm-glib/nm-ip4-config.h
	  src/NetworkManagerSystem.h
	  src/backends/NetworkManagerArch.c
	  src/backends/NetworkManagerDebian.c
	  src/backends/NetworkManagerFrugalware.c
	  src/backends/NetworkManagerGeneric.c
	  src/backends/NetworkManagerGeneric.h
	  src/backends/NetworkManagerGentoo.c
	  src/backends/NetworkManagerMandriva.c
	  src/backends/NetworkManagerPaldo.c
	  src/backends/NetworkManagerRedHat.c
	  src/backends/NetworkManagerSlackware.c
	  src/backends/NetworkManagerSuSE.c
	  src/dhcp-manager/nm-dhcp-manager.c
	  src/nm-device.c
	  src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- Remove NIS logic; should be done from dispatcher scripts instead



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3909 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-07 19:22:23 +00:00
Dan Williams
2c31b5499b 2008-08-06 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-ip4-config.c
	  libnm-glib/nm-ip4-config.h
		- Add 'routes' property

	* libnm-util/nm-setting-vpn.c
	  libnm-util/nm-setting-vpn.h
		- Remove 'routes' property

	* libnm-util/nm-setting-ip4-config.c
	  libnm-util/nm-setting-ip4-config.h
		- 'ignore-dhcp-dns' renamed to 'ignore-auto-dns'
		- Add 'ignore-auto-routes' property
		- 'routes' exposed over D-Bus is now an array of array of uint (4) to 
			accomodate route metrics
		- 'routes' exposed in C is now a list of NMSettingIP4Route structures

	* libnm-util/nm-utils.c
	  libnm-util/nm-utils.h
		- Add helpers for marshalling IP4 routes

	* src/NetworkManagerUtils.c
		- (nm_utils_merge_ip4_config): handle property renames and new route
			structure

	* src/NetworkManagerSystem.c
		- (nm_system_device_set_ip4_route, nm_system_device_set_from_ip4_config,
		   nm_system_vpn_device_set_from_ip4_config): respect route metrics

	* src/dhcp-manager/nm-dhcp-manager.c
		- (nm_dhcp_manager_get_ip4_config): handle new route structure

	* system-settings/plugins/ifcfg-fedora/reader.c
	  system-settings/plugins/ifcfg-fedora/writer.c
		- Handle routes separately from addresses now that routes have a different
			format

	* introspection/nm-ip4-config.xml
	  src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- Rename internal routing functions
		- 'static-routes' renamed to 'routes'



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3898 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-08-06 22:23:48 +00:00
Dan Williams
51503b2d5f 2008-05-06 Dan Williams <dcbw@redhat.com>
* src/dhcp-manager/nm-dhcp-manager.c
		- (nm_dhcp_manager_get_ip4_config): clean up; update for changes to
			NMIP4Config to support multiple IP addresses

	* src/NetworkManagerUtils.c
		- (nm_utils_merge_ip4_config): update for multiple IP addresses

	* src/nm-ip4-config.c
	  src/nm-ip4-config.h
		- Store a list of IPv4 address/netmask/gateway tuples
		- (nm_ip4_config_get_gateway, nm_ip4_config_set_gateway,
		   nm_ip4_config_get_netmask, nm_ip4_config_set_netmask,
		   nm_ip4_config_get_broadcast, nm_ip4_config_set_broadcast,
		   nm_ip4_config_set_address): remove
		- (nm_ip4_config_take_address, nm_ip4_config_add_address,
		   nm_ip4_config_replace_address, nm_ip4_config_get_num_addresses):
			new functions; handle multiple IPv4 addresses

	* src/nm-device.c
	  src/ppp-manager/nm-ppp-manager.c
	  src/vpn-manager/nm-vpn-connection.c
	  src/NetworkManagerPolicy.c
	  test/nm-tool.c
	  libnm-glib/libnm-glib-test.c
		- update for changes to NMIP4Config for multiple IPv4 addresses

	* src/NetworkManagerSystem.c
		- (nm_system_device_set_ip4_route): don't add the route if any address
			is on the same subnet as the destination
		- (check_one_address): ignore the exact match, just match family and
			interface index
		- (add_ip4_addresses): add all IPv4 addresses in an NMIP4Config to
			an interface
		- (nm_system_device_set_from_ip4_config): use add_ip4_addresses()
		- (nm_system_vpn_device_set_from_ip4_config): use add_ip4_addresses()

	* introspection/nm-ip4-config.xml
		- Remove 'address', 'gateway', 'netmask', and 'broadcast' properties
		- Add 'addresses' property which is an array of (uuu) tuples of
			address/netmask/gateway

	* libnm-util/nm-setting-ip4-config.c
		- (set_property): use ip-address <-> GValue converters from nm-utils.c

	* libnm-glib/nm-ip4-config.c
	  libnm-glib/nm-ip4-config.h
		- Handle D-Bus interface changes to support multiple IP addresses



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3637 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-05-06 21:53:22 +00:00
Dan Williams
007351657f 2008-03-24 Dan Williams <dcbw@redhat.com>
Massive fixup of libnm-glib to:
	a) have all objects (with the exception of VPN) cache their properties and
		update them asynchronously on PropertiesChanged signals from NM
	b) return internal const data for most attributes/properties instead of
		allocated values that the caller must free
	c) cache wrapped objects such that a given D-Bus path will always map to the
		same GObject returned by libnm-glib
	d) remove a few signals and move them to GObject property notifications
	e) match recent NM D-Bus API changes for activation/deactivation
	f) remove some private functions from libnm-glib headers



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3491 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2008-03-24 15:17:30 +00:00
Tambet Ingo
6a68d79c08 2007-08-09 Tambet Ingo <tambet@gmail.com>
[Based on patch by Helmut Schaa <hschaa@suse.de>]

        * libnm-glib/nm-client.h:
        * libnm-glib/nm-object.h:
        * libnm-glib/nm-vpn-connection.h:
        * libnm-glib/nm-settings.h:
        * libnm-glib/nm-device.h:
        * libnm-glib/nm-ip4-config.h:
        * libnm-glib/nm-access-point.h:
        * libnm-glib/nm-device-802-3-ethernet.h:
        * libnm-util/nm-setting.h: 
        * libnm-util/nm-connection.h: Add G_BEGIN_DECLS / G_END_DECLS to
        * support C++.

        * libnm-glib/nm-object.c (nm_object_get_byte_property):
        * Implement.

        * libnm-glib/nm-access-point.c: Strength has type char.

        * gnome/vpn-properties/Makefile.am: Remove
        * GNOME_DISABLE_DEPRECTATED for now
        to fix build. GnomeDruid is deprecated in recent libgnomeui.

        * introspection/nm-access-point.xml: Strength property is char,
        * not int.

        * src/NetworkManagerAP.c (set_property): Set strength from char.
        (get_property): Handle hidden APs (with empty SSID).
        Get strength value from char.
        (nm_ap_class_init): Strength property has char type.



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2659 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-08-09 09:19:57 +00:00
Tambet Ingo
636b1140c5 2007-06-21 Tambet Ingo <tambet@ximian.com>
* libnm-glib/Makefile.am: Add NMObject to build, remove nm-utils.[ch].

	* nm-utils.[ch]: Remove.

	* libnm-glib/nm-object.c: Implement a base class for all libnm-glib dbus-aware
	objects for easy property access and dbus connection handling.

	* libnm-glib/nm-client.c: Derive from NMObject.

	* libnm-glib/nm-device.c: Ditto.

	* libnm-glib/nm-device-802-3-ethernet.c: Changes for being based on NMObject.

	* libnm-glib/nm-device-802-11-wireless.c: Ditto.

	* libnm-glib/nm-ip4-config.c: Ditto.

	* libnm-glib/nm-access-point.c: Ditto.

	* libnm-util/nm-connection.c (nm_connection_compare): Add a stub for connection
	comparision. Currently used by the device activation code to determine if the new
	activation is the same as the old one.

	* src/nm-dbus-nmi.c (nm_dbus_get_user_key_for_network): Don't use the obsolete and
	wrong way of getting the dbus path for AP. Fixes the issue where the applet isn't
	able to ask password for the AP.

	* src/nm-device.c (nm_device_activate): Change the logic here - instead of giving
	up if the device is already connected, tear down it's connection (if it isn't the
	same as new one) and start the activation.

	* src/nm-manager.c: Add the beginnings of NMConnection storage and signals.

	* src/NetworkManagerAP.c (nm_ap_init): Set the default values to AP memebers, fixes
	the issue where all APs are always listed as encrypted.

	* src/NetworkManagerDbus.c (nm_dbus_get_object_path_for_network): Remove. APs have
	their own registered paths.

	* test/nm-tool.c (detail_device): Don't try to get active network from wireless
	device if it's not connected - dbus-glib will happily crash trying to marshal NULL.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2615 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-06-22 15:09:02 +00:00
Tambet Ingo
c40051389c 2007-02-16 Tambet Ingo <tambet@ximian.com>
* introspection/nm-ip4-config.xml: Implement.

	* libnm-glib/libnm-glib-test.c: Use new DBUS API in tests.

	* libnm-glib/nm-ip4-config.c:
	* libnm-glib/nm-ip4-config.c: Implement.

	* src/nm-ap-security[-*]: Remove circular dependencies between APs and AP
	securities. APs reference security.

	* src/nm-device-802-11-wireless.c: Implement missing properties that need to
	be exported over DBUS.

	* src/nm-device-802-3-ethernet.c: Ditto.

	* src/NetworkManagerAP.c:
	* src/NetworkManagerAP.h:
		- Convert to GObject, export over DBUS.

	* src/nm-ip4-config.h:
	* src/nm-ip4-config.h:
		- Convert to GObject, export over DBUS.




git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2322 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
2007-02-16 11:23:49 +00:00