inet_diag.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef _INET_DIAG_H_
  2. #define _INET_DIAG_H_ 1
  3. #include <uapi/linux/inet_diag.h>
  4. struct sock;
  5. struct inet_hashinfo;
  6. struct nlattr;
  7. struct nlmsghdr;
  8. struct sk_buff;
  9. struct netlink_callback;
  10. struct inet_diag_handler {
  11. void (*dump)(struct sk_buff *skb,
  12. struct netlink_callback *cb,
  13. const struct inet_diag_req_v2 *r,
  14. struct nlattr *bc);
  15. int (*dump_one)(struct sk_buff *in_skb,
  16. const struct nlmsghdr *nlh,
  17. const struct inet_diag_req_v2 *req);
  18. void (*idiag_get_info)(struct sock *sk,
  19. struct inet_diag_msg *r,
  20. void *info);
  21. __u16 idiag_type;
  22. __u16 idiag_info_size;
  23. };
  24. struct inet_connection_sock;
  25. int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
  26. struct sk_buff *skb, const struct inet_diag_req_v2 *req,
  27. struct user_namespace *user_ns,
  28. u32 pid, u32 seq, u16 nlmsg_flags,
  29. const struct nlmsghdr *unlh);
  30. void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
  31. struct netlink_callback *cb,
  32. const struct inet_diag_req_v2 *r,
  33. struct nlattr *bc);
  34. int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
  35. struct sk_buff *in_skb, const struct nlmsghdr *nlh,
  36. const struct inet_diag_req_v2 *req);
  37. int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
  38. extern int inet_diag_register(const struct inet_diag_handler *handler);
  39. extern void inet_diag_unregister(const struct inet_diag_handler *handler);
  40. #endif /* _INET_DIAG_H_ */