sysctl_net_rose.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * This program is free software; you can redistribute it and/or modify
  3. * it under the terms of the GNU General Public License as published by
  4. * the Free Software Foundation; either version 2 of the License, or
  5. * (at your option) any later version.
  6. *
  7. * Copyright (C) 1996 Mike Shaver (shaver@zeroknowledge.com)
  8. */
  9. #include <linux/mm.h>
  10. #include <linux/sysctl.h>
  11. #include <linux/init.h>
  12. #include <net/ax25.h>
  13. #include <net/rose.h>
  14. static int min_timer[] = {1 * HZ};
  15. static int max_timer[] = {300 * HZ};
  16. static int min_idle[] = {0 * HZ};
  17. static int max_idle[] = {65535 * HZ};
  18. static int min_route[1], max_route[] = {1};
  19. static int min_ftimer[] = {60 * HZ};
  20. static int max_ftimer[] = {600 * HZ};
  21. static int min_maxvcs[] = {1}, max_maxvcs[] = {254};
  22. static int min_window[] = {1}, max_window[] = {7};
  23. static struct ctl_table_header *rose_table_header;
  24. static struct ctl_table rose_table[] = {
  25. {
  26. .procname = "restart_request_timeout",
  27. .data = &sysctl_rose_restart_request_timeout,
  28. .maxlen = sizeof(int),
  29. .mode = 0644,
  30. .proc_handler = proc_dointvec_minmax,
  31. .extra1 = &min_timer,
  32. .extra2 = &max_timer
  33. },
  34. {
  35. .procname = "call_request_timeout",
  36. .data = &sysctl_rose_call_request_timeout,
  37. .maxlen = sizeof(int),
  38. .mode = 0644,
  39. .proc_handler = proc_dointvec_minmax,
  40. .extra1 = &min_timer,
  41. .extra2 = &max_timer
  42. },
  43. {
  44. .procname = "reset_request_timeout",
  45. .data = &sysctl_rose_reset_request_timeout,
  46. .maxlen = sizeof(int),
  47. .mode = 0644,
  48. .proc_handler = proc_dointvec_minmax,
  49. .extra1 = &min_timer,
  50. .extra2 = &max_timer
  51. },
  52. {
  53. .procname = "clear_request_timeout",
  54. .data = &sysctl_rose_clear_request_timeout,
  55. .maxlen = sizeof(int),
  56. .mode = 0644,
  57. .proc_handler = proc_dointvec_minmax,
  58. .extra1 = &min_timer,
  59. .extra2 = &max_timer
  60. },
  61. {
  62. .procname = "no_activity_timeout",
  63. .data = &sysctl_rose_no_activity_timeout,
  64. .maxlen = sizeof(int),
  65. .mode = 0644,
  66. .proc_handler = proc_dointvec_minmax,
  67. .extra1 = &min_idle,
  68. .extra2 = &max_idle
  69. },
  70. {
  71. .procname = "acknowledge_hold_back_timeout",
  72. .data = &sysctl_rose_ack_hold_back_timeout,
  73. .maxlen = sizeof(int),
  74. .mode = 0644,
  75. .proc_handler = proc_dointvec_minmax,
  76. .extra1 = &min_timer,
  77. .extra2 = &max_timer
  78. },
  79. {
  80. .procname = "routing_control",
  81. .data = &sysctl_rose_routing_control,
  82. .maxlen = sizeof(int),
  83. .mode = 0644,
  84. .proc_handler = proc_dointvec_minmax,
  85. .extra1 = &min_route,
  86. .extra2 = &max_route
  87. },
  88. {
  89. .procname = "link_fail_timeout",
  90. .data = &sysctl_rose_link_fail_timeout,
  91. .maxlen = sizeof(int),
  92. .mode = 0644,
  93. .proc_handler = proc_dointvec_minmax,
  94. .extra1 = &min_ftimer,
  95. .extra2 = &max_ftimer
  96. },
  97. {
  98. .procname = "maximum_virtual_circuits",
  99. .data = &sysctl_rose_maximum_vcs,
  100. .maxlen = sizeof(int),
  101. .mode = 0644,
  102. .proc_handler = proc_dointvec_minmax,
  103. .extra1 = &min_maxvcs,
  104. .extra2 = &max_maxvcs
  105. },
  106. {
  107. .procname = "window_size",
  108. .data = &sysctl_rose_window_size,
  109. .maxlen = sizeof(int),
  110. .mode = 0644,
  111. .proc_handler = proc_dointvec_minmax,
  112. .extra1 = &min_window,
  113. .extra2 = &max_window
  114. },
  115. { }
  116. };
  117. void __init rose_register_sysctl(void)
  118. {
  119. rose_table_header = register_net_sysctl(&init_net, "net/rose", rose_table);
  120. }
  121. void rose_unregister_sysctl(void)
  122. {
  123. unregister_net_sysctl_table(rose_table_header);
  124. }