6b13f685e
김민수
BSP 최초 추가
|
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
|
#ifndef _DCCP_FEAT_H
#define _DCCP_FEAT_H
#include <linux/types.h>
#include "dccp.h"
#define DCCPF_ACK_RATIO_MAX 0xFFFF
#define DCCPF_SEQ_WMIN 32
#define DCCPF_SEQ_WMAX 0x3FFFFFFFFFFFull
#define DCCP_FEAT_MAX_SP_VALS (DCCP_SINGLE_OPT_MAXLEN - 2)
enum dccp_feat_type {
FEAT_AT_RX = 1,
FEAT_AT_TX = 2,
FEAT_SP = 4,
FEAT_NN = 8,
FEAT_UNKNOWN = 0xFF
};
enum dccp_feat_state {
FEAT_DEFAULT = 0,
FEAT_INITIALISING,
FEAT_CHANGING,
FEAT_UNSTABLE,
FEAT_STABLE
};
typedef union {
u64 nn;
struct {
u8 *vec;
u8 len;
} sp;
} dccp_feat_val;
struct dccp_feat_entry {
dccp_feat_val val;
enum dccp_feat_state state:8;
u8 feat_num;
bool needs_mandatory,
needs_confirm,
empty_confirm,
is_local;
struct list_head node;
};
static inline u8 dccp_feat_genopt(struct dccp_feat_entry *entry)
{
if (entry->needs_confirm)
return entry->is_local ? DCCPO_CONFIRM_L : DCCPO_CONFIRM_R;
return entry->is_local ? DCCPO_CHANGE_L : DCCPO_CHANGE_R;
}
struct ccid_dependency {
u8 dependent_feat;
bool is_local:1,
is_mandatory:1;
u8 val;
};
extern unsigned long sysctl_dccp_sequence_window;
extern int sysctl_dccp_rx_ccid;
extern int sysctl_dccp_tx_ccid;
int dccp_feat_init(struct sock *sk);
void dccp_feat_initialise_sysctls(void);
int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local,
u8 const *list, u8 len);
int dccp_feat_parse_options(struct sock *, struct dccp_request_sock *,
u8 mand, u8 opt, u8 feat, u8 *val, u8 len);
int dccp_feat_clone_list(struct list_head const *, struct list_head *);
#define DCCP_OPTVAL_MAXLEN 6
void dccp_encode_value_var(const u64 value, u8 *to, const u8 len);
u64 dccp_decode_value_var(const u8 *bf, const u8 len);
u64 dccp_feat_nn_get(struct sock *sk, u8 feat);
int dccp_insert_option_mandatory(struct sk_buff *skb);
int dccp_insert_fn_opt(struct sk_buff *skb, u8 type, u8 feat, u8 *val, u8 len,
bool repeat_first);
#endif /* _DCCP_FEAT_H */
|