sysctl_net_llc.c 2.7 KB

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