aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 633147cb6bbc..07005ebb47a7 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -399,6 +399,8 @@ extern void tcp_parse_options(struct sk_buff *skb,
399 struct tcp_options_received *opt_rx, 399 struct tcp_options_received *opt_rx,
400 int estab); 400 int estab);
401 401
402extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
403
402/* 404/*
403 * TCP v4 functions exported for the inet6 API 405 * TCP v4 functions exported for the inet6 API
404 */ 406 */
@@ -1115,13 +1117,19 @@ struct tcp_md5sig_pool {
1115#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ 1117#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */
1116 1118
1117/* - functions */ 1119/* - functions */
1120extern int tcp_calc_md5_hash(char *md5_hash,
1121 struct tcp_md5sig_key *key,
1122 int bplen,
1123 struct tcphdr *th,
1124 unsigned int tcplen,
1125 struct tcp_md5sig_pool *hp);
1126
1118extern int tcp_v4_calc_md5_hash(char *md5_hash, 1127extern int tcp_v4_calc_md5_hash(char *md5_hash,
1119 struct tcp_md5sig_key *key, 1128 struct tcp_md5sig_key *key,
1120 struct sock *sk, 1129 struct sock *sk,
1121 struct dst_entry *dst, 1130 struct dst_entry *dst,
1122 struct request_sock *req, 1131 struct request_sock *req,
1123 struct tcphdr *th, 1132 struct tcphdr *th,
1124 int protocol,
1125 unsigned int tcplen); 1133 unsigned int tcplen);
1126extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, 1134extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1127 struct sock *addr_sk); 1135 struct sock *addr_sk);
@@ -1134,6 +1142,16 @@ extern int tcp_v4_md5_do_add(struct sock *sk,
1134extern int tcp_v4_md5_do_del(struct sock *sk, 1142extern int tcp_v4_md5_do_del(struct sock *sk,
1135 __be32 addr); 1143 __be32 addr);
1136 1144
1145#ifdef CONFIG_TCP_MD5SIG
1146#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
1147 &(struct tcp_md5sig_key) { \
1148 .key = (twsk)->tw_md5_key, \
1149 .keylen = (twsk)->tw_md5_keylen, \
1150 } : NULL)
1151#else
1152#define tcp_twsk_md5_key(twsk) NULL
1153#endif
1154
1137extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); 1155extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void);
1138extern void tcp_free_md5sig_pool(void); 1156extern void tcp_free_md5sig_pool(void);
1139 1157
@@ -1371,7 +1389,6 @@ struct tcp_sock_af_ops {
1371 struct dst_entry *dst, 1389 struct dst_entry *dst,
1372 struct request_sock *req, 1390 struct request_sock *req,
1373 struct tcphdr *th, 1391 struct tcphdr *th,
1374 int protocol,
1375 unsigned int len); 1392 unsigned int len);
1376 int (*md5_add) (struct sock *sk, 1393 int (*md5_add) (struct sock *sk,
1377 struct sock *addr_sk, 1394 struct sock *addr_sk,