ip_vs.h (e80a07b244dd6726094da73d58537c131cc0b1a6) ip_vs.h (35dfb013149f74c2be1ff9c78f14e6a3cd1539d1)
1/* SPDX-License-Identifier: GPL-2.0 */
2/* IP Virtual Server
3 * data structure and functionality definitions
4 */
5
6#ifndef _NET_IP_VS_H
7#define _NET_IP_VS_H
8
9#include <linux/ip_vs.h> /* definitions shared with userland */
10
11#include <asm/types.h> /* for __uXX types */
12
13#include <linux/list.h> /* for struct list_head */
14#include <linux/spinlock.h> /* for struct rwlock_t */
15#include <linux/atomic.h> /* for struct atomic_t */
16#include <linux/refcount.h> /* for struct refcount_t */
1/* SPDX-License-Identifier: GPL-2.0 */
2/* IP Virtual Server
3 * data structure and functionality definitions
4 */
5
6#ifndef _NET_IP_VS_H
7#define _NET_IP_VS_H
8
9#include <linux/ip_vs.h> /* definitions shared with userland */
10
11#include <asm/types.h> /* for __uXX types */
12
13#include <linux/list.h> /* for struct list_head */
14#include <linux/spinlock.h> /* for struct rwlock_t */
15#include <linux/atomic.h> /* for struct atomic_t */
16#include <linux/refcount.h> /* for struct refcount_t */
17#include <linux/workqueue.h>
17
18#include <linux/compiler.h>
19#include <linux/timer.h>
20#include <linux/bug.h>
21
22#include <net/checksum.h>
23#include <linux/netfilter.h> /* for union nf_inet_addr */
24#include <linux/ip.h>

--- 856 unchanged lines hidden (view full) ---

881 spinlock_t dest_trash_lock;
882 struct timer_list dest_trash_timer; /* expiration timer */
883 /* Service counters */
884 atomic_t ftpsvc_counter;
885 atomic_t nullsvc_counter;
886 atomic_t conn_out_counter;
887
888#ifdef CONFIG_SYSCTL
18
19#include <linux/compiler.h>
20#include <linux/timer.h>
21#include <linux/bug.h>
22
23#include <net/checksum.h>
24#include <linux/netfilter.h> /* for union nf_inet_addr */
25#include <linux/ip.h>

--- 856 unchanged lines hidden (view full) ---

882 spinlock_t dest_trash_lock;
883 struct timer_list dest_trash_timer; /* expiration timer */
884 /* Service counters */
885 atomic_t ftpsvc_counter;
886 atomic_t nullsvc_counter;
887 atomic_t conn_out_counter;
888
889#ifdef CONFIG_SYSCTL
890 /* delayed work for expiring no dest connections */
891 struct delayed_work expire_nodest_conn_work;
889 /* 1/rate drop and drop-entry variables */
890 struct delayed_work defense_work; /* Work handler */
891 int drop_rate;
892 int drop_counter;
893 int old_secure_tcp;
894 atomic_t dropentry;
895 /* locks in ctl.c */
896 spinlock_t dropentry_lock; /* drop entry handling */

--- 149 unchanged lines hidden (view full) ---

1046 ipvs->sysctl_backup_only;
1047}
1048
1049static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs)
1050{
1051 return ipvs->sysctl_conn_reuse_mode;
1052}
1053
892 /* 1/rate drop and drop-entry variables */
893 struct delayed_work defense_work; /* Work handler */
894 int drop_rate;
895 int drop_counter;
896 int old_secure_tcp;
897 atomic_t dropentry;
898 /* locks in ctl.c */
899 spinlock_t dropentry_lock; /* drop entry handling */

--- 149 unchanged lines hidden (view full) ---

