sysctl_net_unix.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * NET4: Sysctl interface to net af_unix subsystem.
  3. *
  4. * Authors: Mike Shaver.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. #include <linux/mm.h>
  12. #include <linux/sysctl.h>
  13. #include <net/af_unix.h>
  14. static ctl_table unix_table[] = {
  15. {
  16. .ctl_name = NET_UNIX_MAX_DGRAM_QLEN,
  17. .procname = "max_dgram_qlen",
  18. .data = &init_net.sysctl_unix_max_dgram_qlen,
  19. .maxlen = sizeof(int),
  20. .mode = 0644,
  21. .proc_handler = &proc_dointvec
  22. },
  23. { .ctl_name = 0 }
  24. };
  25. static struct ctl_path unix_path[] = {
  26. { .procname = "net", .ctl_name = CTL_NET, },
  27. { .procname = "unix", .ctl_name = NET_UNIX, },
  28. { },
  29. };
  30. static struct ctl_table_header * unix_sysctl_header;
  31. int unix_sysctl_register(struct net *net)
  32. {
  33. unix_sysctl_header = register_sysctl_paths(unix_path, unix_table);
  34. return unix_sysctl_header == NULL ? -ENOMEM : 0;
  35. }
  36. void unix_sysctl_unregister(struct net *net)
  37. {
  38. unregister_sysctl_table(unix_sysctl_header);
  39. }