Commit Graph

7740 Commits

Author SHA1 Message Date
Dan Winship
c4417c71b6 core: use non-recursive build
Although having different parts of NM in different subdirectories
keeps the source tree neat, it has made the build messy, particularly
because of cross-dependencies between the subdirs.

Reorganize to build all of the pieces of the NetworkManager binary
from src/Makefile, and only use recursive make for test programs,
helper binaries, and plugins.

As part of this, get rid of all the per-directory convenience
libraries, and switch to building a single top-level
libNetworkManager.la, containing everything except main.c, which all
of the test programs can then link against.
2013-05-08 15:07:18 -04:00
Dan Williams
6c2a35a090 build: clean up old ModemManager defines
Make sure they don't conflict with ModemManager 0.7/0.8 defines from
libmm-glib.
2013-05-08 15:04:02 -04:00
Dan Winship
227b466178 build: stop using client-side generated dbus bindings
We removed these from libnm-glib last year, but there was still one
place where we were using them in the core.
2013-05-08 15:00:12 -04:00
Dan Winship
d529580cbb libnm-glib, core: use g_cclosure_marshal_generic
Since we depend on new glib now, we can just use the generic
marshaller rather than generating our own.
2013-05-08 14:59:29 -04:00
Dan Winship
ec0a66861e build: automate the -glue.h building rules 2013-05-08 14:59:29 -04:00
Dan Winship
6dc7f85ed9 platform: fix ethtool code
Need to initialize auto_g_free variables to NULL, in case we error out
before setting them to real values.
2013-05-08 11:24:50 -04:00
Aleksander Morgado
371f022116 build: fix reporting of modemmanager-1 compilation status
When --with-modem-manager-1=yes not explicitly specified (i.e. 'auto' mode), and
libmm-glib is not found, we should not report:
    Features:
      ...
      modemmanager-1: auto

Instead, better report:
    Features:
      ...
      modemmanager-1: no
2013-05-08 07:03:37 -05:00
Dan Williams
2940d2b3e2 libnm-glib: fix introspection for IPv6 DNS servers
Posix apparently isn't a GObject Introspection module...
2013-05-07 17:15:21 -05:00
Dan Williams
c2d81b9ea8 core: ensure missing IP config settings are treated as "auto" (bgo #699755)
Due to recent changes not all settings plugins send an IP config setting
when the method is 'auto'.  Some old code in the NMDevice IP config paths
mishandled this.  Fix that up; the expected behavior should be:

1) if the device is a slave, IP configuration is DISABLE/IGNORED
2) if the connection has an IP4 or IP6 setting, use the setting's method
3) default to AUTO
2013-05-07 15:58:11 -05:00
Dan Winship
7aefd5b5f4 platform: fix use of ethtool
The bits in the result of ETHTOOL_GFEATURES are not in any defined
order; you need to use ETHTOOL_GSTRINGS to get the names associated
with each bit to find what each one does. Fix
NMPlatformLinux:link_supports_vlans() to do this.

https://bugzilla.gnome.org/show_bug.cgi?id=699649
2013-05-07 16:47:34 -04:00
Jiří Klimeš
67eea30566 man: update nmcli manual page for 'nmcli connection add' 2013-05-07 19:41:37 +02:00
Jiří Klimeš
24f05292da cli: update bash-completion file for 'connection add'
* _nmcli_list vs. _nmcli_list_nl - space vs. new-line separated list
* connection add
  - various types, modes, mac, ifname, ...
