inet_diag.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. 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. 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. };
  23. struct inet_connection_sock;
  24. int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
  25. struct sk_buff *skb, struct inet_diag_req_v2 *req,
  26. struct user_namespace *user_ns,
  27. u32 pid, u32 seq, u16 nlmsg_flags,
  28. const struct nlmsghdr *unlh);
  29. void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
  30. struct netlink_callback *cb, struct inet_diag_req_v2 *r,
  31. struct nlattr *bc);
  32. int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
  33. struct sk_buff *in_skb, const struct nlmsghdr *nlh,
  34. struct inet_diag_req_v2 *req);
  35. int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
  36. extern int inet_diag_register(const struct inet_diag_handler *handler);
  37. extern void inet_diag_unregister(const struct inet_diag_handler *handler);
  38. #endif /* _INET_DIAG_H_ */