sysctl_net_llc.c 2.5 KB

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