Commit Graph

10267 Commits

Author SHA1 Message Date
Jiří Klimeš
214f523f3f libnm-util: document "address-labels" property as for internal use only 2014-06-26 14:56:22 +02:00
Thomas Haller
adb3e37c74 contrib/rpm: cleanup of NetworkManager.spec by adding %{epoch_version} and %{git_sha_version}
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-25 22:11:57 +02:00
Yuri Chornoivan
65068af303 po: updated Ukranian translation (bgo #732172)
https://bugzilla.gnome.org/show_bug.cgi?id=732172

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-25 18:51:03 +02:00
Jiří Klimeš
c88b832ce9 keyfile: allow missing 'id' and 'uuid' in [connection] section (bgo #683345)
If 'id' is missing, it is automatically filled with base file name.
If 'uuid' is missing, it is automatically generated (hashing file path).

https://bugzilla.gnome.org/show_bug.cgi?id=683345
2014-06-25 16:26:59 +02:00
Jiří Klimeš
4b1dd4647e Revert "po: updated Ukranian translation (bgo #732172)"
This reverts commit 586851b86c.

The translation file was for PulseAudio, not NetworkMananger.
2014-06-25 15:29:31 +02:00
Yuri Chornoivan
586851b86c po: updated Ukranian translation (bgo #732172)
https://bugzilla.gnome.org/show_bug.cgi?id=732172

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-25 12:10:12 +02:00
Thomas Haller
fdf78b3d54 platform: don't announce routes/addresses that are not returned from get_all()
There is no point in raising events that a route/address was added, if
a subsequent call to ip4_address_get_all() et.al don't show these
objects.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-24 16:07:13 +02:00
Thomas Haller
f4db6f13cb core: fix assertion logging master device during activation
backtrace:
  #0  0x0000003370c504e9 in g_logv (log_domain=0x4c14cc "NetworkManager", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fff420d05c0) at gmessages.c:989
  #1  0x0000003370c5063f in g_log (log_domain=log_domain@entry=0x4c14cc "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x3370cbc89a "%s: assertion '%s' failed") at gmessages.c:1025
  #2  0x0000003370c50679 in g_return_if_fail_warning (log_domain=log_domain@entry=0x4c14cc "NetworkManager", pretty_function=pretty_function@entry=0x4b4710 <__PRETTY_FUNCTION__.35285> "nm_device_get_iface",
      expression=expression@entry=0x4b160a "self != NULL") at gmessages.c:1034
  #3  0x000000000042e39b in nm_device_get_iface (self=0x0) at devices/nm-device.c:501
  #4  0x00000000004393cc in nm_device_activate_stage3_ip_config_start (user_data=<optimized out>) at devices/nm-device.c:4062
  #5  0x0000003370c492a6 in g_main_dispatch (context=0x153b190) at gmain.c:3066
  #6  g_main_context_dispatch (context=context@entry=0x153b190) at gmain.c:3642
  #7  0x0000003370c49628 in g_main_context_iterate (context=0x153b190, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3713
  #8  0x0000003370c49a3a in g_main_loop_run (loop=0x153ae30) at gmain.c:3907
  #9  0x0000000000429f15 in main (argc=1, argv=0x7fff420d0b78) at main.c:678

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-24 16:07:13 +02:00
Thomas Haller
ed3f598f63 core: add utility function str_if_set()
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-24 16:07:07 +02:00
Thomas Haller
724fc736fe trivial: fix whitespace
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-24 14:28:27 +02:00
Jiří Klimeš
c8902e8171 Merge changes for Ctrl-C and Ctrl-D handling in nmcli/readline (bgo #706118)
https://bugzilla.gnome.org/show_bug.cgi?id=706118
2014-06-24 11:00:19 +02:00
Jiří Klimeš
12f284dee3 cli: make Ctrl-C exit nmcli when line is empty *and* we are not in the editor 2014-06-24 10:58:42 +02:00
Jiří Klimeš
7e75ccea7f cli: don't print "Error: nmcli terminated by signal Quit (3)" on Ctrl-D
Also make sure we don't print anything before quitting on Ctrl-D.
2014-06-24 10:52:16 +02:00
Jiří Klimeš
c0822f6054 cli: append NL to error messages and also print the signal name 2014-06-24 10:52:16 +02:00
Jiří Klimeš
dbf2d08559 cli: allow quitting on Ctrl-D while in readline()
Ctrl-D is mapped as a delete key in readline. When some input is on the line,
Ctrl-D behaves like 'Delete' key. When the line is empty, EOF is generated.
We quit on this EOF. It is the same behaviour many other interactive programs
exhibit, like bash, python, irb, etc.

Users can also quit unconditionally with Ctrl-\ that traditionally generates
SIGQUIT.
2014-06-24 10:52:15 +02:00
Jiří Klimeš
433c067522 cli: mitigate slowness of readline() for some broken versions
There was a bug in readline-6.2 causing very slow processing when
rl_event_hook was used [1]. This was fixed later after 6.2 was out.
Unfortunately some distributions don't include the fix. Fedora is one
example [2].
So we lower keyboard input timeout from 0.1s to 0.01s. This makes readline
more responsive. On the other hand it causes more interrupts, calling
rl_event_hook callback more often and thus slightly higher CPU usage.

[1] https://lists.gnu.org/archive/html/bug-readline/2012-06/msg00005.html
[2] related: https://bugzilla.redhat.com/show_bug.cgi?id=1109946

Note: this commit could (should) be reverted later when we check that most
distributions have the readline bug fixed.
2014-06-24 10:45:37 +02:00
Jiří Klimeš
512fe08c7e cli: don't quit nmcli on Ctrl-C while in readline()
We rather cancel the input and show new prompt on readline. It is more
expected behaviour for interactive input when quitting.
2014-06-24 10:38:14 +02:00
Thomas Haller
1dd50924c8 device: fix warning releasing of slave when slave device gets removed
When the slave device gets removed, the master is not in a state-change when
calling nm_device_release_one_slave(). This triggers a warning [1].

[1] backtrace:
  #0  0x0000003370c504e9 in g_logv (log_domain=0x4c144c "NetworkManager", log_level=G_LOG_LEVEL_WARNING, format=<optimized out>, args=args@entry=0x7fff8b1d35b0) at gmessages.c:989
  #1  0x0000003370c5063f in g_log (log_domain=log_domain@entry=0x4c144c "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_WARNING, format=format@entry=0x3370cc1fdc "%s") at gmessages.c:1025
  #2  0x0000003370c50956 in g_warn_message (domain=domain@entry=0x4c144c "NetworkManager", file=file@entry=0x4b14d5 "devices/nm-device.c", line=line@entry=841, func=func@entry=0x4b48f0 <__FUNCTION__.35456> "nm_device_release_one_slave",
      warnexpr=warnexpr@entry=0x0) at gmessages.c:1058
  #3  0x0000000000436c30 in nm_device_release_one_slave (dev=dev@entry=0xd92540, slave=slave@entry=0xdb0e50, configure=configure@entry=1) at devices/nm-device.c:841
  #4  0x000000000043a779 in slave_state_changed (slave=0xdb0e50, slave_new_state=NM_DEVICE_STATE_UNMANAGED, slave_old_state=NM_DEVICE_STATE_ACTIVATED, reason=<optimized out>, self=0xd92540) at devices/nm-device.c:1214
  #5  0x0000003371805d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
  #6  0x00000033718056bc in ffi_call (cif=cif@entry=0x7fff8b1d3a00, fn=0x43a677 <slave_state_changed>, rvalue=0x7fff8b1d3970, avalue=avalue@entry=0x7fff8b1d38f0) at ../src/x86/ffi64.c:522
  #7  0x0000003371c10ad8 in g_cclosure_marshal_generic (closure=0xd76120, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x0) at gclosure.c:1454
  #8  0x0000003371c10298 in g_closure_invoke (closure=0xd76120, return_value=return_value@entry=0x0, n_param_values=4, param_values=param_values@entry=0x7fff8b1d3c00, invocation_hint=invocation_hint@entry=0x7fff8b1d3ba0) at gclosure.c:777
  #9  0x0000003371c2235d in signal_emit_unlocked_R (node=node@entry=0xd9d850, detail=detail@entry=0, instance=instance@entry=0xdb0e50, emission_return=emission_return@entry=0x0,
      instance_and_params=instance_and_params@entry=0x7fff8b1d3c00) at gsignal.c:3586
  #10 0x0000003371c2a0f2 in g_signal_emit_valist (instance=instance@entry=0xdb0e50, signal_id=signal_id@entry=68, detail=detail@entry=0, var_args=var_args@entry=0x7fff8b1d3e38) at gsignal.c:3330
  #11 0x0000003371c2a8f8 in g_signal_emit_by_name (instance=instance@entry=0xdb0e50, detailed_signal=detailed_signal@entry=0x4c3ce2 "state-changed") at gsignal.c:3426
  #12 0x000000000043754f in _set_state_full (device=device@entry=0xdb0e50, state=state@entry=NM_DEVICE_STATE_UNMANAGED, reason=reason@entry=NM_DEVICE_STATE_REASON_REMOVED, quitting=quitting@entry=0) at devices/nm-device.c:6689
  #13 0x000000000043797c in nm_device_state_changed (device=device@entry=0xdb0e50, state=state@entry=NM_DEVICE_STATE_UNMANAGED, reason=reason@entry=NM_DEVICE_STATE_REASON_REMOVED) at devices/nm-device.c:6823
  #14 0x0000000000439fe7 in nm_device_set_unmanaged (device=device@entry=0xdb0e50, flag=flag@entry=NM_UNMANAGED_INTERNAL, unmanaged=unmanaged@entry=1, reason=reason@entry=NM_DEVICE_STATE_REASON_REMOVED) at devices/nm-device.c:5983
  #15 0x00000000004799c2 in remove_device (manager=manager@entry=0xd86150, device=0xdb0e50, quitting=quitting@entry=0) at nm-manager.c:769
  #16 0x000000000047e3bf in platform_link_cb (platform=<optimized out>, ifindex=35, plink=<optimized out>, change_type=<optimized out>, reason=<optimized out>, user_data=<optimized out>) at nm-manager.c:2123
  #17 0x0000003371805d8c in ffi_call_unix64 () at ../src/x86/unix64.S:76
  #18 0x00000033718056bc in ffi_call (cif=cif@entry=0x7fff8b1d4320, fn=0x47e34b <platform_link_cb>, rvalue=0x7fff8b1d4290, avalue=avalue@entry=0x7fff8b1d4210) at ../src/x86/ffi64.c:522
  #19 0x0000003371c10ad8 in g_cclosure_marshal_generic (closure=0xd32e40, return_gvalue=0x0, n_param_values=<optimized out>, param_values=<optimized out>, invocation_hint=<optimized out>, marshal_data=0x0) at gclosure.c:1454
  #20 0x0000003371c10298 in g_closure_invoke (closure=0xd32e40, return_value=return_value@entry=0x0, n_param_values=5, param_values=param_values@entry=0x7fff8b1d4520, invocation_hint=invocation_hint@entry=0x7fff8b1d44c0) at gclosure.c:777
  #21 0x0000003371c2235d in signal_emit_unlocked_R (node=node@entry=0xcf5780, detail=detail@entry=0, instance=instance@entry=0xcf78a0, emission_return=emission_return@entry=0x0,
      instance_and_params=instance_and_params@entry=0x7fff8b1d4520) at gsignal.c:3586
  #22 0x0000003371c2a0f2 in g_signal_emit_valist (instance=instance@entry=0xcf78a0, signal_id=signal_id@entry=2, detail=detail@entry=0, var_args=var_args@entry=0x7fff8b1d4778) at gsignal.c:3330
  #23 0x0000003371c2a8f8 in g_signal_emit_by_name (instance=instance@entry=0xcf78a0, detailed_signal=detailed_signal@entry=0x4b183d "link-changed") at gsignal.c:3426
  #24 0x000000000044c6f3 in announce_object (platform=platform@entry=0xcf78a0, object=0xde1720, change_type=change_type@entry=NM_PLATFORM_SIGNAL_REMOVED, reason=reason@entry=NM_PLATFORM_REASON_EXTERNAL)
      at platform/nm-linux-platform.c:1572
  #25 0x000000000044ec07 in event_notification (msg=<optimized out>, user_data=<optimized out>) at platform/nm-linux-platform.c:1886
  #26 0x0000003844c1117f in nl_cb_call (msg=<optimized out>, type=<optimized out>, cb=<optimized out>) at ../include/netlink-private/netlink.h:141
  #27 recvmsgs (cb=0xcf7240, sk=0xcf7330) at nl.c:952
  #28 nl_recvmsgs_report (sk=0xcf7330, cb=0xcf7240) at nl.c:1003
  #29 0x0000003844c11549 in nl_recvmsgs (sk=<optimized out>, cb=<optimized out>) at nl.c:1027
  #30 0x0000003844c11569 in nl_recvmsgs_default (sk=<optimized out>) at nl.c:1041
  #31 0x000000000044e955 in event_handler (channel=<optimized out>, io_condition=<optimized out>, user_data=0xcf78a0) at platform/nm-linux-platform.c:3804
  #32 0x0000003370c492a6 in g_main_dispatch (context=0xcf5190) at gmain.c:3066
  #33 g_main_context_dispatch (context=context@entry=0xcf5190) at gmain.c:3642
  #34 0x0000003370c49628 in g_main_context_iterate (context=0xcf5190, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3713
  #35 0x0000003370c49a3a in g_main_loop_run (loop=0xcf4e30) at gmain.c:3907
  #36 0x0000000000429f15 in main (argc=1, argv=0x7fff8b1d4f38) at main.c:678

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-23 19:34:01 +02:00
Thomas Haller
41a20a75a1 tui: fix inverted option "Require IPvX addressing for this connection"
https://bugzilla.redhat.com/show_bug.cgi?id=1108839

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-23 19:09:44 +02:00
Thomas Haller
3d6936b2cc core: fix dhcp4_cleanup() to clear dhcp4_client first (avoids assert accessing NM_DEVICE_DHCP4_CONFIG)
dhcp4_cleanup() should first clear @dhcp4_client variables before
clearing @dhcp4_config. Otherwise the following assert fails [1] and
the DBUS property NM_DEVICE_DHCP4_CONFIG is set to %NULL.

