diff --git a/criu/sk-tcp.c b/criu/sk-tcp.c index a88c0603c..a702abc3d 100644 --- a/criu/sk-tcp.c +++ b/criu/sk-tcp.c @@ -27,45 +27,6 @@ #include "protobuf.h" #include "images/tcp-stream.pb-c.h" -#ifndef CONFIG_HAS_TCP_REPAIR_WINDOW -struct tcp_repair_window { - u32 snd_wl1; - u32 snd_wnd; - u32 max_window; - - u32 rcv_wnd; - u32 rcv_wup; -}; -#endif - -#ifndef CONFIG_HAS_TCP_REPAIR -/* - * It's been reported that both tcp_repair_opt - * and TCP_ enum already shipped in netinet/tcp.h - * system header by some distros thus we need a - * test if we can use predefined ones or provide - * our own. - */ -struct tcp_repair_opt { - u32 opt_code; - u32 opt_val; -}; - -enum { - TCP_NO_QUEUE, - TCP_RECV_QUEUE, - TCP_SEND_QUEUE, - TCP_QUEUES_NR, -}; -#endif - -#ifndef TCP_TIMESTAMP -#define TCP_TIMESTAMP 24 -#endif - -#ifndef TCP_REPAIR_WINDOW -#define TCP_REPAIR_WINDOW 29 -#endif static LIST_HEAD(cpt_tcp_repair_sockets); static LIST_HEAD(rst_tcp_repair_sockets); diff --git a/soccr/config.h b/soccr/config.h new file mode 120000 index 000000000..106aa8bf2 --- /dev/null +++ b/soccr/config.h @@ -0,0 +1 @@ +../criu/include/config.h \ No newline at end of file diff --git a/soccr/soccr.c b/soccr/soccr.c index c27ba66e8..7c6bfb199 100644 --- a/soccr/soccr.c +++ b/soccr/soccr.c @@ -11,19 +11,6 @@ #define SIOCOUTQNSD 0x894B #endif -#ifndef TCP_REPAIR_WINDOW -#define TCP_REPAIR_WINDOW 29 -#endif - -struct tcp_repair_window { - __u32 snd_wl1; - __u32 snd_wnd; - __u32 max_window; - - __u32 rcv_wnd; - __u32 rcv_wup; -}; - static void (*log)(unsigned int loglevel, const char *format, ...) __attribute__ ((__format__ (__printf__, 2, 3))); static unsigned int log_level = 0; diff --git a/soccr/soccr.h b/soccr/soccr.h index c75f7766e..4e272d567 100644 --- a/soccr/soccr.h +++ b/soccr/soccr.h @@ -1,6 +1,49 @@ #ifndef __LIBSOCCR_H__ #define __LIBSOCCR_H__ #include +#include + +#include "config.h" + +#ifndef CONFIG_HAS_TCP_REPAIR_WINDOW +struct tcp_repair_window { + uint32_t snd_wl1; + uint32_t snd_wnd; + uint32_t max_window; + + uint32_t rcv_wnd; + uint32_t rcv_wup; +}; +#endif + +#ifndef CONFIG_HAS_TCP_REPAIR +/* + * It's been reported that both tcp_repair_opt + * and TCP_ enum already shipped in netinet/tcp.h + * system header by some distros thus we need a + * test if we can use predefined ones or provide + * our own. + */ +struct tcp_repair_opt { + uint32_t opt_code; + uint32_t opt_val; +}; + +enum { + TCP_NO_QUEUE, + TCP_RECV_QUEUE, + TCP_SEND_QUEUE, + TCP_QUEUES_NR, +}; +#endif + +#ifndef TCP_TIMESTAMP +#define TCP_TIMESTAMP 24 +#endif + +#ifndef TCP_REPAIR_WINDOW +#define TCP_REPAIR_WINDOW 29 +#endif struct libsoccr_sk;