We will need to disable the repair mode before connect()
to restore syn-sent sockets. And even now connect() looks
like a part of internal logic of libsoccr.
travis-ci: success for series starting with [01/21] build: install libnet-dev
v2: remove libsoccr_set_sk_data_unbound() from soccr.h
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
These addresses will be used to restore half-closed sockets,
we will need to send a fake fin packet for that.
And in the next patch connect() will be moved into soccr.
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
loge() will start a message with "Error:" and
logd() will start a message with "Debug:".
logerr() will add strerror(errno) to the end of messages.
travis-ci: success for series starting with [01/21] build: install libnet-dev
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Some of the loge messages where missing a '\n'. For consistency this
adds '\n' to all messages which were missing it.
travis-ci: success for libsoccr debug/info messages (rev2)
Signed-off-by: Adrian Reber <areber@redhat.com>
Reviewed-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Otherwise there is a broken symlink which makes tags/etags unhappy.
travis-ci: success for soccr: Generate config.h dynamically (rev5)
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
[extended .gitignore, maked link relative to sources]
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Made a symlink to CRIU's generated config.h, played with
moving some code to soccr.h header.
Changed types from u32 to uint32_t, otherwise we should
include CRIU's "int.h" in soccr, but I'm lazy to add that.
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Cc: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Acked-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
TODO: Write proper man page/doc.
TODO: Document that the library spoils the reuseaddrs option on socket.
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
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>
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>
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>
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>
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>
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>