Commit Graph

24 Commits

Author SHA1 Message Date
Thomas Haller
5cdd592457 libnm-util: trivial: rename private field and enum value in NMSettingVlan
The public property is called NM_SETTING_VLAN_INTERFACE_NAME,
so also the internal field and the PROP_* enum should carry
the same name.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-27 21:01:41 +01:00
Thomas Haller
97935382f4 coverity: fix various warnings detected with Coverity
These are (most likely) only warnings and not severe bugs.
Some of these changes are mostly made to get a clean run of
Coverity without any warnings.

Error found by running Coverity scan

https://bugzilla.redhat.com/show_bug.cgi?id=1025894

Co-Authored-By: Jiří Klimeš <jklimes@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-11-13 15:29:24 +01:00
Dan Winship
cbe261caa2 libnm: more valgrinding fixes 2013-10-03 11:04:45 -04:00
Dan Winship
066b592241 all: standardize on NMSettingWired:mac-address for all VLANs
Currently, ethernet-based VLANs can specify the hardware address of
the parent device (and, in theory, the cloned hardware address and MTU
of the VLAN device) by using an NMSettingWired in addition to the
NMSettingVlan.

The theory was that non-ethernet-based VLANs, when we eventually
supported them, would likewise use the setting type corresponding to
their parent device. However, this turns out to be both complicated
(the settings plugins and connection editor would have a
hard-to-impossible time figuring out which setting type to use in some
cases) and incorrect (for most L2 settings [eg, BSSID, bond mode,
etc], the VLAN can't have its own values separate from the parent
device).

What we should have done was just have :mac-address,
:cloned-mac-address, and :mtu properties on NMSettingVlan. However, at
this point, for backward-compatibility, we will just stick with using
a combination of NMSettingVlan and NMSettingWired, but we will use
NMSettingWired regardless of the underlying hardware type.
2013-09-12 18:34:23 -04:00
Jiří Klimeš
816ac9ee70 libnm-util: prefix errors with 'setting.property' instead of 'property' only 2013-06-13 10:05:18 +02:00
Dan Winship
43617d4c1d libnm-util: deprecate nm_utils_slist_free(), use g_slist_free_full() 2013-05-29 17:13:30 -03:00
Dan Williams
f6064e7b74 libnm-util: implement connection changed signal
Emitted whenever settings are added or removed from the connection,
and whenever any property of any setting in the connection is changed.
2013-05-28 12:26:55 -05:00
Dan Williams
4aa91e22a0 libnm-util: fix mis-freed VLAN priority list element
We want to free the element data, then remove the element from the
list.  Instead the code freed the element data, then treated the
element data pointer as a GSList link, which is completely wrong.
2013-04-11 19:11:51 -05:00
Dan Winship
5fec30d98e Revert :carrier-detect properties and associated code
Ignoring carrier is generally something you want at the machine level
(eg, for a server), not at the connection level.
2013-04-03 10:23:49 -04:00
Jiří Klimeš
df142a5dc4 libnm-util: make property verification errors more descriptive
- fix g_set_error()/g_set_error_literal() usage
- make the error messages translatable
- use g_prefix_error() to prepend property name
2013-03-13 17:47:11 +01:00
Dan Williams
47d8db57b5 trivial: plug some memory leaks
(review+ danw)
2013-02-25 16:07:03 +01:00
Jiří Klimeš
2fef987980 libnm-util: add the detailed description of carrier-detect to blurb as well
So that we have the description in generated html documentation and nm-settings
manual page.
2013-02-18 15:57:12 +01:00
Dan Winship
5266e25e2b libnm-utils: add :carrier-detect properties
For settings corresponding to devices that have a :carrier property
(ie bond, bridge, infiniband, vlan, and wired), add a :carrier-detect
property specifying how that affects the connection:

  yes: The connection can only be activated when the device
      has carrier, and will be deactivated if the device loses
      carrier (for more than 4 seconds).
  no: The connection ignores carrier on the device; it can be
      activated when there is no carrier, and stays activated
      when carrier is lost.
  on-activate: The connection can only be activated when the
      device has carrier, but it will not be deactivated if the
      device loses carrier.

https://bugzilla.gnome.org/show_bug.cgi?id=688284
2013-02-15 13:40:38 -05:00
Jiří Klimeš
7147c3d1a3 libnm-util: return FALSE on missing NMSettingVlan:parent && NMSettingWired:mac-address
in NMSettingVlan's verify()
2012-11-29 16:39:15 +01:00
Dan Williams
38e3819b4e libnm-util: clean up setting registration
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)
2012-10-29 15:12:58 -05:00
Dan Winship
de0163fc5c libnm-util: Improve NMSettingVlan's verify()
Do slightly more validation if NMSettingVlan properties, and make sure
that at least one method of specifying a parent is used.

Remove the check that id is in range, since gobject will not allow you
to set the property to a value outside its declared range anyway.
2012-09-27 13:57:20 -04:00
Dan Winship
1814fbca71 libnm-util: remove InfiniBand references in NMSettingVlan
IPoIB doesn't support VLANs (it has something similar done
differently), so remove the references to it in the docs.
2012-07-30 20:36:37 -04:00
Jiří Klimeš
7c841b901a docs: fix documentation for some VLAN setting functions 2012-07-11 13:10:51 +02:00
Colin Walters
c9aa5f76cf Fix various bits of broken gtk-doc
There was some duplication, syntax errors, etc.
2012-06-14 13:56:48 -04:00
Dan Williams
4366fd2f84 docs: fix some annotations and documentation 2012-06-12 12:12:35 -05:00
Dan Winship
8a2267ab6b Fix a few misc issues noticed by Coverity 2012-04-05 13:30:09 -04:00
Dan Williams
e52bf5e172 libnm-util: add 'parent' property to VLAN setting 2012-03-01 17:39:36 -06:00
Dan Williams
552c9959cc libnm-util: various cleanups and documentation fixes
Add documentation so the API spec generator can do something
for the VLAN setting.  Also enforce validation of the ingress
and egress priority maps; 802.1D priorities are limited to
values from 0 - 7 and Linux SKB values are 32 bits.

Also, the 'slave' property is a duplicate of the 'master'
property added to NMSettingConnection in the bonding work
so we can get rid of it and use 'master' instead.
2012-02-16 15:05:55 -06:00
Weiping Pan
23c1b6ad30 libnm-util: add VLAN setting and properties
Signed-off-by: Weiping Pan <wpan@redhat.com>

(dcbw: formatting cleanups and priority map code simplifications)
2012-02-16 15:05:55 -06:00