Commit Graph

7740 Commits

Author SHA1 Message Date
Weiping Pan
ee4b05cfc6 ifcfg-rh: add ifcfg-vlan parser
The example of ifcfg-vlan is as followed:

VLAN=yes
TYPE=Vlan
DEVICE=vlan43  or "DEVICE=eth9.43"
PHYSDEV=eth9
REORDER_HDR=0
VLAN_FLAGS=GVRP,LOOSE_BINDING
VLAN_INGRESS_PRIORITY_MAP=0:1,2:5
VLAN_EGRESS_PRIORITY_MAP=12:3,14:7
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.43.149
NETMASK=255.255.255.0

And we try to make it compitable with the format used by initscripts,
and there is no need to change anything in ifcfg-eth9.

Signed-off-by: Weiping Pan <wpan@redhat.com>

(dcbw: complete VLAN testcase)
2012-02-16 15:05:55 -06:00
Dan Williams
552c9959cc libnm-util: various cleanups and documentation fixes
Add documentation so the API spec generator can do something
for the VLAN setting.  Also enforce validation of the ingress
and egress priority maps; 802.1D priorities are limited to
values from 0 - 7 and Linux SKB values are 32 bits.

Also, the 'slave' property is a duplicate of the 'master'
property added to NMSettingConnection in the bonding work
so we can get rid of it and use 'master' instead.
2012-02-16 15:05:55 -06:00
Weiping Pan
23c1b6ad30 libnm-util: add VLAN setting and properties
Signed-off-by: Weiping Pan <wpan@redhat.com>

(dcbw: formatting cleanups and priority map code simplifications)
2012-02-16 15:05:55 -06:00
Dan Williams
3f963d308a build: fix distcheck due to missing ifcfg-rh test files 2012-02-16 15:05:26 -06:00
Dan Williams
8572ecfd7c libnm-glib: don't crash on unknown object types
Like when an old libnm-glib is being run against a newer NM when
a new device type has been added.
2012-02-16 12:54:47 -06:00
Dan Williams
836f7d177e wifi: fix removal of APs from the scan list when it doesn't change
Due to an omission in the port to the new supplicant D-Bus API
during the 0.9 cycle, if the scan list didn't change, APs may
not have been removed properly from the scan list.
2012-02-16 12:54:42 -06:00
Thomas Graf
4f166d719b bonding: convert individual bonding options to a dict
Removes all bonding options properties and adds a "options" dict to hold
them all. Accessible via accessor functions. ifcfg interface is
unchanged.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-15 21:49:05 -06:00
Thomas Graf
5a3e1caec1 ifcfg-rh: add bonding test cases
Adds two simple test cases for bonding masters and bonding slaves.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-15 21:28:33 -06:00
Dan Williams
7b48862ef6 build: fix distcheck 2012-02-15 19:38:18 -06:00
Dan Williams
cd2603c713 api: fix various Infiniband introspection XML omissions 2012-02-15 17:32:41 -06:00
Dan Winship
839eab5564 Use glib-mkenums to generate enum types
Rather than generating enum classes by hand (and complaining in each
file that "this should really be standard"), use glib-mkenums.

Unfortunately, we need a very new version of glib-mkenums in order to
deal with NM's naming conventions and to fix a few other bugs, so just
import that into the source tree temporarily.

Also, to simplify the use of glib-mkenums, import Makefile.glib from
https://bugzilla.gnome.org/654395.

To avoid having to run glib-mkenums for every subdirectory of src/,
add a new "generated" directory, and put the generated enums files
there.

