sysctl_net_llc.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. .procname = "ack",
  16. .data = &sysctl_llc2_ack_timeout,
  17. .maxlen = sizeof(long),
  18. .mode = 0644,
  19. .proc_handler = proc_dointvec_jiffies,
  20. },
  21. {
  22. .procname = "busy",
  23. .data = &sysctl_llc2_busy_timeout,
  24. .maxlen = sizeof(long),
  25. .mode = 0644,
  26. .proc_handler = proc_dointvec_jiffies,
  27. },
  28. {
  29. .procname = "p",
  30. .data = &sysctl_llc2_p_timeout,
  31. .maxlen = sizeof(long),
  32. .mode = 0644,
  33. .proc_handler = proc_dointvec_jiffies,
  34. },
  35. {
  36. .procname = "rej",
  37. .data = &sysctl_llc2_rej_timeout,
  38. .maxlen = sizeof(long),
  39. .mode = 0644,
  40. .proc_handler = proc_dointvec_jiffies,
  41. },
  42. { },
  43. };
  44. static struct ctl_table llc_station_table[] = {
  45. {
  46. .procname = "ack_timeout",
  47. .data = &sysctl_llc_station_ack_timeout,
  48. .maxlen = sizeof(long),
  49. .mode = 0644,
  50. .proc_handler = proc_dointvec_jiffies,
  51. },
  52. { },
  53. };
  54. static struct ctl_table llc2_dir_timeout_table[] = {
  55. {
  56. .procname = "timeout",
  57. .mode = 0555,
  58. .child = llc2_timeout_table,
  59. },
  60. { },
  61. };
  62. static struct ctl_table llc_table[] = {
  63. {
  64. .procname = "llc2",
  65. .mode = 0555,
  66. .child = llc2_dir_timeout_table,
  67. },
  68. {
  69. .procname = "station",
  70. .mode = 0555,
  71. .child = llc_station_table,
  72. },
  73. { },
  74. };
  75. static struct ctl_path llc_path[] = {
  76. { .procname = "net", },
  77. { .procname = "llc", },
  78. { }
  79. };
  80. static struct ctl_table_header *llc_table_header;
  81. int __init llc_sysctl_init(void)
  82. {
  83. llc_table_header = register_sysctl_paths(llc_path, llc_table);
  84. return llc_table_header ? 0 : -ENOMEM;
  85. }
  86. void llc_sysctl_exit(void)
  87. {
  88. if (llc_table_header) {
  89. unregister_sysctl_table(llc_table_header);
  90. llc_table_header = NULL;
  91. }
  92. }