1. 11 Dec, 2017 2 commits
  2. 06 Mar, 2017 1 commit
    • Beniamino Galvani's avatar
      libnm-core: add attribute parsing/format helpers · 93b3a478
      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.
  3. 06 Jan, 2017 2 commits
  4. 20 Dec, 2016 1 commit
  5. 14 Oct, 2016 1 commit
    • Beniamino Galvani's avatar
      libnm-core: fix documentation comments · 185f0085
      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
  6. 27 Sep, 2016 1 commit
    • Thomas Haller's avatar
      libnm: expose nm_utils_is_json_object() utility function · 32f78ae6
      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.
  7. 01 Dec, 2015 1 commit
  8. 25 Sep, 2015 1 commit
    • Thomas Haller's avatar
      libnm: don't include "nm-version.h" in "nm-dbus-interface.h" · c0852964
      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".
  9. 21 Aug, 2015 1 commit
  10. 29 Jul, 2015 1 commit
  11. 24 Jul, 2015 1 commit
    • Beniamino Galvani's avatar
      libnm-core: add enum conversion utilities · 8be98147
      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
  12. 21 Jan, 2015 1 commit
    • Dan Winship's avatar
      libnm: fix versioning on new APIs, bump soname · 6da3b3a5
      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
      Since we're adding the new section to libnm.ver, this also seems like
      a good time to bump the soname.
  13. 13 Jan, 2015 1 commit
  14. 05 Dec, 2014 1 commit
  15. 04 Dec, 2014 7 commits
  16. 21 Nov, 2014 1 commit
  17. 07 Nov, 2014 4 commits
    • Dan Williams's avatar
      libnm,core: enhance nm_utils_hexstr2bin() · 22762324
      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's avatar
      libnm-core, libnm, core: add AddressData and RouteData properties · d16905df
      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's avatar
      libnm-core: add NMSettingIPConfig:gateway, drop NMIPAddress:gateway · f17699f4
      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
      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's avatar
      libnm-core, all: merge IPv4 and IPv6 address/route types · 21c8a6b2
      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.
  18. 28 Oct, 2014 2 commits
    • Dan Winship's avatar
      libnm-core: add nm-core-types.h, remove cross-includes · b1087908
      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
    • Dan Winship's avatar
      libnm-core: add nm_utils_hwaddr_canonical() · 61e489a7
      Dan Winship authored
      Add a helper function for converting hardware addresses to canonical
  19. 27 Sep, 2014 1 commit
    • Dan Winship's avatar
      libnm-core: add nm_utils_wifi_strength_bars(), use it in nmcli and nmtui · e684f363
      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)
  20. 18 Sep, 2014 2 commits
  21. 04 Sep, 2014 1 commit
  22. 16 Aug, 2014 2 commits
    • Dan Winship's avatar
      libnm-core, libnm, core: make NMConnection an interface · e1ba13a4
      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
      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's avatar
      all: fix up multiple-include-guard defines · c81fb49a
      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
  23. 07 Aug, 2014 3 commits
    • Dan Winship's avatar
      libnm-core, etc: add nm_utils_hwaddr_matches() · 44b9a870
      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's avatar
      libnm-core: include ETH_ALEN/INFINIBAND_ALEN defines in nm-utils.h · 357efd26
      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's avatar
      libnm-core, etc: drop type-based hwaddr funcs, port to length-based ones · 35f36ba4
      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
  24. 01 Aug, 2014 1 commit
    • Dan Winship's avatar
      libnm: add NetworkManager.h, disallow including individual headers · d0b05b34
      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