blob: 62b1448d3795528b07f3b76604a6acc9614dec6a [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 Schillstrom252c6412011-01-03 14:44:46 +010031 /* ip_vs_proto */
32 #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */
33 struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE];
Hans Schillstrom4a85b962011-01-03 14:44:47 +010034 /* ip_vs_proto_tcp */
35#ifdef CONFIG_IP_VS_PROTO_TCP
36 #define TCP_APP_TAB_BITS 4
37 #define TCP_APP_TAB_SIZE (1 << TCP_APP_TAB_BITS)
38 #define TCP_APP_TAB_MASK (TCP_APP_TAB_SIZE - 1)
39 struct list_head tcp_apps[TCP_APP_TAB_SIZE];
40 spinlock_t tcp_app_lock;
41#endif
Hans Schillstrom78b16bd2011-01-03 14:44:48 +010042 /* ip_vs_proto_udp */
43#ifdef CONFIG_IP_VS_PROTO_UDP
44 #define UDP_APP_TAB_BITS 4
45 #define UDP_APP_TAB_SIZE (1 << UDP_APP_TAB_BITS)
46 #define UDP_APP_TAB_MASK (UDP_APP_TAB_SIZE - 1)
47 struct list_head udp_apps[UDP_APP_TAB_SIZE];
48 spinlock_t udp_app_lock;
49#endif
Hans Schillstromd0a1eef2011-01-03 14:44:44 +010050
Hans Schillstromb6e885d2011-01-03 14:44:45 +010051 /* ip_vs_lblc */
52 int sysctl_lblc_expiration;
53 struct ctl_table_header *lblc_ctl_header;
54 struct ctl_table *lblc_ctl_table;
Hans Schillstromd0a1eef2011-01-03 14:44:44 +010055 /* ip_vs_lblcr */
56 int sysctl_lblcr_expiration;
57 struct ctl_table_header *lblcr_ctl_header;
58 struct ctl_table *lblcr_ctl_table;
Hans Schillstrom61b1ab42011-01-03 14:44:42 +010059};
60
61#endif /* IP_VS_H_ */