diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2014-02-06 17:22:09 +0100 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2014-02-08 09:31:00 +0400 |
commit | 175ff4cedb83ae7bee34734eebe5f81e9bb46ab9 (patch) | |
tree | e12a8ab5a6ced0d8e3fb5d9380615ebb3a87e380 /cmake | |
parent | 121194393d17efd00e34947dc064a572f80e7cfa (diff) | |
download | accel-ppp-xebd-175ff4cedb83ae7bee34734eebe5f81e9bb46ab9.tar.gz accel-ppp-xebd-175ff4cedb83ae7bee34734eebe5f81e9bb46ab9.zip |
l2tp: use same context for tunnels and session control channels
Run the control channels of L2TP sessions in their tunnel context to
avoid context calls between tunnels and sessions.
Tunnels and sessions now use the new state STATE_INIT as their initial
state (allows to differentiate between tunnels and sessions that are
starting or stopping). The STATE_CLOSE state isn't implicitely set to
0 by memset() anymore, so its value is changed for consistency with the
other STATE_* values.
With tunnels and sessions running in the same context, sessions can
remove themselves from their tunnel without having to perform context
calls. Tunnels can also remove sessions directly, without having to
asynchronously notify them. So the set of l2tp_tunnel_free_session*()
functions becomes useless. Sessions can also check if they're the last
session of the tunnel and automatically disconnect the tunnel if need
be. So the l2tp_tunnel_session_freed() callback can be removed.
The 'sess_count' field is now used to track the number of sessions
stored in the 'sessions' field of tunnels. It's incremented as soon
as a session is added and everytime one is removed.
The callback, used by data channels to notify their L2TP control session
of disconnection, is now executed in the tunnel context. The session ID
is used by the tunnel to find which session the disconnection applies
to. The session may well get destroyed by other means between the time
of the context call and the time of the callback execution.
The l2tp_tunnel_start_session() function doesn't need to create a new
context for the session. It now only sets the session establishment
timer and directly runs the session startup callback.
Since l2tp_session_free() can now handle sessions in any state and is
called within the tunnel context, there is no need for a special
l2tp_tunnel_cancel_session() (for now, this function is kept for patch
clarity).
Now that session packets are sent while in tunnel context,
l2tp_session_send() only needs to set the header session ID and can
directly call l2tp_tunnel_send(). For reception, the tunnel also
directly calls l2tp_session_recv().
Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'cmake')
0 files changed, 0 insertions, 0 deletions