1. 19 Nov, 2014 1 commit
    • Dan Winship's avatar
      libnm, libnm-util: move settings doc generation to libnm-core · c1448698
      Dan Winship authored
      Move the settings/plugins doc generation from libnm-util to
      libnm-core, since libnm-util isn't being updated for all new
      properties.
      
      With this commit, the keyfile and ifcfg-rh documentation is basically
      unchanged, except that deprecated properties are now gone, and new
      properties have been added, and the sections are in a different order.
      (generate-plugin-docs.pl just outputs the settings in Makefile order,
      and they were unsorted in libnm-util, but are sorted in libnm-core).
      
      The settings documentation used for nm-settings.5, the D-Bus API docs,
      and the nmcli help is changed a bit more at this point, and mostly for
      the worse, since the libnm-core setting properties don't match up with
      the D-Bus API as well as the libnm-util ones do. To be fixed...
      
      (I also removed the "plugins docs" line in each plugin docs comment
      block while moving them, since those blocks will be used for more than
      just plugins soon, and it's sort of obvious anyway.)
      c1448698
  2. 15 Nov, 2014 1 commit
    • Dan Winship's avatar
      libnm: add some missing (transfer) annotations · a41aff37
      Dan Winship authored
      All the old "const GByteArray" methods got changed to return a GBytes
      instead, but since they aren't declared "const" any more, we need to
      explicitly annotate them "(transfer none)".
      
      Also, the scanner apparently doesn't recognize that an (out)
      "const char **" is "(transfer none)", so annotate that in two places
      too
      a41aff37
  3. 13 Nov, 2014 2 commits
    • Dan Winship's avatar
      libnm*: fix library gettext usage · 53f5e9af
      Dan Winship authored
      Libraries need to include <gi18n-lib.h>, not <gi18n.h>, so that _()
      will get defined to "dgettext (GETTEXT_DOMAIN, string)" rather than
      "gettext (string)" (which will use the program's default domain, which
      works fine for programs in the NetworkManager tree, but not for
      external users). Likewise, we need to call bindtextdomain() so that
      gettext can find the translations if the library is installed in a
      different prefix from the program using it (and
      bind_textdomain_codeset(), so it will know the translations are in
      UTF-8 even if the locale isn't).
      
      (The fact that no one noticed this was broken before is because the
      libraries didn't really start returning useful translated strings much
      until 0.9.10, and none of the out-of-tree clients have been updated to
      actually show those strings to users yet.)
      53f5e9af
    • 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
  4. 07 Nov, 2014 1 commit
    • Dan Winship's avatar
      libnm, docs: docs fixes · cbabd135
      Dan Winship authored
      Update the docs build to include and exclude the correct files.
      
      Fill in some missing documentation, and fix problems in the existing
      docs. (In particular, "<" can't appear as a literal in documentation,
      so change it to "&lt;". Also, "PKCS#12" has to be written as
      "PKCS#<!-- -->12", or gtk-doc will think "#12" is a reference to a
      type named "12".)
      cbabd135
  5. 28 Oct, 2014 1 commit
    • Dan Winship's avatar
      libnm-core: make nm_setting_verify() take an NMConnection · 9e5c7d91
      Dan Winship authored
      nm_setting_verify() took a GSList of other NMSettings, but really it
      would just be simpler all around to pass the NMConnection instead...
      
      This means that several formerly NMSetting-branded functions that
      operated on lists-of-settings now get replaced with
      NMConnection-branded functions instead.
      9e5c7d91
  6. 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
  7. 03 Oct, 2014 1 commit
    • Dan Winship's avatar
      libnm: make use of GParamSpecFlags and GParamSpecEnum · fcfb4b40
      Dan Winship authored
      Make enum- and flags-valued properties use GParamSpecEnum and
      GParamSpecFlags, for better introspectability/bindability.
      
      This requires no changes outside libnm-core/libnm since the expected
      data size is still the same with g_object_get()/g_object_set(), and
      GLib will internally convert between int/uint and enum/flags GValues
      when using g_object_get_property()/g_object_set_property().
      fcfb4b40
  8. 18 Sep, 2014 1 commit
    • Dan Winship's avatar
      libnm-core: change connection hash tables to variants in API · acf86f68
      Dan Winship authored
      In preparation for porting to GDBus, make nm_connection_to_dbus(),
      etc, represent connections as GVariants of type 'a{sa{sv}}' rather
      than as GHashTables-of-GHashTables-of-GValues.
      
      This means we're constantly converting back and forth internally, but
      this is just a stepping stone on the way to the full GDBus port, and
      all of that code will go away again later.
      acf86f68
  9. 04 Sep, 2014 5 commits
    • Dan Winship's avatar
      libnm-core: change DBUS_TYPE_G_UCHAR_ARRAY properties to G_TYPE_BYTES · c43f8890
      Dan Winship authored
      Change all DBUS_TYPE_G_UCHAR_ARRAY properties to G_TYPE_BYTES, and
      update corresponding APIs. Notably, this means they are now refcounted
      rather than being copied.
      
      Update the rest of NM for the changes. The daemon still converts SSIDs
      to GByteArrays internally, because changing it to use GBytes has lots
      of trickle-down effects. It can possibly be changed later.
      c43f8890
    • Dan Winship's avatar
      libnm-core: replace GByteArray with pointer + length in some APIs · 3fbabde4
      Dan Winship authored
      APIs that take arbitrary data should take it in the form of a pointer
      and length, not a GByteArray, so that you can use them regardless of
      what format you have the data in (GByteArray, GBytes, plain array,
      etc).
      3fbabde4
    • 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: drop NMParamSpecSpecialized, add nm_property_compare() · ca9938f4
      Dan Winship authored
      NMParamSpecSpecialized existed basically to provide a version of
      GParamSpecBoxed that could compare dbus-glib-valued properties
      correctly.
      
      However, g_param_values_cmp() was only used by NM directly in one
      place (NMSetting's compare_property()), and we don't actually need to
      indirect through GParamSpec there; we could just call
      NMParamSpecSpecialized's value-comparison function directly.
      
      So, change all NMParamSpecSpecialized properties to GParamSpecBoxed,
      rename the _gvalues_compare() function it used to
      "nm_property_compare()", and use that from NMSetting.
      
      (g_param_values_cmp() also gets used internally by
      g_param_value_defaults(), but all NMParamSpecSpecialized properties
      have a default value of NULL, so GParamSpecBoxed's pointer-equality
      check will do the job just fine there.)
      ca9938f4
    • Dan Winship's avatar
      libnm-core: simplify _nm_register_setting(), register error types too · 40bb4028
      Dan Winship authored
      Simplify the use of _nm_register_setting() by having it splice
      together various symbol names itself rather than requiring them to be
      specified explicitly, and extend it to also ensure that the type's
      corresponding error type is registered (allowing one to find it via
      g_type_from_name() if necessary).
      40bb4028
  10. 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: 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
    • Thomas Haller's avatar
      libnm-util: fix warning converting between enum types in nm-setting-8021x.c · 22ca4690
      Thomas Haller authored
      clang warns:
      
          make[4]: Entering directory `./NetworkManager/libnm-util'
            CC       nm-setting-8021x.lo
          nm-setting-8021x.c:1824:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion]
                          *out_format = format;
                                      ~ ^~~~~~
          nm-setting-8021x.c:2135:17: error: implicit conversion from enumeration type 'NMCryptoFileFormat' to different enumeration type 'NMSetting8021xCKFormat' [-Werror,-Wenum-conversion]
                          *out_format = format;
                                      ~ ^~~~~~
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      22ca4690
  11. 15 Jul, 2014 2 commits
    • Dan Winship's avatar
      libnm-util, libnm-glib: whitespace fixes · 2570c5a1
      Dan Winship authored
      Fix indentation, kill trailing whitespace, split some long lines.
      2570c5a1
    • 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
  12. 19 Jun, 2014 4 commits
    • Dan Winship's avatar
      libnm-util: remove NMSetting* GParamSpec docs · cdc15cb2
      Dan Winship authored
      Remove all the GParamSpec docs, since everything now uses the gtk-doc
      docs instead, so there's no point in having two copies of each (which
      are often out of sync anyway).
      
      Since we're touching so many lines anyway, also fix up the indentation
      of the remaining property-installing lines, and add
      G_PARAM_STATIC_STRINGS to each paramspec (so the nick strings don't
      get strduped). Also, be consistent about starting a new line between
      "g_object_class_install_property" and its opening parenthesis.
      cdc15cb2
    • Dan Winship's avatar
      libnm-util: various NMSetting* property doc fixes/improvements · e8577083
      Dan Winship authored
      Fix up various issues with the docs for the NMSetting properties, and
      pull in text from the GParamSpec docs where the GParamSpec docs were
      better (or contained information that is necessary in the context of
      nm-settings.5).
      
      Also, consistently wrap all of the doc comments to the same width (80
      columns).
      e8577083
    • Dan Winship's avatar
      libnm-util: fix gtk-doc bugs in NMSetting* properties · 9de24b16
      Dan Winship authored
      Fix misused gtk-doc annotations and incorrectly-identified properties.
      
      In particular, the upcoming introspection-based generate-settings-spec
      expands macro and enum values, so if you use '%' where you should have
      used '#', it will fail to find an expansion, and error out.
      9de24b16
    • Dan Winship's avatar
      libnm-util, libnm-glib: be consistent about "Wi-Fi", "Ethernet", "InfiniBand" in docs · 8487a449
      Dan Winship authored
      We made the UIs consistent last year, but missed the documentation.
      Fix the docs to also consistently use "Wi-Fi" rather than "WiFi",
      "Wifi", "wifi", or "WiFI"; "Ethernet" rather than "ethernet"; and
      "InfiniBand" rather than "Infiniband".
      8487a449
  13. 12 May, 2014 1 commit
  14. 28 Feb, 2014 1 commit
  15. 25 Feb, 2014 2 commits
  16. 24 Feb, 2014 1 commit
  17. 12 Dec, 2013 1 commit
    • Thomas Haller's avatar
      libnm-util: refactor NMSetting name and register_settings · 9d319e6d
      Thomas Haller authored
      - refactor register_settings to allow lookup by GType and
        add the settings name to SettingInfo.
      
      - setting NM_SETTING_NAME is deprecated and should not be set anymore.
        Indeed it has always be a bug, to reset the name to a different value.
        The only valid place to set the name was in the _init() function of
        the derived class itself.
        This is now no longer needed/possible. Instead the name get's
        detected based on the registered setting types. This makes use of
        the registered metadata that is available anyway since every
        usable setting has to register itself.
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      9d319e6d
  18. 02 Dec, 2013 1 commit
  19. 24 Oct, 2013 1 commit
  20. 13 Jun, 2013 1 commit
  21. 29 May, 2013 1 commit
  22. 28 May, 2013 2 commits
  23. 03 May, 2013 1 commit
  24. 19 Apr, 2013 1 commit
    • Martin Pitt's avatar
      Use %NULL macro in doc strings · 57a9fb3c
      Martin Pitt authored
      Mass-converted "NULL" to "%NULL" in docstrings with
      
        find -name '*.c'| xargs sed -i '/^ \*.*[^%]NULL/ s/NULL\b/%NULL/g'
      57a9fb3c
  25. 26 Mar, 2013 1 commit
  26. 13 Mar, 2013 1 commit