1. 02 Jan, 2019 1 commit
    • Thomas Haller's avatar
      keyfile: various refactoring and restructure nm_keyfile_read() · 269c15e8
      Thomas Haller authored
      - in nm_keyfile_read(), unify _read_setting() and
        _read_setting_vpn_secret() in they way they are called
        (that is, they no longer return any value and don't accept
        any arguments aside @info).
      
      - use cleanup attributes
      
      - use nm_streq() instead of strcmp().
      
      - wrap lines that have multiple statements or conditions.
      269c15e8
  2. 11 Jul, 2018 1 commit
    • Thomas Haller's avatar
      all: don't use gchar/gshort/gint/glong but C types · e1c7a2b5
      Thomas Haller authored
      We commonly don't use the glib typedefs for char/short/int/long,
      but their C types directly.
      
          $ git grep '\<g\(char\|short\|int\|long\|float\|double\)\>' | wc -l
          587
          $ git grep '\<\(char\|short\|int\|long\|float\|double\)\>' | wc -l
          21114
      
      One could argue that using the glib typedefs is preferable in
      public API (of our glib based libnm library) or where it clearly
      is related to glib, like during
      
        g_object_set (obj, PROPERTY, (gint) value, NULL);
      
      However, that argument does not seem strong, because in practice we don't
      follow that argument today, and seldomly use the glib typedefs.
      Also, the style guide for this would be hard to formalize, because
      "using them where clearly related to a glib" is a very loose suggestion.
      
      Also note that glib typedefs will always just be typedefs of the
      underlying C types. There is no danger of glib changing the meaning
      of these typedefs (because that would be a major API break of glib).
      
      A simple style guide is instead: don't use these typedefs.
      
      No manual actions, I only ran the bash script:
      
        FILES=($(git ls-files '*.[hc]'))
        sed -i \
            -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>\( [^ ]\)/\1\2/g' \
            -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>  /\1   /g' \
            -e 's/\<g\(char\|short\|int\|long\|float\|double\)\>/\1/g' \
            "${FILES[@]}"
      e1c7a2b5
  3. 08 Jan, 2018 1 commit
    • Thomas Haller's avatar
      build: refine the NETWORKMANAGER_COMPILATION define · 22ef6a50
      Thomas Haller authored
      Note that:
      
       - we compile some source files multiple times. Most notably those
         under "shared/".
      
       - we include a default header "shared/nm-default.h" in every source
         file. This header is supposed to setup a common environment by defining
         and including parts that are commonly used. As we always include the
         same header, the header must behave differently depending
         one whether the compilation is for libnm-core, NetworkManager or
         libnm-glib. E.g. it must include <glib/gi18n.h> or <glib/gi18n-lib.h>
         depending on whether we compile a library or an application.
      
      For that, the source files need the NETWORKMANAGER_COMPILATION #define
      to behave accordingly.
      
      Extend the define to be composed of flags. These flags are all named
      NM_NETWORKMANAGER_COMPILATION_WITH_*, they indicate which part of the
      build are available. E.g. when building libnm-core.la itself, then
      WITH_LIBNM_CORE, WITH_LIBNM_CORE_INTERNAL, and WITH_LIBNM_CORE_PRIVATE
      are available. When building NetworkManager, WITH_LIBNM_CORE_PRIVATE
      is not available but the internal parts are still accessible. When
      building nmcli, only WITH_LIBNM_CORE (the public part) is available.
      This granularily controls the build.
      22ef6a50
  4. 06 May, 2017 2 commits
    • Thomas Haller's avatar
      keyfile: fix handling unsupported characters in keys · f38878c9
      Thomas Haller authored
      vpn.data, bond.options, and user.data encode their values directly as
      keys in keyfile. However, keys for GKeyFile may not contain characters
      like '='.
      
      We need to escape such special characters, otherwise an assertion
      is hit on the server:
      
        $ nmcli connection modify "$VPN_NAME" +vpn.data 'aa[=value'
      
      Another example of encountering the assertion is when setting user-data key
      with an invalid character "my.this=key=is=causes=a=crash".
      
      (cherry picked from commit 8ef57d0f)
      f38878c9
    • Thomas Haller's avatar
      keyfile: fix handling unsupported characters in keys · 8ef57d0f
      Thomas Haller authored
      vpn.data, bond.options, and user.data encode their values directly as
      keys in keyfile. However, keys for GKeyFile may not contain characters
      like '='.
      
      We need to escape such special characters, otherwise an assertion
      is hit on the server:
      
        $ nmcli connection modify "$VPN_NAME" +vpn.data 'aa[=value'
      
      Another example of encountering the assertion is when setting user-data key
      with an invalid character "my.this=key=is=causes=a=crash".
      8ef57d0f
  5. 05 Jan, 2017 1 commit
  6. 03 Oct, 2016 1 commit
  7. 14 Feb, 2016 1 commit
  8. 12 Mar, 2015 2 commits
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      keyfile: copy read/writer files to libnm-core · 1fc9bc40
      Thomas Haller authored
      This is the first step to move keyfile to libnm. For now, only
      copy the files to make later changes nicer in git-history.
      
        /bin/cp src/settings/plugins/keyfile/reader.c libnm-core/nm-keyfile-reader.c
        /bin/cp src/settings/plugins/keyfile/reader.h libnm-core/nm-keyfile-reader.h
        /bin/cp src/settings/plugins/keyfile/utils.c  libnm-core/nm-keyfile-utils.c
        /bin/cp src/settings/plugins/keyfile/utils.h  libnm-core/nm-keyfile-utils.h
        /bin/cp src/settings/plugins/keyfile/writer.c libnm-core/nm-keyfile-writer.c
        /bin/cp src/settings/plugins/keyfile/writer.h libnm-core/nm-keyfile-writer.h
      1fc9bc40
  9. 23 Feb, 2015 1 commit
  10. 13 Jan, 2015 1 commit
    • Thomas Haller's avatar
      keyfile: cleanup logging · 5c2fa920
      Thomas Haller authored
      Log lines with a "keyfile:" prefix and show more information about
      the loaded connection. Especially printing the UUID is interesting.
      5c2fa920
  11. 17 Oct, 2014 1 commit
  12. 11 Apr, 2013 1 commit
  13. 15 Feb, 2011 1 commit
  14. 04 Feb, 2011 1 commit
  15. 10 Nov, 2010 1 commit
  16. 28 Feb, 2009 1 commit
  17. 03 Nov, 2008 1 commit
  18. 26 Jun, 2008 1 commit
  19. 19 Feb, 2007 1 commit
    • Tambet Ingo's avatar
      2007-02-19 Tambet Ingo <tambet@ximian.com> · 3dcd9d2d
      Tambet Ingo authored
      	* src/vpn-manager/nm-vpn-manager.c: Handle the DBUS state changes itself.
      	Handle device state changes and disconnect VPN if it's device deactivates.
      
      	* src/nm-dbus-nm.c: 
      	* src/nm-dbus-nm.h: 
      	* src/nm-dbus-device.c: 
      	* src/nm-dbus-device.c: 
      	* src/nm-dbus-net.c: 
      	* src/nm-dbus-net.h: Remove. All of it is implemented byt the new dbus API.
      
      	* src/NetworkManagerMain.h: Get rid of all but 3 properties of NMData.
      
      	* src/nm-device.c (nm_device_get_by_udi):
      	(nm_device_get_by_iface): Remove. This doesn't belong here and is already
      	implemented in the correct location (NMManager).
      	Rip out all the test_device stuff.
      
      	* src/NetworkManagerPolicy.c: Remove the leftover activation success and
      	failure handlers, it's all done by NMDevice already.
      
      	* src/NetworkManager.c: Move the signal handling here from nm-logging.c
      	Remove the iochannel hack to route the unix signals to the main thread since
      	we're not threaded anymore.
      
      	* src/NetworkManagerAP.c: Implement HWAddress property.
      
      	* src/NetworkManagerDbus.c: Remove the dbus signal sending code, it happens
      	automatically with dbus-glib.
      
      	* src/nm-netlink-monitor.c: 
      	* src/nm-netlink-monitor.h:
      		- Move it low in the class hierarchy, don't reference any NM types.
      		- Remove private data from the header.
      		- Use type safe checks in public API methods.
      		- Make it a singleton so we don't have to pass the single reference around.
      
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2339 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      3dcd9d2d
  20. 27 Feb, 2006 1 commit
  21. 11 Feb, 2005 1 commit
    • Dan Williams's avatar
      2005-02-11 Dan Williams <dcbw@redhat.com> · 1cc2f8c3
      Dan Williams authored
      	* dhcpcd/client.c
      		- (dhcp_init): only print out client ID and class ID if they are specified
      
      	* src/NetworkManagerDbus.[ch]
      	  src/nm-dbus-nm.[ch]
      	  src/nm-dbus-device.[ch]
      	  src/nm-dbus-net.[ch]
      		- Move NM, Device, and Net functions to separate files and use the
      			dbus method list stuff in NetworkManagerDbusUtils.c to do
      			method dispatching
      
      	* src/NetworkManagerDbusUtils.c
      		- Add new validate_method called before each dispatch (if present)
      			that can validate the method call
      
      	* src/NetworkManagerWireless.c
      		- (nm_wireless_qual_to_percent): Fix misplaced "!" that caused signal
      			levels never to be evaluated
      
      	Patch from j@bootlab.org
      	* src/NetworkManagerDevice.c
      		- Add typedef for "u64"
      
      	* src/backends/NetworkManagerDebian.c
      		- Copy in Dave Woodhouse's fixes for IPv6
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@438 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      1cc2f8c3
  22. 25 Aug, 2004 1 commit
  23. 05 Aug, 2004 2 commits
  24. 28 Jul, 2004 1 commit
    • Dan Williams's avatar
      2004-07-27 Dan Williams <dcbw@redhat.com> · b0d607f9
      Dan Williams authored
      	* Remove various Makefile.in files
      
      	* TODO
      		- Add some more items
      
      	* configure.in
      		- Add checks for OpenSSL/md5 headers and libs
      
      	* src/Makefile.am
      		- Use OpenSSL CFLAGS
      
      	* src/NetworkManagerAP.[ch]
      		- Remove 'stamp' functions, replace with 'invalid' functions
      			to support user cancelling WEP key entry
      
      	* src/NetworkManagerDbus.c
      		- Remove 'stamp' return functions
      		- Treat returned user key as a passphrase and convert to a WEP key,
      			but don't actually use the WEP key yet.  We use the returned user
      			key as a hexadecimal WEP key until we can figure out a UI for
      			passphrase-vs-hex key
      
      	* src/NetworkManagerWireless.[ch]
      		- Add passphrase-to-128bit-key function
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@28 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      b0d607f9
  25. 25 Jul, 2004 1 commit
    • Dan Williams's avatar
      2004-07-24 Dan Williams <dcbw@redhat.com> · 8ae95bf5
      Dan Williams authored
      	* src/NetworkManager.[ch]
      	  src/NetworkManagerDbus.[ch]
      	  src/NetworkManagerDevice.[ch]
      	  src/NetworkManagerPolicy.c
      	  src/NetworkManagerWireless.[ch]
      		- Add many more g_return_if_fail()/g_return_val_if_fail() checks
      		- Pass the NMData application data structure through all calls
      			that need it so we can get rid of nm_get_global_data()
      		- Change deallocation of the allowed_ap_list GSList in preparation
      			for not completely clearing it every time we get an update,
      			but instead getting incremental updates via GConf/dbus
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@20 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      8ae95bf5
  26. 06 Jul, 2004 1 commit
    • Dan Williams's avatar
      2004-07-05 Dan Williams <dcbw@redhat.com> · 019e2337
      Dan Williams authored
      	* dispatcher-daemon/NetworkManagerDispatcher.c
      		- A bit more descriptive state message
      		- Don't segfault when reading directory
      
      	* src/NetworkManager.h
      		- Remove NMData desired_ap member, its now
      			per-device rather than global
      
      	* src/NetworkManager.c
      		- Remove references to desired_ap
      		- Move the allowed AP list refresh stuff into a thread
      
      	* src/NetworkManagerDevice.c
      	  src/NetworkManagerDevice.h
      		- Each wireless device now has a "best ap"
      		- Make device activate/deactivate functions per-device
      		- Make wireless scanning per-device
      		- Add IPv4 address discover functions, stub IPv6 ones
      		- Move ethernet address validation functions to NetworkManagerUtils.c
      		- Add wireless access point accessor function
      		- Get/Set functions for "best ap"
      
      	* src/NetworkManagerPolicy.c
      		- Move activate/deactivate stuff into NetworkManagerDevice.c, per-device
      		- Deal with per-device "best ap" rather than data->desired_apa
      		- Implement allowed access point worker thread
      		- Add nm_policy_essid_is_allowed() function
      
      	* src/NetworkManagerUtils.c
      	  src/NetworkManagerUtils.h
      	  	- Add nm_ethernet_address_is_valid() function
      		- Add IPv4/IPv6 address get functions
      
      	* src/NetworkManagerWireless.c
      	  src/NetworkManagerWireless.h
      		- Move scanning stuff into NetworkManagerDevice.c, per-device
      
      
      git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@12 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
      019e2337
  27. 24 Jun, 2004 1 commit