- 11 Dec, 2017 2 commits
-
-
Lubomir Rintel authored
Tailored to fit both nmcli and keyfile needs.
-
Lubomir Rintel authored
Tailored to fit both nmcli and keyfile needs.
-
- 06 Mar, 2017 1 commit
-
-
Beniamino Galvani authored
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.
-
- 06 Jan, 2017 2 commits
-
-
Lubomir Rintel authored
We don't use it internally and a better version exists. Not like we could drop it or anything.
-
Lubomir Rintel authored
Version of nm_utils_iface_valid_name() with error reporting.
-
- 20 Dec, 2016 1 commit
-
-
Thomas Haller authored
if (nm_utils_version () < NM_ENCODE_VERSION (1, 5, 0)) g_error ("Requires at least version 1.5.0");
-
- 14 Oct, 2016 1 commit
-
-
Beniamino Galvani authored
../libnm-core/nm-utils.c:4405: Warning: NM: nm_utils_is_json_object: unknown parameter 'str' in documentation comment, should be 'json' ../libnm-core/nm-connection.c:2208: Warning: NM: nm_connection_get_setting_proxy: return value: Missing (transfer) annotation
-
- 27 Sep, 2016 1 commit
-
-
Thomas Haller authored
Since we possibly already link against libjansson, we can also expose some helper utils which allows nmcli to do basic validation of JSON without requiring to duplicate the effort of using libjansson. Also, tighten up the cecks to ensure that we have a JSON object at hand. We are really interested in that and not of arrays or literals.
-
- 01 Dec, 2015 1 commit
-
-
Beniamino Galvani authored
Add function nm_utils_enum_get_values() which returns a string array containing the enum values. It can be used, for example, to build a list of allowed values for user.
-
- 25 Sep, 2015 1 commit
-
-
Thomas Haller authored
We want "nm-dbus-interface.h" to have no dependancy on libnm and glib. That way, it is usable for example in the QT examples without dragging in dependencies to glib. Also drop all the unneccessary include to "nm-dbus-interface.h", which we already get by directly or indirectly including "nm-core-types.h".
-
- 21 Aug, 2015 1 commit
-
-
Jiří Klimeš authored
nm_utils_wifi_2ghz_freqs() nm_utils_wifi_5ghz_freqs()
-
- 29 Jul, 2015 1 commit
-
-
Thomas Haller authored
-
- 24 Jul, 2015 1 commit
-
-
Beniamino Galvani authored
Add functions nm_utils_enum_to_str() and nm_utils_enum_from_str() which can be used to perform conversions between enum values and strings, passing the GType automatically generated for every enum by glib-mkenums.
-
- 21 Jan, 2015 1 commit
-
-
Dan Winship authored
The newly added bond mode APIs in nm-utils will be new in 1.2, so mark them as such in the headers and docs, move them to a new section in libnm.ver. Since we're adding the new section to libnm.ver, this also seems like a good time to bump the soname.
-
- 13 Jan, 2015 1 commit
-
-
Jiří Klimeš authored
-
- 05 Dec, 2014 1 commit
-
-
Thomas Haller authored
We now also use a similar function in VPN plugins. It makes sense to provide a generic implementation in libnm. Signed-off-by:
Thomas Haller <thaller@redhat.com> https://bugzilla.gnome.org/show_bug.cgi?id=740783
-
- 04 Dec, 2014 7 commits
-
-
Thomas Haller authored
-
Thomas Haller authored
Compare the results: perl -e 'use UUID::Tiny ":std"; print(uuid_to_string(create_uuid(UUID_V3, UUID_NS_DNS, "test"))."\n");' python -c 'from uuid import *; print(uuid3(UUID("6ba7b810-9dad-11d1-80b4-00c04fd430c8"), "test"))'
-
Thomas Haller authored
There are different types (variants) of UUIDs defined. Especially variants 3 and 5 are name based variants (rfc4122). The way we create our UUIDs in nm_utils_uuid_generate_from_string() however does not create them according to RFC and does not set the flags to indicate the variant. Modify the signature of nm_utils_uuid_generate_from_string() to accept a "uuid_type" argument, so that we later can add other algorithms without breaking API.
-
Thomas Haller authored
This makes the function also useful for non C-strings, non UTF-8-strings, and generic blobs.
-
Dan Winship authored
In general, we shouldn't end up with an unencrypted copy of a certificate key anyway, so this function ought to be unnecessary (or at least, not broadly useful enough to be in the public API). nm-applet's GConf migration tool needs it, but that will eventually go away, and until then it can just use libnm-util.
-
Dan Winship authored
Remove nm_utils_init() from the public API, and just do it as a constructor instead.
-
Dan Winship authored
It was a no-op anyway.
-
- 21 Nov, 2014 1 commit
-
-
Dan Winship authored
Add nm-utils methods to check if a file is a certificate or private key file. nm-applet currently has its own internal versions of these, but they ended up having to duplicate a bunch of logic that we already have in crypto.c.
-
- 07 Nov, 2014 4 commits
-
-
Dan Williams authored
Make the type return GBytes since most in-tree users want that. Allow the function to accept many more formats as valid hex, including bytes delimited by ':' and a leading '0x'.
-
Dan Winship authored
Add AddressData and RouteData properties to NMSettingIPConfig and NMIP[46]Config. These are like the existing "addresses" and "routes" properties, but using strings and containing additional attributes, like NMIPAddress and NMIPRoute. This only affects the D-Bus representations; there are no API changes to NMSettingIP{,4,6}Config or NMIP{4,6}Config as a result of this; the additional information is just added to the existing 'addresses' and 'routes' properties. NMSettingIP4Config and NMSettingIP6Config now always generate both old-style data ('addresses', 'address-labels', 'routes') and new-style data ('address-data', 'gateway', 'route-data') when serializing to D-Bus, for backward compatibility. When deserializing, they will fill in the 'addresses' and 'routes' properties from the new-style data if it is present (ignoring the old-style data), or from the old-style data if the new-style isn't present. The daemon-side NMIP4Config and NMIP6Config always emit changes for both 'Addresses'/'Routes' and 'AddressData'/'RouteData'. The libnm-side classes initially listen for changes on both properties, but start ignoring the 'Addresses' and 'Routes' properties once they know the daemon is also providing 'AddressData' and 'RouteData'.
-
Dan Winship authored
The gateway is a global property of the IPv4/IPv6 configuration, not an attribute of any particular address. So represent it as such in the API; remove the gateway from NMIPAddress, and add it to NMSettingIPConfig. Behind the scenes, the gateway is still serialized along with the first address in NMSettingIPConfig:addresses, and is deserialized from that if the settings dictionary doesn't contain a 'gateway' key. Adjust nmcli's interactive mode to prompt for IP addresses and gateway separately. (Patch partly from Jirka Klimeš.)
-
Dan Winship authored
Merge NMIP4Address and NMIP6Address into NMIPAddress, and NMIP4Route and NMIP6Route into NMIPRoute. The new types represent IP addresses as strings, rather than in binary, and so are address-family agnostic.
-
- 28 Oct, 2014 2 commits
-
-
Dan Winship authored
Add nm-core-types.h, typedefing all of the GObject types in libnm-core; this is needed so that nm-setting.h can reference NMConnection in addition to nm-connection.h referencing NMSetting. Removing the cross-includes from the various headers causes lots of fallout elsewhere. (In particular, nm-utils.h used to include nm-connection.h, which included every setting header, so any file that included nm-utils.h automatically got most of the rest of libnm-core without needing to pay attention to specifics.) Fix this up by including nm-core-internal.h from those files that are now missing includes.
-
Dan Winship authored
Add a helper function for converting hardware addresses to canonical form.
-
- 27 Sep, 2014 1 commit
-
-
Dan Winship authored
Add nm_utils_wifi_strength_bars(), which figures out whether the terminal can display graphical wifi strength bars, and converts a numerical value to the appropriate Unicode or ASCII characters. This also now takes into consideration the fact that the console font doesn't contain all of the necessary characters, so we can't display the graphical bars there. (rh #1131491)
-
- 18 Sep, 2014 2 commits
-
-
Dan Winship authored
Port libnm-core/libnm to GDBus. The NetworkManager daemon continues to use dbus-glib; the previously-added connection hash/variant conversion methods are now moved to NetworkManagerUtils (along with a few other utilities that are now only needed by the daemon code).
-
Dan Winship authored
-
- 04 Sep, 2014 1 commit
-
-
Dan Winship authored
APIs that take arbitrary data should take it in the form of a pointer and length, not a GByteArray, so that you can use them regardless of what format you have the data in (GByteArray, GBytes, plain array, etc).
-
- 16 Aug, 2014 2 commits
-
-
Dan Winship authored
The fact that NMRemoteConnection has to be an NMConnection and therefore can't be an NMObject means that it needs to reimplement bits of NMObject functionality (and likewise NMObject needs some special magic to deal with it). Likewise, we will need a daemon-side equivalent of NMObject as part of the gdbus port, and we would want NMSettingsConnection to be able to inherit from this as well. Solve this problem by making NMConnection into an interface, and having NMRemoteConnection and NMSettingsConnection implement it. (We use some hacks to keep the GHashTable of NMSettings objects inside nm-connection.c rather than having to be implemented by the implementations.) Since NMConnection is no longer an instantiable type, this adds NMSimpleConnection to replace the various non-D-Bus-based uses of NMConnection throughout the code. nm_connection_new() becomes nm_simple_connection_new(), nm_connection_new_from_hash() becomes nm_simple_connection_new_from_hash(), and nm_connection_duplicate() becomes nm_simple_connection_new_clone().
-
Dan Winship authored
Previously, src/nm-ip4-config.h, libnm/nm-ip4-config.h, and libnm-glib/nm-ip4-config.h all used "NM_IP4_CONFIG_H" as an include guard, which meant that nm-test-utils.h could not tell which of them was being included (and so, eg, if you tried to include nm-ip4-config.h in a libnm test, it would fail to compile because nm-test-utils.h was referring to symbols in src/nm-ip4-config.h). Fix this by changing the include guards in the non-API-stable parts of the tree: - libnm-glib/nm-ip4-config.h remains NM_IP4_CONFIG_H - libnm/nm-ip4-config.h now uses __NM_IP4_CONFIG_H__ - src/nm-ip4-config.h now uses __NETWORKMANAGER_IP4_CONFIG_H__ And likewise for all other headers. The two non-"nm"-prefixed headers, libnm/NetworkManager.h and src/NetworkManagerUtils.h are now __NETWORKMANAGER_H__ and __NETWORKMANAGER_UTILS_H__ respectively, which, while not entirely consistent with the general scheme, do still mostly make sense in isolation.
-
- 07 Aug, 2014 3 commits
-
-
Dan Winship authored
Add nm_utils_hwaddr_matches(), for comparing hardware addresses for equality, allowing either binary or ASCII hardware addresses to be passed, and handling the special rules for InfiniBand hardware addresses automatically. Update code to use it.
-
Dan Winship authored
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.
-
Dan Winship authored
Drop the arptype-based nm_utils_hwaddr funcs, and rename the length-based ones to no longer have _len in their names. This also switches nm_utils_hwaddr_atoba() to using a length rather than an arptype, and adds a length argument to nm_utils_hwaddr_valid() (making nm_utils_hwaddr_valid() now a replacement for nm_utils_hwaddr_aton() in some places, where we were only using aton() to do validity checking).
-
- 01 Aug, 2014 1 commit
-
-
Dan Winship authored
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.)
-