2013-05-07 19:41:37 +02:00
Jiří Klimeš
6c2e7706af cli: 'connection add': accept multiple IP addresses 2013-05-07 19:41:37 +02:00
Jiří Klimeš
3901281077 cli: 'connection add' command for adding NM connections non-interactively
A few examples:
nmcli --ask connection add
nmcli connection add type ethernet
nmcli -p connection add type ethernet con-name "my ethernet connection 1"
nmcli connection add type ethernet ip4 192.168.100.5/24
nmcli connection add type ethernet ip4 192.168.100.100/24 gw4 192.168.100.1 ip4 1.2.3.4 ip6 abbe::cafe
nmcli connection add type ethernet ifname eth0
nmcli connection add type ethernet autoconnect no ifname eth0
nmcli connection add type wifi con-name Rakosnicek ssid Brcalnik
nmcli --ask connection add type wifi con-name My_WiFi
nmcli c a type infiniband con-name Infi1 transport-mode connected
nmcli c a type bluetooth addr 12:54:00:fd:db:26
nmcli c a type bluetooth addr 12:54:00:fd:db:26 bt-type dun-cdma
nmcli c a type gsm apn internet
nmcli c a type cdma
nmcli c a type bond
nmcli c a type bond ifname mybond0 mode active-backup
nmcli c a ifname maxipes-fik type vlan dev eth0 id 55
nmcli c a con-name VLAN1 type vlan dev eth0 id 44 ingress "2:4,3:55" egress "1:3" flags 6
nmcli c a type bridge ifname br0 stp on ip4 10.0.0.25
nmcli c a ifname eth0 type bridge-slave master 30fc816a-e7dd-4ae7-a86e-ab0c9cee51c2 hairpin no path-cost 333 priority 20
nmcli c a type bridge-slave master br2
2013-05-07 19:41:36 +02:00
Jiří Klimeš
5761a46da0 cli: add functions for creating NM address and route structures to common.c
nmc_parse_and_build_ip[4|6]_address() creating NMIP[4|6]Address
nmc_parse_and_build_ip[4|6]_route() creating NMIP[4|6]Route
2013-05-07 19:41:36 +02:00
Jiří Klimeš
04d590a923 cli: nmc_string_to_bool() - util function for converting string to boolean
["true", "yes", "on"] -> TRUE
["false", "no", "off"] -> FALSE
2013-05-07 19:41:36 +02:00
Jiří Klimeš
ddd3ea2cd4 cli: util functions for converting string to int
nmc_string_to_int()  - converts string to signed long int (decimal)
nmc_string_to_uint() - converts string to unsigned long int (decimal)
nmc_string_to_int_base()  - converts string to signed long int with given base
nmc_string_to_uint_base() - converts string to unsigned long int with given base
2013-05-07 19:41:36 +02:00
Jiří Klimeš
8598ee1139 cli: nmc_string_is_valid() utility function
This function checks whether a string is contained among allowed strings. It
performs case-insensitive comparison and supports shortcuts if they are unique.
It returns a pointer to the found string in allowed array, or NULL.
2013-05-07 19:41:36 +02:00
Jiří Klimeš
ced61dfc7f libnm-util: add access functions for 'mac-address-blacklist' to wired/wireless
nm_setting_wire(d/less)_get_num_mac_blacklist_items()
nm_setting_wire(d/less)_get_mac_blacklist_item()
nm_setting_wire(d/less)_add_mac_blacklist_item()
nm_setting_wire(d/less)_remove_mac_blacklist_item()
2013-05-07 19:38:31 +02:00
Dan Winship
440223fa3c cli: sort the output of "nmcli dev"
Sort the output of "nmcli dev", first by state (with connected devices
first and unmanaged ones last), then by type and interface name.
2013-05-07 12:46:56 -04:00
Dan Winship
ae9a389f83 libnm-glib, cli: add nm_device_get_type_description
Add a new libnm-glib method to get the type description for a device,
and use it in nmcli. For most types, the type description is based on
the class name, but for NMDeviceGeneric, it comes from the
:type-description property.
2013-05-07 12:46:56 -04:00
Dan Winship
4819df28b4 core: add NMDeviceGeneric:type-description
Use nm_platform_link_get_type_name() to get information about the
generic device, and export that via D-Bus
2013-05-07 12:46:56 -04:00
Dan Winship
be5ef71ab0 platform: add nm_platform_link_get_type_name()
Add a platform method to return the name of the link type. (Eg,
"ethernet", "loopback", "tun")
2013-05-07 12:46:56 -04:00
Dan Winship
ce4f2a4bd6 core, libnm-glib: add NMDeviceGeneric
Add NMDeviceGeneric, to provide generic support for unknown device
types, and create NMDeviceGenerics for those devices that NM
previously was ignoring. Allow NMSettingGeneric connections to be
activated on (managed) NMDeviceGenerics.
2013-05-07 12:46:56 -04:00
Dan Winship
8b823d7c6a libnm-util: add NMSettingGeneric
Add NMSettingGeneric, a dummy L2 NMSetting for creating NMConnections
for devices that are not specifically recognized.
2013-05-07 12:46:56 -04:00
Dan Winship
2226a00cc2 core: add a "default-unmanaged" setting for devices
Allow devices to declare themselves unmanaged-by-default, but tweak
nm-manager and nm-policy to allow activating matching connections on
those devices anyway.

