sock_diag.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __SOCK_DIAG_H__
  2. #define __SOCK_DIAG_H__
  3. #include <linux/types.h>
  4. #define SOCK_DIAG_BY_FAMILY 20
  5. struct sock_diag_req {
  6. __u8 sdiag_family;
  7. __u8 sdiag_protocol;
  8. };
  9. enum {
  10. SK_MEMINFO_RMEM_ALLOC,
  11. SK_MEMINFO_RCVBUF,
  12. SK_MEMINFO_WMEM_ALLOC,
  13. SK_MEMINFO_SNDBUF,
  14. SK_MEMINFO_FWD_ALLOC,
  15. SK_MEMINFO_WMEM_QUEUED,
  16. SK_MEMINFO_OPTMEM,
  17. SK_MEMINFO_BACKLOG,
  18. SK_MEMINFO_VARS,
  19. };
  20. #ifdef __KERNEL__
  21. struct sk_buff;
  22. struct nlmsghdr;
  23. struct sock;
  24. struct sock_diag_handler {
  25. __u8 family;
  26. int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
  27. };
  28. int sock_diag_register(const struct sock_diag_handler *h);
  29. void sock_diag_unregister(const struct sock_diag_handler *h);
  30. void sock_diag_register_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
  31. void sock_diag_unregister_inet_compat(int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh));
  32. int sock_diag_check_cookie(void *sk, __u32 *cookie);
  33. void sock_diag_save_cookie(void *sk, __u32 *cookie);
  34. int sock_diag_put_meminfo(struct sock *sk, struct sk_buff *skb, int attr);
  35. #endif /* KERNEL */
  36. #endif