sysctl.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /*
  2. * net/dccp/sysctl.c
  3. *
  4. * An implementation of the DCCP protocol
  5. * Arnaldo Carvalho de Melo <acme@mandriva.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License v2
  9. * as published by the Free Software Foundation.
  10. */
  11. #include <linux/mm.h>
  12. #include <linux/sysctl.h>
  13. #include "dccp.h"
  14. #include "feat.h"
  15. #ifndef CONFIG_SYSCTL
  16. #error This file should not be compiled without CONFIG_SYSCTL defined
  17. #endif
  18. static struct ctl_table dccp_default_table[] = {
  19. {
  20. .procname = "seq_window",
  21. .data = &sysctl_dccp_feat_sequence_window,
  22. .maxlen = sizeof(sysctl_dccp_feat_sequence_window),
  23. .mode = 0644,
  24. .proc_handler = proc_dointvec,
  25. },
  26. {
  27. .procname = "rx_ccid",
  28. .data = &sysctl_dccp_feat_rx_ccid,
  29. .maxlen = sizeof(sysctl_dccp_feat_rx_ccid),
  30. .mode = 0644,
  31. .proc_handler = proc_dointvec,
  32. },
  33. {
  34. .procname = "tx_ccid",
  35. .data = &sysctl_dccp_feat_tx_ccid,
  36. .maxlen = sizeof(sysctl_dccp_feat_tx_ccid),
  37. .mode = 0644,
  38. .proc_handler = proc_dointvec,
  39. },
  40. {
  41. .procname = "ack_ratio",
  42. .data = &sysctl_dccp_feat_ack_ratio,
  43. .maxlen = sizeof(sysctl_dccp_feat_ack_ratio),
  44. .mode = 0644,
  45. .proc_handler = proc_dointvec,
  46. },
  47. {
  48. .procname = "send_ackvec",
  49. .data = &sysctl_dccp_feat_send_ack_vector,
  50. .maxlen = sizeof(sysctl_dccp_feat_send_ack_vector),
  51. .mode = 0644,
  52. .proc_handler = proc_dointvec,
  53. },
  54. {
  55. .procname = "send_ndp",
  56. .data = &sysctl_dccp_feat_send_ndp_count,
  57. .maxlen = sizeof(sysctl_dccp_feat_send_ndp_count),
  58. .mode = 0644,
  59. .proc_handler = proc_dointvec,
  60. },
  61. {
  62. .procname = "request_retries",
  63. .data = &sysctl_dccp_request_retries,
  64. .maxlen = sizeof(sysctl_dccp_request_retries),
  65. .mode = 0644,
  66. .proc_handler = proc_dointvec,
  67. },
  68. {
  69. .procname = "retries1",
  70. .data = &sysctl_dccp_retries1,
  71. .maxlen = sizeof(sysctl_dccp_retries1),
  72. .mode = 0644,
  73. .proc_handler = proc_dointvec,
  74. },
  75. {
  76. .procname = "retries2",
  77. .data = &sysctl_dccp_retries2,
  78. .maxlen = sizeof(sysctl_dccp_retries2),
  79. .mode = 0644,
  80. .proc_handler = proc_dointvec,
  81. },
  82. {
  83. .procname = "tx_qlen",
  84. .data = &sysctl_dccp_tx_qlen,
  85. .maxlen = sizeof(sysctl_dccp_tx_qlen),
  86. .mode = 0644,
  87. .proc_handler = proc_dointvec,
  88. },
  89. { .ctl_name = 0, }
  90. };
  91. static struct ctl_table dccp_table[] = {
  92. {
  93. .ctl_name = NET_DCCP_DEFAULT,
  94. .procname = "default",
  95. .mode = 0555,
  96. .child = dccp_default_table,
  97. },
  98. { .ctl_name = 0, },
  99. };
  100. static struct ctl_table dccp_dir_table[] = {
  101. {
  102. .ctl_name = NET_DCCP,
  103. .procname = "dccp",
  104. .mode = 0555,
  105. .child = dccp_table,
  106. },
  107. { .ctl_name = 0, },
  108. };
  109. static struct ctl_table dccp_root_table[] = {
  110. {
  111. .ctl_name = CTL_NET,
  112. .procname = "net",
  113. .mode = 0555,
  114. .child = dccp_dir_table,
  115. },
  116. { .ctl_name = 0, },
  117. };
  118. static struct ctl_table_header *dccp_table_header;
  119. int __init dccp_sysctl_init(void)
  120. {
  121. dccp_table_header = register_sysctl_table(dccp_root_table);
  122. return dccp_table_header != NULL ? 0 : -ENOMEM;
  123. }
  124. void dccp_sysctl_exit(void)
  125. {
  126. if (dccp_table_header != NULL) {
  127. unregister_sysctl_table(dccp_table_header);
  128. dccp_table_header = NULL;
  129. }
  130. }