File Index
Files and directories
Sign in
FILE

af_unix.h

File preview with syntax highlighting.

linux-6.19.14/net/unix/af_unix.h C
 1/* SPDX-License-Identifier: GPL-2.0 */
 2#ifndef __AF_UNIX_H
 3#define __AF_UNIX_H
 4
 5#include <linux/uidgid.h>
 6
 7#define UNIX_HASH_MOD	(256 - 1)
 8#define UNIX_HASH_SIZE	(256 * 2)
 9#define UNIX_HASH_BITS	8
10
11struct sock *unix_peer_get(struct sock *sk);
12
13struct unix_skb_parms {
14	struct pid		*pid;		/* skb credentials	*/
15	kuid_t			uid;
16	kgid_t			gid;
17	struct scm_fp_list	*fp;		/* Passed files		*/
18#ifdef CONFIG_SECURITY_NETWORK
19	u32			secid;		/* Security ID		*/
20#endif
21	u32			consumed;
22} __randomize_layout;
23
24#define UNIXCB(skb)	(*(struct unix_skb_parms *)&((skb)->cb))
25
26/* GC for SCM_RIGHTS */
27void unix_add_edges(struct scm_fp_list *fpl, struct unix_sock *receiver);
28void unix_del_edges(struct scm_fp_list *fpl);
29void unix_update_edges(struct unix_sock *receiver);
30int unix_prepare_fpl(struct scm_fp_list *fpl);
31void unix_destroy_fpl(struct scm_fp_list *fpl);
32void unix_peek_fpl(struct scm_fp_list *fpl);
33void unix_schedule_gc(struct user_struct *user);
34
35/* SOCK_DIAG */
36long unix_inq_len(struct sock *sk);
37long unix_outq_len(struct sock *sk);
38
39/* sysctl */
40#ifdef CONFIG_SYSCTL
41int unix_sysctl_register(struct net *net);
42void unix_sysctl_unregister(struct net *net);
43#else
44static inline int unix_sysctl_register(struct net *net)
45{
46	return 0;
47}
48
49static inline void unix_sysctl_unregister(struct net *net)
50{
51}
52#endif
53
54/* BPF SOCKMAP */
55int __unix_dgram_recvmsg(struct sock *sk, struct msghdr *msg, size_t size, int flags);
56int __unix_stream_recvmsg(struct sock *sk, struct msghdr *msg, size_t size, int flags);
57
58#ifdef CONFIG_BPF_SYSCALL
59extern struct proto unix_dgram_proto;
60extern struct proto unix_stream_proto;
61
62int unix_dgram_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
63int unix_stream_bpf_update_proto(struct sock *sk, struct sk_psock *psock, bool restore);
64void __init unix_bpf_build_proto(void);
65#else
66static inline void __init unix_bpf_build_proto(void)
67{
68}
69#endif
70
71#endif
~/ Read-only file preview.