libct: Add @type member into backend_ops

This allows to test what kind of backend the session
carries without exporting additional internal details.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: Add @server_sk member into libct_session structure

We will need it to hook servers over a session in next
patches where we introduce daemon mode for the session
functionality.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: Introduce "server" mode for the library

That named "server" mode allows to wrap local
session with servers by help of libct_session_make_servers
routine. Once wrapped the session may handle RPC requests
received via @sk_server socket, the requests are handled
by libct_session_server_loop helper.

Such functionality will allow us to reduce libctd code
making it simply a user of libct library itself.

Note:

- The structure

  struct container_srv {
	struct list_head l;
	unsigned long rid;
	ct_handler_t hnd;
  };

now represented as

  typedef struct {
	struct list_head	list;
	unsigned long		rid;
	ct_handler_t		ct;
  } ct_server_t;

 - All servers list ct_srvs renamed to ct_servers

Other than that the code is mostly copied from src/libctd/libctd.c

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libctd: Use libct server functionality

Because libct now able to handle RPC requests in
that named "server" mode, lets use it instead of
implementing damon here.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: Drop callback from UAPI

As Pavel requested -- we don't need them.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
libct: Move @server_sk to struct local_session

It's a feature of local session only, not general session.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>