inet_diag.h 1.9 KB

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