Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
The UID is fetched via org.freedesktop.DBus.GetConnectionUnixUser D-Bus
method call.
|
|
Do not handle the small alloc failures because glib will abort
when memory is tight anyway.
|
|
Streamline the callback typedefs with the rest of the code.
|
|
If we receive nameservers from vpnd we must set them in provider.
The connman_provider_set_nameservers() function needs changes
because we get the nameservers as an array, it makes no sense to
convert the array to string and then back to array.
|
|
There is a common pattern when writing a callback function. Let's
add a few helper for this.
It is added to session.h because apart from the core also
the session_policy_local.c will make use of it.
This is shamelessly stolen from oFono.
|
|
|
|
|
|
The point here is to create a virtual configuration, which does not come
from a real file. This is a handy way for plugins to be able to provision
services without creating any file on the FS.
In case of a wifi configuration type and if connect is requested, it will
trigger a scan, thus leading to a possible service being provisioned by
such virtual configuration. If so and if connect was requested: the service
will be asked to connect.
|
|
|
|
|
|
If we have already received gateway address via newroute rtnl
message, then do not overwrite it when receiving newaddr message.
Fixes BMC#25931
|
|
|
|
In the case the callback is directly called we can use the
return value to provide it to the user.
|
|
Whenever a configuration gets invalid (e.g. a configuration
is removed) then we need to be able to drop back to the
default configutation.
|
|
We want to reuse these functions.
|
|
|
|
The error handling can get easily get pretty hairy, e.g.
reallocating memory for allowed_bearers. If we hit this situation
we allow the plugin to shutdown the session. That is consistent
with what we do when there is a problem while creating a new
session.
|
|
Give a policy plugin a way to inform the session core that
some of the config values have changed.
This could be done in a more clever way, e.g. figure out only
to update the necessary info entries but we keep it for now
as simple and assume everthing has changed.
|
|
ConnMan needs to identify application in a secure way when they are
using the Session API. The current D-Bus server implemention supports
two types of LSM, POSIX and SELinux. In order to support SMACK or
TOMOYO the D-Bus code base needs to be patch. This is the initial work
to support at least POSIX and SELinux. Maybe in the future we are able
to support also the other LSMs.
The idea behind gsec is to keep the LSM related code together in one
directory. The API introduces in this patch is not any way final. It
will need some more time figuring out how are able to intregrate this
in a nice way.
The current API introduces g_sec_get_selinux_label() which will return
the SELinux context. The function will issuing a
GetConnectionSELinuxSecurityContext method call.
Note, that this function is not documented in the D-Bus
specification. See for more details the source code dbus/bus/drivers.c
and dbus/bus/selinux.c in the D-Bus reference implementation.
|
|
The inotify code will be used by the core (config.c) and the session
policy plugin. We introduce a new API for file modifcation
notifcation.
We move the factored out code part from the last patch into a new file
and also change the inotify code so that it allows to monitor not only
STORAGEDIR. When registering a new observer, the callee has to tell
which directory should be watched. inotify.c will group the observers
together.
|
|
Because the vpnd Create() in manager API only creates and does
not connect the vpn, we must do the connect part after the
vpn is created. This requires a callback which is called when
the connection is established. Eventually this patch becomes
obsolete because the CreateProvider() connman API is deprecated.
|
|
|
|
|
|
The server and user route handling is refactored in order to
reflect the vpn dbus API changes. The routes are now array of
dicts in dbus API.
|
|
|
|
The VPN support functionality is moved into connman-vpnd.
|
|
|
|
The VPN needs to be able to call the provider disconnect.
|
|
|
|
The device creation function should be part of device.c and
not inet.c. After this change the inet.c can be used by
separate vpn daemon.
|
|
Done so that connman_ipaddress_* functions can be used from
separate vpn daemon.
|
|
Service and network code use only interface indexes. Convert the rest of
the code using interface names to use interface indexes instead. The files
affected are:
include/resolver.h
src/connman.h
src/dnsproxy.c
src/resolver.c
src/rtnl.c
src/service.c
src/tethering.c
As the network and service code used interface indexes, the interface
name had to be looked up via a SIOCGIFNAME ioctl when needed. If a service
was removed due to the interface and network being taken down, the lookup
wouldn't work. This caused DNS servers to be left behind with broken sockets
since removing the DNS servers was done using the interface name.
|
|
Instead start using enum connman_service_type directly.
|
|
The match_all will be expressed through CONNMAN_SESSION_TYPE_UNKNOWN.
The 'no match' case happens when allowed_bearers is NULL.
|
|
The string is only used when appending the bearer to the D-Bus
message in append_allowed_bearers(). Let's use
__connman_session_type2string() in append_allowed_bearers(). This
saves a bit of memory.
|
|
Instead returning directly a config when create() is called
in policy plugin, use a callback function for handing over a valid
configuration from the plugin to the session core. This prepares
support for asynchronous create call.
|
|
|
|
|
|
Up to now an empty or wrong ConnectionType was interpreted as 'any'.
If the ConnectionType is either wrong ignore it. If no ConnectionType
setting is passed in during creation of the session choose 'any'.
|
|
|
|
Basic types are not used for the configuration anymore.
|
|
Whenever a new session is created, the core will ask the plugin
the create the config. This config can then be used by the core
to enforce the user settings.
The owner ship of this config stays in the plugin. Therefore, the plugin
will destroy is later.
|
|
|
|
Instead of passing basic datatypes between the session core and the
policy plugin, provide a complex data structure which holds
the session configuration.
|