~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/inet_diag.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _INET_DIAG_H_
  3 #define _INET_DIAG_H_ 1
  4 
  5 #include <net/netlink.h>
  6 #include <uapi/linux/inet_diag.h>
  7 
  8 struct inet_hashinfo;
  9 
 10 struct inet_diag_handler {
 11         struct module   *owner;
 12         void            (*dump)(struct sk_buff *skb,
 13                                 struct netlink_callback *cb,
 14                                 const struct inet_diag_req_v2 *r);
 15 
 16         int             (*dump_one)(struct netlink_callback *cb,
 17                                     const struct inet_diag_req_v2 *req);
 18 
 19         void            (*idiag_get_info)(struct sock *sk,
 20                                           struct inet_diag_msg *r,
 21                                           void *info);
 22 
 23         int             (*idiag_get_aux)(struct sock *sk,
 24                                          bool net_admin,
 25                                          struct sk_buff *skb);
 26 
 27         size_t          (*idiag_get_aux_size)(struct sock *sk,
 28                                               bool net_admin);
 29 
 30         int             (*destroy)(struct sk_buff *in_skb,
 31                                    const struct inet_diag_req_v2 *req);
 32 
 33         __u16           idiag_type;
 34         __u16           idiag_info_size;
 35 };
 36 
 37 struct bpf_sk_storage_diag;
 38 struct inet_diag_dump_data {
 39         struct nlattr *req_nlas[__INET_DIAG_REQ_MAX];
 40 #define inet_diag_nla_bc req_nlas[INET_DIAG_REQ_BYTECODE]
 41 #define inet_diag_nla_bpf_stgs req_nlas[INET_DIAG_REQ_SK_BPF_STORAGES]
 42 
 43         struct bpf_sk_storage_diag *bpf_stg_diag;
 44 };
 45 
 46 struct inet_connection_sock;
 47 int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
 48                       struct sk_buff *skb, struct netlink_callback *cb,
 49                       const struct inet_diag_req_v2 *req,
 50                       u16 nlmsg_flags, bool net_admin);
 51 void inet_diag_dump_icsk(struct inet_hashinfo *h, struct sk_buff *skb,
 52                          struct netlink_callback *cb,
 53                          const struct inet_diag_req_v2 *r);
 54 int inet_diag_dump_one_icsk(struct inet_hashinfo *hashinfo,
 55                             struct netlink_callback *cb,
 56                             const struct inet_diag_req_v2 *req);
 57 
 58 struct sock *inet_diag_find_one_icsk(struct net *net,
 59                                      struct inet_hashinfo *hashinfo,
 60                                      const struct inet_diag_req_v2 *req);
 61 
 62 int inet_diag_bc_sk(const struct nlattr *_bc, struct sock *sk);
 63 
 64 void inet_diag_msg_common_fill(struct inet_diag_msg *r, struct sock *sk);
 65 
 66 static inline size_t inet_diag_msg_attrs_size(void)
 67 {
 68         return    nla_total_size(1)  /* INET_DIAG_SHUTDOWN */
 69                 + nla_total_size(1)  /* INET_DIAG_TOS */
 70 #if IS_ENABLED(CONFIG_IPV6)
 71                 + nla_total_size(1)  /* INET_DIAG_TCLASS */
 72                 + nla_total_size(1)  /* INET_DIAG_SKV6ONLY */
 73 #endif
 74                 + nla_total_size(4)  /* INET_DIAG_MARK */
 75                 + nla_total_size(4)  /* INET_DIAG_CLASS_ID */
 76 #ifdef CONFIG_SOCK_CGROUP_DATA
 77                 + nla_total_size_64bit(sizeof(u64))  /* INET_DIAG_CGROUP_ID */
 78 #endif
 79                 + nla_total_size(sizeof(struct inet_diag_sockopt))
 80                                                      /* INET_DIAG_SOCKOPT */
 81                 ;
 82 }
 83 int inet_diag_msg_attrs_fill(struct sock *sk, struct sk_buff *skb,
 84                              struct inet_diag_msg *r, int ext,
 85                              struct user_namespace *user_ns, bool net_admin);
 86 
 87 extern int  inet_diag_register(const struct inet_diag_handler *handler);
 88 extern void inet_diag_unregister(const struct inet_diag_handler *handler);
 89 #endif /* _INET_DIAG_H_ */
 90 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php