Finally, use Makefile.glib for marshallers too, and generate separate
ones for libnm-glib and NetworkManager.
2012-02-15 11:42:15 -05:00
Jiří Klimeš
0b57cc68fd examples: fix dependency on GDBus (it's available only in GLib >= 2.26) 2012-02-14 09:03:21 +01:00
Ryan Lortie
227f36d3d5 core: #include <netinet/in.h> for struct in6_addr
commit ae34fa900b introduced a new
function nm_netlink_route6_add().  Its declaration in the header
includes a parameter with type 'struct in6_addr', but the proper
system header for that type was not included.
2012-02-13 17:44:07 -05:00
Jiri Popelka
1e4ccb39d4 firewall: add remove_from_zone()
nm_firewall_manager_remove_from_zone() is called from
nm_device_deactivate()

Also fix nm_firewall_manager_add_to_zone() to the latest
FirewallD1.zone.addInterface signature.
2012-02-13 13:23:20 -06:00
Jiri Popelka
dc385c25cf firewall: update FirewallD DBus service & path & interface 2012-02-13 13:12:01 -06:00
Dan Williams
ae34fa900b core: fix erroneous IPv6 routes by making route addition typesafe
Add two helper functions, one for IPv4 and one for IPv6, to ensure
that the core code benefits from compiler type checking when adding
routes.  Previously nm_netlink_route_add() took a void* which meant
we messed up adding IPv6 routes sometimes due to confusion over
what was supposed to be passed to it.  Also fixes what appears to
be a C&P error with add_ip6_route_to_gateway().

Reported by Tomáš Trnka <tomastrnka@gmx.com>
2012-02-13 13:10:23 -06:00
Jiří Klimeš
0c83e6e3b1 examples: add C example for monitoring overall NetworkManager state 2012-02-13 15:41:35 +01:00
Alexandre Rostovtsev
fe29aa967c ifnet: properly unquote hostnames with g_shell_unquote() (bgo #669148)
If /etc/conf.d/hostname contains "hostname='foo'", then the hostname
needs to be set to "foo", not "'foo'".

https://bugzilla.gnome.org/show_bug.cgi?id=669148
2012-02-13 11:03:28 +01:00
Dan Williams
a9c22166f6 libnm-glib: ensure some new private symbols stay private
_ is our "private" prefix.
2012-02-10 15:03:12 -06:00
Dan Williams
643f0a151c build: fix build breakage caused by b378c3089c 2012-02-10 14:56:35 -06:00
Dan Williams
4041ca7e3e core: trivial device creation cleanup
We really need an NMDevice here, so just call it that instead of
GObject.
2012-02-10 12:21:10 -06:00
Dan Williams
d721d02c18 ifcfg-rh: sub filename characters that are annoying to type
Since people apparently hate any extra typing, and tools just can't
find it in them to deal with human readable file names, escape some
of the more annoying characters in shell-land.

Suggested by David Lutterkort
2012-02-09 18:38:27 -06:00
Dan Williams
b378c3089c core: make NMActiveConnection a base class for NMActRequest and NMVPNConnection
That was always the goal, but never got there.  This time we need it
for real to abstract handling of dependent connections so bite the
bullet and make it happen.
2012-02-09 17:54:26 -06:00
Dan Williams
8fd900c2dc core: let nm_system_get_iface_type() take an interface index
We prefer indexes to names in the core since indexes don't change.
2012-02-09 17:16:30 -06:00
Dan Williams
0a18078b73 settings: add nm_settings_get_connection_by_uuid() 2012-02-09 17:10:44 -06:00
Weiping Pan
c50def68ff trivial: remove unused prototype 2012-02-09 17:09:38 -06:00
Colin Walters
e4f51d1968 build: allow --set-more-warnings=no|yes|error
For the GNOME autobuilders, we want compiler warnings, but don't want
-Werror.  For developer compatibility, the default value is "error".

https://bugzilla.gnome.org/show_bug.cgi?id=668974
2012-02-09 16:54:04 -06:00
Dan Winship
c721477d11 libnm-glib: fix premature child object signal emission
The notifications for child objects (like NMClient's device-added
signal or NMDeviceWifi's access-point-added signal) could get emitted
before the child objects were actually constructed, because
object_created() decrements the properties-retrieved tracking
variable, which wasn't always incremented before calling that
function.
2012-02-09 13:25:59 -06:00
Benjamin Franzke
c24c4d489f core: fix undefined reference to assert in session-monitor-{systemd, null}
assert.h is not included, that results in an undefined
reference to assert, just use g_assert instead.
2012-02-09 10:48:20 -06:00
Benjamin Franzke
49173e9a3a core: report username in systemd uid_has_session
For nm_auth_uid_in_acl to be successfull its required that
nm_session_monitor_uid_has_session returns a user_name.
2012-02-09 10:48:20 -06:00
Jiří Klimeš
d4d89bb0f5 cli: add REASON field to 'nmcli dev list' output 2012-02-09 15:39:57 +01:00
Jiří Klimeš
39d25c2abb libnm-glib: add nm_device_get_state_reason() to libnm-glib.ver to export it
It was forgotten in the previous commit
2012-02-09 15:34:19 +01:00
Jiří Klimeš
81b697c57b libnm-glib: add StateReason property for NMDevice 2012-02-08 10:27:57 +01:00
Dan Williams
5581114726 supplicant: early exit if EAP-FAST is not supported by the supplicant
EAP-FAST used to require some patches to OpenSSL which aren't always
applied.  We can't depend on the supplicant supporting EAP-FAST like
we can for EAP methods that don't require any special support from
external libraries.  To ensure the error gets reported correctly and
early, fail the configuration step if EAP-FAST isn't supported by
the supplicant but the connection requests it.
2012-02-07 23:46:12 -06:00
Dan Williams
d501b6a9f6 modem: delay connect a bit after sending the PIN
Modems take a bit of time, and ModemManager may not quite be
ready for immediate connect after sending the PIN since the
modem isn't enabled.  The specific issue was that MM is still
closing serial ports, so if we try to enable too soon we'll
get an error about serial ports being closed.
2012-02-07 23:00:23 -06:00
Thomas Bechtold
32157d5187 libnm-glib: fix missing G_VALUE_INIT to not depend on newer glib 2012-02-07 12:43:39 -06:00
Dan Williams
7f9fe7601e libnm-glib: better debugging of property accesses and updates
Need to initialize libnm-util to get GValue transforms registered
so the property values print out as strings.  Then actually print
some debugging information about properties.
2012-02-07 12:36:45 -06:00
Dan Williams
57bd84139f libnm-glib: ensure synchronous property updates are actually synchronous
Some property updates (mainly those dealing with properties that
hold objects themsevles) weren't being done in a synchronous manner
when synchronicity was requested.  Make sure that happens.
2012-02-07 12:35:12 -06:00
Dan Williams
ca27121ad6 libnm-util: register more GValue transformations for debugging 2012-02-07 12:33:03 -06:00
Dan Williams
d8dd385a67 wifi: fix nl80211 periodic signal reporting to be more frequent
BSS info apparently doesn't get updated that often since it's
based on scan information, so instead use the AP info which updates
with every beacon.  Using the BSS info caused the signal to
be the same value over long periods of time even when moving far
away from the AP.
2012-02-07 10:23:54 -06:00
Jiří Klimeš
13bba719f9 systemd: suppress logging each message twice when run via systemd (rh #751275) 2012-02-07 14:59:53 +01:00
Thomas Bechtold
49106d8845 core: fix singleton handling in NULL/systemd session monitor 2012-02-07 13:42:18 +01:00
Dan Winship
410ac72325 libnm-glib: fix to not depend on newer glib 2012-02-06 17:29:49 -06:00
Dan Williams
95b0b72211 core: move device creation into the manager
Consolidate device creation in the manager object; bluetooth and
modem devices were already handled by it, so it makes sense to do
it all from one place.  Furthermore we'll be creating virtual devices
in the manager too.  It also reduces indirection (no need to send
device_creator() in the DEVICE_ADDED signal) and makes the code
flow clearer.
2012-02-05 23:18:32 -06:00
Dan Williams
925d5e016b docs: reference NMRemoteSettings from NMClient creators
It can be a bit confusing that one object doesn't do both
control and configuration.  So throw users a bone and tell
them how.
2012-02-03 10:38:38 -06:00
Dan Winship
c619365ee3 libnm-glib: asyncify NMRemoteSettings
Add nm_remote_settings_new_async/_finish, and misc other fixes
2012-02-03 10:33:44 -06:00
Dan Winship
7844ead116 libnm-glib: nm_client_new_async, fix up NMClient asynchrony issues 2012-02-03 10:33:43 -06:00
Dan Winship
9fd98ef91b libnm-glib: implement GInitable/GAsyncInitable in NMObject
Implement GInitable and GAsyncInitable in NMObject, with
implementations that synchronously or asynchonously load all
properties, and change _nm_object_ensure_inited() to run
g_initable_init().

Update the object/object-array property handling to initialize the
objects after creating them (synchronously or asynchronously,
according to the situation), so that they will have all of their
properties preloaded before they are ever visible to the caller.

Move the non-blocking/non-failable parts of various objects'
constructor() methods to constructed(), and move the blocking/failable
parts to init(), and implement init_async() methods with non-blocking
versions of the blocking methods.

Make nm_device_new() and nm_client_new() call
_nm_object_ensure_inited(), to preserve the behaviour formerly
enforced by their construct() methods, that properties are guaranteed
to be initialized before any signals involving them are emitted.
2012-02-03 10:33:43 -06:00
Dan Winship
ad5daa098c libnm-glib: add "pseudoproperties" for things like Client.GetDevices
Add generic handling for "properties" that consist of a "Get" method,
an "Added" signal, and a "Removed" signal, reusing some of the code
for handling object-array-valued properties. And load the values of
pseudo properties from _nm_object_reload/ensure_properties as well.
2012-02-03 10:33:43 -06:00
Dan Winship
cc90f1010e libnm-glib: simplify handling of object and object array properties
Add an "object_type" field to NMPropertiesInfo, and use that with
DBUS_TYPE_G_OBJECT_PATH and DBUS_TYPE_G_ARRAY_OF_OBJECT_PATH
properties so that we don't need custom marshallers for each one.

When creating an NMDevice or NMActiveConnection, we need to fetch an
extra property first to figure out the exact subclass to use, so add a
bit of infrastructure for that as well. Also, do that preprocessing
asynchronously when processing a property change notification, so that
it doesn't block the main loop.
2012-02-03 10:33:43 -06:00