Commit graph

301 commits

Author SHA1 Message Date
Michael Biebl 8f6317f88a build: support building against libsystemd >= 209 library
In systemd v209, the various libraries were merged into a single
libsystemd library [1].
Add support for building against this new library and fall back to the
old library names if not found.

[1] http://lists.freedesktop.org/archives/systemd-devel/2014-February/017146.html
2014-09-30 12:34:24 -05:00
Thomas Haller 53e244bef6 auth: support disabling POLKIT authentication entirely at compile time
Let the user completly disable polkit authentication by
building NM with configure option  '--enable-polkit=disabled'.

In that case, configuring 'main.auth-polkit=yes' will fail all
authentication requests (except root-requests, which are always granted).

This reduces the size of the NetworkManager binary by some 26KB (16KB
stripped).

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-09-29 13:51:11 +02:00
Thomas Haller eabe7d856c auth: rework polkit autorization to use DBUS interface directly
This makes NetworkManager independent of <polkit/polkit.h>
development headers and libpolkit-gobject-1.so library.
Instead communicate directly with polkit using its DBUS
interface.

PolicyKit support is now always compiled in. You can control
polkit authorization with the configuration option
  [main]
  auth-polkit=yes|no

If the configure option is omitted, a build time default
value is used. This default value can be set with the
configure option --enable-polkit.

This commit adds a new class NMAuthManager that reimplements the
relevant DBUS client parts. It takes source code from the polkit
library.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-09-29 13:51:11 +02:00
Thomas Haller 63a8c6a184 build: generate man/NetworkManager.conf.xml by autoconf
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-09-29 13:00:11 +02:00
Dan Winship 280b1e5067 libnm: merge libnm-vpn into libnm
There's not much point in keeping them separate: all existing
libnm-glib-vpn users also link against libnm-glib, and the amount of
extra code added to libnm by merging in libnm-vpn is negligible.

Additionally, nm-vpn-plugin will later need access to some
libnm-internal APIs.

