Commit graph

60 commits

Author SHA1 Message Date
Pavel Emelyanov
c5de18a399 soccr: Handle connection state
For now we only support ESTABLISHED state, so this is mostly
a preparation for the future extention.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:42 +03:00
Pavel Emelyanov
cab3f17645 soccr/tcp: Restore queues using library
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:42 +03:00
Pavel Emelyanov
826a86e496 soccr/tcp: Restore socket's info after binding it
With window parameters, we have stuff to restore before
queues and after queues.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:42 +03:00
Pavel Emelyanov
611dc707e2 soccr/tcp: Restore socket's info before binding it
In TCP repair some stuff should be restored before calling
connect/bind on socker and some -- after it.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:42 +03:00
Pavel Emelyanov
c08eb3dde1 soccr/tcp: Read queues contents using library
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:42 +03:00
Pavel Emelyanov
d98c0ea67c soccr/tcp: Fill actual connection info using the library
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:42 +03:00
Pavel Emelyanov
4fdc20ed40 soccr/tcp: Introduce blob with connection info and getter for it
As an API for dumping and restoring the data the structure
with __u32-s is used. Getting one (and restoring) also involve
the size of the structure so that both -- caller and library --
can know which "version" of it the other one is using.

As a starting point all the fields that tcp_entry carries are
used.

Also note, that only tcp connection info is handled by the
library. Stuff like addresses and ports, socket options and
other are left for the caller to care for.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:41 +03:00
Pavel Emelyanov
b8b113bf56 soccr/tcp: Add _pause and _resume to library and use it
The calls put socket into a mode where it can be saved or
restored. Add take one out of this mode.

TODO: In criu we turn repair off (resume the socket) from
restorer blob that cannot use the library. Need to somehow
fix it.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:41 +03:00
Pavel Emelyanov
e3f270ac05 soccr: Add logging
In order to get messages from libsoccr I propose to
introduce a printing callback that can be set by library
user and that will be called by libsoccr.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:41 +03:00
Pavel Emelyanov
6d9e6d15bf soccr: Wire into builder
For now build the .a library not to produce criu wrappers.
Next version should include the .so library as well.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
2017-01-16 11:03:41 +03:00