Lines Matching +full:int +full:- +full:fwd +full:- +full:mask
1 /* SPDX-License-Identifier: GPL-2.0 */
39 return net->ipvs; in net_ipvs()
43 extern int ip_vs_conn_tab_size;
46 int hdr_flags; /* ipvs flags */
57 static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, in frag_safe_skb_hp()
58 int len, void *buffer) in frag_safe_skb_hp()
67 static inline int
68 ip_vs_fill_iph_skb_off(int af, const struct sk_buff *skb, int offset, in ip_vs_fill_iph_skb_off()
69 int hdr_flags, struct ip_vs_iphdr *iphdr) in ip_vs_fill_iph_skb_off()
71 iphdr->hdr_flags = hdr_flags; in ip_vs_fill_iph_skb_off()
72 iphdr->off = offset; in ip_vs_fill_iph_skb_off()
82 iphdr->saddr.in6 = iph->saddr; in ip_vs_fill_iph_skb_off()
83 iphdr->daddr.in6 = iph->daddr; in ip_vs_fill_iph_skb_off()
85 iphdr->len = offset; in ip_vs_fill_iph_skb_off()
86 iphdr->flags = 0; in ip_vs_fill_iph_skb_off()
87 iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, in ip_vs_fill_iph_skb_off()
88 &iphdr->fragoffs, in ip_vs_fill_iph_skb_off()
89 &iphdr->flags); in ip_vs_fill_iph_skb_off()
90 if (iphdr->protocol < 0) in ip_vs_fill_iph_skb_off()
101 iphdr->len = offset + iph->ihl * 4; in ip_vs_fill_iph_skb_off()
102 iphdr->fragoffs = 0; in ip_vs_fill_iph_skb_off()
103 iphdr->protocol = iph->protocol; in ip_vs_fill_iph_skb_off()
104 iphdr->saddr.ip = iph->saddr; in ip_vs_fill_iph_skb_off()
105 iphdr->daddr.ip = iph->daddr; in ip_vs_fill_iph_skb_off()
111 static inline int
112 ip_vs_fill_iph_skb_icmp(int af, const struct sk_buff *skb, int offset, in ip_vs_fill_iph_skb_icmp()
115 int hdr_flags = IP_VS_HDR_ICMP; in ip_vs_fill_iph_skb_icmp()
123 static inline int
124 ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, bool inverse, in ip_vs_fill_iph_skb()
127 int hdr_flags = 0; in ip_vs_fill_iph_skb()
139 return !!(iph->hdr_flags & IP_VS_HDR_INVERSE); in ip_vs_iph_inverse()
145 return !!(iph->hdr_flags & IP_VS_HDR_ICMP); in ip_vs_iph_icmp()
148 static inline void ip_vs_addr_copy(int af, union nf_inet_addr *dst, in ip_vs_addr_copy()
153 dst->in6 = src->in6; in ip_vs_addr_copy()
156 dst->ip = src->ip; in ip_vs_addr_copy()
159 static inline void ip_vs_addr_set(int af, union nf_inet_addr *dst, in ip_vs_addr_set()
164 dst->in6 = src->in6; in ip_vs_addr_set()
168 dst->ip = src->ip; in ip_vs_addr_set()
169 dst->all[1] = 0; in ip_vs_addr_set()
170 dst->all[2] = 0; in ip_vs_addr_set()
171 dst->all[3] = 0; in ip_vs_addr_set()
174 static inline int ip_vs_addr_equal(int af, const union nf_inet_addr *a, in ip_vs_addr_equal()
179 return ipv6_addr_equal(&a->in6, &b->in6); in ip_vs_addr_equal()
181 return a->ip == b->ip; in ip_vs_addr_equal()
187 int ip_vs_get_debug_level(void);
189 static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, in ip_vs_dbg_addr()
191 int *idx) in ip_vs_dbg_addr()
193 int len; in ip_vs_dbg_addr()
196 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]", in ip_vs_dbg_addr()
197 &addr->in6) + 1; in ip_vs_dbg_addr()
200 len = snprintf(&buf[*idx], buf_len - *idx, "%pI4", in ip_vs_dbg_addr()
201 &addr->ip) + 1; in ip_vs_dbg_addr()
205 return &buf[*idx - len]; in ip_vs_dbg_addr()
211 int ip_vs_dbg_idx = 0; \
218 int ip_vs_dbg_idx = 0; \
241 pp->debug_packet(af, pp, skb, ofs, msg); \
247 pp->debug_packet(af, pp, skb, ofs, msg); \
384 * IPVS statistics object, 64-bit kernel version of struct ip_vs_stats_user
420 int dont_defrag;
426 int (*init_netns)(struct netns_ipvs *ipvs, struct ip_vs_proto_data *pd);
430 int (*conn_schedule)(struct netns_ipvs *ipvs,
431 int af, struct sk_buff *skb,
433 int *verdict, struct ip_vs_conn **cpp,
438 int af,
444 int af,
448 int (*snat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp,
451 int (*dnat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp,
454 const char *(*state_name)(int state);
456 void (*state_transition)(struct ip_vs_conn *cp, int direction,
460 int (*register_app)(struct netns_ipvs *ipvs, struct ip_vs_app *inc);
464 int (*app_conn_bind)(struct ip_vs_conn *cp);
466 void (*debug_packet)(int af, struct ip_vs_protocol *pp,
468 int offset,
471 void (*timeout_change)(struct ip_vs_proto_data *pd, int flags);
478 int *timeout_table; /* protocol timeout table */
543 int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp,
580 unsigned int flags; /* virtual service flags */
581 unsigned int timeout; /* persistent timeout in sec */
592 unsigned int conn_flags; /* connection flags */
593 int weight; /* destination weight */
614 struct hlist_node f_list; /* for fwmark-based service table */
622 unsigned int flags; /* service status flags */
623 unsigned int timeout; /* persistent timeout in ticks */
624 __be32 netmask; /* grouping granularity, mask/plen */
627 struct list_head destinations; /* real server d-linked list */
638 int conntrack_afmask;
661 volatile unsigned int flags; /* dest status flags */
692 unsigned int in_rs_table:1; /* we are in rs_table */
697 struct list_head n_list; /* d-linked list head */
703 int (*init_service)(struct ip_vs_service *svc);
707 int (*add_dest)(struct ip_vs_service *svc, struct ip_vs_dest *dest);
709 int (*del_dest)(struct ip_vs_service *svc, struct ip_vs_dest *dest);
711 int (*upd_dest)(struct ip_vs_service *svc, struct ip_vs_dest *dest);
721 struct list_head n_list; /* d-linked list head */
727 int (*fill_param)(struct ip_vs_conn_param *p, struct sk_buff *skb);
732 int (*show_pe_data)(const struct ip_vs_conn *cp, char *buf);
733 /* create connections for real-server outgoing packets */
744 int type; /* IP_VS_APP_TYPE_xxx */
761 int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *,
762 struct sk_buff *, int *diff, struct ip_vs_iphdr *ipvsh);
768 int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *,
769 struct sk_buff *, int *diff, struct ip_vs_iphdr *ipvsh);
772 int (*init_conn)(struct ip_vs_app *, struct ip_vs_conn *);
775 int (*done_conn)(struct ip_vs_app *, struct ip_vs_conn *);
779 int (*bind_conn)(struct ip_vs_app *, struct ip_vs_conn *,
784 int * timeout_table;
785 int * timeouts;
786 int timeouts_size;
788 int (*conn_schedule)(struct sk_buff *skb, struct ip_vs_app *app,
789 int *verdict, struct ip_vs_conn **cpp);
793 const struct iphdr *iph, int inverse);
797 const struct iphdr *iph, int inverse);
799 int (*state_transition)(struct ip_vs_conn *cp, int direction,
803 void (*timeout_change)(struct ip_vs_app *app, int flags);
810 unsigned int sync_queue_delay;
822 int syncid;
833 int gen; /* Generation */
834 int enable; /* enable like nf_hooks do */
838 #define IP_VS_RTAB_MASK (IP_VS_RTAB_SIZE - 1)
850 #define TCP_APP_TAB_MASK (TCP_APP_TAB_SIZE - 1)
857 #define UDP_APP_TAB_MASK (UDP_APP_TAB_SIZE - 1)
864 #define SCTP_APP_TAB_MASK (SCTP_APP_TAB_SIZE - 1)
874 int num_services; /* no of virtual services */
875 int num_services6; /* IPv6 virtual services */
889 /* 1/rate drop and drop-entry variables */
891 int drop_rate;
892 int drop_counter;
893 int old_secure_tcp;
900 /* sys-ctl struct */
906 int sysctl_amemthresh;
907 int sysctl_am_droprate;
908 int sysctl_drop_entry;
909 int sysctl_drop_packet;
910 int sysctl_secure_tcp;
912 int sysctl_conntrack;
914 int sysctl_snat_reroute;
915 int sysctl_sync_ver;
916 int sysctl_sync_ports;
917 int sysctl_sync_persist_mode;
919 int sysctl_sync_sock_size;
920 int sysctl_cache_bypass;
921 int sysctl_expire_nodest_conn;
922 int sysctl_sloppy_tcp;
923 int sysctl_sloppy_sctp;
924 int sysctl_expire_quiescent_template;
925 int sysctl_sync_threshold[2];
926 unsigned int sysctl_sync_refresh_period;
927 int sysctl_sync_retries;
928 int sysctl_nat_icmp_send;
929 int sysctl_pmtu_disc;
930 int sysctl_backup_only;
931 int sysctl_conn_reuse_mode;
932 int sysctl_schedule_icmp;
933 int sysctl_ignore_tunneled;
934 int sysctl_run_estimation;
937 int sysctl_lblc_expiration;
941 int sysctl_lblcr_expiration;
954 int threads_mask;
955 volatile int sync_state;
964 unsigned int mixed_address_family_dests;
965 unsigned int hooks_afmask; /* &1=AF_INET, &2=AF_INET6 */
984 static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) in sysctl_sync_threshold()
986 return ipvs->sysctl_sync_threshold[0]; in sysctl_sync_threshold()
989 static inline int sysctl_sync_period(struct netns_ipvs *ipvs) in sysctl_sync_period()
991 return READ_ONCE(ipvs->sysctl_sync_threshold[1]); in sysctl_sync_period()
994 static inline unsigned int sysctl_sync_refresh_period(struct netns_ipvs *ipvs) in sysctl_sync_refresh_period()
996 return READ_ONCE(ipvs->sysctl_sync_refresh_period); in sysctl_sync_refresh_period()
999 static inline int sysctl_sync_retries(struct netns_ipvs *ipvs) in sysctl_sync_retries()
1001 return ipvs->sysctl_sync_retries; in sysctl_sync_retries()
1004 static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) in sysctl_sync_ver()
1006 return ipvs->sysctl_sync_ver; in sysctl_sync_ver()
1009 static inline int sysctl_sloppy_tcp(struct netns_ipvs *ipvs) in sysctl_sloppy_tcp()
1011 return ipvs->sysctl_sloppy_tcp; in sysctl_sloppy_tcp()
1014 static inline int sysctl_sloppy_sctp(struct netns_ipvs *ipvs) in sysctl_sloppy_sctp()
1016 return ipvs->sysctl_sloppy_sctp; in sysctl_sloppy_sctp()
1019 static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) in sysctl_sync_ports()
1021 return READ_ONCE(ipvs->sysctl_sync_ports); in sysctl_sync_ports()
1024 static inline int sysctl_sync_persist_mode(struct netns_ipvs *ipvs) in sysctl_sync_persist_mode()
1026 return ipvs->sysctl_sync_persist_mode; in sysctl_sync_persist_mode()
1031 return ipvs->sysctl_sync_qlen_max; in sysctl_sync_qlen_max()
1034 static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) in sysctl_sync_sock_size()
1036 return ipvs->sysctl_sync_sock_size; in sysctl_sync_sock_size()
1039 static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) in sysctl_pmtu_disc()
1041 return ipvs->sysctl_pmtu_disc; in sysctl_pmtu_disc()
1044 static inline int sysctl_backup_only(struct netns_ipvs *ipvs) in sysctl_backup_only()
1046 return ipvs->sync_state & IP_VS_STATE_BACKUP && in sysctl_backup_only()
1047 ipvs->sysctl_backup_only; in sysctl_backup_only()
1050 static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs) in sysctl_conn_reuse_mode()
1052 return ipvs->sysctl_conn_reuse_mode; in sysctl_conn_reuse_mode()
1055 static inline int sysctl_expire_nodest_conn(struct netns_ipvs *ipvs) in sysctl_expire_nodest_conn()
1057 return ipvs->sysctl_expire_nodest_conn; in sysctl_expire_nodest_conn()
1060 static inline int sysctl_schedule_icmp(struct netns_ipvs *ipvs) in sysctl_schedule_icmp()
1062 return ipvs->sysctl_schedule_icmp; in sysctl_schedule_icmp()
1065 static inline int sysctl_ignore_tunneled(struct netns_ipvs *ipvs) in sysctl_ignore_tunneled()
1067 return ipvs->sysctl_ignore_tunneled; in sysctl_ignore_tunneled()
1070 static inline int sysctl_cache_bypass(struct netns_ipvs *ipvs) in sysctl_cache_bypass()
1072 return ipvs->sysctl_cache_bypass; in sysctl_cache_bypass()
1075 static inline int sysctl_run_estimation(struct netns_ipvs *ipvs) in sysctl_run_estimation()
1077 return ipvs->sysctl_run_estimation; in sysctl_run_estimation()
1082 static inline int sysctl_sync_threshold(struct netns_ipvs *ipvs) in sysctl_sync_threshold()
1087 static inline int sysctl_sync_period(struct netns_ipvs *ipvs) in sysctl_sync_period()
1092 static inline unsigned int sysctl_sync_refresh_period(struct netns_ipvs *ipvs) in sysctl_sync_refresh_period()
1097 static inline int sysctl_sync_retries(struct netns_ipvs *ipvs) in sysctl_sync_retries()
1102 static inline int sysctl_sync_ver(struct netns_ipvs *ipvs) in sysctl_sync_ver()
1107 static inline int sysctl_sloppy_tcp(struct netns_ipvs *ipvs) in sysctl_sloppy_tcp()
1112 static inline int sysctl_sloppy_sctp(struct netns_ipvs *ipvs) in sysctl_sloppy_sctp()
1117 static inline int sysctl_sync_ports(struct netns_ipvs *ipvs) in sysctl_sync_ports()
1122 static inline int sysctl_sync_persist_mode(struct netns_ipvs *ipvs) in sysctl_sync_persist_mode()
1132 static inline int sysctl_sync_sock_size(struct netns_ipvs *ipvs) in sysctl_sync_sock_size()
1137 static inline int sysctl_pmtu_disc(struct netns_ipvs *ipvs) in sysctl_pmtu_disc()
1142 static inline int sysctl_backup_only(struct netns_ipvs *ipvs) in sysctl_backup_only()
1147 static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs) in sysctl_conn_reuse_mode()
1152 static inline int sysctl_expire_nodest_conn(struct netns_ipvs *ipvs) in sysctl_expire_nodest_conn()
1157 static inline int sysctl_schedule_icmp(struct netns_ipvs *ipvs) in sysctl_schedule_icmp()
1162 static inline int sysctl_ignore_tunneled(struct netns_ipvs *ipvs) in sysctl_ignore_tunneled()
1167 static inline int sysctl_cache_bypass(struct netns_ipvs *ipvs) in sysctl_cache_bypass()
1172 static inline int sysctl_run_estimation(struct netns_ipvs *ipvs) in sysctl_run_estimation()
1182 const char *ip_vs_proto_name(unsigned int proto);
1183 void ip_vs_init_hash_table(struct list_head *table, int rows);
1204 static inline void ip_vs_conn_fill_param(struct netns_ipvs *ipvs, int af, int protocol, in ip_vs_conn_fill_param()
1211 p->ipvs = ipvs; in ip_vs_conn_fill_param()
1212 p->af = af; in ip_vs_conn_fill_param()
1213 p->protocol = protocol; in ip_vs_conn_fill_param()
1214 p->caddr = caddr; in ip_vs_conn_fill_param()
1215 p->cport = cport; in ip_vs_conn_fill_param()
1216 p->vaddr = vaddr; in ip_vs_conn_fill_param()
1217 p->vport = vport; in ip_vs_conn_fill_param()
1218 p->pe = NULL; in ip_vs_conn_fill_param()
1219 p->pe_data = NULL; in ip_vs_conn_fill_param()
1225 struct ip_vs_conn * ip_vs_conn_in_get_proto(struct netns_ipvs *ipvs, int af,
1231 struct ip_vs_conn * ip_vs_conn_out_get_proto(struct netns_ipvs *ipvs, int af,
1236 * By default, RCU read-side critical sections have access only to
1241 return refcount_inc_not_zero(&cp->refcnt); in __ip_vs_conn_get()
1248 refcount_dec(&cp->refcnt); in __ip_vs_conn_put()
1253 struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, int dest_af,
1255 __be16 dport, unsigned int flags,
1262 int ip_vs_check_template(struct ip_vs_conn *ct, struct ip_vs_dest *cdest);
1264 int ip_vs_conn_init(void);
1269 struct ip_vs_conn *ctl_cp = cp->control; in ip_vs_control_del()
1273 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_del()
1274 ntohs(cp->cport), in ip_vs_control_del()
1275 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), in ip_vs_control_del()
1276 ntohs(cp->vport)); in ip_vs_control_del()
1283 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_del()
1284 ntohs(cp->cport), in ip_vs_control_del()
1285 IP_VS_DBG_ADDR(cp->af, &ctl_cp->caddr), in ip_vs_control_del()
1286 ntohs(ctl_cp->cport)); in ip_vs_control_del()
1288 cp->control = NULL; in ip_vs_control_del()
1289 if (atomic_read(&ctl_cp->n_control) == 0) { in ip_vs_control_del()
1292 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_del()
1293 ntohs(cp->cport), in ip_vs_control_del()
1294 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), in ip_vs_control_del()
1295 ntohs(cp->vport)); in ip_vs_control_del()
1299 atomic_dec(&ctl_cp->n_control); in ip_vs_control_del()
1305 if (cp->control) { in ip_vs_control_add()
1308 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_add()
1309 ntohs(cp->cport), in ip_vs_control_add()
1310 IP_VS_DBG_ADDR(cp->af, &cp->vaddr), in ip_vs_control_add()
1311 ntohs(cp->vport)); in ip_vs_control_add()
1318 IP_VS_DBG_ADDR(cp->af, &cp->caddr), in ip_vs_control_add()
1319 ntohs(cp->cport), in ip_vs_control_add()
1320 IP_VS_DBG_ADDR(cp->af, &ctl_cp->caddr), in ip_vs_control_add()
1321 ntohs(ctl_cp->cport)); in ip_vs_control_add()
1323 cp->control = ctl_cp; in ip_vs_control_add()
1324 atomic_inc(&ctl_cp->n_control); in ip_vs_control_add()
1331 struct ip_vs_conn *ct = cp->control; in ip_vs_control_assure_ct()
1333 if (ct && !(ct->state & IP_VS_CTPL_S_ASSURED) && in ip_vs_control_assure_ct()
1334 (ct->flags & IP_VS_CONN_F_TEMPLATE)) in ip_vs_control_assure_ct()
1335 ct->state |= IP_VS_CTPL_S_ASSURED; in ip_vs_control_assure_ct()
1339 int ip_vs_estimator_net_init(struct netns_ipvs *ipvs);
1340 int ip_vs_control_net_init(struct netns_ipvs *ipvs);
1341 int ip_vs_protocol_net_init(struct netns_ipvs *ipvs);
1342 int ip_vs_app_net_init(struct netns_ipvs *ipvs);
1343 int ip_vs_conn_net_init(struct netns_ipvs *ipvs);
1344 int ip_vs_sync_net_init(struct netns_ipvs *ipvs);
1359 int ip_vs_bind_app(struct ip_vs_conn *cp, struct ip_vs_protocol *pp);
1361 int register_ip_vs_app_inc(struct netns_ipvs *ipvs, struct ip_vs_app *app, __u16 proto,
1363 int ip_vs_app_inc_get(struct ip_vs_app *inc);
1366 int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb,
1368 int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb,
1371 int register_ip_vs_pe(struct ip_vs_pe *pe);
1372 int unregister_ip_vs_pe(struct ip_vs_pe *pe);
1378 if (pe && pe->module) \
1379 __module_get(pe->module);
1382 if (pe && pe->module) \
1383 module_put(pe->module);
1386 int ip_vs_protocol_init(void);
1388 void ip_vs_protocol_timeout_change(struct netns_ipvs *ipvs, int flags);
1389 int *ip_vs_create_timeout_table(int *table, int size);
1390 void ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
1391 const struct sk_buff *skb, int offset,
1404 int register_ip_vs_scheduler(struct ip_vs_scheduler *scheduler);
1405 int unregister_ip_vs_scheduler(struct ip_vs_scheduler *scheduler);
1406 int ip_vs_bind_scheduler(struct ip_vs_service *svc,
1414 struct ip_vs_proto_data *pd, int *ignored,
1416 int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
1423 extern int sysctl_ip_vs_sync_ver;
1426 ip_vs_service_find(struct netns_ipvs *ipvs, int af, __u32 fwmark, __u16 protocol,
1429 bool ip_vs_has_real_service(struct netns_ipvs *ipvs, int af, __u16 protocol,
1433 ip_vs_find_real_service(struct netns_ipvs *ipvs, int af, __u16 protocol,
1435 struct ip_vs_dest *ip_vs_find_tunnel(struct netns_ipvs *ipvs, int af,
1439 int ip_vs_use_count_inc(void);
1441 int ip_vs_register_nl_ioctl(void);
1443 int ip_vs_control_init(void);
1446 ip_vs_find_dest(struct netns_ipvs *ipvs, int svc_af, int dest_af,
1454 refcount_inc(&dest->refcnt); in ip_vs_dest_hold()
1460 refcount_dec(&dest->refcnt); in ip_vs_dest_put()
1465 if (refcount_dec_and_test(&dest->refcnt)) in ip_vs_dest_put_and_free()
1472 int start_sync_thread(struct netns_ipvs *ipvs, struct ipvs_sync_daemon_cfg *cfg,
1473 int state);
1474 int stop_sync_thread(struct netns_ipvs *ipvs, int state);
1475 void ip_vs_sync_conn(struct netns_ipvs *ipvs, struct ip_vs_conn *cp, int pkts);
1484 int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1486 int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1488 int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1490 int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1492 int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1494 int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
1495 struct ip_vs_protocol *pp, int offset,
1496 unsigned int hooknum, struct ip_vs_iphdr *iph);
1500 int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1502 int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1504 int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1506 int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1508 int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
1509 struct ip_vs_protocol *pp, int offset,
1510 unsigned int hooknum, struct ip_vs_iphdr *iph);
1518 static inline int ip_vs_todrop(struct netns_ipvs *ipvs) in ip_vs_todrop()
1520 if (!ipvs->drop_rate) in ip_vs_todrop()
1522 if (--ipvs->drop_counter > 0) in ip_vs_todrop()
1524 ipvs->drop_counter = ipvs->drop_rate; in ip_vs_todrop()
1528 static inline int ip_vs_todrop(struct netns_ipvs *ipvs) { return 0; } in ip_vs_todrop()
1539 &ipvs->expire_nodest_conn_work, 1); in ip_vs_enqueue_expire_nodest_conns()
1547 #define IP_VS_DFWD_METHOD(dest) (atomic_read(&(dest)->conn_flags) & \
1551 #define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK)
1555 char fwd; in ip_vs_fwd_tag() local
1559 fwd = 'M'; break; in ip_vs_fwd_tag()
1561 fwd = 'L'; break; in ip_vs_fwd_tag()
1563 fwd = 'T'; break; in ip_vs_fwd_tag()
1565 fwd = 'R'; break; in ip_vs_fwd_tag()
1567 fwd = 'B'; break; in ip_vs_fwd_tag()
1569 fwd = '?'; break; in ip_vs_fwd_tag()
1571 return fwd; in ip_vs_fwd_tag()
1575 struct ip_vs_conn *cp, int dir);
1579 struct ip_vs_conn *cp, int dir);
1582 __sum16 ip_vs_checksum_complete(struct sk_buff *skb, int offset);
1617 nf_conntrack_put(&ct->ct_general); in ip_vs_notrack()
1627 static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) in ip_vs_conntrack_enabled()
1630 return ipvs->sysctl_conntrack; in ip_vs_conntrack_enabled()
1637 int outin);
1638 int ip_vs_confirm_conntrack(struct sk_buff *skb);
1641 const __be16 port, int from_rs);
1646 static inline int ip_vs_conntrack_enabled(struct netns_ipvs *ipvs) in ip_vs_conntrack_enabled()
1652 struct ip_vs_conn *cp, int outin) in ip_vs_update_conntrack()
1656 static inline int ip_vs_confirm_conntrack(struct sk_buff *skb) in ip_vs_confirm_conntrack()
1681 static inline int ip_vs_register_conntrack(struct ip_vs_service *svc) in ip_vs_register_conntrack()
1684 int afmask = (svc->af == AF_INET6) ? 2 : 1; in ip_vs_register_conntrack()
1685 int ret = 0; in ip_vs_register_conntrack()
1687 if (!(svc->conntrack_afmask & afmask)) { in ip_vs_register_conntrack()
1688 ret = nf_ct_netns_get(svc->ipvs->net, svc->af); in ip_vs_register_conntrack()
1690 svc->conntrack_afmask |= afmask; in ip_vs_register_conntrack()
1701 int afmask = (svc->af == AF_INET6) ? 2 : 1; in ip_vs_unregister_conntrack()
1703 if (svc->conntrack_afmask & afmask) { in ip_vs_unregister_conntrack()
1704 nf_ct_netns_put(svc->ipvs->net, svc->af); in ip_vs_unregister_conntrack()
1705 svc->conntrack_afmask &= ~afmask; in ip_vs_unregister_conntrack()
1710 int ip_vs_register_hooks(struct netns_ipvs *ipvs, unsigned int af);
1711 void ip_vs_unregister_hooks(struct netns_ipvs *ipvs, unsigned int af);
1713 static inline int
1720 * dest->activeconns*256 + dest->inactconns in ip_vs_dest_conn_overhead()
1722 return (atomic_read(&dest->activeconns) << 8) + in ip_vs_dest_conn_overhead()
1723 atomic_read(&dest->inactconns); in ip_vs_dest_conn_overhead()
1727 INDIRECT_CALLABLE_DECLARE(int
1733 INDIRECT_CALLABLE_DECLARE(int