1. 11 Jun, 2019 2 commits
    • Thomas Haller's avatar
      all: drop empty first line from sources · 87a73df9
      Thomas Haller authored
        git ls-files -z -- ':(exclude)src/settings/plugins/keyfile/tests/keyfiles' | xargs -0 -n1 sed -i '1 { /^$/d }'
      87a73df9
    • Thomas Haller's avatar
      all: drop emacs file variables from source files · c0e075c9
      Thomas Haller authored
      We no longer add these. If you use Emacs, configure it yourself.
      
      Also, due to our "smart-tab" usage the editor anyway does a subpar
      job handling our tabs. However, on the upside every user can choose
      whatever tab-width he/she prefers. If "smart-tabs" are used properly
      (like we do), every tab-width will work.
      
      No manual changes, just ran commands:
      
          F=($(git grep -l -e '-\*-'))
          sed '1 { /\/\* *-\*-  *[mM]ode.*\*\/$/d }'     -i "${F[@]}"
          sed '1,4 { /^\(#\|--\|dnl\) *-\*- [mM]ode/d }' -i "${F[@]}"
      
      Check remaining lines with:
      
          git grep -e '-\*-'
      
      The ultimate purpose of this is to cleanup our files and eventually use
      SPDX license identifiers. For that, first get rid of the boilerplate lines.
      c0e075c9
  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. 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
  4. 17 Aug, 2016 2 commits
    • Thomas Haller's avatar
      all: cleanup includes in header files · 0bdcab10
      Thomas Haller authored
      - don't include "nm-default.h" in header files. Every source file must
        include as first header "nm-default.h", thus our headers get the
        default include already implicitly.
      
      - we don't support compiling NetworkManager itself with a C++ compiler. Remove
        G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support
        users of libnm to use C++, thus they stay in public headers.
      
      (cherry picked from commit f19aff89)
      0bdcab10
    • Thomas Haller's avatar
      all: cleanup includes in header files · f19aff89
      Thomas Haller authored
      - don't include "nm-default.h" in header files. Every source file must
        include as first header "nm-default.h", thus our headers get the
        default include already implicitly.
      
      - we don't support compiling NetworkManager itself with a C++ compiler. Remove
        G_BEGIN_DECLS/G_END_DECLS from internal headers. We do however support
        users of libnm to use C++, thus they stay in public headers.
      f19aff89
  5. 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
  6. 24 Jul, 2015 1 commit
    • Dan Winship's avatar
      all: rename nm-glib-compat.h to nm-glib.h, use everywhere · 3452ee2a
      Dan Winship authored
      Rather than randomly including one or more of <glib.h>,
      <glib-object.h>, and <gio/gio.h> everywhere (and forgetting to include
      "nm-glib-compat.h" most of the time), rename nm-glib-compat.h to
      nm-glib.h, include <gio/gio.h> from there, and then change all .c
      files in NM to include "nm-glib.h" rather than including the glib
      headers directly.
      
      (Public headers files still have to include the real glib headers,
      since nm-glib.h isn't installed...)
      
      Also, remove glib includes from header files that are already
      including a base object header file (which must itself already include
      the glib headers).
      3452ee2a
  7. 22 Oct, 2014 1 commit
    • Dan Winship's avatar
      devices: drop device-type-specific error domains · fd7b9df4
      Dan Winship authored
      Most NMDevice types defined their own error domain but then never used
      it. A few did use their errors, but some of those errors are redundant
      with NMDeviceError, and others can be added to it.
      fd7b9df4
  8. 03 Sep, 2014 1 commit
  9. 16 Aug, 2014 1 commit
    • 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
      isolation.
      c81fb49a
  10. 13 May, 2014 1 commit
    • 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
  11. 05 Jun, 2013 1 commit
    • 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
  12. 20 May, 2013 2 commits
  13. 08 May, 2013 1 commit
  14. 12 Mar, 2012 1 commit
    • Dan Winship's avatar
      Fix names of error enum values · 54ef8f32
      Dan Winship authored
      When NM was registering all of its enum types by hand, it was using
      NamesLikeThis rather than the default names-like-this for the "nick"
      values. When we switched to using glib-mkenums, this resulted in
      dbus-glib using different strings for the D-Bus error names, causing
      compatibility problems.
      
      Fix this by using glib-mkenums annotations to manually fix all the
      enum values back to what they were before. (This can't be done in a
      more automated way, because the old names aren't 100% consistent. Eg,
      "UNKNOWN" frequently becomes "UnknownError" rather than just
      "Unknown".)
      54ef8f32
  15. 15 Feb, 2012 1 commit
    • Dan Winship's avatar
      Use glib-mkenums to generate enum types · 839eab55
      Dan Winship authored
      Rather than generating enum classes by hand (and complaining in each
      file that "this should really be standard"), use glib-mkenums.
      
      Unfortunately, we need a very new version of glib-mkenums in order to
      deal with NM's naming conventions and to fix a few other bugs, so just
      import that into the source tree temporarily.
      
      Also, to simplify the use of glib-mkenums, import Makefile.glib from
      https://bugzilla.gnome.org/654395.
      
      To avoid having to run glib-mkenums for every subdirectory of src/,
      add a new "generated" directory, and put the generated enums files
      there.
      
      Finally, use Makefile.glib for marshallers too, and generate separate
      ones for libnm-glib and NetworkManager.
      839eab55
  16. 21 Apr, 2010 1 commit
    • Dan Williams's avatar
      core: use ifindex instead of interface name in a lot of places · 34793c1f
      Dan Williams authored
      Where we can do so, let's use ifindex since that's actually unique
      and doesn't change when the interface name changes.  We already use
      ifindex in a bunch of places, and netlink *only* uses ifindex, so
      this will make it easier later when we move over to ifindexes fully.
      34793c1f
  17. 21 Jan, 2010 1 commit
  18. 05 Aug, 2009 1 commit