blob: 03f7fe1bede6b9c79556d1e96e3e2548e40372d1 [file] [log] [blame]
Hans Schillstrom61b1ab42011-01-03 14:44:42 +01001/*
2 * IP Virtual Server
3 * Data structure for network namspace
4 *
5 */
6
7#ifndef IP_VS_H_
8#define IP_VS_H_
9
10#include <linux/list.h>
11#include <linux/mutex.h>
12#include <linux/list_nulls.h>
13#include <linux/ip_vs.h>
14#include <asm/atomic.h>
15#include <linux/in.h>
16
17struct ip_vs_stats;
18struct ip_vs_sync_buff;
19struct ctl_table_header;
20
21struct netns_ipvs {
22 int gen; /* Generation */
Hans Schillstromfc723252011-01-03 14:44:43 +010023 /*
24 * Hash table: for real service lookups
25 */
26 #define IP_VS_RTAB_BITS 4
27 #define IP_VS_RTAB_SIZE (1 << IP_VS_RTAB_BITS)
28 #define IP_VS_RTAB_MASK (IP_VS_RTAB_SIZE - 1)
29
30 struct list_head rs_table[IP_VS_RTAB_SIZE];
Hans Schillstromab8a5e82011-01-03 14:44:53 +010031 /* ip_vs_app */
32 struct list_head app_list;
33 struct mutex app_mutex;
34 struct lock_class_key app_key; /* mutex debuging */
35
Hans Schillstrom252c6412011-01-03 14:44:46 +010036 /* ip_vs_proto */
37 #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */
38 struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE];
Hans Schillstrom4a85b962011-01-03 14:44:47 +010039 /* ip_vs_proto_tcp */
40#ifdef CONFIG_IP_VS_PROTO_TCP
41 #define TCP_APP_TAB_BITS 4
42 #define TCP_APP_TAB_SIZE (1 << TCP_APP_TAB_BITS)
43 #define TCP_APP_TAB_MASK (TCP_APP_TAB_SIZE - 1)
44 struct list_head tcp_apps[TCP_APP_TAB_SIZE];
45 spinlock_t tcp_app_lock;
46#endif
Hans Schillstrom78b16bd2011-01-03 14:44:48 +010047 /* ip_vs_proto_udp */
48#ifdef CONFIG_IP_VS_PROTO_UDP
49 #define UDP_APP_TAB_BITS 4
50 #define UDP_APP_TAB_SIZE (1 << UDP_APP_TAB_BITS)
51 #define UDP_APP_TAB_MASK (UDP_APP_TAB_SIZE - 1)
52 struct list_head udp_apps[UDP_APP_TAB_SIZE];
53 spinlock_t udp_app_lock;
54#endif
Hans Schillstrom9d934872011-01-03 14:44:49 +010055 /* ip_vs_proto_sctp */
56#ifdef CONFIG_IP_VS_PROTO_SCTP
57 #define SCTP_APP_TAB_BITS 4
58 #define SCTP_APP_TAB_SIZE (1 << SCTP_APP_TAB_BITS)
59 #define SCTP_APP_TAB_MASK (SCTP_APP_TAB_SIZE - 1)
60 /* Hash table for SCTP application incarnations */
61 struct list_head sctp_apps[SCTP_APP_TAB_SIZE];
62 spinlock_t sctp_app_lock;
63#endif
Hans Schillstromd0a1eef2011-01-03 14:44:44 +010064
Hans Schillstromb6e885d2011-01-03 14:44:45 +010065 /* ip_vs_lblc */
66 int sysctl_lblc_expiration;
67 struct ctl_table_header *lblc_ctl_header;
68 struct ctl_table *lblc_ctl_table;
Hans Schillstromd0a1eef2011-01-03 14:44:44 +010069 /* ip_vs_lblcr */
70 int sysctl_lblcr_expiration;
71 struct ctl_table_header *lblcr_ctl_header;
72 struct ctl_table *lblcr_ctl_table;
Hans Schillstrom61b1ab42011-01-03 14:44:42 +010073};
74
75#endif /* IP_VS_H_ */