| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The calling process, that implements the session API is identified by
the user ID as it is runs. All processes of the same user share the
same list of allowed bearers, and the same priority for choosing
between available bearers.
This extension allows processes to select a service context dependent
behaviour for which the routing decision is made.
This is an extention to session API interface. Helps to enable a
service differentiation for processes run by the same user. Allows
ConnMan to differentiate between bearer usage permissions and the
respective priorities based on the requested service type.
|
|
|
|
|
| |
Will return the session mark (without needing to expose the complete
struct connman_session).
|
|
|
|
|
| |
Returns the allowed service for a session based on a provided list of
available services.
|
|
|
|
| |
Called when state of session changes.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement an option for a session to enable packet filtering
based on interfce source ip address. This allows an application
to create a session, and direct traffic to a specific network
interface, on which the session is connected.
Applications can use bind before connect on a socket to specify
the source ip address.
This mechanism re-uses the routing table created by the session,
iproute fwmark rule, and adds a new iptables source ip rule.
|
|
|
|
|
|
|
|
|
|
| |
In order to be able to bind a session to a specific interface,
AllowedInterface config option has been added. It allows to
bind a session to a service with a specified network interface
name (e.g. eth0).
AllowedInterface is supported through both dbus and session policy.
Policy always overrides dbus.
|
|
|
|
|
|
|
|
|
|
| |
The copyright statement for my company is not consistent or even
wrongly spelled.
s/All rights reserved//
s/CarIT/Car IT/
s/BWM/BMW/
s/GbmH/GmbH/
|
|
|
|
|
| |
Ensure that connect/disconnect reason is properly set to
CONNMAN_SERVICE_CONNECT_REASON_SESSION.
|
|
|
|
|
| |
Check with the session policy whether a specific service is allowed
for a session.
|
|
|
|
|
| |
This callback updates the session policy when the session becomes
active or inactive.
|
|
|
|
|
| |
By default allow all autoconnects if no session policy module exists
or no autoconnect policy function is supplied.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch is completely generated by set of coccille rules and
containts zero manual changes. The rule set is not really beautiful
but it does the job. We might miss a few conversions but there should
be none accidently wrong converted bool here.
The rules are as following:
//// Do not compare boolean expressions
@@
expression E;
symbol TRUE;
symbol FALSE;
@@
(
E
- == TRUE
|
- TRUE == E
+ E
|
- E != TRUE
+ !E
|
- TRUE != E
+ !E
|
- E == FALSE
+ !E
|
- FALSE == E
+ !E
|
E
- != FALSE
|
- FALSE != E
+ E
)
//// Convert connman_bool_t to stdbool
@@
connman_bool_t x;
@@
x =
(
- TRUE
+ true
|
- FALSE
+ false
)
@@
identifier f;
@@
connman_bool_t f(...) {
<...
- return TRUE;
+ return true;
...>
}
@@
identifier f;
@@
connman_bool_t f(...) {
<...
- return FALSE;
+ return false;
...>
}
@r@
identifier f;
parameter list[n] ps;
identifier i;
@@
f(ps, connman_bool_t i, ...) { ... }
@@
identifier r.f;
expression list [r.n] es;
@@
f(es,
(
- FALSE
+ false
|
- TRUE
+ true
)
,...)
@r2@
type T;
identifier f;
parameter list[n] ps;
identifier i;
@@
T f(ps, connman_bool_t i, ...);
@@
identifier r2.f;
expression list [r.n] es;
@@
f(es,
(
- FALSE
+ false
|
- TRUE
+ true
)
,...)
@@
typedef bool;
@@
- connman_bool_t
+ bool
//// Convert gboolean to stdbool
@@
gboolean x;
@@
x =
(
- TRUE
+ true
|
- FALSE
+ false
)
// Figure out which function signature will to be fixed...
// when we have the defitition
@r@
identifier f;
parameter list[n] ps;
identifier i;
@@
f(ps, gboolean i, ...) { ... }
// ... and now convert all call sites
@@
identifier r.f;
expression list [r.n] es;
@@
f(es,
(
- FALSE
+ false
|
- TRUE
+ true
)
,...)
// Figure out which function signature will to be fixed...
// when we have the declaration only
@r2@
type T;
identifier f;
parameter list[n] ps;
identifier i;
@@
T f(ps, gboolean i, ...);
// ... and now convert all call sites
@@
identifier r2.f;
expression list [r.n] es;
@@
f(es,
(
- FALSE
+ false
|
- TRUE
+ true
)
,...)
// A handfull of the GLib hooks we can't change. Let's remember
// all ther positions.
// 1. timeouts
@k1@
identifier f;
position p;
typedef gpointer;
identifier ptr;
@@
static gboolean@p f(gpointer ptr);
@k2@
identifier f;
position p;
identifier ptr;
@@
static gboolean@p f(gpointer ptr) { ... }
// hash map iterator functions
@k3@
identifier f;
position p;
identifier p1, p2, p3;
@@
static gboolean@p f(gpointer p1, gpointer p2, gpointer p3) { ... }
// 2. GIOChannel
@k4@
identifier f;
position p;
typedef GIOChannel, GIOCondition;
identifier ptr;
identifier ch, cn;
@@
static gboolean@p f(GIOChannel *ch, GIOCondition cn, gpointer ptr);
@k5@
identifier f;
position p;
identifier ptr;
identifier ch, cn;
@@
static gboolean@p f(GIOChannel *ch, GIOCondition cn, gpointer ptr) { ... }
// 3. GSourceFuncs
@k6@
identifier f;
position p;
typedef GSource;
identifier src;
@@
static gboolean@p f(GSource *src, ...) { ... }
// gdbus functions
@k7@
identifier f;
position p;
typedef DBusConnection;
identifier con;
@@
static gboolean@p f(DBusConnection *con, ...) { ... }
// Now convert all gboolean which are are not used for interactin
// with GLib
// Note here happens the magic!
@@
typedef bool;
position p != {k1.p,k2.p,k3.p,k4.p,k5.p,k6.p,k7.p};
@@
- gboolean@p
+ bool
// Update all return types
@@
identifier f;
@@
bool f(...) {
<...
- return TRUE;
+ return true;
...>
}
@@
identifier f;
@@
bool f(...) {
<...
- return FALSE;
+ return false;
...>
}
//// Last last rule is to fixup all missed call sites. In theory we should
//// fixed them with some rules above but somehow coccinelle does not
//// match.
@@
identifier f =~ "^(__)?connman_.*" ;
@@
f(...,
(
- FALSE
+ false
|
- TRUE
+ true
)
,...)
|
|
|
|
|
| |
The helper doesn't really belong to the session.h and ELL also does
define the helper in util.h header.
|
|
|
|
|
|
| |
The session core needs to the know which kind of session
identification method has been selected in the plugin in order
to use the right iptables rules etc.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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.
|
|
|
|
| |
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.
|
|
|
|
|
| |
Rename bearer_info to connman_session_bearer. Use also 'bearer' as local
variable instead of 'info' to avoid confusion with session_info.
|
|
|
|
|
|
|
| |
Instead of passing in some string to identify we can use the
connman_session pointer. This allows us to keep the way sessions
are identfied away from the core, e.g. using the D-Bus owner id or
something else.
|
| |
|
|
|
|
|
| |
Support several session configuration plugins at runtime.
Set the default priority to low for the current policy plugin.
|
| |
|
|
|