kcm.h 759 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Kernel Connection Multiplexor
  3. *
  4. * Copyright (c) 2016 Tom Herbert <tom@herbertland.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2
  8. * as published by the Free Software Foundation.
  9. *
  10. * User API to clone KCM sockets and attach transport socket to a KCM
  11. * multiplexor.
  12. */
  13. #ifndef KCM_KERNEL_H
  14. #define KCM_KERNEL_H
  15. struct kcm_attach {
  16. int fd;
  17. int bpf_fd;
  18. };
  19. struct kcm_unattach {
  20. int fd;
  21. };
  22. struct kcm_clone {
  23. int fd;
  24. };
  25. #define SIOCKCMATTACH (SIOCPROTOPRIVATE + 0)
  26. #define SIOCKCMUNATTACH (SIOCPROTOPRIVATE + 1)
  27. #define SIOCKCMCLONE (SIOCPROTOPRIVATE + 2)
  28. #define KCMPROTO_CONNECTED 0
  29. /* Socket options */
  30. #define KCM_RECV_DISABLE 1
  31. #endif