Analog to dhcp6_cleanup(), dhcp6_client, and NM_DEVICE_DHCP6_CONFIG.

[1] backtrace:
  #0  0x0000003370c504e9 in g_logv (log_domain=0x4c148c "unrecognized-specs-changed", log_level=G_LOG_LEVEL_CRITICAL, format=<optimized out>, args=args@entry=0x7fff4710ed60) at gmessages.c:989
  #1  0x0000003370c5063f in g_log (log_domain=log_domain@entry=0x4c144c "NetworkManager", log_level=log_level@entry=G_LOG_LEVEL_CRITICAL, format=format@entry=0x3370cbc89a "%s: assertion '%s' failed") at gmessages.c:1025
  #2  0x0000003370c50679 in g_return_if_fail_warning (log_domain=log_domain@entry=0x4c144c "NetworkManager", pretty_function=pretty_function@entry=0x4c6140 <__PRETTY_FUNCTION__.15969> "nm_dhcp4_config_get_dbus_path",
      expression=expression@entry=0x4c60d9 "NM_IS_DHCP4_CONFIG (self)") at gmessages.c:1034
  #3  0x000000000046b1d4 in nm_dhcp4_config_get_dbus_path (self=0x0) at nm-dhcp4-config.c:115
  #4  0x0000000000434791 in get_property (object=0x9d2320, prop_id=13, value=0x9618a0, pspec=0x9bbc20) at devices/nm-device.c:7539
  #5  0x0000003371c18e73 in object_get_property (value=0x9618a0, pspec=<optimized out>, object=0x9d2320) at gobject.c:1303
  #6  g_object_get_property (object=0x9d2320, property_name=<optimized out>, value=0x9618a0) at gobject.c:2402
  #7  0x000000000048482c in idle_id_reset (data=<optimized out>) at nm-properties-changed-signal.c:123
  #8  0x0000003371c13055 in g_cclosure_marshal_VOID__PARAM (closure=0x9618a0, return_value=0xffffffff, n_param_values=0, param_values=0x7fff4710f130, invocation_hint=0x0, marshal_data=0x4b5201) at gmarshal.c:1037
  #9  0x0000003371c10298 in g_closure_invoke (closure=0x2, closure@entry=0x919d00, return_value=return_value@entry=0x0, n_param_values=1192292656, param_values=0x9d2320, param_values@entry=0x7fff4710f130,
      invocation_hint=invocation_hint@entry=0x7fff4710f0d0) at gclosure.c:777
  #10 0x0000003371c21b87 in signal_emit_unlocked_R (node=node@entry=0x919d90, detail=detail@entry=667, instance=instance@entry=0x9d2320, emission_return=emission_return@entry=0x0,
      instance_and_params=instance_and_params@entry=0x7fff4710f130) at gsignal.c:3516
  #11 0x0000003371c2a0f2 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fff4710f2c0) at gsignal.c:3330
  #12 0x0000003371c2a3af in g_signal_emit (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3386
  #13 0x0000003371c14945 in g_object_dispatch_properties_changed (object=0x9d2320, n_pspecs=4294967295, pspecs=0x0) at gobject.c:1047
  #14 0x0000003371c17019 in g_object_notify_by_spec_internal (pspec=<optimized out>, object=0x9d2320) at gobject.c:1141
  #15 g_object_notify (object=0x9d2320, property_name=property_name@entry=0x4c400f "dhcp4-config") at gobject.c:1183
  #16 0x0000000000434332 in dhcp4_cleanup (self=self@entry=0x9d2320, stop=stop@entry=1, release=release@entry=0) at devices/nm-device.c:2581
  #17 0x0000000000434cab in _cleanup_generic_pre (self=self@entry=0x9d2320, deconfigure=deconfigure@entry=1) at devices/nm-device.c:6448
  #18 0x0000000000436db1 in nm_device_cleanup (self=self@entry=0x9d2320, reason=reason@entry=NM_DEVICE_STATE_REASON_REMOVED) at devices/nm-device.c:6524
  #19 0x0000000000437358 in _set_state_full (device=device@entry=0x9d2320, state=state@entry=NM_DEVICE_STATE_UNMANAGED, reason=reason@entry=NM_DEVICE_STATE_REASON_REMOVED, quitting=quitting@entry=0) at devices/nm-device.c:6641
  #20 0x000000000043797c in nm_device_state_changed (device=device@entry=0x9d2320, state=state@entry=NM_DEVICE_STATE_UNMANAGED, reason=reason@entry=NM_DEVICE_STATE_REASON_REMOVED) at devices/nm-device.c:6823
  #21 0x0000000000439fe7 in nm_device_set_unmanaged (device=device@entry=0x9d2320, flag=flag@entry=NM_UNMANAGED_INTERNAL, unmanaged=unmanaged@entry=1, reason=reason@entry=NM_DEVICE_STATE_REASON_REMOVED) at devices/nm-device.c:5983
  #22 0x000000000043a193 in nm_device_set_unmanaged_quitting (device=0x9d2320) at devices/nm-device.c:5998
  #23 0x00000000004799f9 in remove_device (manager=0x9b2150, device=0x9d2320, quitting=1) at nm-manager.c:775
  #24 0x000000000047bf47 in dispose (object=0x9b2150) at nm-manager.c:4935
  #25 0x0000003371c14ee8 in g_object_unref (_object=0x9b2150) at gobject.c:3160
  #26 0x0000000000429f43 in main (argc=1, argv=0x7fff4710f9a8) at main.c:681

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-23 17:51:51 +02:00
Jiří Klimeš
a78386b6d1 team: start teamd when ensuring team connection else teamdctl_connect() fails
Check if teamd is already running before trying to connect, else it would fail
anyway with errors:
libteamdctl: teamdctl_connect: Failed to connect using all CLIs.
NetworkManager[5535]: <error> [1402495644.226625] [devices/nm-device-team.c:208] ensure_teamd_connection(): (TTT): failed to connect to teamd (err=-22)

 # ip link set name TTT type team
