1. 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
  2. 04 Sep, 2014 1 commit
    • 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
  3. 22 Aug, 2014 1 commit
    • Thomas Haller's avatar
      all: add nm-core-internal.h header · ef32da01
      Thomas Haller authored
      Add a header file to expose private utility functions from libnm-core
      that can be used by NetworkManager (core) and libnm.so. The header
      is also used to give privileged access to libnm-core. Since NM links
      statically, these functions are not exported and not part of public ABI.
      
      This also removes the NM_UTILS_PRIVATE_CALL() macro and libnm.so no
      longer exports nm_utils_get_private().
      
      Before, this functionality was partly declared in nm-utils-private.h.
      This was wrong because nm-utils-private.h is for functionality
      entirely private to libnm-core.
      Signed-off-by: Thomas Haller's avatarThomas Haller <thaller@redhat.com>
      ef32da01
  4. 16 Aug, 2014 1 commit
    • Dan Winship's avatar
      libnm-core, libnm, core: make NMConnection an interface · e1ba13a4
      Dan Winship authored
      The fact that NMRemoteConnection has to be an NMConnection and
      therefore can't be an NMObject means that it needs to reimplement bits
      of NMObject functionality (and likewise NMObject needs some special
      magic to deal with it). Likewise, we will need a daemon-side
      equivalent of NMObject as part of the gdbus port, and we would want
      NMSettingsConnection to be able to inherit from this as well.
      
      Solve this problem by making NMConnection into an interface, and
      having NMRemoteConnection and NMSettingsConnection implement it. (We
      use some hacks to keep the GHashTable of NMSettings objects inside
      nm-connection.c rather than having to be implemented by the
      implementations.)
      
      Since NMConnection is no longer an instantiable type, this adds
      NMSimpleConnection to replace the various non-D-Bus-based uses of
      NMConnection throughout the code. nm_connection_new() becomes
      nm_simple_connection_new(), nm_connection_new_from_hash() becomes
      nm_simple_connection_new_from_hash(), and nm_connection_duplicate()
      becomes nm_simple_connection_new_clone().
      e1ba13a4
  5. 01 Aug, 2014 3 commits
    • Thomas Haller's avatar
      833ff17c
    • Dan Winship's avatar
      libnm: rename NetworkManager.h and NetworkManagerVPN.h · 3ddce748
      Dan Winship authored
      "NetworkManager.h"'s name (and non-standard capitalization) suggest
      that it's some sort of high-level super-important header, but it's
      really just low-level D-Bus stuff. Rename it to "nm-dbus-interface.h"
      and likewise "NetworkManagerVPN.h" to "nm-vpn-dbus-interface.h"
      3ddce748
    • Dan Winship's avatar
      libnm: add libnm/libnm-core (part 2) · eedcf185
      Dan Winship authored
      This fixes up the code from the previous "clean" import, and adds
      build infrastructure.
      
      [There are two slightly orthogonal sets of changes in this patch.
      First, the files added in the previous commit were modified as followed:
      
        # Replace internal references to "libnm-util" and "libnm-glib" with "libnm"
        perl -pi -e 's/libnm-(util|glib)/libnm/;' libnm-core/*.[ch] libnm-core/tests/*.[ch] libnm/*.[ch] libnm/tests/*.[ch]
      
        # Fix includes of the enum-types files
        perl -pi -e 's/nm-utils-enum-types/nm-core-enum-types/;' libnm-core/*.[ch] libnm-core/tests/*.[ch] libnm/*.[ch] libnm/tests/*.[ch]
        perl -pi -e 's/nm-glib-enum-types/nm-enum-types/;' libnm/*.[ch] libnm/tests/*.[ch]
      
        # Fix some python example code
        perl -pi -e 's/import NMClient/import NM/;' -e 's/NMClient.Client\(\)/NM.Client()/;' libnm/nm-client.c
      
      Then, the build infrastructure was added (without further modifying
      any existing files in libnm-core or libnm.)
      
      Note: to regenerate libnm.ver after rebase:
        (head -2 libnm-util/libnm-util.ver; (grep -h '\s'nm_ libnm-util/libnm-util.ver libnm-glib/libnm-glib.ver | env LANG=C sort); tail -3 libnm-util/libnm-util.ver) > libnm/libnm.ver
      ]
      eedcf185