1. 01 Aug, 2014 5 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
    • 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).
    • Dan Winship's avatar
      libnm, core, cli, tui: fix the capitalization of various types · 3ac0f528
      Dan Winship authored
      GLib/Gtk have mostly settled on the convention that two-letter
      acronyms in type names remain all-caps (eg, "IO"), but longer acronyms
      become initial-caps-only (eg, "Tcp").
      NM was inconsistent, with most long acronyms using initial caps only
      (Adsl, Cdma, Dcb, Gsm, Olpc, Vlan), but others using all caps (DHCP,
      PPP, PPPOE, VPN). Fix libnm and src/ to use initial-caps only for all
      three-or-more-letter-long acronyms (and update nmcli and nmtui for the
      libnm changes).
    • 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.
    • 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/
  2. 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.
  3. 30 Jun, 2014 3 commits
  4. 05 Mar, 2014 1 commit
  5. 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.)
      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
      always allowed to use all APIs.
  6. 27 Jan, 2014 1 commit
  7. 31 Oct, 2013 1 commit
  8. 15 Aug, 2013 2 commits
  9. 28 May, 2013 1 commit
  10. 07 May, 2013 1 commit
  11. 17 Apr, 2013 1 commit
  12. 03 Apr, 2013 1 commit
  13. 15 Feb, 2013 1 commit
    • Dan Winship's avatar
      core: Update device activation for :carrier-detect · feeafb8c
      Dan Winship authored
      Add a "need_carrier" argument to nm_device_is_available(), to allow
      distinguishing between "device is not available", "device is fully
      available", and "device is available except for not having carrier".
      Adjust various parts of NMDevice and NMManager to allow for the
      possibility of activating a connection with :carrier-detect = "no" on
      a device with no carrier, and to avoid auto-disconnecting devices with
      :carrier-detect = "on-activate".
  14. 30 Nov, 2012 2 commits
  15. 27 Jul, 2012 1 commit
  16. 18 May, 2012 1 commit
    • Pantelis Koukousoulas's avatar
      adsl: add libnm-glib and nmcli code · 8039dd30
      Pantelis Koukousoulas authored
      For the finale, this is the libnm-glib and nmcli part of the support,
      with this you can now make a full pppoatm connection from NetworkManager
      by configuring it in system scope in a keyfile.
      As an example, here is mine:
      (password and username snipped for obvious reasons)
      Extract from logs:
      NetworkManager[29155]: <info> Activation (ueagle-atm0) starting connection 'MYISP'
      NetworkManager[29155]: <info> (ueagle-atm0): device state change: disconnected -> prepare (reason 'none') [30 40 0]
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) scheduled...
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) started...
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) scheduled...
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 1 of 5 (Device Prepare) complete.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) starting...
      NetworkManager[29155]: <info> (ueagle-atm0): device state change: prepare -> config (reason 'none') [40 50 0]
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) successful.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) scheduled.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 2 of 5 (Device Configure) complete.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) started...
      NetworkManager[29155]: <info> (ueagle-atm0): device state change: config -> ip-config (reason 'none') [50 70 0]
      NetworkManager[29155]: <info> starting PPP connection
      NetworkManager[29155]: <debug> [1304671146.590156] [nm-ppp-manager.c:1047] nm_ppp_manager_start(): command line: /usr/sbin/pppd nodetach lock nodefaultroute user user@myisp.com plugin pppoatm.so 8.35 noipdefault noauth usepeerdns lcp-echo-failure 0 lcp-echo-interval 0 ipparam /org/freedesktop/NetworkManager/PPP/0 plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so
      NetworkManager[29155]: <info> pppd started with pid 29175
      NetworkManager[29155]: <debug> [1304671146.591235] [NetworkManagerUtils.c:816] nm_utils_get_proc_sys_net_value(): (ueagle-atm0): error reading /proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra: (4) Failed to open file '/proc/sys/net/ipv6/conf/ueagle-atm0/accept_ra': No such file or directory
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 3 of 5 (IP Configure Start) complete.
      Plugin pppoatm.so loaded.
      Plugin /opt/nmadsl/lib/pppd/2.4.5/nm-pppd-plugin.so loaded.
      ** Message: nm-ppp-plugin: (plugin_init): initializing
      ** Message: nm-ppp-plugin: (nm_phasechange): status 3 / phase 'serial connection'
      NetworkManager[29155]: <debug> [1304671146.612937] [nm-udev-manager.c:621] handle_uevent(): UDEV event: action 'add' subsys 'net' device 'ppp0'
      NetworkManager[29155]: <debug> [1304671146.613134] [nm-udev-manager.c:525] net_add(): ignoring interface with type 512
      NetworkManager[29155]: <debug> [1304671146.617308] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x1090
      Using interface ppp0
      Connect: ppp0 <--> 8.35
      ** Message: nm-ppp-plugin: (nm_phasechange): status 5 / phase 'establish'
      ** Message: nm-ppp-plugin: (nm_phasechange): status 6 / phase 'authenticate'
      ** Message: nm-ppp-plugin: (get_credentials): passwd-hook, requesting credentials...
      NetworkManager[29155]: <debug> [1304671149.639511] [nm-agent-manager.c:1044] nm_agent_manager_get_secrets(): Secrets requested for connection /org/freedesktop/NetworkManager/Settings/0 (adsl)
      NetworkManager[29155]: <debug> [1304671149.639684] [nm-settings-connection.c:717] nm_settings_connection_get_secrets(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets requested flags 0x1 hint 'password'
      NetworkManager[29155]: <debug> [1304671149.640950] [nm-agent-manager.c:959] get_start(): (0x9b4ad10/adsl) system settings secrets sufficient
      NetworkManager[29155]: <debug> [1304671149.641332] [nm-settings-connection.c:573] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) existing secrets returned
      NetworkManager[29155]: <debug> [1304671149.641541] [nm-settings-connection.c:579] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) secrets request completed
      NetworkManager[29155]: <debug> [1304671149.643074] [nm-settings-connection.c:618] agent_secrets_done_cb(): (34d04e69-fdd9-4231-af2c-25ed1f34dc1e/adsl:1) new agent secrets processed
      ** Message: nm-ppp-plugin: (get_credentials): got credentials from NetworkManager
      PAP authentication succeeded
      ** Message: nm-ppp-plugin: (nm_phasechange): status 8 / phase 'network'
      local  IP address
      remote IP address
      primary   DNS address
      secondary DNS address
      ** Message: nm-ppp-plugin: (nm_phasechange): status 9 / phase 'running'
      ** Message: nm-ppp-plugin: (nm_ip_up): ip-up event
      ** Message: nm-ppp-plugin: (nm_ip_up): sending Ip4Config to NetworkManager...
      NetworkManager[29155]: <debug> [1304671150.607440] [nm-netlink-monitor.c:117] link_msg_handler(): netlink link message: iface idx 35 flags 0x110D1
      NetworkManager[29155]: <info> PPP manager(IP Config Get) reply received.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) scheduled...
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) started...
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) scheduled...
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 4 of 5 (IP4 Configure Get) complete.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) started...
      NetworkManager[29155]: <debug> [1304671150.608918] [nm-system.c:222] sync_addresses(): (ppp0): syncing addresses (family 2)
      NetworkManager[29155]: <info> (ueagle-atm0): device state change: ip-config -> activated (reason 'none') [70 100 0]
      NetworkManager[29155]: <info> Policy set 'MYISP' (ppp0) as default for IPv4 routing and DNS.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) successful, device activated.
      NetworkManager[29155]: <info> Activation (ueagle-atm0) Stage 5 of 5 (IP Configure Commit) complete.
      Signed-off-by: default avatarPantelis Koukousoulas <pktoss@gmail.com>
  17. 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
  18. 16 Feb, 2012 1 commit
  19. 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
      To avoid having to run glib-mkenums for every subdirectory of src/,
      add a new "generated" directory, and put the generated enums files
      Finally, use Makefile.glib for marshallers too, and generate separate
      ones for libnm-glib and NetworkManager.
  20. 08 Dec, 2011 1 commit
    • Thomas Graf's avatar
      bonding: add nm_connection_get_virtual_iface_name() to abstract kernel interface binding · 1cd8d520
      Thomas Graf authored
      Some connection types such as bonding, bridging and VLAN require
      specific virtual kernel interfaces identified by name to be auto
      connected to the connection.
      The function nm_connection_get_virtual_iface_name() returns the name
      of the kernel interface if the connection type requires this
      Each connection base type settings class can implement the function
      get_virtual_iface_name() if the connection needs to be auto connected
      to a specific kernel interface.
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
  21. 06 Dec, 2011 1 commit
  22. 02 Dec, 2011 1 commit
  23. 10 Nov, 2011 1 commit
    • Thomas Graf's avatar
      bonding: settings parser for ifcfg plugin + NMSettingBond class · a2a0d788
      Thomas Graf authored
      Introduced a new TYPE=bond for ifcfg-rh configuration files.
      Alternatively BONDING_MASTER=yes can be specified instead of
      setting the type explicitely to maintain backwards compatibility
      with existing configuration files.
      Bonding device files require a DEVICE= line to be present which
      specifies the virtual bonding interface in the kernel. We do not
      allow auto-generation of the name in order to keep confusion to
      a minimum when reusing existing bonding interfaces.
      The BONDING_OPTS= parameter can be used to specify various bonding
      related options, such as:
        - mode
        - miimon
        - updelay
        - downdelay
        - arp_interval
        - arp_ip_target
      By default, the NMSettingBond class uses a miimon value of 100 which
      seems like a sensible default value for 99% of all configurations.
      If this is not suitable, an arp_ip_target needs to be specified
      A writer is not yet implemented.
      Changes v2:
       - renamed DeviceName property to InterfaceName
       - moved code to validate device name to dev_valid_name() for future use
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
  24. 27 Oct, 2011 1 commit
  25. 23 Aug, 2011 1 commit
  26. 16 Aug, 2011 2 commits
    • Dan Williams's avatar
      settings: preserve agent secrets the right way · 2b2404bb
      Dan Williams authored
      What we want to do here is keep separate caches of system and
      agent secrets.  For system secrets, we cache them because NM
      periodically clears secrets using nm_connection_clear_secrets() to
      ensure they don't stay around in memory, and that transient secrets
      get requested again when they are needed.  For agent secrets, we
      only want them during activation, but a connection read from disk
      will not include agent secrets becuase by definition they aren't
      stored in system settings along with the connection.  Thus we need
      to keep the agent/transient secrets somewhere for the duration of
      the activation to ensure they don't get deleted.
      This removes the copy-back hack in update_auth_cb() which copied
      agent/transient secrets back into the connection over top of the
      transient secrets that had been copied back in
      nm_settings_connection_replace_settings().  No reason to copy
      them twice if we keep an agent/transient secrets hash and do
      the right thing with it.
    • Dan Williams's avatar
      settings: preserve agent secrets over Update operation · e2d88f59
      Dan Williams authored
      The core problem was that the Update would trigger a write to
      disk to save the connection's new settings, which called
      nm_settings_connection_replace_settings().  Which saved existing
      transient (agent/unsaved) secrets, replaced settings with the
      new ones from Update(), then copied back the old transient
      secrets.  This was to ensure that changes triggered from getting
      agent secrets during activation (which might write the connection
      out to disk if new system secrets were provided, which triggered
      an inotify read-back of the connection, which blew away the
      transient secrets just returned from the agent) didn't blow away
      transient secrets.  Unfortunately that fix was too general.
      As a quick hack for now, copy the new secrets and re-apply them
      after nm_connection_replace_settings() has run.  We'll do the
      actual fix later, but it's more involved and needs more testing
      so we don't want to apply it this close to release.
  27. 28 Mar, 2011 1 commit
  28. 15 Mar, 2011 1 commit
  29. 10 Mar, 2011 1 commit
  30. 28 Feb, 2011 1 commit
  31. 23 Feb, 2011 1 commit