diff options
author | Simon Horman <horms@verge.net.au> | 2010-08-22 08:37:52 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2010-10-04 09:45:24 -0400 |
commit | f11017ec2d1859c661f4e2b12c4a8d250e1f47cf (patch) | |
tree | 07278dbced3c8c61b9e6bbe9c3d502c65b127f24 /include/net | |
parent | 5b57a98c1f0d78a4c238d83c4ac70de3bd237b2f (diff) |
IPVS: Add struct ip_vs_conn_param
Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: Julian Anastasov <ja@ssi.bg>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/ip_vs.h | 44 |
1 files changed, 30 insertions, 14 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 3915a4f4cd30..d4da774eca75 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -357,6 +357,15 @@ struct ip_vs_protocol { | |||
357 | 357 | ||
358 | extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto); | 358 | extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto); |
359 | 359 | ||
360 | struct ip_vs_conn_param { | ||
361 | const union nf_inet_addr *caddr; | ||
362 | const union nf_inet_addr *vaddr; | ||
363 | __be16 cport; | ||
364 | __be16 vport; | ||
365 | __u16 protocol; | ||
366 | u16 af; | ||
367 | }; | ||
368 | |||
360 | /* | 369 | /* |
361 | * IP_VS structure allocated for each dynamically scheduled connection | 370 | * IP_VS structure allocated for each dynamically scheduled connection |
362 | */ | 371 | */ |
@@ -626,13 +635,23 @@ enum { | |||
626 | IP_VS_DIR_LAST, | 635 | IP_VS_DIR_LAST, |
627 | }; | 636 | }; |
628 | 637 | ||
629 | extern struct ip_vs_conn *ip_vs_conn_in_get | 638 | static inline void ip_vs_conn_fill_param(int af, int protocol, |
630 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | 639 | const union nf_inet_addr *caddr, |
631 | const union nf_inet_addr *d_addr, __be16 d_port); | 640 | __be16 cport, |
641 | const union nf_inet_addr *vaddr, | ||
642 | __be16 vport, | ||
643 | struct ip_vs_conn_param *p) | ||
644 | { | ||
645 | p->af = af; | ||
646 | p->protocol = protocol; | ||
647 | p->caddr = caddr; | ||
648 | p->cport = cport; | ||
649 | p->vaddr = vaddr; | ||
650 | p->vport = vport; | ||
651 | } | ||
632 | 652 | ||
633 | extern struct ip_vs_conn *ip_vs_ct_in_get | 653 | struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p); |
634 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | 654 | struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); |
635 | const union nf_inet_addr *d_addr, __be16 d_port); | ||
636 | 655 | ||
637 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | 656 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, |
638 | struct ip_vs_protocol *pp, | 657 | struct ip_vs_protocol *pp, |
@@ -640,9 +659,7 @@ struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | |||
640 | unsigned int proto_off, | 659 | unsigned int proto_off, |
641 | int inverse); | 660 | int inverse); |
642 | 661 | ||
643 | extern struct ip_vs_conn *ip_vs_conn_out_get | 662 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); |
644 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | ||
645 | const union nf_inet_addr *d_addr, __be16 d_port); | ||
646 | 663 | ||
647 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | 664 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, |
648 | struct ip_vs_protocol *pp, | 665 | struct ip_vs_protocol *pp, |
@@ -658,11 +675,10 @@ static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) | |||
658 | extern void ip_vs_conn_put(struct ip_vs_conn *cp); | 675 | extern void ip_vs_conn_put(struct ip_vs_conn *cp); |
659 | extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); | 676 | extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); |
660 | 677 | ||
661 | extern struct ip_vs_conn * | 678 | struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, |
662 | ip_vs_conn_new(int af, int proto, const union nf_inet_addr *caddr, __be16 cport, | 679 | const union nf_inet_addr *daddr, |
663 | const union nf_inet_addr *vaddr, __be16 vport, | 680 | __be16 dport, unsigned flags, |
664 | const union nf_inet_addr *daddr, __be16 dport, unsigned flags, | 681 | struct ip_vs_dest *dest); |
665 | struct ip_vs_dest *dest); | ||
666 | extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); | 682 | extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); |
667 | 683 | ||
668 | extern const char * ip_vs_state_name(__u16 proto, int state); | 684 | extern const char * ip_vs_state_name(__u16 proto, int state); |