forked from gao-feng/colo-proxy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nf_conntrack_colo.h
74 lines (62 loc) · 1.57 KB
/
nf_conntrack_colo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/*
* Copyright (c) 2014, 2015 Fujitsu Limited.
* Copyright (c) 2014, 2015 HUAWEI TECHNOLOGIES CO.,LTD.
* Copyright (c) 2014, 2015 Intel Corporation.
*
* Authors:
* Gao feng <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#ifndef _NF_CONNTRACK_COLO_H
#define _NF_CONNTRACK_COLO_H
#include <net/netfilter/nf_conntrack_extend.h>
#include "xt_COLO.h"
union nf_conn_colo_tcp {
struct {
u32 mrcv_nxt;
u32 srcv_nxt;
bool sort;
/* FIXME: get ride of mack, mwin */
u32 mack;
u32 sack;
u32 mwin;
u32 swin;
u16 mscale;
u16 sscale;
u32 compared_seq;
u32 master_snd_nxt;
u32 slaver_snd_nxt;
} p;
struct {
u32 sec_isn;
u32 pri_isn;
} s;
};
struct nf_conn_colo {
struct list_head conn_list;
struct list_head entry_list;
struct sk_buff_head slaver_pkt_queue;
struct nf_conntrack *nfct;
spinlock_t lock;
spinlock_t chk_lock;
u32 flags;
u32 index;
char proto[];
};
/* COLO netlink socket */
extern struct sock *colo_sock;
static inline
struct nf_conn_colo *nfct_colo(const struct nf_conn *ct)
{
return (struct nf_conn_colo *) nf_ct_ext_find(ct, NF_CT_EXT_COLO);
}
struct nf_conn_colo *
nf_ct_colo_get(struct sk_buff *skb, struct colo_node *node, u32 flag);
struct colo_node *colo_node_find(u32 index);
struct colo_node *colo_node_find_get(u32 index);
int colo_node_register(struct colo_node *colo);
void colo_node_unregister(struct colo_node *colo);
#endif