sysctl_net_core.c
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:3k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /* -*- linux-c -*-
  2.  * sysctl_net_core.c: sysctl interface to net core subsystem.
  3.  *
  4.  * Begun April 1, 1996, Mike Shaver.
  5.  * Added /proc/sys/net/core directory entry (empty =) ). [MS]
  6.  */
  7. #include <linux/mm.h>
  8. #include <linux/sysctl.h>
  9. #include <linux/config.h>
  10. #ifdef CONFIG_SYSCTL
  11. extern int netdev_max_backlog;
  12. extern int weight_p;
  13. extern int no_cong_thresh;
  14. extern int no_cong;
  15. extern int lo_cong;
  16. extern int mod_cong;
  17. extern int netdev_fastroute;
  18. extern int net_msg_cost;
  19. extern int net_msg_burst;
  20. extern __u32 sysctl_wmem_max;
  21. extern __u32 sysctl_rmem_max;
  22. extern __u32 sysctl_wmem_default;
  23. extern __u32 sysctl_rmem_default;
  24. extern int sysctl_core_destroy_delay;
  25. extern int sysctl_optmem_max;
  26. extern int sysctl_hot_list_len;
  27. #ifdef CONFIG_NET_DIVERT
  28. extern char sysctl_divert_version[];
  29. #endif /* CONFIG_NET_DIVERT */
  30. ctl_table core_table[] = {
  31. #ifdef CONFIG_NET
  32. {NET_CORE_WMEM_MAX, "wmem_max",
  33.  &sysctl_wmem_max, sizeof(int), 0644, NULL,
  34.  &proc_dointvec},
  35. {NET_CORE_RMEM_MAX, "rmem_max",
  36.  &sysctl_rmem_max, sizeof(int), 0644, NULL,
  37.  &proc_dointvec},
  38. {NET_CORE_WMEM_DEFAULT, "wmem_default",
  39.  &sysctl_wmem_default, sizeof(int), 0644, NULL,
  40.  &proc_dointvec},
  41. {NET_CORE_RMEM_DEFAULT, "rmem_default",
  42.  &sysctl_rmem_default, sizeof(int), 0644, NULL,
  43.  &proc_dointvec},
  44. {NET_CORE_DEV_WEIGHT, "dev_weight",
  45.  &weight_p, sizeof(int), 0644, NULL,
  46.  &proc_dointvec},
  47. {NET_CORE_MAX_BACKLOG, "netdev_max_backlog",
  48.  &netdev_max_backlog, sizeof(int), 0644, NULL,
  49.  &proc_dointvec},
  50. {NET_CORE_NO_CONG_THRESH, "no_cong_thresh",
  51.  &no_cong, sizeof(int), 0644, NULL,
  52.  &proc_dointvec},
  53. {NET_CORE_NO_CONG, "no_cong",
  54.  &no_cong, sizeof(int), 0644, NULL,
  55.  &proc_dointvec},
  56. {NET_CORE_LO_CONG, "lo_cong",
  57.  &lo_cong, sizeof(int), 0644, NULL,
  58.  &proc_dointvec},
  59. {NET_CORE_MOD_CONG, "mod_cong",
  60.  &mod_cong, sizeof(int), 0644, NULL,
  61.  &proc_dointvec},
  62. #ifdef CONFIG_NET_FASTROUTE
  63. {NET_CORE_FASTROUTE, "netdev_fastroute",
  64.  &netdev_fastroute, sizeof(int), 0644, NULL,
  65.  &proc_dointvec},
  66. #endif
  67. {NET_CORE_MSG_COST, "message_cost",
  68.  &net_msg_cost, sizeof(int), 0644, NULL,
  69.  &proc_dointvec_jiffies},
  70. {NET_CORE_MSG_BURST, "message_burst",
  71.  &net_msg_burst, sizeof(int), 0644, NULL,
  72.  &proc_dointvec_jiffies},
  73. {NET_CORE_OPTMEM_MAX, "optmem_max",
  74.  &sysctl_optmem_max, sizeof(int), 0644, NULL,
  75.  &proc_dointvec},
  76. {NET_CORE_HOT_LIST_LENGTH, "hot_list_length",
  77.  &sysctl_hot_list_len, sizeof(int), 0644, NULL,
  78.  &proc_dointvec},
  79. #ifdef CONFIG_NET_DIVERT
  80. {NET_CORE_DIVERT_VERSION, "divert_version",
  81.  (void *)sysctl_divert_version, 32, 0444, NULL,
  82.  &proc_dostring},
  83. #endif /* CONFIG_NET_DIVERT */
  84. #endif /* CONFIG_NET */
  85. { 0 }
  86. };
  87. #endif