aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
authorSimon Horman <horms@verge.net.au>2010-08-22 08:37:53 -0400
committerSimon Horman <horms@verge.net.au>2010-10-04 09:45:24 -0400
commit85999283a21ab2dd37427fdd8c8e8af57223977c (patch)
treea78ba043c23182d47cfe473a9a829d8608e2d526 /include/net
parent2fabf35bfcd89445c54cf1e6a5437dd3cf924a92 (diff)
IPVS: Add struct ip_vs_pe
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.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index d4da774eca75..b6b309d05e4e 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -364,6 +364,10 @@ struct ip_vs_conn_param {
364 __be16 vport; 364 __be16 vport;
365 __u16 protocol; 365 __u16 protocol;
366 u16 af; 366 u16 af;
367
368 const struct ip_vs_pe *pe;
369 char *pe_data;
370 __u8 pe_data_len;
367}; 371};
368 372
369/* 373/*
@@ -416,6 +420,9 @@ struct ip_vs_conn {
416 void *app_data; /* Application private data */ 420 void *app_data; /* Application private data */
417 struct ip_vs_seq in_seq; /* incoming seq. struct */ 421 struct ip_vs_seq in_seq; /* incoming seq. struct */
418 struct ip_vs_seq out_seq; /* outgoing seq. struct */ 422 struct ip_vs_seq out_seq; /* outgoing seq. struct */
423
424 char *pe_data;
425 __u8 pe_data_len;
419}; 426};
420 427
421 428
@@ -486,6 +493,9 @@ struct ip_vs_service {
486 struct ip_vs_scheduler *scheduler; /* bound scheduler object */ 493 struct ip_vs_scheduler *scheduler; /* bound scheduler object */
487 rwlock_t sched_lock; /* lock sched_data */ 494 rwlock_t sched_lock; /* lock sched_data */
488 void *sched_data; /* scheduler application data */ 495 void *sched_data; /* scheduler application data */
496
497 /* alternate persistence engine */
498 struct ip_vs_pe *pe;
489}; 499};
490 500
491 501
@@ -549,6 +559,20 @@ struct ip_vs_scheduler {
549 const struct sk_buff *skb); 559 const struct sk_buff *skb);
550}; 560};
551 561
562/* The persistence engine object */
563struct ip_vs_pe {
564 struct list_head n_list; /* d-linked list head */
565 char *name; /* scheduler name */
566 atomic_t refcnt; /* reference counter */
567 struct module *module; /* THIS_MODULE/NULL */
568
569 /* get the connection template, if any */
570 int (*fill_param)(struct ip_vs_conn_param *p, struct sk_buff *skb);
571 bool (*ct_match)(const struct ip_vs_conn_param *p,
572 struct ip_vs_conn *ct);
573 u32 (*hashkey_raw)(const struct ip_vs_conn_param *p, u32 initval,
574 bool inverse);
575};
552 576
553/* 577/*
554 * The application module object (a.k.a. app incarnation) 578 * The application module object (a.k.a. app incarnation)
@@ -648,6 +672,8 @@ static inline void ip_vs_conn_fill_param(int af, int protocol,
648 p->cport = cport; 672 p->cport = cport;
649 p->vaddr = vaddr; 673 p->vaddr = vaddr;
650 p->vport = vport; 674 p->vport = vport;
675 p->pe = NULL;
676 p->pe_data = NULL;
651} 677}
652 678
653struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p); 679struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p);
@@ -803,7 +829,7 @@ extern int ip_vs_unbind_scheduler(struct ip_vs_service *svc);
803extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); 829extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name);
804extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); 830extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler);
805extern struct ip_vs_conn * 831extern struct ip_vs_conn *
806ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb); 832ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb);
807extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, 833extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
808 struct ip_vs_protocol *pp); 834 struct ip_vs_protocol *pp);
809 835