Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) #ifndef _AF_NETLINK_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3) #define _AF_NETLINK_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5) #include <linux/rhashtable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6) #include <linux/atomic.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8) #include <net/sock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) /* flags */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define NETLINK_F_KERNEL_SOCKET		0x1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define NETLINK_F_RECV_PKTINFO		0x2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define NETLINK_F_BROADCAST_SEND_ERROR	0x4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define NETLINK_F_RECV_NO_ENOBUFS	0x8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define NETLINK_F_LISTEN_ALL_NSID	0x10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define NETLINK_F_CAP_ACK		0x20
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #define NETLINK_F_EXT_ACK		0x40
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define NETLINK_F_STRICT_CHK		0x80
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define NLGRPSZ(x)	(ALIGN(x, sizeof(unsigned long) * 8) / 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define NLGRPLONGS(x)	(NLGRPSZ(x)/sizeof(unsigned long))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) struct netlink_sock {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) 	/* struct sock has to be the first member of netlink_sock */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) 	struct sock		sk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) 	u32			portid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) 	u32			dst_portid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) 	u32			dst_group;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) 	u32			flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) 	u32			subscriptions;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) 	u32			ngroups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) 	unsigned long		*groups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	unsigned long		state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) 	size_t			max_recvmsg_len;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 	wait_queue_head_t	wait;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) 	bool			bound;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 	bool			cb_running;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) 	int			dump_done_errno;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) 	struct netlink_callback	cb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) 	struct mutex		*cb_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) 	struct mutex		cb_def_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) 	void			(*netlink_rcv)(struct sk_buff *skb);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) 	int			(*netlink_bind)(struct net *net, int group);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) 	void			(*netlink_unbind)(struct net *net, int group);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) 	struct module		*module;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 	struct rhash_head	node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 	struct rcu_head		rcu;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) 	struct work_struct	work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) static inline struct netlink_sock *nlk_sk(struct sock *sk)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 	return container_of(sk, struct netlink_sock, sk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) struct netlink_table {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 	struct rhashtable	hash;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 	struct hlist_head	mc_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 	struct listeners __rcu	*listeners;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 	unsigned int		flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 	unsigned int		groups;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) 	struct mutex		*cb_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) 	struct module		*module;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) 	int			(*bind)(struct net *net, int group);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) 	void			(*unbind)(struct net *net, int group);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) 	bool			(*compare)(struct net *net, struct sock *sock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) 	int			registered;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) extern struct netlink_table *nl_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) extern rwlock_t nl_table_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) #endif