So, merge them together.
2014-09-18 11:51:07 -04:00
Dan Williams 6d659ab2cd build: fix build after "settings: create default wired connection..."
Fix build broken by beb18050b5
2014-09-11 17:14:27 -05:00
Dan Williams 544fc82aa7 core: consolidate helper progam searching (bgo #734131)
Instead of having basically the same code in a bunch of different
place to find helper programs, just have one place do it.  Yes, this
does mean that the same sequence of paths is searched for all helpers
(so for example, dnsmasq will no longer be found first in /usr/local)
but I think consistency is the better option here.

https://bugzilla.gnome.org/show_bug.cgi?id=734131
2014-09-11 12:11:56 -05:00
Dan Williams 37f11fbdf8 platform: add support for kernel IPv6LL address generation modes
This patch requires both upstream kernel support for
IFLA_INET6_ADDR_GEN_MODE which was merged in this patch:

ipv6: addrconf: implement address generation modes
bc91b0f07ada5535427373a4e2050877bcc12218

and corresponding libnl support, merged in these patches:

veth: add kernel header linux/veth.h for VETH defines
9dc6e6da90016a33929f262bea0187396e1a061b

link: update copy of kernel header include/linux/if_link.h
b51815a9dbd8e45fd2558bbe337fb360ca2fd861

link/inet6: add link IPv6 address generation mode support
558f966782539f6d975da705fd73cea561c9dc83
2014-09-04 15:10:26 -05:00
Dan Williams 448254f761 ibft: add settings plugin for reading iBFT configuration (bgo #734009)
Instead of handling iBFT (iSCSI Boot Firmware Table) in the ifcfg-rh plugin,
create a new plugin for it.  This allows all distributions to use iBFT
configuration, and makes both iBFT handling and ifcfg-rh less complicated.

The plugin (like the old ifcfg-rh code) creates read-only connections backed
by the data exported by iscsiadm.  The plugin does not support adding new
connections or modifying existing connections (since the iBFT data is
read-only anyway).  Instead, users should change their iBFT data through
the normal firmware interfaces.

Unmanaged devices can be configured through NetworkManager.conf and the
normal 'keyfile' mechanisms.

(In the future, we'll read this data directly from the kernel's
/sys/firmware/ibft/ethernetX directory instead of iscsiadm, since the
kernel has all the information we need and that's where iscsiadm gets
it from anyway.)

https://bugzilla.gnome.org/show_bug.cgi?id=734009
2014-08-29 18:46:11 -05:00
Jiří Klimeš 1c2174a802 libnm-util: generate-plugin-docs.pl script for extracting plugin docs
The scripts extracts plugin description from document comments for particular
properties and builds a XML file out of the data. The XML file can be used
later for generating manual pages or other documentation.

Unfortunately, gtk-doc won't allow descriptions that would be separated from
the main gtk-doc stuff. But it is still useful to have plugin description bits
co-located with property definitions. We use our home-grown comments and parse
them ourself. Afterall it's not that bad, and in addition it brings us a
freedom in shaping the comments to our needs.
2014-08-29 13:59:44 +02:00
Thomas Haller e1de236db1 build: add configure option not to install udev rules
Previously, user could only change the udev base directory,
but not disabling installation entirely.

Support this now with:
  ./configure --with-udev-dir=no
or
  ./configure --without-udev-dir

Also, just passing '--with-udev-dir' equals '--with-udev-dir=yes'.
Treat 'yes' equal to the default '/lib/udev'.

Also, check that the path is an absolute path starting with a '/'.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-08-26 19:37:51 +02:00
Dan Winship c5daa4c4df docs: add libnm documentation
Add docs infrastructure
2014-08-01 14:34:05 -04:00
Dan Winship eedcf185a7 libnm: add libnm/libnm-core (part 2)
This fixes up the code from the previous "clean" import, and adds
build infrastructure.

[There are two slightly orthogonal sets of changes in this patch.
First, the files added in the previous commit were modified as followed:

  # Replace internal references to "libnm-util" and "libnm-glib" with "libnm"
  perl -pi -e 's/libnm-(util|glib)/libnm/;' libnm-core/*.[ch] libnm-core/tests/*.[ch] libnm/*.[ch] libnm/tests/*.[ch]

  # Fix includes of the enum-types files
  perl -pi -e 's/nm-utils-enum-types/nm-core-enum-types/;' libnm-core/*.[ch] libnm-core/tests/*.[ch] libnm/*.[ch] libnm/tests/*.[ch]
  perl -pi -e 's/nm-glib-enum-types/nm-enum-types/;' libnm/*.[ch] libnm/tests/*.[ch]

  # Fix some python example code
  perl -pi -e 's/import NMClient/import NM/;' -e 's/NMClient.Client\(\)/NM.Client()/;' libnm/nm-client.c

Then, the build infrastructure was added (without further modifying
any existing files in libnm-core or libnm.)

Note: to regenerate libnm.ver after rebase:
  (head -2 libnm-util/libnm-util.ver; (grep -h '\s'nm_ libnm-util/libnm-util.ver libnm-glib/libnm-glib.ver | env LANG=C sort); tail -3 libnm-util/libnm-util.ver) > libnm/libnm.ver
]
2014-08-01 14:34:04 -04:00
Thomas Haller 833ea6944d build: fix linker error for '--disable-concheck' and add '--with-libsoup'
When building with '--disable-concheck' with libsoup installed,
configure would set HAVE_LIBSOUP. But without connection
checking, we didn't link against libsoup, resulting in a
linker error.

Add a new configure option '--with-libsoup' / '--without-libsoup'
to control whether linking against libsoup.
The combination '--without-libsoup --enable-concheck' does not
make sense.

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

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-07-31 22:19:52 +02:00
Dan Winship 8aa3b9859b core: merge src/config, src/logging, src/posix-signals into src/
Some subdirectories of src/ encapsulate large chunks of functionality,
but src/config/, src/logging/, and src/posix-signals/ are really only
separated out because they used to be built into separate
sub-libraries that were needed either for test programs, or to prevent
circular dependencies. Since this is no longer relevant, simplify
things by moving their files back into the main source directory.
2014-07-30 15:56:29 -04:00
Dan Winship 763ce29e58 test: drop this directory
The remaining contents of the test/ directory are:

  - 2 python example programs that aren't as good as the ones in examples/

  - a test of the deprecated libnm_glib API which isn't as good as the one
    in libnm-glib/

  - A DHCP-related test program that hasn't been relevant since 2005

Let's just kill it all
2014-07-30 15:56:29 -04:00
Dan Winship 3d25d70461 clients: reorganize source tree, put all the installed clients together
Create a new clients/ subdirectory at the top level, and move cli/ and
tui/ into it, as well as nm-online.c (which was previously in test/,
which made no sense).

cli/ was split into two subdirectories, src/ and completion/. While
this does simplify things (given that the completion file and the
binary both need to be named "nmcli"), it bloats the source tree, and
we can work around it by just renaming the completion file at install
time. Then we can combine the two directories into one and just have
it all under clients/cli/.
2014-07-30 15:56:19 -04:00
Dan Winship 7eb0288aa0 libnm-util: move NetworkManager.h, etc, from include/ to here
NetworkManager.h, NetworkManagerVPN.h, and nm-version.h are part of
the libnm-util API, so move them to libnm-util.

include/ still contains headers that are strictly NM-internal (eg,
nm-glib-compat.h).
2014-07-15 09:44:54 -04:00
Dan Winship 377f72a66f build: fix nm-setting-docs build in various configurations
Certain build configurations (like --enable-gtk-doc
--disable-introspection) were broken with respect to nm-setting-docs.
Fix this. Also, we don't require just gobject-introspection, we need
pygobject specifically as well.
2014-06-27 17:24:57 -04:00
Dan Williams 29297f8531 build: check harder for readline
Not all distros build their readline linked with a termcap library,
since apps are (apparently) supposed to choose one for themselves
and explicitly link to it when using readline.  So add some checks
to figure out whether readline is already linked, and if not, prefer
ncurses since we use that for nmtui already.

ax_lib_readline based off:

http://www.gnu.org/software/autoconf-archive/ax_lib_readline.html
2014-06-27 13:10:50 -05:00
Thomas Haller 38a83e15a2 team: make team support a plugin
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-27 13:27:01 +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
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
Michael Biebl ec1034a03a build: fix bashisms in configure.ac
[[ && ]] is a bashism, so use [ ] && [ ] instead.
Also use readlink -f instead of realpath, since the latter is not
guaranteed to be installed.
2014-06-17 11:33:50 -05:00
Thomas Haller 9f114f661a build: remove libndp location in summary of ./configure
This is a left-over from the early days of libndp when
the libarary was optionally a git-submodule of NetworkManager.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-12 14:58:48 +02:00
Thomas Haller 2af20f9389 release: bump version to 0.9.11.0 (development) 2014-06-07 02:09:00 +02:00
Dan Williams c817409fc0 release: bump version to 0.9.9.95 (0.9.10-beta1) 2014-06-06 18:28:21 -05:00
Thomas Haller e3784fa618 platform/test: always run linux platform tests (will be skipped as non-root)
Always run the linux platform tests, even if called as non-root user.
In such a case, print a message and return 77 (signalizing that the test
was skipped).

Only if we configured with --enable-test=root, we enforce that the
user executes the tests as root.

Co-Authored-By: Pavel Šimerda <psimerda@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-06-05 18:12:58 +02:00
Jiří Klimeš 03be41d409 cli/build: make libreadline a build-time dependency (bgo #729846)
and link nmcli against it.

This simplifies code, makes sure that line editing capability is supported,
and will allow using readline on other places too.

https://bugzilla.gnome.org/show_bug.cgi?id=729846
https://bugzilla.redhat.com/show_bug.cgi?id=1007365
2014-06-04 09:47:37 +02:00
Dan Williams 06e3c6d02f wifi: make Wi-Fi support a plugin
Make Wi-Fi support a plugin using the new device factory interface.
Provides a 7% size reduction in the core NM binary.

        Before    After
NM:    1154104  1071992  (-7%)
Wi-Fi:       0   110464

(all results from stripped files)
2014-05-13 12:38:43 -05:00
Dan Winship 7955806a02 ppp-manager: don't use kernel pppoe (rh #1034860, rh #1061641)
The kernel PPPoE code disconnects when it receives a PADT frame, but
doesn't notify userland about it. So if the server sends a PPPoE PADT
without having sent the standard PPP LCP Termination request first,
then pppd (and thus NetworkManager) will not know that the connection
has been disconnected.

This should eventually be fixed in the kernel, but for now, work
around this by using the userland pppoe client rather than the kernel
code.
2014-04-14 10:11:05 -04:00
Dan Winship ebc5ea0b80 ppp-manager: find pppd at build time, allow overriding
Add --with-pppd, just like --with-dnsmasq.

Also change "ppp" to "pppd" for clarity in a few places.
2014-04-14 10:11:05 -04:00
Jiří Klimeš da354830da core: build with SELinux; don't break /etc/hostname context (rh #1070829)
https://bugzilla.redhat.com/show_bug.cgi?id=1070829
2014-03-31 17:44:15 +02:00
Dan Winship a18248dd1b devices: rename "atm" plugin to "adsl", and "bt" to "bluetooth"
The atm/adsl plugin really is a generic ATM plugin but (a) it needs a
bit of work to do IPoATM rather than just PPPoATM and PPPoEoATM, and
(b) most people currently using NM's ATM support are using DSL devices
not actual ATM cards anyway, and have no idea what "ATM" even means.
If we add the necessary IPoATM support later we can rename the plugin
back to -atm
2014-03-19 14:56:47 -04:00
Jiří Klimeš 94d0d30e95 team: read team port config in nm_team_update_slave_connection() (rh #1035859)
Without reading team port config we would fail to assume team slaves.

libteam provides teamdctl_port_config_get_raw_direct() from 1.9 up
See https://bugzilla.redhat.com/show_bug.cgi?id=1028138

https://bugzilla.redhat.com/show_bug.cgi?id=1035859
2014-03-12 10:44:29 +01:00
Dan Williams aeb1e103d8 mobile: make WWAN support a plugin
Make WWAN support a plugin using the new device factory interface.
Provides a 5% size reduction in the core NM binary.

     Before    After
NM: 1187224  1125208  (-5%)
MM:       0   100576

(all results from stripped files)
2014-03-03 09:32:41 -06:00
Dan Williams a9591aecaf bluez: make Bluetooth support a plugin
Make Bluetooth support a plugin using the new device factory interface.
Provides a 5% size reduction in the core NM binary.

     Before   After
NM: 1253016 1187224 (-5%)
BT:       0   85752

(all results from stripped files)
2014-03-03 09:32:41 -06:00
Dan Williams 71a52347f3 atm: make ADSL support a plugin
Make ADSL support a plugin using the new device factory interface.
Provides a 1% size reduction in the core NM binary.

      Before    After
NM:  1265336  1253016  (-1%)
ATM:       0    27360

(all results from stripped files)
2014-03-03 09:32:41 -06:00
Thomas Haller 16bbc90c16 release: bump version to 0.9.9.1 (development)
Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-28 14:21:35 +01:00
Dan Winship 932aa29026 trivial: fix configure.ac comment 2014-02-19 13:43:10 -05:00
Aleksander Morgado 3b76ae18a5 modem-manager: if building systemd support, assume it manages the MM lifecycle
We will not explicitly poke MM to start it if NetworkManager is built with
systemd support.

https://bugzilla.gnome.org/show_bug.cgi?id=703040
2014-02-13 12:06:17 -05:00
Dan Winship 64c5395cb1 build: improve our use of glib's version macros to catch more bugs
We were setting GLIB_VERSION_MAX_ALLOWED to 2.34, since we provide
reimplementations of a few 2.34 functions in nm-glib-compat.h. But
this was turning off warnings for the 2.34+ APIs we *didn't* have
compat versions of too.

Fix this by setting MAX_ALLOWED to 2.32 (same as MIN_REQUIRED), and
defining macros to wrap calls to compat-ified functions and disable
deprecation warnings around them.

This points out several places where we were accidentally using 2.34
APIs without noticing, which need to be fixed now.
2014-02-13 11:24:37 -05:00
Thomas Haller 8da98026da build: include the git commit id of HEAD in ./configure
`make dist` packs the 'configure' file in the tarball, so this is
useful, to include the commit id into the release tarball.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2014-02-05 17:13:23 +01:00
Dan Winship dd58d9c703 build: drop the libndp submodule
libndp has existed for a while now. 1.0 was released six months
ago. So drop the submodule and just require an installed package.
2014-02-03 12:13:41 +01:00
Dan Williams d18f524984 wifi: add nl80211 Critical Protocol indication support
At critical times during the connection process, especially during
DHCP and EAPOL, the driver can increase the reliability of communication
in an attempt to increase the possibility of success.  This could be
done by suppressing bluetooth for a short period, or locking in a low
(and thus more reliable) bitrate, or enforcing some other interference
protection.  The 3.10 kernel added nl80211 support for this, so lets
use it if we can.
2014-01-31 14:11:28 -06:00
Dan Williams 32a001f526 core: allow custom IP address ranges for Shared connections (bgo #675973)
Given an IPv4 address and prefix for a shared config, figure out
the DHCP address range automatically.  To keep things simple we
allow a max of 252 addresses (not including network address,
broadcast address, and the hotspot) no matter what prefix you use,
so if the address is 10.0.10.1, you still only get a range of
10.0.10.2 -> 10.0.10.254.

But we also leave some addresses available above the host address
for static stuff, like we did before.  This is done on a sliding
scale from 0 to 8 addresses, where about 1/10th the number of
available addresses are reserved.

https://bugzilla.gnome.org/show_bug.cgi?id=675973
2014-01-23 16:21:01 -06:00
Jan Alexander Steffens 691422a460 build: add --with-dnsmasq, to specify dnsmasq path
https://bugzilla.gnome.org/show_bug.cgi?id=700219
2014-01-03 14:51:16 -05:00
Dan Winship dfe194eea6 dns-manager: don't add "public suffix" domains to search (rh #851521)
If the hostname is "foo.example.com" then we want to add
"search example.com" to resolv.conf, but if it's just "example.com",
we don't want to add "search com" (rh #812394).

So if NetworkManager is being built with recent libsoup, use
soup_tld_domain_is_public_suffix() to double-check the domain before
adding it. (If it is not being built with libsoup, or is being built
with too old a version, we just skip that test, keeping the old
behavior.)
2013-12-20 09:31:04 -05:00
Dan Winship 7481c64ad5 systemd: add "Before=network.service" on Fedora/RHEL (rh #1034983)
On Fedora/RHEL, NetworkManager.service needs to be started before
network.service, or else network.service may try to bring up NM's
devices itself.
2013-12-17 09:45:18 -05:00
Dan Winship 3bda3fb60c nmtui: initial import of nmtui
nmtui is a TUI (curses-based Text User Interface) for NetworkManager
2013-12-13 16:00:51 +01:00