summaryrefslogtreecommitdiff
path: root/libnm-core/nm-setting-bridge.c
Commit message (Collapse)AuthorAgeFilesLines
* all: drop empty first line from sourcesThomas Haller2019-06-111-1/+0
| | | | git ls-files -z -- ':(exclude)src/settings/plugins/keyfile/tests/keyfiles' | xargs -0 -n1 sed -i '1 { /^$/d }'
* all: drop emacs file variables from source filesThomas Haller2019-06-111-1/+0
| | | | | | | | | | | | | | | | | | | | | | We no longer add these. If you use Emacs, configure it yourself. Also, due to our "smart-tab" usage the editor anyway does a subpar job handling our tabs. However, on the upside every user can choose whatever tab-width he/she prefers. If "smart-tabs" are used properly (like we do), every tab-width will work. No manual changes, just ran commands: F=($(git grep -l -e '-\*-')) sed '1 { /\/\* *-\*- *[mM]ode.*\*\/$/d }' -i "${F[@]}" sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}" Check remaining lines with: git grep -e '-\*-' The ultimate purpose of this is to cleanup our files and eventually use SPDX license identifiers. For that, first get rid of the boilerplate lines.
* libnm: pass connection to compare_property() functionThomas Haller2019-05-011-7/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have certain artificial properties that not only depend on one property alone or that depend on a property in another(!) setting. For that, we have synth_func. Other than that, synth_func and get_func are really fundamentally similar and should be merged. That is because the distinction whether a property value is "synthetized" or just based on a plain property is minor. It's better to have the general concept of "convert property to GVariant" in one form only. Note that compare_property() is by default implemented based on get_func. Hence, if get_func and synth_func get merged, compare_property() will also require access to the NMConnection. Also it makes some sense: some properties are artificial and actually stored in "another" setting of the connection. But still, the property descriptor for the property is in this setting. The example is the "bond.interface-name" which only exists on D-Bus. It's stored as "connection.interface-name". I don't really like to say "exists on D-Bus only". It's still a valid property, despite in NMSetting it's stored somehow differently (or not at all). So, this is also just a regular property for which we have a property-info vtable. Does it make sense to compare such properties? Maybe. But the point is that compare_property() function needs sometimes access to the entire connection. So add the argument.
* all: use escaped_tokens API for bridge vlansBeniamino Galvani2019-04-181-1/+1
| | | | (cherry picked from commit 9f23c5e2de4166dd12992d658156451ba29938fa)
* all: support bridge vlan rangesBeniamino Galvani2019-04-181-34/+107
| | | | | | | | | | | | | In some cases it is convenient to specify ranges of bridge vlans, as already supported by iproute2 and natively by kernel. With this commit it becomes possible to add a range in this way: nmcli connection modify eth0-slave +bridge-port.vlans "100-200 untagged" vlan ranges can't be PVIDs because only one PVID vlan can exist. https://bugzilla.redhat.com/show_bug.cgi?id=1652910 (cherry picked from commit 70935157771b1de39f27d20e50112efcc50d1f5c)
* shared: add flags argument to nm_utils_strsplit_set()Thomas Haller2019-04-101-1/+1
| | | | | | It will be useful to extend nm_utils_strsplit_set() with various flavors and subtly different behaviors. Add a flags argument to support these.
* libnm-core: drop unused variableFrancesco Giudici2019-03-281-1/+0
|
* ifcfg-rh: add bridge vlans supportBeniamino Galvani2019-03-261-0/+7
|
* libnm-core: add bridge vlan conversion utilsBeniamino Galvani2019-03-261-0/+118
|
* libnm-core: add vlans property to bridge settingBeniamino Galvani2019-03-261-2/+284
|
* libnm-core: add vlans property to bridge-port settingBeniamino Galvani2019-03-261-1/+286
|
* all: add vlan-filtering and vlan-default-pvid bridge propertiesBeniamino Galvani2019-03-261-0/+95
|
* all: drop unnecessary includes of <errno.h> and <string.h>Thomas Haller2019-02-121-1/+0
| | | | | "nm-macros-interal.h" already includes <errno.h> and <string.h>. No need to include it everywhere else too.
* all: don't use "static inline" in source filesThomas Haller2019-02-061-1/+1
| | | | | | | | For static functions inside a module, the compiler determines on its own whether to inline the function. Also, "inline" was used at some places that don't immediatly look like candidates for inlining. It was most likely a copy&paste error.
* libnm-core: reorder code in settingsThomas Haller2019-01-151-66/+75
| | | | | | | | | | Order the code in our common way. No other changes. - ensure to include the main header first (directly after "nm-default.h"). - reorder function definitions: get_property(), set_property(), *_init(), *_new(), finalize(), *_class_init().
* libnm-core: cleanup NMSetting's class initializationThomas Haller2019-01-151-77/+67
| | | | | | | Unify the coding style for class-init functions in libnm-core. Also make use of obj_properties, NM_GOBJECT_PROPERTIES_DEFINE(), and _notify().
* libnm: rework setting metadata for property handlingThomas Haller2018-08-101-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMSetting internally already tracked a list of all proper GObject properties and D-Bus-only properties. Rework the tracking of the list, so that: - instead of attaching the data to the GType of the setting via g_type_set_qdata(), it is tracked in a static array indexed by NMMetaSettingType. This allows to find the setting-data by simple pointer arithmetic, instead of taking a look and iterating (like g_type_set_qdata() does). Note, that this is still thread safe, because the static table entry is initialized in the class-init function with _nm_setting_class_commit(). And it only accessed by following a NMSettingClass instance, thus the class constructor already ran (maybe not for all setting classes, but for the particular one that we look up). I think this makes initialization of the metadata simpler to understand. Previously, in a first phase each class would attach the metadata to the GType as setting_property_overrides_quark(). Then during nm_setting_class_ensure_properties() it would merge them and set as setting_properties_quark(). Now, during the first phase, we only incrementally build a properties_override GArray, which we finally hand over during nm_setting_class_commit(). - sort the property infos by name and do binary search. Also expose this meta data types as internal API in nm-setting-private.h. While not accessed yet, it can prove beneficial, to have direct (internal) access to these structures. Also, rename NMSettingProperty to NMSettInfoProperty to use a distinct naming scheme. We already have 40+ subclasses of NMSetting that are called NMSetting*. Likewise, NMMetaSetting* is heavily used already. So, choose a new, distinct name.
* libnm: use NMMetaSettingInfo for tracking setting priorityThomas Haller2018-08-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, each (non abstract) NMSetting class had to register its name and priority via _nm_register_setting(). Note, that libnm-core.la already links against "nm-meta-setting.c", which also redundantly keeps track of the settings name and gtype as well. Re-use NMMetaSettingInfo also in libnm-core.la, to track this meta data. The goal is to get rid of private data structures that track meta data about NMSetting classes. In this case, "registered_settings" hash. Instead, we should have one place where all this meta data is tracked. This was, it is also accessible as internal API, which can be useful (for keyfile). Note that NMSettingClass has some overlap with NMMetaSettingInfo. One difference is, that NMMetaSettingInfo is const, while NMSettingClass is only initialized during the class_init() method. Appart from that, it's mostly a matter of taste, whether we attach meta data to NMSettingClass, to NMMetaSettingInfo, or to a static-array indexed by NMMetaSettingType. Note, that previously, _nm_register_setting() was private API. That means, no user could subclass a functioning NMSetting instance. The same is still true: NMMetaSettingInfo is internal API and users cannot access it to create their own NMSetting subclasses. But that is almost desired. libnm is not designed, to be extensible via subclassing, nor is it clear why that would be a useful thing to do. One day, we should remove the NMSetting and NMSettingClass definitions from public headers. Their only use is subclassing the types, which however does not work. While libnm-core was linking already against nm-meta-setting.c, nm_meta_setting_infos was unreferenced. So, this change increases the binary size of libnm and NetworkManager (1032 bytes). Note however that roughly the same information was previously allocated at runtime.
* libnm/trivial: cleanup variable names in settings' class-init functionsThomas Haller2018-08-101-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Don't use @parent_class name. This local variable (and @object_class) is the class instance up-cast to the pointer types of the parents. The point here is not that it is the direct parent. The point is, that it's the NMSettingClass type. Also, it can only be used inconsistently, in face of NMSettingIP4Config, who's parent type is NMSettingIPConfig. Clearly, inside nm-setting-ip4-config.c we wouldn't want to use the "parent_class" name. Consistently rename @parent_class to @setting_class. - Also rename the pointer to the own class to @klass. "setting_class" is also the wrong name for that, because the right name would be something like "setting_6lowpan_class". However, "klass" is preferred over the latter, because we commonly create new GObject implementations by copying an existing one. Generic names like "klass" and "self" inside a type implementation make that simpler. - drop useless comments like /* virtual functions */ /* Properties */ It's better to logically and visually structure the code, and avoid trival remarks about that. They only end up being used inconsistently. If you even need a stronger visual separator, then an 80 char /****/ line should be preferred.
* libnm: avoid constructor function for registering NMSetting typesThomas Haller2018-07-011-1/+0
| | | | | | | | | | constructor functions are ugly, because code is running before main() starts. Instead, as the registration code for NMSetting types is insid the GType constructor, we just need to ensure at the right place, that the GType was created. The right place here is _register_settings_ensure_inited(), because that is called before we need the registration information.
* libnm: move bridge min/max defines to header fileThomas Haller2017-11-231-26/+12
|
* ifcfg-rh: use distinct variables for bridge and wired mac addressBeniamino Galvani2017-11-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently both bridge.mac-address and ethernet.cloned-mac-address get written to the same MACADDR ifcfg-rh variable; the ethernet property wins if both are present. When one property is set and the connection is saved (and thus reread) both properties are populated with the same value. This is wrong because, even if the properties have the same meaning, the setting plugin should not read something different from what was written. Also consider that after the following steps: $ nmcli con mod c ethernet.cloned-mac-address 00:11:22:33:44:55 $ nmcli con mod c ethernet.cloned-mac-address "" the connection will still have the new mac address set in the bridge.mac-address property, which is certainly unexpected. In general, mapping multiple properties to the same variable is harmful and must be avoided. Therefore, let's use a different variable for bridge.mac-address. This changes behavior, but not so much: - connections that have MACADDR set will behave as before; the only difference will be that the MAC will be present in the wired setting instead of the bridge one; - initscripts compatibility is not relevant because MACADDR for bridges was a NM extension; - if someone creates a new connection and sets bridge.mac-address NM will set the BRIDGE_MACADDR property instead of MACADDR. But this shouldn't be a big concern as bridge.mac-address is documented as deprecated and should not be used for new connections. https://bugzilla.redhat.com/show_bug.cgi?id=1516659
* libnm-core: document bridge.mac-address as deprecatedBeniamino Galvani2017-11-231-0/+2
| | | | The description already says that. Also add the deprecation tag.
* docs: fix typo in NMSettingBridge:group-forward-mask docThomas Haller2017-10-301-1/+1
| | | | | | Fixes: 17ec3aef2fa4d31ef80f54923f89e6719f1ce83b https://bugzilla.gnome.org/show_bug.cgi?id=789662
* bridge: introduce a bridge.group-forward-mask connection propertyBeniamino Galvani2017-07-271-1/+55
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1358615
* device: deprecate "bridge.mac-address" for "ethernet.cloned-mac-address" settingThomas Haller2017-07-251-2/+7
| | | | | | | | | | | | The settings "bridge.mac-address" and "ethernet.cloned-mac-address" have an overlapping meaning. If the former is unset, fallback to the latter. Effectively, "bridge.mac-address" is deprecated in favor of "ethernet.cloned-mac-address", which is more powerful as it supports various modes like "stable". However, if a connection specifies "bridge.mac-address", it is used when creating the bridge interface, while "ethernet.cloned-mac-address" is used shortly after, during activation.
* libnm: use enum for setting prioritiesThomas Haller2017-06-071-1/+1
|
* man,libnm-core: fix typosBeniamino Galvani2016-03-301-1/+1
|
* all: cleanup includes and let "nm-default.h" include "config.h"Thomas Haller2016-02-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - All internal source files (except "examples", which are not internal) should include "config.h" first. As also all internal source files should include "nm-default.h", let "config.h" be included by "nm-default.h" and include "nm-default.h" as first in every source file. We already wanted to include "nm-default.h" before other headers because it might contains some fixes (like "nm-glib.h" compatibility) that is required first. - After including "nm-default.h", we optinally allow for including the corresponding header file for the source file at hand. The idea is to ensure that each header file is self contained. - Don't include "config.h" or "nm-default.h" in any header file (except "nm-sd-adapt.h"). Public headers anyway must not include these headers, and internal headers are never included after "nm-default.h", as of the first previous point. - Include all internal headers with quotes instead of angle brackets. In practice it doesn't matter, because in our public headers we must include other headers with angle brackets. As we use our public headers also to compile our interal source files, effectively the result must be the same. Still do it for consistency. - Except for <config.h> itself. Include it with angle brackets as suggested by https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
* all: drop includes to <glib/gi18n.h> for "nm-default.h"Dan Winship2015-08-051-1/+0
| | | | | | | The localization headers are now included via "nm-default.h". Also fixes several places, where we wrongly included <glib/gi18n-lib.h> instead of <glib/gi18n.h>. For example under "clients/" directory.
* libnm-core: add multicast-snooping property to bridge settingJiří Klimeš2015-02-261-0/+51
|
* bridge: Properly check range of STP properties (rh #1160815)Lubomir Rintel2015-01-091-1/+9
| | | | | | If zero is out of range, only allow it when STP is disabled. https://bugzilla.redhat.com/show_bug.cgi?id=1160815
* libnm: Override parts of nm-setting-docs.xmlDan Winship2014-11-191-0/+8
| | | | | | | | | | | Add "---dbus---" sections to the NMSetting property docs, in the same style as the plugin docs, parse them out into a file "nm-setting-docs-overrides.xml", and use them to override the GObject property docs in nm-setting-docs.xml. This lets us put more D-Bus-specific information in the setting docs, without cluttering up the property docs, and it also lets us document dbus-only properties.
* libnm, libnm-util: move settings doc generation to libnm-coreDan Winship2014-11-191-0/+63
| | | | | | | | | | | | | | | | | | | | | Move the settings/plugins doc generation from libnm-util to libnm-core, since libnm-util isn't being updated for all new properties. With this commit, the keyfile and ifcfg-rh documentation is basically unchanged, except that deprecated properties are now gone, and new properties have been added, and the sections are in a different order. (generate-plugin-docs.pl just outputs the settings in Makefile order, and they were unsorted in libnm-util, but are sorted in libnm-core). The settings documentation used for nm-settings.5, the D-Bus API docs, and the nmcli help is changed a bit more at this point, and mostly for the worse, since the libnm-core setting properties don't match up with the D-Bus API as well as the libnm-util ones do. To be fixed... (I also removed the "plugins docs" line in each plugin docs comment block while moving them, since those blocks will be used for more than just plugins soon, and it's sort of obvious anyway.)
* libnm*: fix library gettext usageDan Winship2014-11-131-1/+1
| | | | | | | | | | | | | | | | | Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _() will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than "gettext (string)" (which will use the program's default domain, which works fine for programs in the NetworkManager tree, but not for external users). Likewise, we need to call bindtextdomain() so that gettext can find the translations if the library is installed in a different prefix from the program using it (and bind_textdomain_codeset(), so it will know the translations are in UTF-8 even if the locale isn't). (The fact that no one noticed this was broken before is because the libraries didn't really start returning useful translated strings much until 0.9.10, and none of the out-of-tree clients have been updated to actually show those strings to users yet.)
* all: consistently include config.hDan Winship2014-11-131-0/+2
| | | | | | | | | | | config.h should be included from every .c file, and it should be included before any other include. Fix that. (As a side effect of how I did this, this also changes us to consistently use "config.h" rather than <config.h>. To the extent that it matters [which is not much], quotes are more correct anyway, since we're talking about a file in our own build tree, not a system include.)
* libnm-core: make nm_setting_verify() take an NMConnectionDan Winship2014-10-281-3/+3
| | | | | | | | | nm_setting_verify() took a GSList of other NMSettings, but really it would just be simpler all around to pass the NMConnection instead... This means that several formerly NMSetting-branded functions that operated on lists-of-settings now get replaced with NMConnection-branded functions instead.
* libnm-core: canonicalize hardware addresses in settingsDan Winship2014-10-281-1/+2
| | | | | | Convert hardware addresses to canonical form (uppercase, leading zeros, colons) when setting them on/adding them to NMSetting properties.
* libnm-core: merge NMSetting*Error into NMConnectionErrorDan Winship2014-10-221-22/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each setting type was defining its own error type, but most of them had exactly the same three errors ("unknown", "missing property", and "invalid property"), and none of the other values was of much use programmatically anyway. So, this commit merges NMSettingError, NMSettingAdslError, etc, all into NMConnectionError. (The reason for merging into NMConnectionError rather than NMSettingError is that we also already have "NMSettingsError", for errors related to the settings service, so "NMConnectionError" is a less-confusable name for settings/connection errors than "NMSettingError".) Also, make sure that all of the affected error messages are localized, and (where appropriate) prefix them with the relevant property name. Renamed error codes: NM_SETTING_ERROR_PROPERTY_NOT_FOUND -> NM_CONNECTION_ERROR_PROPERTY_NOT_FOUND NM_SETTING_ERROR_PROPERTY_NOT_SECRET -> NM_CONNECTION_ERROR_PROPERTY_NOT_SECRET Remapped error codes: NM_SETTING_*_ERROR_MISSING_PROPERTY -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_*_ERROR_INVALID_PROPERTY -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_INVALID_SETTING NM_SETTING_BOND_ERROR_INVALID_OPTION -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_BOND_ERROR_MISSING_OPTION -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_CONNECTION_ERROR_SLAVE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_VLAN_ERROR_INVALID_PARENT -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING -> NM_CONNECTION_ERROR_MISSING_SETTING NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME -> NM_CONNECTION_ERROR_MISSING_PROPERTY NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP -> NM_CONNECTION_ERROR_INVALID_PROPERTY NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND -> NM_CONNECTION_ERROR_MISSING_PROPERTY Dropped error codes (were previously defined but unused): NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING
* libnm-core: change connection hash tables to variants in APIDan Winship2014-09-181-3/+3
| | | | | | | | | | In preparation for porting to GDBus, make nm_connection_to_dbus(), etc, represent connections as GVariants of type 'a{sa{sv}}' rather than as GHashTables-of-GHashTables-of-GValues. This means we're constantly converting back and forth internally, but this is just a stepping stone on the way to the full GDBus port, and all of that code will go away again later.
* libnm-core: drop the ability to verify settings from property overridesDan Winship2014-09-171-1/+1
| | | | | | | | | | | | | | | | | | It needs to be possible to deserialize a connection hash into an invalid NMConnection; in particular, AddAndActivateConnection() explicitly allows this. Previously, the SetFunc and NotSetFunc passed to _nm_setting_class_override_property() could return a verification error immediately, but this functionality has to go away if we're going to be able to deserialize invalid connections. That functionality was only used in the handling of invalid virtual interface names; reorganize how that code works so that NMSettingConnection does all of the verification itself. (The code to make sure that it returned the "correct" error domain in that case turned out to be irrelevant, since the setting error domains don't get serialized over D-Bus correctly anyway.)
* libnm-core: change all mac-address properties to G_TYPE_STRINGDan Winship2014-09-041-15/+16
| | | | | | | | | | Make all mac-address properties (including NMSettingBluetooth:bdaddr, NMSettingOlpcMesh:dhcp-anycast-addr, and NMSettingWireless:bssid) be strings, using _nm_setting_class_transform_property() to handle translating to/from binary form when dealing with D-Bus. Update everything accordingly for the change, and also add a test for transformed setting properties to test-general.
* libnm-core: drop NMParamSpecSpecialized, add nm_property_compare()Dan Winship2014-09-041-6/+5
| | | | | | | | | | | | | | | | | | | | NMParamSpecSpecialized existed basically to provide a version of GParamSpecBoxed that could compare dbus-glib-valued properties correctly. However, g_param_values_cmp() was only used by NM directly in one place (NMSetting's compare_property()), and we don't actually need to indirect through GParamSpec there; we could just call NMParamSpecSpecialized's value-comparison function directly. So, change all NMParamSpecSpecialized properties to GParamSpecBoxed, rename the _gvalues_compare() function it used to "nm_property_compare()", and use that from NMSetting. (g_param_values_cmp() also gets used internally by g_param_value_defaults(), but all NMParamSpecSpecialized properties have a default value of NULL, so GParamSpecBoxed's pointer-equality check will do the job just fine there.)
* libnm-core: drop :interface-name properties on virtual NMSetting typesDan Winship2014-09-041-45/+5
| | | | | | | | | | | | | Remove the virtual :interface-name properties and their getters, and use property overrides to do backward-compat handling when serializing/deserializing. Now when constructing an NMConnection from a hash, if the virtual property is set and the NMSettingConnection property isn't, then the override for NMSettingConnection:interface-name will set that property to the value of the virtual interface-name. And when converting an NMConnection to a hash, the overrides for the virtual properties will return the value of NMSettingConnection:interface-name.
* libnm-core: simplify _nm_register_setting(), register error types tooDan Winship2014-09-041-4/+1
| | | | | | | | Simplify the use of _nm_register_setting() by having it splice together various symbol names itself rather than requiring them to be specified explicitly, and extend it to also ensure that the type's corresponding error type is registered (allowing one to find it via g_type_from_name() if necessary).
* libnm-core: drop nm_{setting,connection}_get_virtual_iface_name()Dan Winship2014-09-041-9/+0
| | | | | | | | | | | | | | | | | | Since we enforce the fact that bond, bridge, team, and vlan interface-name properties match NMSettingConnection:interface-name, nm_connection_get_virtual_iface_name() can be replaced with nm_connection_get_interface_name() basically everywhere. The one place this doesn't work is with InfiniBand partitions (where get_virtual_iface_name() was actually computing the name), but for the most part we only need to care about the interface names of InfiniBand partitions in places where we also already need to do some other InfiniBand-specific handling as well, so we can use an InfiniBand-specific method (nm_setting_infiniband_get_virtual_interface_name()) to get it. (Also, while updating nm_device_get_virtual_device_description(), fix it to handle InfiniBand partitions too.)
* libnm-core: include ETH_ALEN/INFINIBAND_ALEN defines in nm-utils.hDan Winship2014-08-071-1/+0
| | | | | | | | Include <linux/if_ether.h> and <linux/if_infiniband.h> from nm-utils.h, to get ETH_ALEN and INFINIBAND_ALEN, and remove those includes (as well as <net/ethernet.h> and <netinet/ether.h>, and various headers that had been included to get the ARPHRD_* constants) from other files where they're not needed now.
* libnm: add NetworkManager.h, disallow including individual headersDan Winship2014-08-011-1/+0
| | | | | | | | | | Add NetworkManager.h, which includes all of the other NM header, and require all external users of libnm to use that rather than the individual headers. (An exception is made for nm-dbus-interface.h, nm-vpn-dbus-interface.h, and nm-version.h, which can be included separately.)
* libnm: remove Since tags and NM_AVAILABLE_IN_* attributesDan Winship2014-08-011-38/+0
| | | | Everything currently in libnm has always been there.
* libnm: add libnm/libnm-core (part 1)Dan Winship2014-08-011-0/+576
This commit begins creating the new "libnm", which will replace libnm-util and libnm-glib. The main reason for the libnm-util/libnm-glib split is that the daemon needs to link to libnm-util (to get NMSettings, NMConnection, etc), but can't link to libnm-glib (because it uses many of the same type names as the NetworkManager daemon. eg, NMDevice). So the daemon links to only libnm-util, but basically all clients link to both. With libnm, there will be only a single client-visible library, and NetworkManager will internally link against a private "libnm-core" containing the parts that used to be in libnm-util. (The "libnm-core" parts still need to be in their own directory so that the daemon can see those header files without also seeing the ones in libnm/ that conflict with its own headers.) [This commit just copies the source code from libnm-util/ to libnm-core/, and libnm-glib/ to libnm/: mkdir -p libnm-core/tests/ mkdir -p libnm/tests/ cp libnm-util/*.[ch] libnm-util/nm-version.h.in libnm-core/ rm -f libnm-core/nm-version.h libnm-core/nm-setting-template.[ch] libnm-core/nm-utils-enum-types.[ch] cp libnm-util/tests/*.[ch] libnm-core/tests/ cp libnm-glib/*.[ch] libnm/ rm -f libnm/libnm_glib.[ch] libnm/libnm-glib-test.c libnm/nm-glib-enum-types.[ch] cp libnm-glib/tests/*.[ch] libnm/tests/ ]