Commit Graph

13873 Commits

Author SHA1 Message Date
Lubomir Rintel
7e5f27a21c manager: let external devices go on removal
If we didn't create them, we shouldn't keep them around unrealized.
2015-12-09 15:41:39 +01:00
Beniamino Galvani
e25d144d77 merge: macvlan and macvtap devices creation support
https://bugzilla.gnome.org/show_bug.cgi?id=755986
2015-12-09 14:30:27 +01:00
Beniamino Galvani
f841f17882 libnm: add NMDeviceMacvlan 2015-12-09 14:30:08 +01:00
Beniamino Galvani
4de8851eca device/macvlan: support device creation 2015-12-09 14:30:08 +01:00
Beniamino Galvani
3871056019 platform: add macvtap link creation support 2015-12-09 14:30:08 +01:00
Beniamino Galvani
62c1f2c6a8 platform/tests: test macvlans also using platform code 2015-12-09 14:30:08 +01:00
Beniamino Galvani
27c0f8def4 platform: add macvlan link creation support 2015-12-09 14:30:08 +01:00
Beniamino Galvani
c3e6e25239 cli: add macvlan support 2015-12-09 14:30:08 +01:00
Beniamino Galvani
4d0192e661 libnm-core: add NMSettingMacvlan
The setting contains properties that are specific to macvlans and
macvtaps.
2015-12-09 14:30:08 +01:00
Beniamino Galvani
c1be9856bf platform: return the macvlan mode as integer
It's easier to handle it as an integer than as a string.
2015-12-09 14:30:07 +01:00
Thomas Haller
783b3642d0 man: correct manual page with respect to whitespace in device-spec 2015-12-09 14:08:43 +01:00
Beniamino Galvani
4a9ae9d14e device/tun: set tun mode when the device is created
Otherwise after 72c36bd6db ("device/tun: fix reloading tun
properties") the mode would remain always set to the default value
"tun".

Fixes: 9110ad39c5
2015-12-09 13:48:59 +01:00
Jiří Klimeš
20e750a3c3 libnm: fix description of NMDeviceIPTunnel:input-key property
Fixes: e2da055f90
2015-12-09 13:33:17 +01:00
Jiří Klimeš
1a48e5d918 libnm: fix indenting in libnm/nm-device-ip-tunnel.c
Fixes: e2da055f90
2015-12-09 13:29:02 +01:00
Thomas Haller
b9a35b6913 device/trivial: rename variable 2015-12-09 12:49:29 +01:00
Thomas Haller
e967cbd0bf device: during activating device transit to DISCONNECTED state
When activating a device, we must progress the device state to
disconnected state.

This matters when activating a device without carrier. In this
case we would have skipped DISCONNECTED state. Skipping the
device state then leads to other issues like a slave device
never noticing that the master got ready.
2015-12-09 12:42:50 +01:00
Thomas Haller
2d1d187493 device: add NM_DEVICE_CHECK_DEV_AVAILABLE_FOR_USER_REQUEST flag
This generalizes _NM_DEVICE_CHECK_DEV_AVAILABLE_IGNORE_CARRIER.
2015-12-09 12:08:40 +01:00
Thomas Haller
7eeadc2caf device: fix enum value NM_DEVICE_CHECK_CON_AVAILABLE_ALL
ALL had wrongly the value 0x05 instead of 0x03.
2015-12-09 12:04:36 +01:00
Beniamino Galvani
158c63eb2c device: move initialization of ifindex to constructor()
Device subclasses (for example NMDeviceWifi) can use the ifindex in
their constructor(), but the value now is set later in
parent class constructed(). This causes the following:

  nm_platform_wifi_get_capabilities: assertion 'ifindex > 0' failed

Fix this by initializing ifindex earlier in NMDevice's
constructor(). While at it, remove the

  nm_assert (pllink->type != NM_LINK_TYPE_NONE);

assertion, since pllink can be NULL there.

Fixes: 6db04dc206
2015-12-09 11:09:48 +01:00
Jiří Klimeš
3e5fea9820 cli: TAB-complete yes/no for boolean properties in the editor 2015-12-09 09:31:36 +01:00
Lubomir Rintel
e68619df06 merge: branch 'lr/device-link-type'
Avoids a mismatch of incompatible devices of the same class. Consider two
devices of tap class, one of tun mode and one of tap mode.
2015-12-08 18:14:53 +01:00
Lubomir Rintel
1762d58a8c manager: improve the add_device() error handling a bit
Let it indicate that it didn't succeed adding a device to the global list and
bail out.
2015-12-08 18:11:53 +01:00
Lubomir Rintel
f72d0f6efb device: set link type from all factories
This is, in particular, important for devices that support multiple link types
which can not be changed once the platform device exists.
2015-12-08 18:11:53 +01:00
Lubomir Rintel
7dbf821cb2 device: precisely match the link type to the platform device
The unrealized device's factory could be using one particular link type, don't
allow matching the device to a non-matching one.
2015-12-08 18:11:53 +01:00
Lubomir Rintel
6db04dc206 device: add link_type property
This is to make it possible for the device factories to indicate the desired
link type and make it possible to avoid matching the unrealized device to a
platform device of different link type.
2015-12-08 18:11:52 +01:00
Thomas Haller
5201c3d8f9 trival: fix whitespace 2015-12-08 11:52:37 +01:00
Thomas Haller
3a3b32a9f6 config: add defines for key names for keyfile 2015-12-08 11:47:56 +01:00
Thomas Haller
7685961261 active-connection: improve logging in NMActiveConnection
- cleanup _NMLOG()
- implement state_to_string() based on NM_UTILS_STRING_LOOKUP_TABLE(),
  which prints unknown values as numeric
- add logging when setting device and state
- cleanup logging in check-master-ready to consistently
  print relevant information
- update logging in set_master() to match simpler logging
  format like set_device() and set_state().
2015-12-07 21:47:01 +01:00
Thomas Haller
cc99ab81f3 macros: add nm_sprintf_bufa() 2015-12-07 21:36:16 +01:00
Thomas Haller
1104110865 device: fix crash in master_ready() logging unset priv->master
Fixes: f45f702a5e
2015-12-07 21:36:16 +01:00
Thomas Haller
03f8ba490a core: use define for NMManager's "state-changed" signal name 2015-12-07 19:54:12 +01:00
Thomas Haller
3755209039 core: use define for NMPPPManager's "state-changed" signal name 2015-12-07 19:54:11 +01:00
Thomas Haller
e1738c7c61 core: use define for NMDnsMasqManager's "state-changed" signal name 2015-12-07 19:53:14 +01:00
Thomas Haller
ee4ec4e600 core: use define for NMDevice's "state-changed" signal name 2015-12-07 19:53:14 +01:00
Thomas Haller
04c70c76bc device: cache pointer to private-data in NMDevice structure
We often lookup the private data and retrieve it via NM_DEVICE_GET_PRIVATE(),
which in turn calls G_TYPE_INSTANCE_GET_PRIVATE().

Instead cache the pointer to the private data.

There are up- and downsides:

 - requries additional sizeof(gpointer) bytes for each NMDevice.
 + retrieving the private pointer will be slightly faster.
 + easier debugging in gdb as it is currently often a pain to
   retrieve the private data.

But most importantly, the allows to change our common pattern
to first cache the private data in a variable @priv. That is
often cumbersome to write, especially for short functions.
This change gives us a choice to use self->priv directly.

Such a change should not be aimed for every class. Instead it makes
mostly sense for NMDevice, where it pays off better due to the
class' size and ubiquitous use.

https://mail.gnome.org/archives/networkmanager-list/2015-December/msg00017.html
2015-12-07 19:30:11 +01:00
Lubomir Rintel
2077dee582 device: fix a typo in assertion
It is well understood that world would implode if the device was its own master.

Fixes: f45f702a5e
2015-12-07 19:02:54 +01:00
Jiří Klimeš
e29b844f42 cli: produce new line after readline when echoing was off
The new line was missing.
Adding termios_new.c_lflag |= (ECHONL | ICANON); did not help. Why?

Fixes: a14306c2ce
2015-12-07 17:33:03 +01:00
Thomas Haller
229ea4547c device: don't pass void* pointer to NM_DEVICE_GET_PRIVATE() 2015-12-07 16:34:48 +01:00
Thomas Haller
14bb9419a0 examples: add README for python-networkmanager NetworkManager library 2015-12-07 16:06:46 +01:00
Thomas Haller
5b732c3b9f examples: add README for examples/python/gi 2015-12-07 15:59:20 +01:00
Thomas Haller
9b2a34c978 route-manager: always flush IPv6 routes during nm_route_manager_route_flush() 2015-12-07 15:23:27 +01:00
Thomas Haller
0a6cca9450 device: use NM_UTILS_STRING_LOOKUP_TABLE() for reason_to_string()
Showcase for the new macros NM_UTILS_STRING_LOOKUP_TABLE() and
NM_UTILS_STRING_LOOKUP_TABLE_DEFINE_STATIC().

It changes behavior in case of looking up an invalid/unknown
state reason. Previously it would just have returned "unknown"
-- which was indistinguishable from a regular "unknown" value.

Now it returns the numeric id as a string. The string is allocated
with alloca(), which is desired but one should be aware of the pitfalls:

- prevents the caller from being inlined
- bad idea to do in a loop.
2015-12-07 14:41:32 +01:00
Thomas Haller
a291ecc29c utils: add NM_UTILS_STRING_LOOKUP_TABLE() macro 2015-12-07 14:34:59 +01:00
Thomas Haller
01ea90b57a utils: minor refactoring of NM_UTILS_FLAGS2STR_DEFINE() macro 2015-12-07 14:34:59 +01:00
Jiří Klimeš
c52b2044cd merge: nmcli: don't show password by default, add --show-secrets (rh #759116)
https://bugzilla.gnome.org/show_bug.cgi?id=759116
2015-12-07 14:25:37 +01:00
Jiří Klimeš
629de4e689 cli: add global --show-secrets option
- it controls echoing passwords input on terminal
- it replaces --show-secrets in 'nmcli connection show', which is deprecated now
- it replaces --show-password in 'nmcli device wifi hotspot', which is deprecated now
2015-12-07 14:14:58 +01:00
Jiří Klimeš
23aff47826 cli: use nmc_readline_echo() for asking password in 'nmcli con add' 2015-12-07 14:14:58 +01:00
Jiří Klimeš
1056408fd4 cli: use nmc_readline_echo() for asking password in 'nmcli dev wifi connect' 2015-12-07 14:14:58 +01:00
Jiří Klimeš
02388060c1 cli: use new nmc_readline_echo() in polkit agent 2015-12-07 14:14:58 +01:00
Jiří Klimeš
a14306c2ce cli: do not echo passwords on terminal when asking for them
adds nmc_readline_echo() function that can disable displaying characters.
2015-12-07 14:14:58 +01:00