ip_vs.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*
  2. * IP Virtual Server
  3. * Data structure for network namspace
  4. *
  5. */
  6. #ifndef IP_VS_H_
  7. #define IP_VS_H_
  8. #include <linux/list.h>
  9. #include <linux/mutex.h>
  10. #include <linux/list_nulls.h>
  11. #include <linux/ip_vs.h>
  12. #include <asm/atomic.h>
  13. #include <linux/in.h>
  14. struct ip_vs_stats;
  15. struct ip_vs_sync_buff;
  16. struct ctl_table_header;
  17. struct netns_ipvs {
  18. int gen; /* Generation */
  19. /*
  20. * Hash table: for real service lookups
  21. */
  22. #define IP_VS_RTAB_BITS 4
  23. #define IP_VS_RTAB_SIZE (1 << IP_VS_RTAB_BITS)
  24. #define IP_VS_RTAB_MASK (IP_VS_RTAB_SIZE - 1)
  25. struct list_head rs_table[IP_VS_RTAB_SIZE];
  26. /* ip_vs_proto */
  27. #define IP_VS_PROTO_TAB_SIZE 32 /* must be power of 2 */
  28. struct ip_vs_proto_data *proto_data_table[IP_VS_PROTO_TAB_SIZE];
  29. /* ip_vs_proto_tcp */
  30. #ifdef CONFIG_IP_VS_PROTO_TCP
  31. #define TCP_APP_TAB_BITS 4
  32. #define TCP_APP_TAB_SIZE (1 << TCP_APP_TAB_BITS)
  33. #define TCP_APP_TAB_MASK (TCP_APP_TAB_SIZE - 1)
  34. struct list_head tcp_apps[TCP_APP_TAB_SIZE];
  35. spinlock_t tcp_app_lock;
  36. #endif
  37. /* ip_vs_proto_udp */
  38. #ifdef CONFIG_IP_VS_PROTO_UDP
  39. #define UDP_APP_TAB_BITS 4
  40. #define UDP_APP_TAB_SIZE (1 << UDP_APP_TAB_BITS)
  41. #define UDP_APP_TAB_MASK (UDP_APP_TAB_SIZE - 1)
  42. struct list_head udp_apps[UDP_APP_TAB_SIZE];
  43. spinlock_t udp_app_lock;
  44. #endif
  45. /* ip_vs_lblc */
  46. int sysctl_lblc_expiration;
  47. struct ctl_table_header *lblc_ctl_header;
  48. struct ctl_table *lblc_ctl_table;
  49. /* ip_vs_lblcr */
  50. int sysctl_lblcr_expiration;
  51. struct ctl_table_header *lblcr_ctl_header;
  52. struct ctl_table *lblcr_ctl_table;
  53. };
  54. #endif /* IP_VS_H_ */