1. 18 Apr, 2019 6 commits
    • Thomas Haller's avatar
      build/meson: rename "nm_core_dep" to "libnm_core_dep" · e7836cd1
      Thomas Haller authored
      The library is called "libnm_core". So the dependency should be called
      "libnm_core_dep", like in all other cases.
      
      (cherry picked from commit c27ad37c)
      e7836cd1
    • Thomas Haller's avatar
      shared: build helper "libnm-libnm-core-{intern|aux}.la" library for libnm-core · 284ac92e
      Thomas Haller authored
      "libnm-core" implements common functionality for "NetworkManager" and
      "libnm".
      
      Note that clients like "nmcli" cannot access the internal API provided
      by "libnm-core". So, if nmcli wants to do something that is also done by
      "libnm-core", , "libnm", or "NetworkManager", the code would have to be
      duplicated.
      
      Instead, such code can be in "libnm-libnm-core-{intern|aux}.la".
      Note that:
      
        0) "libnm-libnm-core-intern.la" is used by libnm-core itsself.
           On the other hand, "libnm-libnm-core-aux.la" is not used by
           libnm-core, but provides utilities on top of it.
      
        1) they both extend "libnm-core" with utlities that are not public
           API of libnm itself. Maybe part of the code should one day become
           public API of libnm. On the other hand, this is code for which
           we may not want to commit to a stable interface or which we
           don't want to provide as part of the API.
      
        2) "libnm-libnm-core-intern.la" is statically linked by "libnm-core"
           and thus directly available to "libnm" and "NetworkManager".
           On the other hand, "libnm-libnm-core-aux.la" may be used by "libnm"
           and "NetworkManager".
           Both libraries may be statically linked by libnm clients (like
           nmcli).
      
        3) it must only use glib, libnm-glib-aux.la, and the public API
           of libnm-core.
           This is important: it must not use "libnm-core/nm-core-internal.h"
           nor "libnm-core/nm-utils-private.h" so the static library is usable
           by nmcli which couldn't access these.
      
      Note that "shared/nm-meta-setting.c" is an entirely different case,
      because it behaves differently depending on whether linking against
      "libnm-core" or the client programs. As such, this file must be compiled
      twice.
      
      (cherry picked from commit af07ed01)
      284ac92e
    • Thomas Haller's avatar
      shared: move "nm-dbus-compat.h" header to "nm-std-aux/nm-dbus-compat.h" · 87f7e684
      Thomas Haller authored
      (cherry picked from commit 81833358)
      87f7e684
    • Thomas Haller's avatar
      shared: move most of "shared/nm-utils" to "shared/nm-glib-aux" · d984b2ce
      Thomas Haller authored
      From the files under "shared/nm-utils" we build an internal library
      that provides glib-based helper utilities.
      
      Move the files of that basic library to a new subdirectory
      "shared/nm-glib-aux" and rename the helper library "libnm-core-base.la"
      to "libnm-glib-aux.la".
      
      Reasons:
      
       - the name "utils" is overused in our code-base. Everything's an
         "utils". Give this thing a more distinct name.
      
       - there were additional files under "shared/nm-utils", which are not
         part of this internal library "libnm-utils-base.la". All the files
         that are part of this library should be together in the same
         directory, but files that are not, should not be there.
      
       - the new name should better convey what this library is and what is isn't:
         it's a set of utilities and helper functions that extend glib with
         funcitonality that we commonly need.
      
      There are still some files left under "shared/nm-utils". They have less
      a unifying propose to be in their own directory, so I leave them there
      for now. But at least they are separate from "shared/nm-glib-aux",
      which has a very clear purpose.
      
      (cherry picked from commit 80db06f7)
      d984b2ce
    • Thomas Haller's avatar
      shared: move udev helper to separate directory "shared/nm-udev-aux" · 95621586
      Thomas Haller authored
      We built (among others) two libraries from the sources in "shared/nm-utils":
      "libnm-utils-base.la" and "libnm-utils-udev.la".
      
      It's confusing. Instead use directories so there is a direct
      correspondence between these internal libraries and the source files.
      
      (cherry picked from commit 2973d682)
      95621586
    • Beniamino Galvani's avatar
      all: support bridge vlan ranges · da204257
      Beniamino Galvani authored
      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 70935157)
      da204257
  2. 12 Apr, 2019 1 commit
  3. 03 Apr, 2019 1 commit
  4. 27 Mar, 2019 6 commits
    • Thomas Haller's avatar
      6e6d1e07
    • Thomas Haller's avatar
      libnm: add NMIPRoutingRule API · 7fb23b0a
      Thomas Haller authored
      Add NMIPRoutingRule API with a few basic rule properties. More
      properties will be added later as we want to support them.
      
      Also, add to/from functions for string/GVariant representations.
      These will be needed to persist/load/exchange rules.
      
      The to-string format follows the `ip rule add` syntax, with the aim
      to be partially compatible. Full compatibility is not possible though,
      for various reasons (see code comment).
      7fb23b0a
    • Thomas Haller's avatar
      libnm/lldp: cleanup asserting for valid NMLldpNeighbor agument · 5b51a1a9
      Thomas Haller authored
      At a few places we checked whether neighbor->attrs was non-NULL.
      That is not necessary, unless we'd like to catch some dangling/invalid
      pointers. The attrs hash is always set otherwise.
      
      Instead of just dropping the check, add a NM_IS_LLDP_NEIGHBOR() macro
      (inline function).
      5b51a1a9
    • Thomas Haller's avatar
      libnm/lldp: fix leak and bug in nm_lldp_neighbor_dup() · 8db03191
      Thomas Haller authored
      For one, just reassigning copy->attrs leaks the previous
      hash table. Fix that.
      
      Also, NMLldpNeighbor instances are not immutable. I think that
      is an uglyness, and it would be preferable that they can be sealed.
      A sealed object could safely share/ref the internal hash-table. However,
      as it is, we cannot just have two NMLldpNeighbor instances share the
      same hash-table. Do a full copy.
      8db03191
    • Beniamino Galvani's avatar
      libnm: add nm_lldp_neighbor_get_attr_value() · 937796f6
      Beniamino Galvani authored
      The function provides access to the GVariant representing a LLDP
      attribute.
      937796f6
    • Beniamino Galvani's avatar
      libnm: make attribute name const in LLDP API functions · 8cdc011c
      Beniamino Galvani authored
      Add the const qualifier to the attribute name in LLDP API functions so
      that const strings and string literals are accepted. This change is
      backwards compatible for existing users of the API.
      8cdc011c
  5. 26 Mar, 2019 4 commits
  6. 25 Mar, 2019 1 commit
  7. 19 Mar, 2019 1 commit
    • Lubomir Rintel's avatar
      all: goodbye libnm-glib · 1de8383a
      Lubomir Rintel authored
      This removes libnm-glib, libnm-glib-vpn, and libnm-util for good.
      The it has been replaced with libnm since NetworkManager 1.0, disabled
      by default since 1.12 and no up-to-date distributions ship it for years
      now.
      
      Removing the libraries allows us to:
      
      * Remove the horrible hacks that were in place to deal with accidental use
        of both the new and old library in a single process.
      * Relief the translators of maintenance burden of similar yet different
        strings.
      * Get rid of known bad code without chances of ever getting fixed
        (libnm-glib/nm-object.c and libnm-glib/nm-object-cache.c)
      * Generally lower the footprint of the releases and our workspace
      
      If there are some really really legacy users; they can just build
      libnm-glib and friends from the NetworkManager-1.16 distribution. The
      D-Bus API is stable and old libnm-glib will keep working forever.
      
      https://github.com/NetworkManager/NetworkManager/pull/308
      1de8383a
  8. 15 Mar, 2019 2 commits
  9. 11 Mar, 2019 2 commits
  10. 07 Mar, 2019 8 commits
    • Benjamin Berg's avatar
      libnm: Fix reporting of unknown device types · 6b2aaba6
      Benjamin Berg authored
      nm_device_get_device_type would report the device type as it was send on
      DBus, while fetching the property would mean that only a known device
      types is reported.
      
      Make both results consistent by coercing in nm_device_get_device_type
      rather than when setting the property.
      
      (cherry picked from commit a6a185ba)
      6b2aaba6
    • Benjamin Berg's avatar
      core,wifi-p2p: Fix Wi-Fi P2P device type · 2d547059
      Benjamin Berg authored
      The device type was set to the GType rather than a new value in the
      NMDeviceType enum.
      
      Add the corresponding enum entry, fix the device type and set the
      routing priority to the same value as generic devices.
      
      (cherry picked from commit 8d9365a9)
      2d547059
    • Thomas Haller's avatar
      libnm: rename and expose nm_utils_base64secret_decode() in libnm · 0d178a96
      Thomas Haller authored
      A NetworkManager client requires an API to validate and decode
      a base64 secret -- like it is used by WireGuard. If we don't have
      this as part of the API, it's inconvenient. Expose it.
      
      Rename it from _nm_utils_wireguard_decode_key(), to give it a more
      general name.
      
      Also, rename _nm_utils_wireguard_normalize_key() to
      nm_utils_base64secret_normalize(). But this one we keep as internal
      API. The user will care more about validating and decoding the base64
      key. To convert the key back to base64, we don't need a public API in
      libnm.
      
      This is another ABI change since 1.16-rc1.
      
      (cherry picked from commit e46ba018)
      0d178a96
    • Benjamin Berg's avatar
      libnm: Fix reporting of unknown device types · a6a185ba
      Benjamin Berg authored
      nm_device_get_device_type would report the device type as it was send on
      DBus, while fetching the property would mean that only a known device
      types is reported.
      
      Make both results consistent by coercing in nm_device_get_device_type
      rather than when setting the property.
      a6a185ba
    • Benjamin Berg's avatar
      core,wifi-p2p: Fix Wi-Fi P2P device type · 8d9365a9
      Benjamin Berg authored
      The device type was set to the GType rather than a new value in the
      NMDeviceType enum.
      
      Add the corresponding enum entry, fix the device type and set the
      routing priority to the same value as generic devices.
      8d9365a9
    • Thomas Haller's avatar
      libnm: rename and expose nm_utils_base64secret_decode() in libnm · e46ba018
      Thomas Haller authored
      A NetworkManager client requires an API to validate and decode
      a base64 secret -- like it is used by WireGuard. If we don't have
      this as part of the API, it's inconvenient. Expose it.
      
      Rename it from _nm_utils_wireguard_decode_key(), to give it a more
      general name.
      
      Also, rename _nm_utils_wireguard_normalize_key() to
      nm_utils_base64secret_normalize(). But this one we keep as internal
      API. The user will care more about validating and decoding the base64
      key. To convert the key back to base64, we don't need a public API in
      libnm.
      
      This is another ABI change since 1.16-rc1.
      e46ba018
    • Marco Trevisan's avatar
      nm: Fix syntax on introspection annotations · b5bbf8ed
      Marco Trevisan authored
      Various annotations were added using multiple colons, while only one has
      to be added or g-ir-introspect will consider them part of the description
      
      !94
      (cherry picked from commit 73005fcf)
      b5bbf8ed
    • Marco Trevisan's avatar
      nm: Fix syntax on introspection annotations · 73005fcf
      Marco Trevisan authored
      Various annotations were added using multiple colons, while only one has
      to be added or g-ir-introspect will consider them part of the description
      
      !94
      73005fcf
  11. 05 Mar, 2019 4 commits
  12. 26 Feb, 2019 2 commits
  13. 22 Feb, 2019 2 commits