Commit Graph

783 Commits

Author SHA1 Message Date
Colin Walters
dab7dfaf35 build: fix srcdir != builddir
nm-version.h is in ${top_builddir}/include.
2012-01-09 14:20:36 -06:00
Jiří Klimeš
3a23cddb37 libnm-util: add functions to get number of data items and secrets
nm_setting_vpn_get_num_data_items()
nm_setting_vpn_get_num_secrets()
2012-01-05 15:44:46 +01:00
Jiří Klimeš
1db0015cd0 trivial: fix spelling in a annotation 2012-01-05 09:32:43 +01:00
Dan Williams
a080a1ed08 libnm-util: fix some introspection annotations 2011-12-22 11:04:56 -06:00
Dan Williams
2e858619d3 trivial: fix up libnm-util testcases 2011-12-09 00:13:19 -06:00
Thomas Graf
1cd8d52061 bonding: add nm_connection_get_virtual_iface_name() to abstract kernel interface binding
Some connection types such as bonding, bridging and VLAN require
specific virtual kernel interfaces identified by name to be auto
connected to the connection.

The function nm_connection_get_virtual_iface_name() returns the name
of the kernel interface if the connection type requires this
functionatlity.

Each connection base type settings class can implement the function
get_virtual_iface_name() if the connection needs to be auto connected
to a specific kernel interface.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 09:56:47 -06:00
Thomas Graf
86d5a40677 libnm-util: add nm_connection_get_setting_serial()
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:08:39 -06:00
Thomas Graf
5b7503e95e core: use nm_connection_get_setting_<type>() whenever possible
Leads to shorter, easier to read code and improves type casting safety.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:06:43 -06:00
Dan Williams
1f8090fb58 libnm-util: add nm_utils_hwaddr_type()
Returns the address type given the length.
2011-12-02 13:09:16 -06:00
Dan Williams
6e4eb4902e libnm-util: fix nm_utils_hwaddr_aton() for input with no leading zeros
ether_aton() allows addresses like "0:1:2:3:4:5" which was casusing
some problems when reading connections after switching callers of
ether_aton() to nm_utils_hwaddr_aton().
2011-12-02 13:09:16 -06:00
Dan Winship
d96bf9e866 libnm-util: add NMSettingInfiniband 2011-12-02 13:09:16 -06:00
Evan Broder
dc92d1258d settings: Add new password-raw and password-raw-flags properties to 8021x.
In cases where the actual password is non-ASCII, it may not be
possible to deliver the 802.1x password as a D-Bus string. Instead
provide an alternate field holding the password as a byte array.

In cases where both a password and password-raw are supplied,
password is preferred.
2011-11-21 23:50:48 -06:00
Dan Winship
2510c617ec libnm-util: add ether_ntoa/ether_aton-like utility methods
nm_utils_hwaddr_ntoa() and nm_utils_hwaddr_aton() are like
ether_ntoa()/ether_aton(), but handle IPoIB too.

nm_utils_hwaddr_atoba() is like _aton() but returns a GByteArray,
since that's what's wanted in many places.

Also remove nm_ether_ntop() and replace uses of it with
nm_utils_hwaddr_ntoa().
2011-11-17 13:37:08 -06:00
Dan Williams
c15dea298f core: make testcases work after bonding merge 2011-11-09 23:40:04 -06:00
Thomas Graf
6349151de1 bonding: implement bonding slaves
Adds a MASTER= directive to ifcfg-rh allowing a connection to define
itself as bonding slave.

Adds a connection property "master" which contains the in-kernel device
name or UUID of the master connection.

Adds a connection property "slave-type" which defines the type of slave
this connection represents. Currently this is only set by bonding but
eventually this will be used by VLAN and bridging.

Enforces that no bonding slave connection has any IPv4 or IPv6
configuration set.

Changes make_ip4_setting() to take a universal flag indicating whether
to allow disabling ip4 config or not and use it for both, ip6 and
bonding special case.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:23:21 -06:00
Thomas Graf
a2a0d78818 bonding: settings parser for ifcfg plugin + NMSettingBond class
Introduced a new TYPE=bond for ifcfg-rh configuration files.
Alternatively BONDING_MASTER=yes can be specified instead of
setting the type explicitely to maintain backwards compatibility
with existing configuration files.