2014-06-23 15:20:27 +02:00
Jiří Klimeš
4ece719beb team: set connection type for class, else the generating connection is invalid 2014-06-23 15:20:27 +02:00
Jiří Klimeš
206753fed8 team: don't pass priv parameter to functions, get it when needed 2014-06-23 15:20:27 +02:00
Jiří Klimeš
e554ef606f ifcfg-rh: write GATEWAY instead of GATEWAY0 to be ifup-compatible (rh #771673)
https://bugzilla.redhat.com/show_bug.cgi?id=771673
https://bugzilla.redhat.com/show_bug.cgi?id=1105770
2014-06-23 15:00:54 +02:00
Piotr Drąg
f5681d15ba po: update Polish (pl) translation (bgo #732013)
https://bugzilla.gnome.org/show_bug.cgi?id=732013

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-23 12:13:01 +02:00
Thomas Haller
3789e45428 core: ensure boolean properties for nm_active_connection_set_default[6]() are either TRUE or FALSE
Since @is_default is compared using ==, we should ensure that the
boolean properties are always either TRUE or FALSE.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-20 17:56:06 +02:00
Dan Williams
5a4e42bc51 examples: add Python dbus example indicating if WWAN is the default connection 2014-06-20 10:54:03 -05:00
Thomas Haller
0d45284aa7 dispatcher: suppress log warning when nm-dispatcher is disabled in systemd
When 'nm-dispatcher' is not running because its systemd service
'NetworkManager-dispatcher.service' is not enabled, any calls to the dispatcher
will fail with an error of typ DBUS_ERROR:DBUS_GERROR_REMOTE_EXCEPTION (32):

  "Unit dbus-org.freedesktop.nm-dispatcher.service failed to load: No such file or directory."

This clutters the logfile with warnings, although the user probably
disabled the service on purpose.

Special case this particular (recurring) failure and downgrade the warning
to debug level.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-20 17:25:01 +02:00
Dan Winship
73508704d8 wifi: fix WoWLAN detection
WoWLAN state has to be requested by phy, not by ifindex

Related: rh#1025009
2014-06-20 11:15:25 -04:00
Jiří Klimeš
530412134d cli: make "(not available)" translatable 2014-06-20 13:58:36 +02:00
Jiří Klimeš
142e2c4726 build: fix gobject-introspection detection
so that HAVE_INTROSPECTION is properly defined
2014-06-20 13:58:36 +02:00
Thomas Haller
aaf0ef42dd nm-online: refactor calculation of wait timeout for better accuracy
Also, in verbose mode, synchronize the printing of the progress
bar and the counting seconds so that the output appears smooth.

This schedules the timeouts so that there are roughly
(PROGRESS_STEPS + n_secs) wakeups.

https://bugzilla.gnome.org/show_bug.cgi?id=728163

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-20 08:15:37 +02:00
Dan Winship
9a06f1a2eb libnm-util: drop GParamSpec docs, use gtk-doc docs elsewhere
https://bugzilla.gnome.org/show_bug.cgi?id=731406
2014-06-19 17:45:03 -04:00
Dan Winship
aa1dce6da2 all: remove remaining GParamSpec name/blurb strings
Remove all remaining GParamSpec name and blurb strings (and fix
indentation while we're there), and add G_PARAM_STATIC_STRINGS to all
paramspecs that were lacking it.
2014-06-19 17:45:03 -04:00
Dan Winship
cdc15cb2a6 libnm-util: remove NMSetting* GParamSpec docs
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.
2014-06-19 17:45:03 -04:00
Dan Winship
8252ebd941 cli: generate setting docs from libnm-util/nm-setting-docs.xml
nmcli used the GParamSpec doc strings to get property descriptions,
but they will be going away. Generate a .c file from the new XML
setting docs file, and link that into nmcli.
2014-06-19 17:45:02 -04:00
Dan Winship
07bb19a3bb tools: remove generate-settings-spec, which is no longer used 2014-06-19 17:45:02 -04:00
Dan Winship
cceb773510 docs: generate settings-spec.xml from libnm-util/nm-setting-docs.xml
Generate docs/api/settings-spec.xml via an XSLT stylesheet applied to
libnm-util/nm-setting-docs.xml.
2014-06-19 17:45:02 -04:00
Dan Winship
a3d02ddeef man: generate nm-settings.xml from libnm-util/nm-setting-docs.xml
Generate man/nm-settings.xml via an XSLT stylesheet applied to
libnm-util/nm-setting-docs.xml.
2014-06-19 17:45:02 -04:00
Dan Winship
dcc109516d libnm-util: build nm-setting-docs.xml from gtk-doc and GParamSpecs
Add generate-setting-docs.py, based on tools/generate-settings-spec.c,
which generates a simple XML file describing all libnm setting
properties (still getting the default values via GParamSpec
introspection like generate-settings-spec.c does, but getting the
documentation out of the gtk-doc strings in the GIR file instead).
2014-06-19 17:45:02 -04:00
Dan Winship
e8577083ca libnm-util: various NMSetting* property doc fixes/improvements
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).
2014-06-19 17:45:02 -04:00
Dan Winship
9de24b16e8 libnm-util: fix gtk-doc bugs in NMSetting* properties
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.
2014-06-19 17:45:02 -04:00
Dan Winship
8487a4490c libnm-util, libnm-glib: be consistent about "Wi-Fi", "Ethernet", "InfiniBand" in docs
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".
2014-06-19 17:45:01 -04:00
Thomas Haller
7475d8c28d platform: merge branch 'th/bgo727382_platform_fix_addr_lifetime' (part 2)
https://bugzilla.gnome.org/show_bug.cgi?id=727382

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 23:20:43 +02:00
Thomas Haller
6f013183e8 platform: extend nm_platform_ip_address_cmp_expiry() to handle addresses without timestamp
If the timestamp is set to zero, the to_string() functions treat the lifetime
as based on *now*. For nm_platform_ip_address_cmp_expiry() this makes no
sense, because there is no absolute exiry to compare. Instead compare
them as expire earlier then the other address.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
c6d45a4083 platform: modify address to_string() to show raw lifetime values
The "lifetime" part when printing an address in nm_platform_ip[46]_address_to_string()
is supposed to show the raw, internal values of the address.

We already have the "lft" and "pref" output that presents the expiries based on now.
These fields are already crafted to show what the user probably wants
to see when looking at debugging log. "lifetime" should not do any
special casing and just print the raw values.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
c29496125f platform: handle unset address timestamp as *now* in to_string()
When printing an address in nm_platform_ip4_address_to_string()
and nm_platform_ip6_address_to_string() treat an unset @timestamp
as counting from @now.

This is useful, if you just have the remaining lifetime at hand
and want to print an address. In general it is not a good idea to
leave the timestamp not anchored to an absolute @timestamp.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
a2791f54da platform: set timestamp in platform addresses to last_update_time()
Previous patch 8310a039d8 modified
platform to set the timestamp of addresses always to 1.

So, when adding an address platform logging looked like:
  signal: address 4 added: 192.168.232.3/24 lft 2000sec pref 1000sec lifetime 12345-1[13344,14344] dev em1 src kernel

This is confusing in the log file and during debugging. Instead set the
timestamp to the last modification time of the address so that it will
look like:
  signal: address 4 added: 192.168.232.3/24 lft 2000sec pref 1000sec lifetime 12345-12345[1000,2000] dev em1 src kernel

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:26:10 +02:00
Thomas Haller
31db488396 platform: fix off-by-two error converting lifetimes in _init_ip_address_lifetime()
When setting the timestamp to 1, we have to subtract(!) one second
from a_valid and a_preferred.

Due to this error, NM saw the lifetimes of addresses from system as two
seconds larger then the actual value.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:13:48 +02:00
Thomas Haller
6723745fe0 dhcp: nm_dhcp_dhclient_read_lease_ip_configs() must anchor the address lifetime at *now*
nm_dhcp_dhclient_read_lease_ip_configs() calculates the remaining time
until the address expires. It must anchor the lifetimes by setting the
@timestamp to nm_utils_get_monotonic_timestamp_s().

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-19 22:13:48 +02:00