Commit Graph

198 Commits

Author SHA1 Message Date
Dan Winship
30c74c6007 build: more srcdir!=builddir fixes
nm-version.h was getting disted, making srcdir!=builddir work for
tarball builds, but not for git builds.

Also, remove "-I${top_builddir}/include" from all Makefile.ams, since
there's nothing generated in include/ any more.
2014-07-15 11:37:19 -04: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
Jiří Klimeš
98ae6e06d2 all: g_type_init() has been deprecated in GLib 2.35.0
g_type_init() deprecation:
https://bugzilla.gnome.org/show_bug.cgi?id=686161
2014-05-27 16:58:21 +02:00
Dan Winship
bea82ca98b all: set G_LOG_DOMAIN appropriately, for better g_log() messages 2014-04-23 10:19:17 -04:00
Thomas Haller
0a85bff70a nm-online: fix considering the --quiet option
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-03-31 08:37:10 +02:00
Jiří Klimeš
ea962ce411 trivial: correct nm-online's '--exit' option description 2014-03-31 08:37:10 +02:00
Jiří Klimeš
20fb078dd6 nm-online: fix nm-online to report online status correctly (rh #1054364)
This fixes a behaviour change made by 44ac1020da.
That commit make nm-online to wait for NM finishing startup instead of waiting
for a real connection. So for NetworkManager fully initialized, but
disconnected nm-online would return 0.

$ nmcli -f RUNNING,STATE,STARTUP,CONNECTIVITY gen status
RUNNING  STATE         STARTUP  CONNECTIVITY
running  disconnected  started  none

Revert back to the original behaviour of waiting for a connection. And
introduce a new option '--wait-for-startup' waiting for NetworkManager
finishing its startup, which is useful in some cases, like
NetworkManager-wait-online.service.

https://bugzilla.redhat.com/show_bug.cgi?id=1054364
2014-03-31 08:37:10 +02:00
Dan Winship
9c4d86ee80 libnm-util, libnm-glib: add versioned deprecation/availability macros
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.)

Add NM_VERSION_MIN_REQUIRED and NM_VERSION_MAX_ALLOWED macros which
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
NM_VERSION_MAX_ALLOWED to NM_VERSION_NEXT_STABLE to ensure that it is
always allowed to use all APIs.
2014-02-13 11:24:37 -05:00
Jiří Klimeš
15ade8a0ca nm-online: check return value of nm_client_new() 2013-10-14 08:48:06 +02:00
Dan Winship
bfce3f7dc8 build: switch from $(INCLUDES) to $(AM_CPPFLAGS) to make automake happy
Unfortunately, $(AM_CPPFLAGS) gets overridden by per-target _CPPFLAGS
variables, which $(INCLUDES) did not, so this requires some additional
changes.

In most places, I have just gotten rid of the per-target _CPPFLAGS
variables; in directories with a single target, the per-target
variable is unnecessary, and in directories with multiple targets, the
per-target variable is often undesirable, since it forces some files
to be compiled twice, even though there ends up being no difference
between the two files.
2013-08-22 11:49:16 -04:00
Dan Winship
44ac1020da nm-online: wait for all startup-time connections, not just one
Rewrite nm-online to use libnm-glib, and change it so that it waits
until NM has finished all of its startup-time connection activation
attempts, rather than only waiting until at least one has succeeded.