(This ensures that NM keeps its hands completely off the device unless
the user explicitly asks it to do something with it.)
2013-05-07 12:46:56 -04:00
Dan Winship
ab7ebead2c core: add IP configuration for unmanaged devices
Use NMPlatform to read the IP address/route configuration of unmanaged
devices, and export that via D-Bus like we do with NM-generated IP
configs.
2013-05-07 12:46:55 -04:00
Jiří Klimeš
669fdf9131 man: add a few pieces of metadata to silence DocBook warnings in manpages
and correct "SEE ALSO"
2013-05-07 10:07:57 +02:00
Dan Williams
e0409e631b build: error at configure-time if WiMAX stack built with incompatible libnl (bgo #687630)
If the Intel WiMAX stack is built with libnl1, but NM is built with a
newer libnl, then symbol conflicts between libnl versions will occur
when the WiMAX plugin is loaded into NM, and NM will crash.

Distros should be building their WiMAX stack with libnl3, using the
following git repos, rather than the long-defunct Intel git repos:

git://people.freedesktop.org/~dcbw/wimax
git://people.freedesktop.org/~dcbw/wimax-tools

These repos contain fixes to allow the WiMAX stack to build against
libnl3.
2013-05-06 15:34:23 -05:00
Dan Williams
a112ec8f9e Revert "build: error at configure-time if WiMAX stack built with incompatible libnl (bgo #687630)"
This reverts commit fcf4542ab3.

Pushed before some requested cleanups were added.
2013-05-06 15:34:08 -05:00
Dan Williams
fcf4542ab3 build: error at configure-time if WiMAX stack built with incompatible libnl (bgo #687630)
If the Intel WiMAX stack is built with libnl1, but NM is built with a
newer libnl, then symbol conflicts between libnl versions will occur
when the WiMAX plugin is loaded into NM, and NM will crash.

Distros should be building their WiMAX stack with libnl3, using the
following git repos, rather than the long-defunct Intel git repos:

git://people.freedesktop.org/~dcbw/wimax
git://people.freedesktop.org/~dcbw/wimax-tools

These repos contain fixes to allow the WiMAX stack to build against
libnl3.
2013-05-06 12:21:30 -05:00
Dan Williams
cefdb51fbe valgrind: suppressions update
This suppression didn't work on F17 for some reason, even though the
stacktrace was the same.  Valgrind wanted some kind of:

obj:<path to libglib>

between the calloc and the g_malloc0 lines; but we don't actually
care much about the calloc anyway.
2013-05-06 11:51:51 -05:00
Dan Williams
6fee19b17b bluetooth: fix device creation after 9ce458256d
The initialization of priv->bdaddr (the string representation of the device
hardware address) got removed in the named commit.
2013-05-06 11:17:37 -05:00
Jürg Billeter
cf8b338b27 remove paldo initscript
paldo has migrated to systemd a while ago
2013-05-06 16:33:14 +02:00
Jiří Klimeš
4d048cc2d8 cli: fix displaying unknown flags/bands 2013-05-06 14:00:10 +02:00
Dan Williams
0a5f272c35 libnm-util: correct documentation for nm_setting_update_secrets() 2013-05-04 13:18:28 -05:00
Emanuele Aina
c300e953fb build: Require libnl >= 3.2.8 for nl_object_get_type()
https://bugzilla.gnome.org/show_bug.cgi?id=698452
2013-05-04 01:47:43 +02:00
Pavel Šimerda
2c656e37dd platform: add mss attribute to NMPlatformIP*Route 2013-05-03 19:50:17 +02:00
Dan Winship
9ce458256d core: reorganize hw-address properties
Now that NMDevice reads the hwaddr directly from netlink, it's silly
to have every device subtype maintain its own hw-address property
(using data that it gets from the NMDevice base class).

Remove all the device-specific hw-address properties, and add one to
NMDevice instead. (Because of the way nm-properties-changed-signal
works, this has no effect on the D-Bus API.) Subclasses now call
nm_device_get_hw_address() in places where they used to just refer to
priv->hw_addr (and to simplify this, we now allow passing NULL for the
out length parameter, since the subclasses almost always know what the
length will be already).

Also reorganize/simplify a few other methods to take advantage of the
fact that NMDevice is now keeping track of the hw-address directly.

https://bugzilla.gnome.org/show_bug.cgi?id=699391
2013-05-03 13:19:16 -04:00
Martin Pitt
fa9b295c0e core: close private D-BUS connections on disconnect (bgo #698640)
Private connections need to be closed in addition to being unrefed.

https://bugzilla.gnome.org/show_bug.cgi?id=698640
2013-05-03 10:50:33 -05:00
Dan Williams
5f61594585 wifi: wep40 and wep104 are invalid algorithms for WPA pairwise
The supplicant rejects them, so any configuration that used them
wasn't working for a long time anyway.  Remove them.
2013-05-03 10:31:50 -05:00
Dan Williams
ccaf5231a2 libnm-util: clarify WiFi security pairwise/group property descriptions 2013-05-03 10:31:50 -05:00
Dan Williams
72ea5dac33 libnm-util: clarify WiFi setting MAC address blacklist description 2013-05-03 10:31:50 -05:00
Dan Williams
e09550ec62 cli: clarify generic getter alloc/free behavior 2013-05-03 10:31:50 -05:00
Dan Williams
229cba8354 libnm-util: clarify 802.1x password and password-raw documentation 2013-05-03 10:31:50 -05:00
Jiří Klimeš
5a50e60ac3 libnm-util: define NM_SETTING_GSM_BANDS_MAX - maximal value for allowed bands
and use it in 'allowed-bands' property installation.

The macro NM_SETTING_GSM_BANDS_MAX also allows libnm-util users to check
if bands are valid (before setting them).
2013-05-03 17:23:41 +02:00
Jiří Klimeš
dd80e247a9 ifcfg-rh: fix tests after nm_utils_wep_key_valid() fix
bfc20af513
2013-05-03 17:05:39 +02:00
Pavel Šimerda
acb1fd75bc platform: manual testing tool
This is a simple testing tool. Even though it includes a basic help (just run
it without arguments), the command syntax often requires looking into the
code. Use it whenever you want to test specific behavior of nm-platform.

For regular tests, please amend the automatic testsuite instead.
2013-05-03 15:38:57 +02:00
Pavel Šimerda
e2009e3fe3 platform: don't use gateway as key attribute for routes
On Linux, the gateway attribute is not a key attribute and therefore is
not necessary for functions that just need to identify a route. This may
be revisited when porting to other platforms but for now I want to keep
things simple.
2013-05-03 15:38:57 +02:00
Dan Winship
b041877dc1 build: fix srcdir!=builddir 2013-05-03 09:33:57 -04:00