diff options
Diffstat (limited to 'src/plugins/lb/lb.h')
-rw-r--r-- | src/plugins/lb/lb.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/plugins/lb/lb.h b/src/plugins/lb/lb.h index ebbb1f6f8f0..46da40970c9 100644 --- a/src/plugins/lb/lb.h +++ b/src/plugins/lb/lb.h @@ -22,7 +22,7 @@ * The load-balancer receives traffic destined to VIP (Virtual IP) * addresses from one or multiple(ECMP) routers. * The load-balancer tunnels the traffic toward many application servers - * ensuring session stickyness (i.e. that a single sessions is tunneled + * ensuring session stickiness (i.e. that a single sessions is tunneled * towards a single application server). * */ @@ -324,6 +324,7 @@ typedef struct { */ u8 flags; #define LB_VIP_FLAGS_USED 0x1 +#define LB_VIP_FLAGS_SRC_IP_STICKY 0x2 /** * Pool of AS indexes used for this VIP. @@ -346,11 +347,14 @@ typedef struct { || (vip)->type == LB_VIP_TYPE_IP4_L3DSR \ || (vip)->type == LB_VIP_TYPE_IP4_NAT4 ) +#define lb_vip_is_src_ip_sticky(vip) \ + (((vip)->flags & LB_VIP_FLAGS_SRC_IP_STICKY) != 0) + +/* clang-format off */ #define lb_vip_is_gre4(vip) (((vip)->type == LB_VIP_TYPE_IP6_GRE4 \ || (vip)->type == LB_VIP_TYPE_IP4_GRE4) \ && ((vip)->port == 0)) - #define lb_vip_is_gre6(vip) (((vip)->type == LB_VIP_TYPE_IP6_GRE6 \ || (vip)->type == LB_VIP_TYPE_IP4_GRE6) \ && ((vip)->port == 0)) @@ -362,27 +366,28 @@ typedef struct { #define lb_vip_is_gre6_port(vip) (((vip)->type == LB_VIP_TYPE_IP6_GRE6 \ || (vip)->type == LB_VIP_TYPE_IP4_GRE6) \ && ((vip)->port != 0)) +/* clang-format on */ always_inline bool lb_vip_is_l3dsr(const lb_vip_t *vip) { - return (vip->type == LB_VIP_TYPE_IP4_L3DSR && vip->port ==0); + return (vip->type == LB_VIP_TYPE_IP4_L3DSR && vip->port == 0); } always_inline bool lb_vip_is_l3dsr_port(const lb_vip_t *vip) { - return (vip->type == LB_VIP_TYPE_IP4_L3DSR && vip->port !=0); + return (vip->type == LB_VIP_TYPE_IP4_L3DSR && vip->port != 0); } always_inline bool lb_vip_is_nat4_port(const lb_vip_t *vip) { - return (vip->type == LB_VIP_TYPE_IP4_NAT4 && vip->port !=0); + return (vip->type == LB_VIP_TYPE_IP4_NAT4 && vip->port != 0); } always_inline bool lb_vip_is_nat6_port(const lb_vip_t *vip) { - return (vip->type == LB_VIP_TYPE_IP6_NAT6 && vip->port !=0); + return (vip->type == LB_VIP_TYPE_IP6_NAT6 && vip->port != 0); } format_function_t format_lb_vip; @@ -575,6 +580,7 @@ typedef struct { u8 plen; u8 protocol; u16 port; + u8 src_ip_sticky; lb_vip_type_t type; u32 new_length; lb_vip_encap_args_t encap_args; |