Commit f9a8673d authored by Pavel Emelyanov's avatar Pavel Emelyanov

tcp: Dump and restore support

What it does is uses the tcp repair engine from the kernel.

On dump the connection is locked with netfilter, socket is put
in the repair state and then its internals are dumped.

On restore we create a socket, put it into repair, dress it up
and then unlock all the connections at the very end.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 675b4698
......@@ -14,11 +14,15 @@ struct inet_sk_desc {
unsigned int wqlen;
unsigned int src_addr[4];
unsigned int dst_addr[4];
int rfd;
struct list_head rlist;
};
struct inet_sk_info {
struct inet_sk_entry ie;
struct file_desc d;
struct list_head rlist;
};
int inet_bind(int sk, struct inet_sk_info *);
......@@ -28,15 +32,8 @@ void tcp_unlock_all(void);
void tcp_locked_conn_add(struct inet_sk_info *);
void tcp_unlock_connections(void);
static inline int dump_one_tcp(int sk, struct inet_sk_desc *sd)
{
return -1;
}
static inline int restore_one_tcp(int sk, struct inet_sk_info *si)
{
return -1;
}
int dump_one_tcp(int sk, struct inet_sk_desc *sd);
int restore_one_tcp(int sk, struct inet_sk_info *si);
#define SK_EST_PARAM "tcp-established"
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment