1. 13 Dec, 2017 2 commits
    • Thomas Haller's avatar
      wifi: downgrade logging level and support reloading "wifi-backend" configuration · af6f2e49
      Thomas Haller authored
      NM_CONFIG_GET_DATA_ORIG is the configuration that was loaded the first time.
      NM_CONFIG_GET_DATA is the currently loaded one. Sometimes we want to always
      stick to the original configuration, if we don't support reloading the
      parameter (for example main.plugins, because it would be cumbersome to properly
      implementing loading/unloading setting plugins.
      
      In this case however, we can allow reloading the configuration just fine.
      Of course, this only matters, if the device appears after the configuration
      is reloaded, for example by reloading the driver.
      
      Also, don't log any warnings, unless necessary.
      af6f2e49
    • Andrew Zaborowski's avatar
      devices/wifi: Add the wifi-backend config option · 3967eca4
      Andrew Zaborowski authored
      Let the config file select between creating classes of NMDeviceWifi
      (for the usual wpa_supplicant based devices) and NMDeviceIwd depending
      on the new NetworkManager.conf setting.
      
      [bgalvani@redhat.com: fix leaking @backend in create_device()]
      3967eca4
  2. 21 Nov, 2016 1 commit
    • Thomas Haller's avatar
      build: don't add subdirectories to include search path but require qualified include · 44ecb415
      Thomas Haller authored
      Keep the include paths clean and separate. We use directories to group source
      files together. That makes sense (I guess), but then we should use this
      grouping also when including files. Thus require to #include files with their
      path relative to "src/".
      
      Also, we build various artifacts from the "src/" tree. Instead of having
      individual CFLAGS for each artifact in Makefile.am, the CFLAGS should be
      unified. Previously, the CFLAGS for each artifact differ and are inconsistent
      in which paths they add to the search path. Fix the inconsistency by just
      don't add the paths at all.
      44ecb415
  3. 11 Oct, 2016 2 commits
    • Thomas Haller's avatar
      device: make NMDeviceFactory a class instead of an interface · 18660604
      Thomas Haller authored
      An interface would make sense to allow the actual device-factory to inherit
      from another type.
      
      However, glib interfaces make code much harder to follow and less
      efficient. The device factory shall be a very simple type with meta data
      about supported device types and the ability to create device instances.
      There is no need to make this an interface implementation, instead just
      let the factories inherit from NM_TYPE_DEVICE_FACTORY directly.
      18660604
    • Thomas Haller's avatar
      logging: remove LOGD_HW alias for LOGD_PLATFORM · 64951f07
      Thomas Haller authored
      Since commit 1495853e, LOGD_HW is renamed to
      LOGD_PLATFORM. Remove the internal usage of the deprecated name.
      64951f07
  4. 04 Oct, 2016 1 commit
    • Thomas Haller's avatar
      core: refactor private data in "src" · 4d37f7a1
      Thomas Haller authored
      - use _NM_GET_PRIVATE() and _NM_GET_PRIVATE_PTR() everywhere.
      
      - reorder statements, to have GObject related functions (init, dispose,
        constructed) at the bottom of each file and in a consistent order w.r.t.
        each other.
      
      - unify whitespaces in signal and properties declarations.
      
      - use NM_GOBJECT_PROPERTIES_DEFINE() and _notify()
      
      - drop unused signal slots in class structures
      
      - drop unused header files for device factories
      4d37f7a1
  5. 03 Oct, 2016 1 commit
  6. 24 Feb, 2016 1 commit
  7. 19 Feb, 2016 1 commit
    • Thomas Haller's avatar
      all: cleanup includes and let "nm-default.h" include "config.h" · 8bace23b
      Thomas Haller authored
      - All internal source files (except "examples", which are not internal)
        should include "config.h" first. As also all internal source
        files should include "nm-default.h", let "config.h" be included
        by "nm-default.h" and include "nm-default.h" as first in every
        source file.
        We already wanted to include "nm-default.h" before other headers
        because it might contains some fixes (like "nm-glib.h" compatibility)
        that is required first.
      
      - After including "nm-default.h", we optinally allow for including the
        corresponding header file for the source file at hand. The idea
        is to ensure that each header file is self contained.
      
      - Don't include "config.h" or "nm-default.h" in any header file
        (except "nm-sd-adapt.h"). Public headers anyway must not include
        these headers, and internal headers are never included after
        "nm-default.h", as of the first previous point.
      
      - Include all internal headers with quotes instead of angle brackets.
        In practice it doesn't matter, because in our public headers we must
        include other headers with angle brackets. As we use our public
        headers also to compile our interal source files, effectively the
        result must be the same. Still do it for consistency.
      
      - Except for <config.h> itself. Include it with angle brackets as suggested by
        https://www.gnu.org/software/autoconf/manual/autoconf.html#Configuration-Headers
      8bace23b
  8. 11 Jan, 2016 1 commit
  9. 06 Jan, 2016 1 commit
  10. 10 Sep, 2015 1 commit
    • Dan Winship's avatar
      core: fix interface type names · 8e9f7820
      Dan Winship authored
      A GObject interface, like a class, has two different C types
      associated with it; the type of the "class" struct (eg, GObjectClass,
      GFileIface), and the type of instances of that class/interface (eg,
      GObject, GFile).
      
      NetworkManager was doing this wrong though, and using the same C type
      to point to both the interface's class struct and to instances of the
      interface. This ends up not actually breaking anything, since for
      interface types, the instance type is a non-dereferenceable dummy type
      anyway. But it's wrong, since if, eg, NMDeviceFactory is a struct type
      containing members "start", "device_added", etc, then you should not
      be using an NMDeviceFactory* to point to an object that does not
      contain those members.
      
      Fix this by splitting NMDeviceFactory into NMDeviceFactoryInterface
      and NMDeviceFactory; by splitting NMConnectionProvider into
      NMConnectionProviderInterface and NMConnectionProvider; and by
      splitting NMSettingsPlugin into NMSettingsPluginInterface and
      NMSettingsPlugin; and then use the right types in the right places.
      
      As a bonus, this also lets us now use G_DEFINE_INTERFACE.
      8e9f7820
  11. 31 Jul, 2015 1 commit
    • Dan Williams's avatar
      core: split device creation and device setup (bgo #737458) · e8139f56
      Dan Williams authored
      Future patches will create devices long before they are backed by
      kernel resources, so we need to split NMDevice object creation from
      actual setup based on the backing resources.
      
      This patch combines the NMDeviceFactory's new_link() and
      create_virtual_device_for_connection() class methods into a single
      create_device() method that simply creates an unrealized NMDevice
      object; this method is not expected to fail unless the device is
      supposed to be ignored.  This also means that the NMDevice
      'platform-device' property is removed, because a platform link
      object may not be available at NMDevice object creation time.
      
      After the device is created, it is then "realized" at some later
      time from a platform link (for existing/hardware devices via the
      realize() method) or from an NMConnection (for newly created software
      devices via the create_and_realize() NMDeviceClass methods).
      
      https://bugzilla.gnome.org/show_bug.cgi?id=737458
      e8139f56
  12. 06 May, 2015 2 commits
  13. 13 Nov, 2014 1 commit
    • Dan Winship's avatar
      all: consistently include config.h · 3bfb163a
      Dan Winship authored
      config.h should be included from every .c file, and it should be
      included before any other include. Fix that.
      
      (As a side effect of how I did this, this also changes us to
      consistently use "config.h" rather than <config.h>. To the extent that
      it matters [which is not much], quotes are more correct anyway, since
      we're talking about a file in our own build tree, not a system
      include.)
      3bfb163a
  14. 11 Sep, 2014 1 commit
    • Dan Williams's avatar
      core: move device factory type function into factory object · 00fe31f5
      Dan Williams authored
      In preparation for internal device types exposing factories too, it's
      easier to have the device type that the factory creates be returned
      by the factory object instead of the plugin, because internal device
      types don't have plugins.
      
      This requires that we create the factory objects earlier, which
      further requires that any operations that trigger signals must be
      moved out of each factory's construction path to a separate start()
      function.
      00fe31f5
  15. 23 Jul, 2014 1 commit
    • Dan Winship's avatar
      core: fill in nm-types.h, clean out other headers · b28f6526
      Dan Winship authored
      Clean up some of the cross-includes between headers (which made it so
      that, eg, if you included NetworkManagerUtils.h in a test program, you
      would need to build the test with -I$(top_srcdir)/src/platform, and if
      you included nm-device.h you'd need $(POLKIT_CFLAGS)) by moving all
      GObject struct definitions for src/ and src/settings/ into nm-types.h
      (which already existed to solve the NMDevice/NMActRequest circular
      references).
      
      Update various .c files to explicitly include the headers they used to
      get implicitly, and remove some now-unnecessary -I options from
      Makefiles.
      b28f6526
  16. 13 May, 2014 2 commits
    • Dan Williams's avatar
      devices: simplify plugin type checking · e62ac0d4
      Dan Williams authored
      Instead of having a GObject property and a factory function to get
      the plugin's device type, just use the factory function, since it
      always has to be around.
      e62ac0d4
    • Dan Williams's avatar
      wifi: make Wi-Fi support a plugin · 06e3c6d0
      Dan Williams authored
      Make Wi-Fi support a plugin using the new device factory interface.
      Provides a 7% size reduction in the core NM binary.
      
              Before    After
      NM:    1154104  1071992  (-7%)
      Wi-Fi:       0   110464
      
      (all results from stripped files)
      06e3c6d0
  17. 03 Mar, 2014 1 commit
  18. 05 Jun, 2013 2 commits
    • Dan Winship's avatar
      devices: make constructors take an NMPlatformLink · b322c0dc
      Dan Winship authored
      Rather than passing UDI, ifname, and driver name to the device
      constructors as separate arguments, just pass the NMPlatformLink
      instead and let it parse them out.
      
      Virtual types still take UDI and ifname separately, since we create
      fake NMDevices for them for autoactivating connections. That's weird
      in other ways too though, so perhaps this should be revisted.
      b322c0dc
    • Dan Winship's avatar
      platform: merge remaining NMUdevManager functionality into NMLinuxPlatform · 2fe8019a
      Dan Winship authored
      Merge the net-subsystem-monitoring functionality of NMUdevManager into
      NMLinuxPlatform (and kill NMUdevManager). NMLinuxPlatform now only
      emits link-added signals after udev processes the device, and uses
      udev attributes to further identify the device. NMManager now
      identifies devices solely based on the NMLinkType provided by the
      platform.
      2fe8019a
  19. 08 May, 2013 1 commit
  20. 13 Feb, 2013 1 commit
    • Dan Winship's avatar
      all: remove more pointless NULL checks · 08f04466
      Dan Winship authored
      GObject creation cannot normally fail, except for types that implement
      GInitable and take a GError in their _new() method. Some NM types
      override constructor() and return NULL in some cases, but these
      generally only happen in the case of programmer error (eg, failing to
      set a mandatory property), and so crashing is reasonable (and most
      likely inevitable anyway).
      
      So, remove all NULL checks after calls to g_object_new() and its
      myriad wrappers.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=693678
      08f04466
  21. 02 Dec, 2011 1 commit
    • Dan Williams's avatar
      core: add device factory infrastructure and make WiMAX a plugin · 20994597
      Dan Williams authored
      This allows us to package WiMAX separately so you can choose
      to install WiMAX or not.  For package-based distros you can now
      install libnm-device-plugin-wimax.so in a separate package that
      links to/requires the Intel WiMAX service instead of having the
      main NM package require it and pull it in by default.  This
      plugin infrastructure will be extended to other device types
      as well.
      20994597