aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/ip_vs.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/ip_vs.h')
-rw-r--r--include/net/ip_vs.h55
1 files changed, 41 insertions, 14 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 8dc3296b7bea..f976885f686f 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -26,6 +26,11 @@
26#include <linux/ipv6.h> /* for struct ipv6hdr */ 26#include <linux/ipv6.h> /* for struct ipv6hdr */
27#include <net/ipv6.h> /* for ipv6_addr_copy */ 27#include <net/ipv6.h> /* for ipv6_addr_copy */
28 28
29
30/* Connections' size value needed by ip_vs_ctl.c */
31extern int ip_vs_conn_tab_size;
32
33
29struct ip_vs_iphdr { 34struct ip_vs_iphdr {
30 int len; 35 int len;
31 __u8 protocol; 36 __u8 protocol;
@@ -220,6 +225,26 @@ enum {
220}; 225};
221 226
222/* 227/*
228 * SCTP State Values
229 */
230enum ip_vs_sctp_states {
231 IP_VS_SCTP_S_NONE,
232 IP_VS_SCTP_S_INIT_CLI,
233 IP_VS_SCTP_S_INIT_SER,
234 IP_VS_SCTP_S_INIT_ACK_CLI,
235 IP_VS_SCTP_S_INIT_ACK_SER,
236 IP_VS_SCTP_S_ECHO_CLI,
237 IP_VS_SCTP_S_ECHO_SER,
238 IP_VS_SCTP_S_ESTABLISHED,
239 IP_VS_SCTP_S_SHUT_CLI,
240 IP_VS_SCTP_S_SHUT_SER,
241 IP_VS_SCTP_S_SHUT_ACK_CLI,
242 IP_VS_SCTP_S_SHUT_ACK_SER,
243 IP_VS_SCTP_S_CLOSED,
244 IP_VS_SCTP_S_LAST
245};
246
247/*
223 * Delta sequence info structure 248 * Delta sequence info structure
224 * Each ip_vs_conn has 2 (output AND input seq. changes). 249 * Each ip_vs_conn has 2 (output AND input seq. changes).
225 * Only used in the VS/NAT. 250 * Only used in the VS/NAT.
@@ -592,17 +617,6 @@ extern void ip_vs_init_hash_table(struct list_head *table, int rows);
592 * (from ip_vs_conn.c) 617 * (from ip_vs_conn.c)
593 */ 618 */
594 619
595/*
596 * IPVS connection entry hash table
597 */
598#ifndef CONFIG_IP_VS_TAB_BITS
599#define CONFIG_IP_VS_TAB_BITS 12
600#endif
601
602#define IP_VS_CONN_TAB_BITS CONFIG_IP_VS_TAB_BITS
603#define IP_VS_CONN_TAB_SIZE (1 << IP_VS_CONN_TAB_BITS)
604#define IP_VS_CONN_TAB_MASK (IP_VS_CONN_TAB_SIZE - 1)
605
606enum { 620enum {
607 IP_VS_DIR_INPUT = 0, 621 IP_VS_DIR_INPUT = 0,
608 IP_VS_DIR_OUTPUT, 622 IP_VS_DIR_OUTPUT,
@@ -618,10 +632,22 @@ extern struct ip_vs_conn *ip_vs_ct_in_get
618(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, 632(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
619 const union nf_inet_addr *d_addr, __be16 d_port); 633 const union nf_inet_addr *d_addr, __be16 d_port);
620 634
635struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb,
636 struct ip_vs_protocol *pp,
637 const struct ip_vs_iphdr *iph,
638 unsigned int proto_off,
639 int inverse);
640
621extern struct ip_vs_conn *ip_vs_conn_out_get 641extern struct ip_vs_conn *ip_vs_conn_out_get
622(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, 642(int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port,
623 const union nf_inet_addr *d_addr, __be16 d_port); 643 const union nf_inet_addr *d_addr, __be16 d_port);
624 644
645struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb,
646 struct ip_vs_protocol *pp,
647 const struct ip_vs_iphdr *iph,
648 unsigned int proto_off,
649 int inverse);
650
625/* put back the conn without restarting its timer */ 651/* put back the conn without restarting its timer */
626static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) 652static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
627{ 653{
@@ -722,8 +748,6 @@ extern void ip_vs_app_inc_put(struct ip_vs_app *inc);
722 748
723extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); 749extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
724extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); 750extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
725extern int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri,
726 char *o_buf, int o_len, char *n_buf, int n_len);
727extern int ip_vs_app_init(void); 751extern int ip_vs_app_init(void);
728extern void ip_vs_app_cleanup(void); 752extern void ip_vs_app_cleanup(void);
729 753
@@ -747,7 +771,7 @@ extern struct ip_vs_protocol ip_vs_protocol_udp;
747extern struct ip_vs_protocol ip_vs_protocol_icmp; 771extern struct ip_vs_protocol ip_vs_protocol_icmp;
748extern struct ip_vs_protocol ip_vs_protocol_esp; 772extern struct ip_vs_protocol ip_vs_protocol_esp;
749extern struct ip_vs_protocol ip_vs_protocol_ah; 773extern struct ip_vs_protocol ip_vs_protocol_ah;
750 774extern struct ip_vs_protocol ip_vs_protocol_sctp;
751 775
752/* 776/*
753 * Registering/unregistering scheduler functions 777 * Registering/unregistering scheduler functions
@@ -931,6 +955,9 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
931 return csum_partial(diff, sizeof(diff), oldsum); 955 return csum_partial(diff, sizeof(diff), oldsum);
932} 956}
933 957
958extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp,
959 int outin);
960
934#endif /* __KERNEL__ */ 961#endif /* __KERNEL__ */
935 962
936#endif /* _NET_IP_VS_H */ 963#endif /* _NET_IP_VS_H */