summaryrefslogtreecommitdiff
path: root/libnm
Commit message (Collapse)AuthorAgeFilesLines
* libnm/nm-vpn-connection: un-deprecate the NMVpnStateReason use in a headerThomas Haller2017-03-201-0/+2
| | | | | Otherwise merely including a header would trigger a deprecation warhing. The signal slot is not really used anyway.
* libnm: fix memleak of GUdevDevice in get_bus_name()Thomas Haller2017-03-201-0/+1
| | | | Fixes: f7b1b2820245aff26da0c2c946b55752e91112e5
* doc: fix generate-setting-docs.py for supporting Python 3 sorted() styleThomas Haller2017-03-201-7/+4
| | | | | | Python 3 has no "cmp" argument to sorted(). Fixes: b0da972f5fa51608cca5837af9fe7094818204f8
* libnm: revert coercing NMVpnConnectionStateReason to ↵Thomas Haller2017-03-172-10/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMActiveConnectionStateReason NMVpnConnectionStateReason is no longer used and replaced by NMActiveConnectionStateReason. However, the old enums should stay in place as they were: Otherwise: #define NMVpnConnectionStateReason NMActiveConnectionStateReason causes compiler warnings: NMVpnConnectionStateReason x; x = NM_VPN_CONNECTION_STATE_REASON_UNKNOWN; // -Wenum-conversion if (x == NM_VPN_CONNECTION_STATE_REASON_NO_SECRETS) { } // -Wenum-compare Similarly, a user who didn't upgrade shall continue to get the old GType for NM_TYPE_VPN_CONNECTION_STATE_REASON. In practice, old users will have no issues using the old enum the places where it worked before. The only use of the deprecated enum is in vpn_state_changed() signal slot of NMVpnConnection. This makes the signal slot itself deprecated. However, NMVpnConnection is an NMObject and commonly created within libnm itself, not by the user. It is very unlikely that a user of libnm subclassed NMVpnConnection and makes use of the vpn_state_changed() signal slot. So, deprecate it without replacement. Fixes: a91369f80d44d1fc748fc3a9f5d9ef0fb566c77c
* libnm: fix chaining up NMActiveConnection::constructed()Thomas Haller2017-03-171-0/+2
| | | | Fixes: 40ffb962bec3700e447254d4a1cc93f21b8a25dd
* vpn-connection: use NMActiveConnectionStateReasonlr/active-connection-state-changedLubomir Rintel2017-03-171-1/+1
|
* libnm-core: drop NMVpnConnectionStateReasonLubomir Rintel2017-03-172-0/+9
| | | | | It's now the same as NMActiveConnectionStateReason. Keep a compatibility typedef and enum.
* fixup! libnm/active-connection: track reason for state changesLubomir Rintel2017-03-172-1/+13
|
* libnm/active-connection: track reason for state changesLubomir Rintel2017-03-174-15/+85
| | | | | | | | | Note that the reason tracking starts as soon as the object exists (which is immediately after GDBusObject is created), not when the asynchronous NMObject initialization finishes. That is so that we the reason changes in between are not lost. The vpn-connection should probably be doing the same.
* active-connection: emit a StateChanged signal on state changesLubomir Rintel2017-03-171-0/+1
| | | | | | | | It includes a reason code that makes it possible for the clients to be more reasonable about error messages. The reason code is essentially copied from the VPN, plus three more reasons that were useful for non-VPN connections.
* libnm/generate-setting-docs.py: include description attributeLubomir Rintel2017-03-171-3/+6
|
* doc: sort "connection" settings first in nm-settings manualLubomir Rintel2017-03-171-1/+9
|
* all: use nm_clear_g_cancellable()Thomas Haller2017-03-132-9/+2
|
* include: use double-quotes to include our own headersThomas Haller2017-03-0942-122/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In practice, this should only matter when there are multiple header files with the same name. That is something we try to avoid already, by giving headers a distinct name. When building NetworkManager itself, we clearly want to use double-quotes for including our own headers. But we also want to do that in our public headers. For example: ./a.c #include <stdio.h> #include <nm-1.h> void main() { printf ("INCLUDED %s/nm-2.h\n", SYMB); } ./1/nm-1.h #include <nm-2.h> ./1/nm-2.h #define SYMB "1" ./2/nm-2.h #define SYMB "2" $ cc -I./2 -I./1 ./a.c $ ./a.out INCLUDED 2/nm-2.h Exceptions to this are - headers in "shared/nm-utils" that include <NetworkManager.h>. These headers are copied into projects and hence used like headers owned by those projects. - examples/C
* all/trivial: unify construct-only property commentsThomas Haller2017-03-083-5/+5
| | | | | | | Unify marking GObject properties that are G_PARAM_CONSTRUCT_ONLY with a comment /* construct-only */
* libnm: add assertion to NMObject that a dbus-object is setThomas Haller2017-03-081-0/+2
| | | | | | | | | The libnm cache types don't have public _new() functions. However, such types can be easily created using g_object_new() directly from user code. Such a usage is not supported. Add an assertion that a valid dbus-object is present.
* libnm: chain up NMRemoteConnection::constructed() functionThomas Haller2017-03-071-0/+2
| | | | Fixes: 0fdd71fe6ece66a801f5ff66e0d26b7d26953c14
* libnm-core: define known route attribute names and validation functionBeniamino Galvani2017-03-061-0/+2
| | | | | | | | | | | | | | | This adds definition of a set of known route option attributes to libnm-core and helper functions. nm_ip_route_attribute_validate() performs the validation of the attribute type and, in case of a formatted string attribute, of its content. nm_ip_route_get_variant_attribute_spec() returns the attribute format specifier to be passed to nm_utils_parse_variant_attributes(). Since at the moment NMIPRoute is the only user of NMVariantAttributeSpec and the type is opaque to users of the library, the struct is extended to carry some other data useful for validation.
* libnm-core: add attribute parsing/format helpersBeniamino Galvani2017-03-061-0/+2
| | | | | | | | | | | Various libnm objects (addresses, routes) carry an hash table of attributes represented as GVariants indexed by name. Add common routines to convert to and from a string representation. To parse a string, a knowledge of the supported attributes (and their types) is needed: we represent it as an opaque type NMVariantAttributeSpec that callers must query to the library for the specific object type and pass to the parse function.
* libnm/manager: make sure the devices and acs won't notify manager after the ↵Lubomir Rintel2017-02-281-4/+4
| | | | | | manager is gone https://bugzilla.redhat.com/show_bug.cgi?id=1425838
* cli: support dummy connectionsBeniamino Galvani2017-02-221-1/+1
|
* core: add support for dummy devicesBeniamino Galvani2017-02-227-0/+146
| | | | | | | Add support for creating dummy devices. This commit adds a D-Bus interface 'org.freedesktop.NetworkManager.Device.Dummy' which is used primarily for determining the device type but does not carry any properties.
* libnm-core: add dummy connection settingBeniamino Galvani2017-02-222-0/+4
| | | | | The setting must be present in connections with type=dummy. It does not contain any property.
* libnm-core: add auth-timeout property to the 802.1x settingBeniamino Galvani2017-02-211-0/+1
| | | | | | | The property can be used to tune the authentication timeout. It's especially useful to speed up the failure in case the port doesn't support 802.1X and make NM try a different, non-authenticated connection.
* libnm-core/8021x: add phase1-auth-flags configuration itemsLeorize2017-02-201-0/+2
|
* libnm-core: add mtu property to cdma settingBeniamino Galvani2017-02-201-0/+1
|
* libnm-core: add mtu property to gsm settingBeniamino Galvani2017-02-201-0/+1
|
* libnm: disconnect signal from D-Bus proxies on disposeBeniamino Galvani2017-02-182-1/+17
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=778615
* core/8021x: add password properties for certificatesLubomir Rintel2017-02-171-0/+12
| | | | | | Useful for certificates that are stored on PKCS#11 tokens. We fail verification if someone tries tu specify a password for a blob or a flat file.
* all: use NM_CACHED_QUARK_FCN() to define cached quarksThomas Haller2017-02-101-9/+1
|
* all: use NM_CACHED_QUARK_FCN() instead of G_DEFINE_QUARK()Thomas Haller2017-02-101-1/+1
| | | | | | | | | | | | | | | | | | I think NM_CACHED_QUARK_FCN() is better because: - the implementation is in our hand, meaning it is clear that putting a "static" before NM_CACHED_QUARK_FCN() is guaranteed to work -- without relying on G_DEFINE_QUARK() to be defined in a way that this works (in fact, we currently never do that and instead make all functions non-static). - it does not construct function names by appending "_quark". Thus you can grep for the entire function name and finding the place where it is implemented. - same with the stings, where the new macro doesn't stringify the argument, which is less surpising. Again, now you can grep for the string including the double quoting. (yes, I really use grep to understand the source-code)
* all: cleanup switch fall-through comments for -Wimplicit-fallthrough warningThomas Haller2017-02-061-1/+1
| | | | | | | | | | The -Wimplicit-fallthrough=3 warning is quite flexible of accepting a fall-through warning. Some comments were missing or not detected correctly. Thereby, also change all other comments to follow the exact same pattern.
* libnm/object: lower the severity of the dangling object warningLubomir Rintel2017-01-191-1/+12
| | | | | | | The user can't do much about it and we can recover. This is a temporary measure to avoid unnecessarily bothering the user. (cherry picked from commit 7fec0755c9072dc37140a7b63b491ed02a3539cd)
* build: fix build with older giLubomir Rintel2017-01-191-0/+5
| | | | | Fixes: 6c96aafaa9a61ca4fe713551a4cd4b15fb7e8a63 (cherry picked from commit 22722b77322fb3ddc1a99509340e8175acddb154)
* build: make the doc generator find the right libnm.soLubomir Rintel2017-01-191-2/+14
| | | | | | | | At some point gobject-introspection added an API to add a library path and stopped honoring the LD_LIBRARY_PATH (a bug, according to GI documentation?). (cherry picked from commit 6c96aafaa9a61ca4fe713551a4cd4b15fb7e8a63)
* libnm: (trivial): add missing return description in comment blockJiří Klimeš2017-01-171-1/+1
|
* libnm-core: add NMSettingMacsecBeniamino Galvani2017-01-162-0/+14
| | | | | | | | | | The new NMSettingMacsec contains information necessary to establish a MACsec connection. At the moment we support two different MACsec modes, both using wpa_supplicant: PSK and EAP. PSK mode is based on a static CAK key for the MACsec key agreement protocol, while EAP mode derives keys from a 802.1x authentication and thus requires the presence of a NMSetting8021x in the connection.
* core,libnm: introduce NMDeviceMacsecBeniamino Galvani2017-01-166-0/+761
| | | | | At the moment the device only exposes the current link status, but cannot create new links.
* libnm-core/8021x: add pkcs11: scheme for certificates and keysLubomir Rintel2017-01-061-0/+6
| | | | The getters just return the whole URI as-is, without any mangling.
* libnm-core: add nm_utils_is_valid_iface_name()Lubomir Rintel2017-01-061-0/+1
| | | | Version of nm_utils_iface_valid_name() with error reporting.
* libnm: add nm_utils_version() function to query libnm version at runtimeThomas Haller2016-12-201-0/+1
| | | | | if (nm_utils_version () < NM_ENCODE_VERSION (1, 5, 0)) g_error ("Requires at least version 1.5.0");
* libnm/dns: fix memleak in demarshal_dns_configurationThomas Haller2016-12-141-0/+2
| | | | Fixes: a8d60052564371b530b8375716a9a0da77d22990
* libnm: implement support for DNS manager propertiesBeniamino Galvani2016-12-125-0/+758
|
* build: fix compilation with Python3mirh2016-11-291-2/+2
| | | | | | | | | has_key() has long been dropped https://docs.python.org/3.1/whatsnew/3.0.html#builtins Should still work with anything from 2.3 onwards https://github.com/NetworkManager/NetworkManager/pull/11
* agent: don't clear "error", g_simple_async_result_take_error() overtakes itJiří Klimeš2016-11-251-1/+0
| | | | | | | | | | | | | | | | | | | | From valgrind: ==21921== Invalid free() / delete / delete[] / realloc() ==21921== at 0x4C2CD5A: free (vg_replace_malloc.c:530) ==21921== by 0x81C4F2D: g_free (gmem.c:189) ==21921== by 0x81AB021: g_error_free (gerror.c:491) ==21921== by 0x81AB325: g_clear_error (gerror.c:674) ==21921== by 0x767B555: reg_request_cb (nm-secret-agent-old.c:616) ==21921== by 0x7A211F2: g_task_return_now (gtask.c:1107) ==21921== by 0x7A21228: complete_in_idle_cb (gtask.c:1121) ==21921== by 0x81BF6B9: g_main_dispatch (gmain.c:3154) ==21921== by 0x81BF6B9: g_main_context_dispatch (gmain.c:3769) ==21921== by 0x81BFA6F: g_main_context_iterate.isra.29 (gmain.c:3840) ==21921== by 0x81BFB1B: g_main_context_iteration (gmain.c:3901) ==21921== by 0x7A4748C: g_application_run (gapplication.c:2381) ==21921== by 0x118AEF: main (main.c:81) It caused memory corruption and may result in strange nm-applet crashes.
* libnm/vpn-service-plugin: transition to STOPPED state from INIT tooLubomir Rintel2016-11-241-0/+1
| | | | | We may want to stop the plugin before we started connecting e.g. when the plugin NeedsSecrets but we can't supply them.
* all: rename the introspection data to use the interface paths in namesLubomir Rintel2016-11-2310-16/+16
| | | | | | | | This makes it easier to install the files with proper names. Also, it makes the makefile rules slightly simpler. Lastly, the documentation is now generated into docs/api, which makes it possible to get rid of the awkward relative file names in docbook.
* libnm/generate-plugin-docs: don't replace newlines with spacesLubomir Rintel2016-11-211-1/+1
| | | | That serves no purpose whatsoever.
* libnm/generate-plugin-docs: drop YAML dependencyLubomir Rintel2016-11-211-24/+16
| | | | It makes little sense to produce a YAML and then decompose it.
* libnm/client: do not autostart the serviceLubomir Rintel2016-11-161-2/+2
| | | | | | | | | Apparently, the client is used by the services we depend on (firewalld), and an attempt to start the service would deadlock them. This was an accidental change anyway. Related firewalld change: https://github.com/t-woerner/firewalld/pull/171