1. 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
      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
      * 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.
  2. 13 Mar, 2019 1 commit
    • Thomas Haller's avatar
      platform: add NMPRulesManager for syncing routing rules · b8398b9e
      Thomas Haller authored
      Routing rules are unlike addresses or routes not tied to an interface.
      NetworkManager thinks in terms of connection profiles. That works well
      for addresses and routes, as one profile configures addresses and routes
      for one device. For example, when activating a profile on a device, the
      configuration does not interfere with the addresses/routes of other
      devices. That is not the case for routing rules, which are global, netns-wide
      When one connection profile specifies rules, then this per-device configuration
      must be merged with the global configuration. And when a device disconnects later,
      the rules must be removed.
      Add a new NMPRulesManager API to track/untrack routing rules. Devices can
      register/add there the routing rules they require. And the sync method will
      apply the configuration. This is be implemented on top of NMPlatform's
      caching API.
  3. 07 Mar, 2019 2 commits
  4. 05 Mar, 2019 2 commits
  5. 22 Feb, 2019 1 commit
    • Thomas Haller's avatar
      libnm,cli: add NMSettingWireGuard · b521f426
      Thomas Haller authored
      For now only add the core settings, no peers' data.
      To support peers and the allowed-ips of the peers is more complicated
      and will be done later. It's more complicated because these are nested
      lists (allowed-ips) inside a list (peers). That is quite unusual and to
      conveniently support that in D-Bus API, in keyfile format, in libnm,
      and nmcli, is a effort.
      Also, it's further complicated by the fact that each peer has a secret (the
      preshared-key). Thus we probably need secret flags for each peer, which
      is a novelty as well (until now we require a fixed set of secrets per
      profile that is well known).
  6. 05 Feb, 2019 1 commit
  7. 01 Feb, 2019 2 commits
    • Thomas Haller's avatar
      wifi-p2p: rename Wi-Fi P2P · 09090f26
      Thomas Haller authored
      After renaming the files, also rename all the content
      to follow the "Wi-Fi P2P" naming scheme.
    • Thomas Haller's avatar
      wifi-p2p: rename files for consistent Wi-Fi P2P naming · 0420fa1f
      Thomas Haller authored
      We named the types inconsistently:
        - "p2p-wireless" ("libnm-core/nm-setting-p2p-wireless.h")
        - "p2p" ("libnm/nm-p2p-peer.h")
        - "p2p-wifi" ("src/devices/wifi/nm-device-p2p-wifi.h")
      It seems to me, "libnm/nm-p2p-peer.h" should be qualified with a "Wi-Fi"
      specific name. It's not just peer-to-peer, it's Wi-Fi P2P.
      Yes, there is an inconsistency now, because there is already
      It seems to me (from looking at the internet), that the name "Wi-Fi P2P"
      is more common than "P2P Wi-Fi" -- although both are used. There is also
      the name "Wi-Fi Direct". But it's not clear which name should be
      preferred here, so stick to "Wi-Fi P2P".
      In this first commit only rename the files. The following commit will
      rename the content.
  8. 27 Jan, 2019 4 commits
  9. 02 Jan, 2019 5 commits
    • Thomas Haller's avatar
      libnm: use "libnm-systemd-shared.a" in "libnm-core.la" (and "libnm.so") · c4512f83
      Thomas Haller authored
      It's not yet used, but it will be. We will need nm_sd_utils_unbase64mem()
      to strictly validate WireGuard settings, which contain keys in base64 encoding.
      Note that we also need a stub implementation for logging. This will do
      nothing for all logging from "libnm-systemd-shared.a". This makes
      sense because "libnm.so" as a library should not log directly. Also,
      "libnm.so" will only use a small portion of "libnm-systemd-shared.a" which
      doesn't log anything. Thus this code is unused and dropped by the linker
      with "--gc-sections".
    • Thomas Haller's avatar
      systemd: move basic systemd library to shared/nm-utils · 2c537b9d
      Thomas Haller authored
      For better or worse, we already pull in large parts of systemd sources.
      I need a base64 decode implementation (because glib's g_base64_decode()
      cannot reject invalid encodings). Instead of coming up with my own or
      copy-paste if from somewhere, reuse systemd's unbase64mem().
      But for that, make systemd's basic bits an independent static library
      first because I will need it in libnm-core.
      This doesn't really change anything except making "libnm-systemd-core.la"
      an indpendent static library that could be used from "libnm-core". We
      shall still be mindful about which internal code of systemd we use, and only
      access functionality that is exposed via "systemd/nm-sd-utils-shared.h".
    • Thomas Haller's avatar
      systemd: drop workaround for missing C11 header <uchar.h> · 5f945adf
      Thomas Haller authored
      Now as we build as C11, we can us it.
    • Thomas Haller's avatar
      build: bump C standard to (gcc's) C11 · 066357aa
      Thomas Haller authored
      We already import systemd code which is C11. To get this even
      to build, we need workaround like patching import of <uchar.h>.
      Also, the libraries from c-util and nettools are C11. We cannot even
      compile them in C99 mode (and didn't do that either).
      It's time to bump the version. We need C11 from now on (or better: gcc's
      dialect of it).
      Also, note that since nettools/nacd is not optional, we could not even
      build NetworkManager without a C11 compiler. So, just use it everywhere.
    • Thomas Haller's avatar
      shared,core: move logging enums to header "shared/nm-utils/nm-logging-fwd.h" · ef53b47e
      Thomas Haller authored
      In core ("src/"), we use "nm-logging.h" for all logging. This dispatches
      for logging to syslog, glog or systemd-journald.
      If we want to log from a shared component under "shared/", we need to
      use a common logging function. Add "nm-utils/nm-logging-fwd.h" for
      forward declaring the used logging mechaism.
      The shared library will still need to link with "src/nm-logging.c"
      or an alternative implementation, depending on whether it is used
      inside core or not.
  10. 27 Dec, 2018 1 commit
    • Thomas Haller's avatar
      shared,core: add "nm-errno.h" · 943dcba5
      Thomas Haller authored
      This will be our extension on top of <errno.h>.
      We want to use (integer) error numbers, that can both
      contain native errors from <errno.h> and our own defines,
      both merge in one domain. That is, we will reserve a small
      range of integers for our own defines (that hopefully won't
      clash with errors from <errno.h>).
      We can use this at places where GError is too cumbersome to use.
      The advantage is, that our error numbers extend <errno.h> and can
      be mixed.
      This is what "src/platform/nm-netlink.h" already does with nl_errno(). Next,
      the netlink errors from there will be merged into "nm-errno.h".
      Also, platform has NMPlatformError, which are a distinct set of error
      numbers. But these work differently in the sense that negative values
      represent codes from <errno.h> and positive numbers are our own platform
      specific defines. NMPlatformError will also be merged into "nm-errno.h".
      "nm-errno.h" will unify the error handling of platform and netlink,
      making it more similar to what we are used to from systemd, and give
      room to extend it for our own purpose.
  11. 12 Dec, 2018 1 commit
  12. 01 Dec, 2018 2 commits
  13. 17 Nov, 2018 1 commit
    • Benjamin Berg's avatar
      core: Introduce helper class to track connection keep alive · 37e8c53e
      Benjamin Berg authored
      For P2P connections it makes sense to bind the connection to the status
      of the operation that is being done. One example is that a wifi display
      (miracast) P2P connection should be shut down when streaming fails for
      some reason.
      This new helper class allows binding a connection to the presence of a
      DBus path meaning that it will be torn down if the process disappears.
  14. 15 Nov, 2018 1 commit
  15. 12 Nov, 2018 2 commits
    • Thomas Haller's avatar
      build: create intermediate libraries of shared/nm-utils · 70c4e49c
      Thomas Haller authored
      Previously we would compile source files from shared/nm-utils
      multiple times. That not only slows down compilation, but it makes it
      confusing which project require exactly what.
      Most of the files in shared/nm-utils are a mixed bag of utility
      functions. Just build one libnm-utils-base library. Since the linker
      will throw away unused parts, there is no problem that not every user
      of libnm-utils-base needs everything.
      Also add libnm-utils-udev, which cannot be part of libnm-utils-base as
      it has an additional dependency on libudev.
    • Thomas Haller's avatar
      build: move code for shared libs in Makefile.am around · 06ccf3a6
      Thomas Haller authored
      Let's sort the code by the dependencies. The shared/ projects
      have the least dependencies. Move to the beginning.
  16. 25 Oct, 2018 2 commits
  17. 24 Oct, 2018 2 commits
  18. 23 Oct, 2018 1 commit
    • Thomas Haller's avatar
      core: add "nm-sd-utils.h" to access system internal helper · eece5aff
      Thomas Haller authored
      We have a fork of a lot of useful systemd helper code.
      However, until now we shyed away from using it aside from
      the bits that we really need.
      That means, although we have some really nice implementations
      in our source-tree, we didn't use them. Either we were missing
      them, or we had to re-implement them.
      Add "nm-sd-utils.h" header to very carefully make internal
      systemd API accessible to the rest of core.
      This is not intended as a vehicle to access all of internal
      API. Instead, this must be used with care, and only a hand picked
      selection of functions must be exposed. Use with caution, but where it
      makes sense.
  19. 18 Oct, 2018 2 commits
    • Thomas Haller's avatar
      shared/tests: add test for "shared/nm-utils" · dfdbd1b3
      Thomas Haller authored
      "shared/nm-utils" is a loose collection of utility functions.
      There is a certain aim that they can be used independently.
      However, they also rely on each other.
      Add a test that we can build a minimal shared library with
      these tools, independent of libnm-core.
    • Thomas Haller's avatar
      shared: move nm_utils_get_monotonic_timestamp*() to shared/nm-utils. · a6add817
      Thomas Haller authored
      This is independent functionality that only depends on linux API
      and glib.
      Note how "nm-logging" uses this for getting the timestamps. This
      makes "nm-logging.c" itself dependen on "src/nm-core-utils.c",
      for little reason.
  20. 12 Oct, 2018 1 commit
    • Michael Biebl's avatar
      systemd: don't make NetworkManager D-Bus activatable · 90f71c0f
      Michael Biebl authored
      If the NetworkManager daemon has been stopped manually we don't want it
      to be autostarted by a client request.
      [lkundrak@v3.sk: The auto-activation is probably more surprising than useful.
      Services that need NetworkManager API should depend on NetworkManager service
      I have no idea what purpose does the D-Bus service file serve nowadays,
      but it looks rather hacky (really, activating /bin/false) and the comment
      in it suggests that the autoactivating behavior was not intended anyway.
      Debian has been shipping this for quite some time and no complains have been
  21. 27 Sep, 2018 1 commit
    • Thomas Haller's avatar
      acd: make NMAcdManager no GObject · 7729555a
      Thomas Haller authored
      NMAcdManager is a rather simple instance.
      It does not need (thread-safe) ref-counting, in fact, having
      it ref-counted makes it slighly ugly that we connect a signal,
      but never bother to disconnect it (while the ref-counted instance
      could outlife the signal subscriber).
      We also don't need GObject signals. They have more overhead
      and are less type-safe than a regular function pointers. Signals
      would make sense, if there could be multiple independent listeners,
      but that just doesn't make sense.
      Implementing it as a plain struct is less lines of code, and less
      runtime over head.
      Also drop the possiblitiy to reset the NMAcdManager instance.
      It wasn't needed and I think it was buggy because it wouldn't
      reset the n-acd instance.
  22. 19 Sep, 2018 1 commit
  23. 18 Sep, 2018 3 commits
    • Lubomir Rintel's avatar
      initrd: add configuration generator · 9f960955
      Lubomir Rintel authored
      nm-initrd-generator scans the command line for options relevant to network
      configuration and creates configuration files for an early instance of
      NetworkManager run from the initial ramdisk during early boot.
    • Lubomir Rintel's avatar
      initrd: add command line parser · ecc074b2
      Lubomir Rintel authored
    • Lubomir Rintel's avatar
      initrd: add iBFT reader · b544f724
      Lubomir Rintel authored
      This is loosely based on nms-ibft-reader, but with some significant
      changes. Notably, it parses /sys/firmware/ibft directly instead of
      iscsiadm output.
      iscsiadm is not available on early boot (perhaps it's too large) and
      turns out that parsing sysfs directly is easier and more
      straightforwared anyways. A win-win situation.
      It is not useful alone, it's in a separate commit just for the sake of
      easier review.