sysctl_net_llc.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * sysctl_net_llc.c: sysctl interface to LLC net subsystem.
  3. *
  4. * Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  5. */
  6. #include <linux/config.h>
  7. #include <linux/mm.h>
  8. #include <linux/init.h>
  9. #include <linux/sysctl.h>
  10. #ifndef CONFIG_SYSCTL
  11. #error This file should not be compiled without CONFIG_SYSCTL defined
  12. #endif
  13. extern int sysctl_llc2_ack_timeout;
  14. extern int sysctl_llc2_busy_timeout;
  15. extern int sysctl_llc2_p_timeout;
  16. extern int sysctl_llc2_rej_timeout;
  17. extern int sysctl_llc_station_ack_timeout;
  18. static struct ctl_table llc2_timeout_table[] = {
  19. {
  20. .ctl_name = NET_LLC2_ACK_TIMEOUT,
  21. .procname = "ack",
  22. .data = &sysctl_llc2_ack_timeout,
  23. .maxlen = sizeof(long),
  24. .mode = 0644,
  25. .proc_handler = &proc_dointvec_jiffies,
  26. .strategy = &sysctl_jiffies,
  27. },
  28. {
  29. .ctl_name = NET_LLC2_BUSY_TIMEOUT,
  30. .procname = "busy",
  31. .data = &sysctl_llc2_busy_timeout,
  32. .maxlen = sizeof(long),
  33. .mode = 0644,
  34. .proc_handler = &proc_dointvec_jiffies,
  35. .strategy = &sysctl_jiffies,
  36. },
  37. {
  38. .ctl_name = NET_LLC2_P_TIMEOUT,
  39. .procname = "p",
  40. .data = &sysctl_llc2_p_timeout,
  41. .maxlen = sizeof(long),
  42. .mode = 0644,
  43. .proc_handler = &proc_dointvec_jiffies,
  44. .strategy = &sysctl_jiffies,
  45. },
  46. {
  47. .ctl_name = NET_LLC2_REJ_TIMEOUT,
  48. .procname = "rej",
  49. .data = &sysctl_llc2_rej_timeout,
  50. .maxlen = sizeof(long),
  51. .mode = 0644,
  52. .proc_handler = &proc_dointvec_jiffies,
  53. .strategy = &sysctl_jiffies,
  54. },
  55. { 0 },
  56. };
  57. static struct ctl_table llc_station_table[] = {
  58. {
  59. .ctl_name = NET_LLC_STATION_ACK_TIMEOUT,
  60. .procname = "ack_timeout",
  61. .data = &sysctl_llc_station_ack_timeout,
  62. .maxlen = sizeof(long),
  63. .mode = 0644,
  64. .proc_handler = &proc_dointvec_jiffies,
  65. .strategy = &sysctl_jiffies,
  66. },
  67. { 0 },
  68. };
  69. static struct ctl_table llc2_dir_timeout_table[] = {
  70. {
  71. .ctl_name = NET_LLC2,
  72. .procname = "timeout",
  73. .mode = 0555,
  74. .child = llc2_timeout_table,
  75. },
  76. { 0 },
  77. };
  78. static struct ctl_table llc_table[] = {
  79. {
  80. .ctl_name = NET_LLC2,
  81. .procname = "llc2",
  82. .mode = 0555,
  83. .child = llc2_dir_timeout_table,
  84. },
  85. {
  86. .ctl_name = NET_LLC_STATION,
  87. .procname = "station",
  88. .mode = 0555,
  89. .child = llc_station_table,
  90. },
  91. { 0 },
  92. };
  93. static struct ctl_table llc_dir_table[] = {
  94. {
  95. .ctl_name = NET_LLC,
  96. .procname = "llc",
  97. .mode = 0555,
  98. .child = llc_table,
  99. },
  100. { 0 },
  101. };
  102. static struct ctl_table llc_root_table[] = {
  103. {
  104. .ctl_name = CTL_NET,
  105. .procname = "net",
  106. .mode = 0555,
  107. .child = llc_dir_table,
  108. },
  109. { 0 },
  110. };
  111. static struct ctl_table_header *llc_table_header;
  112. int __init llc_sysctl_init(void)
  113. {
  114. llc_table_header = register_sysctl_table(llc_root_table, 1);
  115. return llc_table_header ? 0 : -ENOMEM;
  116. }
  117. void llc_sysctl_exit(void)
  118. {
  119. if (llc_table_header) {
  120. unregister_sysctl_table(llc_table_header);
  121. llc_table_header = NULL;
  122. }
  123. }