sysctl.c 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 = "request_retries",
  42. .data = &sysctl_dccp_request_retries,
  43. .maxlen = sizeof(sysctl_dccp_request_retries),
  44. .mode = 0644,
  45. .proc_handler = proc_dointvec,
  46. },
  47. {
  48. .procname = "retries1",
  49. .data = &sysctl_dccp_retries1,
  50. .maxlen = sizeof(sysctl_dccp_retries1),
  51. .mode = 0644,
  52. .proc_handler = proc_dointvec,
  53. },
  54. {
  55. .procname = "retries2",
  56. .data = &sysctl_dccp_retries2,
  57. .maxlen = sizeof(sysctl_dccp_retries2),
  58. .mode = 0644,
  59. .proc_handler = proc_dointvec,
  60. },
  61. {
  62. .procname = "tx_qlen",
  63. .data = &sysctl_dccp_tx_qlen,
  64. .maxlen = sizeof(sysctl_dccp_tx_qlen),
  65. .mode = 0644,
  66. .proc_handler = proc_dointvec,
  67. },
  68. {
  69. .procname = "sync_ratelimit",
  70. .data = &sysctl_dccp_sync_ratelimit,
  71. .maxlen = sizeof(sysctl_dccp_sync_ratelimit),
  72. .mode = 0644,
  73. .proc_handler = proc_dointvec_ms_jiffies,
  74. },
  75. { .ctl_name = 0, }
  76. };
  77. static struct ctl_path dccp_path[] = {
  78. { .procname = "net", .ctl_name = CTL_NET, },
  79. { .procname = "dccp", .ctl_name = NET_DCCP, },
  80. { .procname = "default", .ctl_name = NET_DCCP_DEFAULT, },
  81. { }
  82. };
  83. static struct ctl_table_header *dccp_table_header;
  84. int __init dccp_sysctl_init(void)
  85. {
  86. dccp_table_header = register_sysctl_paths(dccp_path,
  87. dccp_default_table);
  88. return dccp_table_header != NULL ? 0 : -ENOMEM;
  89. }
  90. void dccp_sysctl_exit(void)
  91. {
  92. if (dccp_table_header != NULL) {
  93. unregister_sysctl_table(dccp_table_header);
  94. dccp_table_header = NULL;
  95. }
  96. }