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 cf54034019d9..b5a1b9eb12e8 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -398,6 +398,8 @@ extern void tcp_parse_options(struct sk_buff *skb,
398 struct tcp_options_received *opt_rx, 398 struct tcp_options_received *opt_rx,
399 int estab); 399 int estab);
400 400
401extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
402
401/* 403/*
402 * TCP v4 functions exported for the inet6 API 404 * TCP v4 functions exported for the inet6 API
403 */ 405 */
@@ -1113,13 +1115,19 @@ struct tcp_md5sig_pool {
1113#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ 1115#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */
1114 1116
1115/* - functions */ 1117/* - functions */
1118extern int tcp_calc_md5_hash(char *md5_hash,
1119 struct tcp_md5sig_key *key,
1120 int bplen,
1121 struct tcphdr *th,
1122 unsigned int tcplen,
1123 struct tcp_md5sig_pool *hp);
1124
1116extern int tcp_v4_calc_md5_hash(char *md5_hash, 1125extern int tcp_v4_calc_md5_hash(char *md5_hash,
1117 struct tcp_md5sig_key *key, 1126 struct tcp_md5sig_key *key,
1118 struct sock *sk, 1127 struct sock *sk,
1119 struct dst_entry *dst, 1128 struct dst_entry *dst,
1120 struct request_sock *req, 1129 struct request_sock *req,
1121 struct tcphdr *th, 1130 struct tcphdr *th,
1122 int protocol,
1123 unsigned int tcplen); 1131 unsigned int tcplen);
1124extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, 1132extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1125 struct sock *addr_sk); 1133 struct sock *addr_sk);
@@ -1132,6 +1140,16 @@ extern int tcp_v4_md5_do_add(struct sock *sk,
1132extern int tcp_v4_md5_do_del(struct sock *sk, 1140extern int tcp_v4_md5_do_del(struct sock *sk,
1133 __be32 addr); 1141 __be32 addr);
1134 1142
1143#ifdef CONFIG_TCP_MD5SIG
1144#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
1145 &(struct tcp_md5sig_key) { \
1146 .key = (twsk)->tw_md5_key, \
1147 .keylen = (twsk)->tw_md5_keylen, \
1148 } : NULL)
1149#else
1150#define tcp_twsk_md5_key(twsk) NULL
1151#endif
1152
1135extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); 1153extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void);
1136extern void tcp_free_md5sig_pool(void); 1154extern void tcp_free_md5sig_pool(void);
1137 1155
@@ -1369,7 +1387,6 @@ struct tcp_sock_af_ops {
1369 struct dst_entry *dst, 1387 struct dst_entry *dst,
1370 struct request_sock *req, 1388 struct request_sock *req,
1371 struct tcphdr *th, 1389 struct tcphdr *th,
1372 int protocol,
1373 unsigned int len); 1390 unsigned int len);
1374 int (*md5_add) (struct sock *sk, 1391 int (*md5_add) (struct sock *sk,
1375 struct sock *addr_sk, 1392 struct sock *addr_sk,