Make setting type registration less icky; instead of having the
connection register all the settings, have the settings themselves
register that information at library load time. Putting this sort
of thing in G_DEFINE_TYPE_WITH_CODE is apparently more standard
than the home-rolled stuff we had before. Also document the
priority stuff so when adding new settings, people know what
priority to use.
(cleanups by jklimes)
(comments by dcbw)
This allows out-of-the-box connectivity on IPv6-only networks.
Once caveat is that connections where the user currently
expects no IPv4 connectivity to terminate the connection and
retry will no longer do so until IPv6 also times out, and if
that network where IPv4 is expected to fail also has an IPv6
router sending advertisements, the connection will succeed
instead of failing. That can be resolved by setting the
right bit in the connection's config file; and it's expected
that the number of users who expect IPv4 failure on a
network with usable IPv6 connectivity is quite small
compared to the benefit of OOB IPv6 connectivity.
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.
Add the necessary annotations (the mininum required, that is those
on return values. NULL parameters or container types may require
more), and the Autotools stuff to get a NetworkManager GIR for
libnm-util and a NMClient for libnm-glib.
When this property is TRUE, IP configuration can continue as long
as at least on IP configuration type succeeds. This allows
connections to networks where the user does not necessarily know
whether the network supports IPv4 or IPv6 and does not require
that both complete succesfully.
Since most of the time the user doesn't really care what type
of connectivity they have, as long as they have *some* connectivity,
this allows better "Just Works" behavior as long as the system
settings plugins and connection editors/applets use the right
defaults.
Suggested defaults for may-fail are:
IPv4: no (ie, require IPv4 connectivity)
IPv6: yes (ie, do not require IPv6 connectivity)
Users who require a specific type of connectivity are probably
knowlegable enough to check the box as needed for their network.
This caused the 'autoconnect' property of NMSettingConnection to not
get updated in some cases (as when a system setting plugin noticed a
change to autoconnect=true and emitted the Updated signal, which wouldn't
contain the new value). Add a testcase for setting default values too.
* libnm-util/libnm-util.ver
libnm-util/nm-setting-ip4-config.c
libnm-util/nm-setting-ip4-config.h
- Add 'never-default' property, which when true indicates that a
connection should never be the default connection
* src/nm-ip4-config.c
src/nm-ip4-config.h
- (nm_ip4_config_get_never_default, nm_ip4_config_set_never_default):
Add never-default helpers
* src/NetworkManagerUtils.c
- (nm_utils_merge_ip4_config): update never-default when merging the
IP4 setting to the IP4 config
* src/NetworkManagerSystem.c
- (nm_system_apply_ip4_config): if the connection is never-default,
don't add routes without a gateway
* src/NetworkManagerPolicy.c
- (get_best_device): don't let never-default connections be the best
- (update_routing_and_dns): handle never-default for VPN connections
* system-settings/plugins/ifcfg-rh/reader.c
- (make_ip4_setting): handle never-default by checking GATEWAYDEV
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/branches/NETWORKMANAGER_0_7@4378 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 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
* libnm-util/nm-setting-ip4-config.c
libnm-util/nm-setting-ip4-config.h
- Make IPv4 methods reflect their usage; 'dhcp' -> 'auto' and
'autoip' -> 'link-local'. VPN & PPP connections can also have IPv4
settings, and they don't necessarily use DHCP.
* src/NetworkManagerPolicy.c
src/nm-device.c
system-settings/plugins/ifcfg-fedora/reader.c
system-settings/plugins/ifcfg-suse/parser.c
- Fixup for method changes
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3882 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-ip6-config.c
- (set_property): add missing break that caused routes to be overwritten
with addresses
* libnm-util/nm-setting-ip6-config.c
- (verify): validate routes and return GError everywhere on invalid setting
- (finalize): don't leak routes
- (set_property): add missing break that caused routes to be overwritten
with addresses
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3865 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-ip4-config.c
libnm-util/nm-setting-ip4-config.h
- Add properties for DHCP Client Identifier and DHCP Hostname
* src/dhcp-manager/nm-dhcp-manager.c
src/dhcp-manager/nm-dhcp-manager.h
- (nm_dhcp_manager_begin_transaction): take the connection's ip4-config
setting as an argument to pass on to the dhclient config file
creation function
- (nm_dhcp_manager_cancel_transaction_real): remove dhclient config when
DHCP is torn down
- (dhclient_run): punt config file handling to create_dhclient_config()
- (create_dhclient_config): create an interface-specific dhclient
config file since there may need to be interface-specific options
passed to dhclient
- (merge_dhclient_config): merge normal distro dhclient config file and
add options from the connection
- (nm_dhcp_device_new): generate the interface specific dhclient
config file path once
- (nm_dhcp_device_destroy): handle partially initialized objects; free
dhclient config file path
* src/nm-device.c
- (real_act_stage3_ip_config_start): pass ip4-config, if any, to the
DHCP manager when starting DHCP
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3805 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Add a GError argument to nm_connection_verify() and nm_setting_verify(),
and add error enums to each NMSetting subclass. Each NMSetting subclass now
returns a descriptive GError when verification fails.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3751 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-ip4-config.[ch]: Add static routes property.
* src/nm-ip4-config.[ch]: Store the static routes as a list of
NMIP4Address, update the getters and setters.
* src/dhcp-manager/nm-dhcp-manager.c (nm_dhcp_manager_get_ip4_config):
Use the updated NMIP4Config routes api.
* src/NetworkManagerUtils.c (nm_utils_merge_ip4_config): Merge
static routes as well.
* src/NetworkManagerSystem.c (netmask_to_prefix): Implement.
(nm_system_device_set_from_ip4_config): Use the updated NMIP4Config
routes api.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3715 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-ip4-config.c
libnm-util/nm-setting-ip4-config.h
- Add a 'shared' method to indicate that this connection should be
brought up with a DHCP and proxy DNS server to facilitate
connection sharing.
- (verify): 'shared' method doesn't allow DNS or searches either
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3709 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Add a flag to NMSettingIP4Config to make it possible to ignore the DNS
information received from DHCP.
* libnm-util/nm-setting-ip4-config.c: Add a new membet "ignore_dhcp_dns"
to make it possible to ignore the DNS information (both servers and
searches) returned by DHCP server.
* src/NetworkManagerUtils.c (nm_utils_merge_ip4_config): Reset the
name servers and searches if "ignore_dhcp_dns" is set.
* src/nm-ip4-config.c (nm_ip4_config_reset_nameservers)
(nm_ip4_config_reset_searches): Implement.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3685 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* 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
* libnm-util/nm-setting-ip4-config.c
libnm-util/nm-setting-ip4-config.h
- Remove 'manual' and 'autoip' properties
- Add 'method' property
- (verify): fix verification with 'method'
- (finalize): free 'method'
- (set_property, get_property, nm_setting_ip4_config_class_init): fix
up for 'method'
* src/nm-device.c
- (real_act_stage3_ip_config_start): check IP4Config method
- (nm_device_new_ip4_autoip_config): add a note about not sucking in
the future
- (merge_ip4_config): IP settings are valid with DHCP too
- (real_act_stage4_get_ip4_config): handle all IP4Config methods
- (real_act_stage4_ip_config_timeout): don't do autoip on DHCP timeout
* src/nm-device-802-11-wireless.c
- (real_act_stage3_ip_config_start): remove; autoip only on demand
- (real_act_stage4_get_ip4_config): just chain up to parent; autoip
only on demand
* system-settings/plugins/ifcfg-fedora/parser.c
system-settings/plugins/ifcfg-suse/parser.c
- (make_ip4_setting): fix up for 'method'
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3443 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
* libnm-util/nm-setting-ip4-config.c
- (ip4_addresses_from_gvalue, ip4_addresses_to_gvalue,
nm_setting_ip4_config_class_init): apparently dbus-glib can't
marshal GValueArrays inside collections, so switch to types that it
can actually marshal/demarshal
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3098 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Rework NMSetting structures: Move each setting to it's own file.
Convert to GObject. Remove home grown setting types and use
GTypes.
Use GObject property introspection for hash conversion,
enumerating
properties, etc.
* libnm-util/nm-setting-connection.[ch]
* libnm-util/nm-setting-ip4-config.[ch]
* libnm-util/nm-setting-ppp.[ch]
* libnm-util/nm-setting-vpn.[ch]
* libnm-util/nm-setting-vpn-properties.[ch]
* libnm-util/nm-setting-wired.[ch]
* libnm-util/nm-setting-wireless.[ch]
* libnm-util/nm-setting-wireless-security.[ch]
New files, each containing a setting.
* libnm-util/nm-setting-template.[ch]: A template for creating
* new
settings. To use it, just replace 'template' with the new
setting
name, and you're half-way done.
* libnm-util/nm-setting.c: Convert to GObject and use GObject
introspection instead of internal types and tables.
* libnm-util/nm-connection.c: Adapt the new NMSetting work.
* libnm-util/nm-param-spec-specialized.[ch]: Implement. Handles
GValue types defined by dbus-glib for composed types like
collections,
structures and maps.
* src/*: The API of NMSetting and NMConnection changed a bit:
* Getting
a setting from connection takes the setting type now. Also,
since
the settings are in multiple files, include relevant settings.
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@3068 4912f4e0-d625-0410-9fb7-b9a5a253dbdc