Bonding device files require a DEVICE= line to be present which
specifies the virtual bonding interface in the kernel. We do not
allow auto-generation of the name in order to keep confusion to
a minimum when reusing existing bonding interfaces.

The BONDING_OPTS= parameter can be used to specify various bonding
related options, such as:
  - mode
  - miimon
  - updelay
  - downdelay
  - arp_interval
  - arp_ip_target

By default, the NMSettingBond class uses a miimon value of 100 which
seems like a sensible default value for 99% of all configurations.
If this is not suitable, an arp_ip_target needs to be specified
manually.

A writer is not yet implemented.

Changes v2:
 - renamed DeviceName property to InterfaceName
 - moved code to validate device name to dev_valid_name() for future use

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-09 23:16:31 -06:00
Dan Williams
bc628da16b libnm-util: fix up connection diff test 2011-11-09 22:06:36 -06:00
Dan Williams
40fc428f9f libnm-util: fix up symbol visibility test for zones 2011-11-09 22:06:36 -06:00
Jiri Popelka
04c8ec7360 libnm-util: new 'zone' property for NMSettingConnection
Used to indicate what firewall zone the interface should be in
when the connection is active.
2011-11-09 21:40:12 -06:00
Dan Williams
a5c2c47b3e wifi: make wireless-helper.h private to src/
The less stuff that needs WEXT the better.
2011-11-09 21:28:02 -06:00
Dan Williams
d8437ffaf1 core: fix deprecated usage of g_value_[get|set]_char() (bgo #662694) 2011-10-28 11:35:59 -05:00
Dan Williams
a8256961f6 trivial: fix GSM setting 'home-only' property nickname 2011-10-27 11:24:15 -05:00
Thomas Graf
594a2f677d libnm-util: add nm_connection_is_type()
Adds a helper nm_connection_is_type(connection, type) which returns TRUE
if a connection is of specified type.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-10-27 11:06:17 -05:00
Dan Winship
7b7d7bce2f libnm-util: add some more introspection annotations to silence warnings 2011-10-14 10:09:46 -05:00
Colin Walters
979d527828 build: fix glib version check for g_value_get_schar() (bgo #661271)
The function appeared in glib master (which was 2.31.0); it's not
in glib-2-30 branch.
2011-10-12 10:17:00 +02:00
Ludwig Nussel
c379df568c build: glib 2.30.0 doesn't have g_value_get_schar yet 2011-10-10 16:04:34 -05:00
Thomas Jarosch
1453abbebc test: add missing return values
Signed-off-by: Thomas Jarosch <thomas.jarosch@intra2net.com>
2011-10-10 16:02:27 -05:00
Dan Williams
6c6ec65abe libnm-util: fix deprecated g_value_get_char() for glib 2.29.90 and later 2011-10-03 10:33:49 -05:00
Dan Williams
b3ca1e56c1 Merge remote-tracking branch 'origin/agent-secrets' 2011-08-23 09:34:55 -05:00
Dan Williams
2a5617c22b docs: update documentation for nm_utils_security_valid() 2011-08-22 20:33:07 -05:00
Dan Williams
a8eaa4a3ea docs: fix a wrong variable name in code documentation 2011-08-22 20:33:07 -05:00
Dan Williams
e3cc3366b2 docs: fix a prototype causing doc generation warnings 2011-08-22 20:33:07 -05:00
Evan Broder
4f38f02add settings: add 802.1X setting properties for subject and altsubject matches
Includes subject_match and phase2_subject_match (string) parameters,
and altsubject_matches and phase2_altsubject_matches (list of string)
parameters.

subject_match is matched against a substring of the subject from the
certificate presented by the remote authentication server. If this
option is unset, no subject verification is performed.

altsubject_matches are each tested against the alternate subject name
(altSubjectName) of the certificate presented by the remote
authentication server. If this option is unset, no verification of the
altSubjectName is performed.
2011-08-19 18:20:41 -05:00
Dan Williams
2b2404bbef settings: preserve agent secrets the right way
What we want to do here is keep separate caches of system and
agent secrets.  For system secrets, we cache them because NM
periodically clears secrets using nm_connection_clear_secrets() to
ensure they don't stay around in memory, and that transient secrets
get requested again when they are needed.  For agent secrets, we
only want them during activation, but a connection read from disk
will not include agent secrets becuase by definition they aren't
stored in system settings along with the connection.  Thus we need
to keep the agent/transient secrets somewhere for the duration of
the activation to ensure they don't get deleted.

This removes the copy-back hack in update_auth_cb() which copied
agent/transient secrets back into the connection over top of the
transient secrets that had been copied back in
nm_settings_connection_replace_settings().  No reason to copy
them twice if we keep an agent/transient secrets hash and do
the right thing with it.
2011-08-16 16:19:23 -05:00
Dan Williams
e2d88f59e6 settings: preserve agent secrets over Update operation
The core problem was that the Update would trigger a write to
disk to save the connection's new settings, which called
nm_settings_connection_replace_settings().  Which saved existing
transient (agent/unsaved) secrets, replaced settings with the
new ones from Update(), then copied back the old transient
secrets.  This was to ensure that changes triggered from getting
agent secrets during activation (which might write the connection
out to disk if new system secrets were provided, which triggered
an inotify read-back of the connection, which blew away the
transient secrets just returned from the agent) didn't blow away
transient secrets.  Unfortunately that fix was too general.

As a quick hack for now, copy the new secrets and re-apply them
after nm_connection_replace_settings() has run.  We'll do the
actual fix later, but it's more involved and needs more testing
so we don't want to apply it this close to release.
2011-08-16 15:48:38 -05:00
Dan Williams
0cb27772f3 docs: update VPN setting 'user-name' property documentation
Lamarque wanted clarification about how it's supposed to be used.
2011-08-12 10:23:25 -05:00
Mathieu Trudel-Lapierre
36db194ae9 libnm-util: default to allowing IPv6 connections to fail
Allow IPv6 connections to fail by changing the default value of the may-fail
property for ipv6 settings to TRUE.

This makes sure connections created manually using nm-connection-editor
will default to having the "Require ..." checkbox unchecked; in other words,
IPv6 timing out will still allow the interface to be configured if
IPv4 succeeds.
2011-07-20 23:56:48 -05:00
Dan Williams
5fb8efbb19 docs: another trivial doc fix 2011-07-19 12:27:44 -05:00
Dan Williams
809e791f02 docs: trivial doc fix 2011-07-19 12:22:08 -05:00
Dan Williams
50df7397a5 docs: document the VPN setting 2011-07-19 12:06:47 -05:00
Dan Williams
2a020de944 docs: document PPP setting 2011-07-19 11:34:11 -05:00
Dan Williams
86854167d6 libnm-util: add some missing GObject introspection annotations 2011-07-19 11:14:01 -05:00
Dan Williams
2c401887aa docs: document the PPPoE setting 2011-07-19 11:08:38 -05:00
Dan Williams
d45e9cb062 libnm-util: rename symbol to fix export check
The export check looks for symbols that begin with "nm_" (except
for GObject class stuff) which indicate that the symbol should be
exported.  If the symbols is 'l' (local) as reported by objdump
that probably means we forgot to add it to the .ver file and it
really should be exported.  nm_gvalue_dup() shouldn't be exported
though, so rename it such that it's obviously internal.
2011-07-19 09:56:46 -05:00
Dan Williams
664204e56c docs: document the IP6Config setting 2011-07-05 19:27:46 -05:00
Dan Williams
39b2d78ee3 libnm-util: enforce IPv4 prefix range validity
Prefixes are between 1 and 32 inclusive so we might as well
enforce that.
2011-07-05 19:26:57 -05:00
Dan Williams
24855b02ec libnm-util: fix up another GObject introspection annotation 2011-07-05 18:23:37 -05:00
Dan Williams
55f55781a8 docs: update Serial setting documentation 2011-07-05 18:17:08 -05:00
Dan Williams
2de340ab7a docs: fix some Wireless Security setting documentation 2011-07-05 18:13:51 -05:00
Dan Williams
223532c385 docs: update CDMA setting documentation 2011-07-05 18:11:35 -05:00