1. 03 Apr, 2019 1 commit
  2. 22 Feb, 2019 1 commit
  3. 19 Feb, 2019 1 commit
  4. 17 Mar, 2017 1 commit
  5. 09 Mar, 2017 1 commit
    • Thomas Haller's avatar
      include: use double-quotes to include our own headers · 831286df
      Thomas Haller authored
      In practice, this should only matter when there are multiple
      header files with the same name. That is something we try
      to avoid already, by giving headers a distinct name.
      
      When building NetworkManager itself, we clearly want to use
      double-quotes for including our own headers.
      But we also want to do that in our public headers. For example:
      
        ./a.c
          #include <stdio.h>
          #include <nm-1.h>
          void main() {
              printf ("INCLUDED %s/nm-2.h\n", SYMB);
          }
      
        ./1/nm-1.h
          #include <nm-2.h>
      
        ./1/nm-2.h
          #define SYMB "1"
      
        ./2/nm-2.h
          #define SYMB "2"
      
      $ cc -I./2 -I./1 ./a.c
      $ ./a.out
      INCLUDED 2/nm-2.h
      
      Exceptions to this are
        - headers in "shared/nm-utils" that include <NetworkManager.h>. These
          headers are copied into projects and hence used like headers owned by
          those projects.
        - examples/C
      831286df
  6. 30 Jun, 2016 1 commit
    • Thomas Haller's avatar
      all: make MAC address randomization algorithm configurable · 96cabbcb
      Thomas Haller authored
      For the per-connection settings "ethernet.cloned-mac-address"
      and "wifi.cloned-mac-address", and for the per-device setting
      "wifi.scan-rand-mac-address", we may generate MAC addresses using
      either the "random" or "stable" algorithm.
      
      Add new properties "generate-mac-address-mask" that allow to configure
      which bits of the MAC address will be scrambled.
      
      By default, the "random" and "stable" algorithms scamble all bits
      of the MAC address, including the OUI part and generate a locally-
      administered, unicast address.
      
      By specifying a MAC address mask, we can now configure to perserve
      parts of the current MAC address of the device. For example, setting
      "FF:FF:FF:00:00:00" will preserve the first 3 octects of the current
      MAC address.
      
      One can also explicitly specify a MAC address to use instead of the
      current MAC address. For example, "FF:FF:FF:00:00:00 68:F7:28:00:00:00"
      sets the OUI part of the MAC address to "68:F7:28" while scrambling
      the last 3 octects.
      Similarly, "02:00:00:00:00:00 00:00:00:00:00:00" will scamble
      all bits of the MAC address, except clearing the second-least
      significant bit. Thus, creating a burned-in address, globally
      administered.
      
      One can also supply a list of MAC addresses like
      "FF:FF:FF:00:00:00 68:F7:28:00:00:00 00:0C:29:00:00:00 ..." in which
      case a MAC address is choosen randomly.
      
      To fully scamble the MAC address one can configure
      "02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00".
      which also randomly creates either a locally or globally administered
      address.
      
      With this, the following macchanger options can be implemented:
      
        `macchanger --random`
         This is the default if no mask is configured.
         -> ""
         while is the same as:
         -> "00:00:00:00:00:00"
         -> "02:00:00:00:00:00 02:00:00:00:00:00"
      
        `macchanger --random --bia`
         -> "02:00:00:00:00:00 00:00:00:00:00:00"
      
        `macchanger --ending`
         This option cannot be fully implemented, because macchanger
         uses the current MAC address but also implies --bia.
         -> "FF:FF:FF:00:00:00"
            This would yields the same result only if the current MAC address
            is already a burned-in address too. Otherwise, it has not the same
            effect as --ending.
         -> "FF:FF:FF:00:00:00 <MAC_ADDR>"
            Alternatively, instead of using the current MAC address,
            spell the OUI part out. But again, that is not really the
            same as macchanger does because you explictly have to name
            the OUI part to use.
      
        `machanger --another`
        `machanger --another_any`
        -> "FF:FF:FF:00:00:00 <MAC_ADDR> <MAC_ADDR> ..."
           "$(printf "FF:FF:FF:00:00:00 %s\n" "$(sed -n 's/^\([0-9a-fA-F][0-9a-fA-F]\) \([0-9a-fA-F][0-9a-fA-F]\) \([0-9a-fA-F][0-9a-fA-F]\) .*/\1:\2:\3:00:00:00/p' /usr/share/macchanger/wireless.list | xargs)")"
      96cabbcb
  7. 05 May, 2016 1 commit
  8. 16 Oct, 2015 1 commit
  9. 04 Aug, 2015 1 commit
  10. 24 Jul, 2015 1 commit
  11. 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
      includes.
      b1087908
    • Dan Winship's avatar
      libnm-core: make _get_mac_address_blacklist() methods return arrays · dfcb2213
      Dan Winship authored
      Make nm_setting_wired_get_mac_address_blacklist() and
      nm_setting_wireless_get_mac_address_blacklist() return a char**,
      rather than a GSList.
      dfcb2213
  12. 22 Oct, 2014 1 commit
    • Dan Winship's avatar
      libnm-core: merge NMSetting*Error into NMConnectionError · 2d8e7bd2
      Dan Winship authored
      Each setting type was defining its own error type, but most of them
      had exactly the same three errors ("unknown", "missing property", and
      "invalid property"), and none of the other values was of much use
      programmatically anyway.
      
      So, this commit merges NMSettingError, NMSettingAdslError, etc, all
      into NMConnectionError. (The reason for merging into NMConnectionError
      rather than NMSettingError is that we also already have
      "NMSettingsError", for errors related to the settings service, so
      "NMConnectionError" is a less-confusable name for settings/connection
      errors than "NMSettingError".)
      
      Also, make sure that all of the affected error messages are localized,
      and (where appropriate) prefix them with the relevant property name.
      
      Renamed error codes:
      
      NM_SETTING_ERROR_PROPERTY_NOT_FOUND -> NM_CONNECTION_ERROR_PROPERTY_NOT_FOUND
      NM_SETTING_ERROR_PROPERTY_NOT_SECRET -> NM_CONNECTION_ERROR_PROPERTY_NOT_SECRET
      
      Remapped error codes:
      
      NM_SETTING_*_ERROR_MISSING_PROPERTY -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      NM_SETTING_*_ERROR_INVALID_PROPERTY -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_ERROR_PROPERTY_TYPE_MISMATCH -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_BLUETOOTH_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_INVALID_SETTING
      NM_SETTING_BOND_ERROR_INVALID_OPTION -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_BOND_ERROR_MISSING_OPTION -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      NM_SETTING_CONNECTION_ERROR_TYPE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
      NM_SETTING_CONNECTION_ERROR_SLAVE_SETTING_NOT_FOUND -> NM_CONNECTION_ERROR_MISSING_SETTING
      NM_SETTING_IP4_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_IP6_CONFIG_ERROR_NOT_ALLOWED_FOR_METHOD -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_VLAN_ERROR_INVALID_PARENT -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_WIRELESS_SECURITY_ERROR_MISSING_802_1X_SETTING -> NM_CONNECTION_ERROR_MISSING_SETTING
      NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_802_1X -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_WIRELESS_SECURITY_ERROR_LEAP_REQUIRES_USERNAME -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      NM_SETTING_WIRELESS_SECURITY_ERROR_SHARED_KEY_REQUIRES_WEP -> NM_CONNECTION_ERROR_INVALID_PROPERTY
      NM_SETTING_WIRELESS_ERROR_CHANNEL_REQUIRES_BAND -> NM_CONNECTION_ERROR_MISSING_PROPERTY
      
      Dropped error codes (were previously defined but unused):
      
      NM_SETTING_CDMA_ERROR_MISSING_SERIAL_SETTING
      NM_SETTING_CONNECTION_ERROR_IP_CONFIG_NOT_ALLOWED
      NM_SETTING_GSM_ERROR_MISSING_SERIAL_SETTING
      NM_SETTING_PPP_ERROR_REQUIRE_MPPE_NOT_ALLOWED
      NM_SETTING_PPPOE_ERROR_MISSING_PPP_SETTING
      NM_SETTING_SERIAL_ERROR_MISSING_PPP_SETTING
      NM_SETTING_WIRELESS_ERROR_MISSING_SECURITY_SETTING
      2d8e7bd2
  13. 04 Sep, 2014 2 commits
    • Dan Winship's avatar
      libnm-core: change list-of-string and array-of-string properties to G_TYPE_STRV · 6a4127cf
      Dan Winship authored
      Change all DBUS_TYPE_G_LIST_OF_STRING and DBUS_TYPE_G_ARRAY_OF_STRING
      properties to G_TYPE_STRV, and update everything accordingly.
      
      (This doesn't actually require using
      _nm_setting_class_transform_property(); dbus-glib is happy to transform
      between 'as' and G_TYPE_STRV.)
      6a4127cf
    • Dan Winship's avatar
      libnm-core: change all mac-address properties to G_TYPE_STRING · 3a54d050
      Dan Winship authored
      Make all mac-address properties (including NMSettingBluetooth:bdaddr,
      NMSettingOlpcMesh:dhcp-anycast-addr, and NMSettingWireless:bssid) be
      strings, using _nm_setting_class_transform_property() to handle
      translating to/from binary form when dealing with D-Bus.
      
      Update everything accordingly for the change, and also add a test for
      transformed setting properties to test-general.
      3a54d050
  14. 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
  15. 01 Aug, 2014 4 commits
    • 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
      separately.)
      d0b05b34
    • Dan Winship's avatar
      libnm: fix up class struct reserved slots · 2fc55941
      Dan Winship authored
      Add reserved slots to those classes that were missing them (or had run
      out), and sync up the number of slots across classes:
      
        - 8 slots for "important" classes, abstract base classes, and
          classes we expect we might need to add new virtual methods or
          signals to later.
      
        - 4 for everything else
      
      Also, rearrange the class elements in a few places into standard order
      (signals first, then methods).
      2fc55941
    • Dan Winship's avatar
      libnm: remove Since tags and NM_AVAILABLE_IN_* attributes · b4ae6eae
      Dan Winship authored
      Everything currently in libnm has always been there.
      b4ae6eae
    • Dan Winship's avatar
      libnm: add libnm/libnm-core (part 1) · d595f784
      Dan Winship authored
      This commit begins creating the new "libnm", which will replace
      libnm-util and libnm-glib.
      
      The main reason for the libnm-util/libnm-glib split is that the daemon
      needs to link to libnm-util (to get NMSettings, NMConnection, etc),
      but can't link to libnm-glib (because it uses many of the same type
      names as the NetworkManager daemon. eg, NMDevice). So the daemon links
      to only libnm-util, but basically all clients link to both.
      
      With libnm, there will be only a single client-visible library, and
      NetworkManager will internally link against a private "libnm-core"
      containing the parts that used to be in libnm-util.
      
      (The "libnm-core" parts still need to be in their own directory so
      that the daemon can see those header files without also seeing the
      ones in libnm/ that conflict with its own headers.)
      
      [This commit just copies the source code from libnm-util/ to
      libnm-core/, and libnm-glib/ to libnm/:
      
        mkdir -p libnm-core/tests/
        mkdir -p libnm/tests/
        cp libnm-util/*.[ch] libnm-util/nm-version.h.in libnm-core/
        rm -f libnm-core/nm-version.h libnm-core/nm-setting-template.[ch] libnm-core/nm-utils-enum-types.[ch]
        cp libnm-util/tests/*.[ch] libnm-core/tests/
        cp libnm-glib/*.[ch] libnm/
        rm -f libnm/libnm_glib.[ch] libnm/libnm-glib-test.c libnm/nm-glib-enum-types.[ch]
        cp libnm-glib/tests/*.[ch] libnm/tests/
      
      ]
      d595f784
  16. 15 Jul, 2014 1 commit
    • Dan Winship's avatar
      libnm-util, libnm-glib: standardize copyright/license headers · cb7e1893
      Dan Winship authored
      - Remove list of authors from files that had them; these serve no
        purpose except to quickly get out of date (and were only used in
        libnm-util and not libnm-glib anyway).
      
      - Just say "Copyright", not "(C) Copyright" or "Copyright (C)"
      
      - Put copyright statement after the license, not before
      
      - Remove "NetworkManager - Network link manager" from the few files
        that contained it, and "libnm_glib -- Access network status &
        information from glib applications" from the many files that
        contained it.
      
      - Remove vim modeline from nm-device-olpc-mesh.[ch], add emacs modeline
        to files that were missing it.
      cb7e1893
  17. 28 Feb, 2014 1 commit
  18. 13 Feb, 2014 1 commit
    • Dan Winship's avatar
      libnm-util, libnm-glib: add versioned deprecation/availability macros · 9c4d86ee
      Dan Winship authored
      Add versioned NM_DEPRECATED_IN_* and NM_AVAILABLE_IN_* macros, and tag
      new/deprecated functions accordingly. (All currently-deprecated
      functions are assumed to have been deprecated in 0.9.10.)
      
      Add NM_VERSION_MIN_REQUIRED and NM_VERSION_MAX_ALLOWED macros which
      can be set to determine which versions will cause warnings.
      
      With the current settings, external consumers of the
      libnm-util/libnm-glib APIs will have MIN_REQUIRED and MAX_ALLOWED both
      set to NM_VERSION_0_9_8 by default, meaning they will get warnings
      about functions added in 0.9.10. NM internally sets
      NM_VERSION_MAX_ALLOWED to NM_VERSION_NEXT_STABLE to ensure that it is
      always allowed to use all APIs.
      9c4d86ee
  19. 07 May, 2013 1 commit
  20. 03 Apr, 2013 1 commit
  21. 01 Apr, 2013 1 commit
  22. 19 Mar, 2013 1 commit
  23. 15 Feb, 2013 1 commit
    • Dan Winship's avatar
      libnm-utils: add :carrier-detect properties · 5266e25e
      Dan Winship authored
      For settings corresponding to devices that have a :carrier property
      (ie bond, bridge, infiniband, vlan, and wired), add a :carrier-detect
      property specifying how that affects the connection:
      
        yes: The connection can only be activated when the device
            has carrier, and will be deactivated if the device loses
            carrier (for more than 4 seconds).
        no: The connection ignores carrier on the device; it can be
            activated when there is no carrier, and stays activated
            when carrier is lost.
        on-activate: The connection can only be activated when the
            device has carrier, but it will not be deactivated if the
            device loses carrier.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=688284
      5266e25e
  24. 27 Jul, 2012 1 commit
  25. 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
  26. 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
  27. 05 Jul, 2011 1 commit
  28. 30 Jun, 2011 1 commit
  29. 29 Jun, 2010 1 commit
    • Dan Williams's avatar
      core: handle s390 options more cleanly · 16bccfd6
      Dan Williams authored
      There are so many... so handle them as a table of key/value pairs
      instead of having separate functions for each one.  At the moment
      nothing but subchannels is used internally, but this allows plugins
      to preserve options that NM doesn't care about when reading/writing
      system configuration.
      16bccfd6
  30. 24 Jun, 2010 1 commit
  31. 22 Jun, 2010 1 commit
    • Jiří Klimeš's avatar
      core: MAC address spoofing/cloning (rh #447827) (bgo #553771) · 1b49f941
      Jiří Klimeš authored
      This commit implements MAC cloning feature in NetworkManager. To support that,
      'PermHwAddress' property is added into *.Device.Wired and *.Device.Wireless
      interfaces. The permanent MAC address is obtained when creating the device, and
      is used for 'locking' connections to the device. If a cloned MAC is specified
      in connection to be activated, the MAC is set to the interface in stage1. While
      disconecting, the permanent MAC is set back to the interface.
      1b49f941
  32. 18 Jun, 2010 1 commit
  33. 26 May, 2010 1 commit
  34. 30 Sep, 2009 1 commit
  35. 26 Oct, 2008 1 commit
    • Dan Williams's avatar
      2008-10-26 Dan Williams <dcbw@redhat.com> · fff2e85b
      Dan Williams authored
      	Patch from Tambet Ingo <tambet@gmail.com>
      
      	* libnm-util/libnm-util.ver
      	  libnm-util/nm-setting-wired.c
      	  libnm-util/nm-setting-wired.h
      		- Make properties private and add accessor functions
      
      	* src/nm-device-ethernet.c
      	  system-settings/plugins/ifcfg-fedora/nm-ifcfg-connection.c
      	  system-settings/plugins/ifcfg-suse/parser.c
      	  system-settings/src/main.c
      		- Use those accessors
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@4215 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      fff2e85b