1049 ipvs->sysctl_backup_only;
1050}
1051
1052static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs)
1053{
1054 return ipvs->sysctl_conn_reuse_mode;
1055}
1056
1057static inline int sysctl_expire_nodest_conn(struct netns_ipvs *ipvs)
1058{
1059 return ipvs->sysctl_expire_nodest_conn;
1060}
1061
1054static inline int sysctl_schedule_icmp(struct netns_ipvs *ipvs)
1055{
1056 return ipvs->sysctl_schedule_icmp;
1057}
1058
1059static inline int sysctl_ignore_tunneled(struct netns_ipvs *ipvs)
1060{
1061 return ipvs->sysctl_ignore_tunneled;

--- 71 unchanged lines hidden (view full) ---

1133 return 0;
1134}
1135
1136static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs)
1137{
1138 return 1;
1139}
1140
1062static inline int sysctl_schedule_icmp(struct netns_ipvs *ipvs)
1063{
1064 return ipvs->sysctl_schedule_icmp;
1065}
1066
1067static inline int sysctl_ignore_tunneled(struct netns_ipvs *ipvs)
1068{
1069 return ipvs->sysctl_ignore_tunneled;

--- 71 unchanged lines hidden (view full) ---

1141 return 0;
1142}
1143
1144static inline int sysctl_conn_reuse_mode(struct netns_ipvs *ipvs)
1145{
1146 return 1;
1147}
1148
1149static inline int sysctl_expire_nodest_conn(struct netns_ipvs *ipvs)
1150{
1151 return 0;
1152}
1153
1141static inline int sysctl_schedule_icmp(struct netns_ipvs *ipvs)
1142{
1143 return 0;
1144}
1145
1146static inline int sysctl_ignore_tunneled(struct netns_ipvs *ipvs)
1147{
1148 return 0;

--- 353 unchanged lines hidden (view full) ---

1502 return 0;
1503 ipvs->drop_counter = ipvs->drop_rate;
1504 return 1;
1505}
1506#else
1507static inline int ip_vs_todrop(struct netns_ipvs *ipvs) { return 0; }
1508#endif
1509
1154static inline int sysctl_schedule_icmp(struct netns_ipvs *ipvs)
1155{
1156 return 0;
1157}
1158
1159static inline int sysctl_ignore_tunneled(struct netns_ipvs *ipvs)
1160{
1161 return 0;

--- 353 unchanged lines hidden (view full) ---

1515 return 0;
1516 ipvs->drop_counter = ipvs->drop_rate;
1517 return 1;
1518}
1519#else
1520static inline int ip_vs_todrop(struct netns_ipvs *ipvs) { return 0; }
1521#endif
1522
1523#ifdef CONFIG_SYSCTL
1524/* Enqueue delayed work for expiring no dest connections
1525 * Only run when sysctl_expire_nodest=1
1526 */
1527static inline void ip_vs_enqueue_expire_nodest_conns(struct netns_ipvs *ipvs)
1528{
1529 if (sysctl_expire_nodest_conn(ipvs))
1530 queue_delayed_work(system_long_wq,
1531 &ipvs->expire_nodest_conn_work, 1);
1532}
1533
1534void ip_vs_expire_nodest_conn_flush(struct netns_ipvs *ipvs);
1535#else
1536static inline void ip_vs_enqueue_expire_nodest_conns(struct netns_ipvs *ipvs) {}
1537#endif
1538
1510#define IP_VS_DFWD_METHOD(dest) (atomic_read(&(dest)->conn_flags) & \
1511 IP_VS_CONN_F_FWD_MASK)
1512
1513/* ip_vs_fwd_tag returns the forwarding tag of the connection */
1514#define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK)
1515
1516static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
1517{

--- 172 unchanged lines hidden ---
1539#define IP_VS_DFWD_METHOD(dest) (atomic_read(&(dest)->conn_flags) & \
1540 IP_VS_CONN_F_FWD_MASK)
1541
1542/* ip_vs_fwd_tag returns the forwarding tag of the connection */
1543#define IP_VS_FWD_METHOD(cp) (cp->flags & IP_VS_CONN_F_FWD_MASK)
1544
1545static inline char ip_vs_fwd_tag(struct ip_vs_conn *cp)
1546{

--- 172 unchanged lines hidden ---