In particular, this means that on multi-homed servers, the
NetworkManager-wait-online systemd service (and by extension,
network.service) will now block until *all* of the server's IP
addresses are up, which is needed for some old daemons that assume
that no network interfaces will be added after they start.
2013-08-16 17:27:34 -04:00
Pavel Šimerda
320a9d16a3 all: replace struct in_addr with guint32 2013-08-03 00:15:07 -05:00
Dan Winship
fe8275aa7e nm-online: fix indentation, etc 2013-07-23 09:07:39 -04:00
Jiří Klimeš
fc9f7e06b9 nm-online: describe '--timeout' option more exactly (rh #969363) 2013-07-11 15:21:22 +02:00
Pavel Šimerda
9ba40ca886 cleanup: remove obsolete nmnetlink.test.c 2013-03-08 15:12:13 +01:00
Pavel Šimerda
bb8c75bd53 remove obsolete nm-tool
Use nmcli instead.
2013-03-04 22:11:45 +01:00
Pavel Šimerda
d82669d3fd build: unify NetworkManager path handling (some paths are changed)
Use autoconf/automake variables for NetworkManager paths. Use
NetworkManager subdirectory where appropriate.

Files in /var/run (or /run on some distros) are moved into a separate
directory as is usual with other daemons. It makes the filesystem
more readable and file prefixing unnecessary.

/var/run/NetworkManager.pid -> /var/run/NetworkManager/NetworkManager.pid
/var/run/nm-dns-dnsmasq.pid -> /var/run/NetworkManager/dnsmasq.pid
/var/run/nm-dns-dnsmasq.conf -> /var/run/NetworkManager/dnsmasq.conf

The /var/run/NetworkManager directory is created at runtime, if it doesn't
exist.

Note: Path-based security policies like SELinux and AppArmor may need to
be adapted.
2012-11-05 14:01:47 +01:00
Jan Luebbe
f9c72dee3e wifi: support ap-mode with wpa_supplicant
A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the
new mode is passed to wpa_supplicant analogous to adhoc-mode.
The places which need to know the interface mode have been extended to
handle the new mode.

If the configuration does not contain a fixed frequency, a channel is
selected the same way as with adhoc-mode before.
2012-10-17 12:08:11 -05:00
Dan Winship
6878d20ac4 all: Don't use ctype.h macros
The ctype macros (eg, isalnum(), tolower()) are locale-dependent. Use
glib's ASCII-only versions instead.

Also, replace isascii() with g_ascii_isprint(), since isascii()
accepts control characters, which isn't what the code wanted in any of
the places where it was using it.
2012-09-26 12:14:37 -04:00
Jiří Klimeš
21f8468708 nm-online: internationalize nm-online tool 2012-07-09 16:21:11 +02:00
Colin Walters
74ec56d956 build: fix srcdir != builddir for new generated headers 2012-02-22 16:27:28 -06:00
Colin Walters
dab7dfaf35 build: fix srcdir != builddir
nm-version.h is in ${top_builddir}/include.
2012-01-09 14:20:36 -06:00
Dan Williams
8f110f40b1 test: fix errors in debug helper if a service isn't running
No point in complaining about modem-manager not running when
modem-manager isn't getting changed.
2011-12-19 21:04:54 -06:00
Thomas Graf
5b7503e95e core: use nm_connection_get_setting_<type>() whenever possible
Leads to shorter, easier to read code and improves type casting safety.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:06:43 -06:00
Dan Williams
b6a911f051 trivial: remove stray backtick 2011-10-26 14:17:23 -05:00
Mathieu Trudel-Lapierre
3863c87f18 test: add debug helper to make enabling NM, MM, and supplicant debuging easier 2011-10-26 14:15:11 -05:00
Dan Williams
f1a8227436 nm-tool: show WiMAX info when available
libnm-glib will always be built with WiMAX enabled so we might as well
show it.  It's only NM itself that gets built with/without WiMAX
support.
2011-08-04 14:22:15 -05:00
Dan Williams
4a0c7d9dd4 test: use nm_device_get_active_connection() in nm-tool 2011-05-26 22:12:15 -05:00
Michael Biebl
530f143adf use /usr/bin/env instead of /bin/env 2011-03-29 01:00:47 +02:00
Dan Williams
23943e7ce2 core: handle new device states
The device states aren't used yet, but handle them anyway.
2011-03-17 13:42:22 -05:00
Dan Williams
2140dad5e0 core: consolidate mobile broadband device types
These days more and more devices are showing up that support a
number of different access technology families in the same hardware,
like Qualcomm Gobi (CDMA and GSM), Pantech UM190 (CDMA and GSM),
Pantech UML290 (CDMA and LTE), LG VL600 (CDMA and LTE), Sierra
320U (GSM and LTE), etc.  The previous scheme of having device
classes based on access technology family simply cannot handle
this hardware and attempting to add LTE to both the CDMA and GSM
device classes would result in a bunch of code duplication that
we don't want.  There's a better way...

Instead, combine both CDMA and GSM device classes into a generic
"Modem" device class that provides capabilities indicating what
access technology families a modem supports, and what families
it supports immediately without a firmware reload.  (Gobi devices
for example require a firmware reload before they can switch
between GSM and CDMA).  This provides the necessary flexibility
to the client and allows us to keep the API stable when the
same consolidation change is made in ModemManager.

The current code doesn't yet allow multi-mode operation internally,
but the API is now what we want it to be and won't need to be
changed.
2011-02-25 10:16:17 -06:00
Dan Williams
eab5851145 libnm-util: remove nm_warning/nm_info/nm_error macros
Clients need to do their own logging using glib or whatever; these
macros while somewhat helpful were not flexible and are not a
substitute for actual logging in the client.  g_warning, g_message,
and g_error are more suitable anyway.
2011-02-23 11:42:04 -06:00
Dan Williams
ec115ed442 api: add additional NM daemon states
DISCONNECTING: the only active network connection is now being disconnected
LOCAL, SITE, GLOBAL: one-stop items for level of connectivity, which
we'll use to show when we think we're actually connected to the internet
or behind a captive portal or something
2011-02-14 17:55:27 -06:00
Dan Williams
9806a92eaa trivial: fix some possible uninitialized variable usage in error cases 2011-01-25 15:41:14 -06:00
Dan Williams
f9ceafd4a1 Merge remote branch 'origin/master' into rm-userset 2011-01-12 15:46:37 -06:00
Dan Williams
9d24269e30 wimax: add Center Frequency, RSSI, CINR, TX Power, and BSID properties
Useful diagnostic/support info when device is connected.
2011-01-06 15:18:19 -06:00
Dan Williams
430151d6c2 build: make WiMAX support optional 2011-01-05 18:23:08 -06:00
Dan Williams
9e80c1e85d wimax: make WiMAX mostly work
Heavily modify Inaky's Intel WiMAX SDK glue (originally from connman)
to be more generic and more thread-safe, and suitable for use with
NetworkManager instead of rolling our own client code.  Rewrite the
NMDeviceWimax code to mostly work.

Still to be done: actual connection logic, DHCP handling, spawning
wimaxd if it's not started yet
2011-01-03 23:55:38 -06:00
Dan Williams
0587ef1179 Merge remote branch 'origin/master' into wimax 2011-01-02 17:24:23 -06:00
Dan Williams
87aa9a1412 test: add helper for testing connection addition 2010-11-18 14:27:47 -06:00
Dan Williams
64c817ddcc test: add hostname test helper 2010-11-18 12:51:35 -06:00
Dan Williams
cfaa80b261 Merge remote branch 'origin/master' into rm-userset 2010-11-16 18:08:48 -06:00
Ionut Biru
57bef052ce test: install nm-online binary 2010-11-08 17:53:46 +01:00
Dan Williams
6e287e4179 Merge remote branch 'origin/master' into rm-userset 2010-09-16 17:10:49 -05:00
Dan Williams
52d312da57 trivial: remove long-obsolete NMLoadModules script 2010-09-07 18:17:10 -05:00
Daniel Gnoutcheff
fb96309899 DBus: merge NetworkManger{,SystemSettings}
Remove the org.freedesktop.NetworkManagerSystemSettings bus name and
have everybody talk to org.freedesktop.NetworkManager. Now that we have
a single settings service that's embedded in the main daemon, we don't
need separate names anymore.
2010-08-07 01:19:46 -04:00
Daniel Gnoutcheff
227f5664b2 nm-tool: remove user settings support 2010-08-06 13:05:46 -04:00
Dan Williams
863a757012 nm-tool: silence annoying settings service warning
User settings service isn't always running.
2010-08-03 16:26:42 -07:00
Jiří Klimeš
2767195a9c nm-tool: print IPv6 settings in nm-tool 2010-06-28 19:23:35 +02:00
Jiří Klimeš
b880cbe829 trivial: fix a typo in nm-tool 2010-06-23 10:53:44 +02:00