sysctl_net_x25.c 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /* -*- linux-c -*-
  2. * sysctl_net_x25.c: sysctl interface to net X.25 subsystem.
  3. *
  4. * Begun April 1, 1996, Mike Shaver.
  5. * Added /proc/sys/net/x25 directory entry (empty =) ). [MS]
  6. */
  7. #include <linux/sysctl.h>
  8. #include <linux/skbuff.h>
  9. #include <linux/socket.h>
  10. #include <linux/netdevice.h>
  11. #include <linux/init.h>
  12. #include <net/x25.h>
  13. static int min_timer[] = { 1 * HZ };
  14. static int max_timer[] = { 300 * HZ };
  15. static struct ctl_table_header *x25_table_header;
  16. static struct ctl_table x25_table[] = {
  17. {
  18. .procname = "restart_request_timeout",
  19. .data = &sysctl_x25_restart_request_timeout,
  20. .maxlen = sizeof(int),
  21. .mode = 0644,
  22. .proc_handler = proc_dointvec_minmax,
  23. .extra1 = &min_timer,
  24. .extra2 = &max_timer,
  25. },
  26. {
  27. .procname = "call_request_timeout",
  28. .data = &sysctl_x25_call_request_timeout,
  29. .maxlen = sizeof(int),
  30. .mode = 0644,
  31. .proc_handler = proc_dointvec_minmax,
  32. .extra1 = &min_timer,
  33. .extra2 = &max_timer,
  34. },
  35. {
  36. .procname = "reset_request_timeout",
  37. .data = &sysctl_x25_reset_request_timeout,
  38. .maxlen = sizeof(int),
  39. .mode = 0644,
  40. .proc_handler = proc_dointvec_minmax,
  41. .extra1 = &min_timer,
  42. .extra2 = &max_timer,
  43. },
  44. {
  45. .procname = "clear_request_timeout",
  46. .data = &sysctl_x25_clear_request_timeout,
  47. .maxlen = sizeof(int),
  48. .mode = 0644,
  49. .proc_handler = proc_dointvec_minmax,
  50. .extra1 = &min_timer,
  51. .extra2 = &max_timer,
  52. },
  53. {
  54. .procname = "acknowledgement_hold_back_timeout",
  55. .data = &sysctl_x25_ack_holdback_timeout,
  56. .maxlen = sizeof(int),
  57. .mode = 0644,
  58. .proc_handler = proc_dointvec_minmax,
  59. .extra1 = &min_timer,
  60. .extra2 = &max_timer,
  61. },
  62. {
  63. .procname = "x25_forward",
  64. .data = &sysctl_x25_forward,
  65. .maxlen = sizeof(int),
  66. .mode = 0644,
  67. .proc_handler = proc_dointvec,
  68. },
  69. { 0, },
  70. };
  71. int __init x25_register_sysctl(void)
  72. {
  73. x25_table_header = register_net_sysctl(&init_net, "net/x25", x25_table);
  74. if (!x25_table_header)
  75. return -ENOMEM;
  76. return 0;
  77. }
  78. void x25_unregister_sysctl(void)
  79. {
  80. unregister_net_sysctl_table(x25_table_header);
  81. }