xref: /original-bsd/sys/sys/un.h (revision e4816757)
1 /*
2  * Copyright (c) 1982, 1986, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)un.h	8.3 (Berkeley) 02/19/95
8  */
9 
10 /*
11  * Definitions for UNIX IPC domain.
12  */
13 struct	sockaddr_un {
14 	u_char	sun_len;		/* sockaddr len including null */
15 	u_char	sun_family;		/* AF_UNIX */
16 	char	sun_path[104];		/* path name (gag) */
17 };
18 
19 #ifdef KERNEL
20 struct unpcb;
21 
22 int	uipc_usrreq __P((struct socket *so, int req, struct mbuf *m,
23 		struct mbuf *nam, struct mbuf *control));
24 int	unp_attach __P((struct socket *so));
25 int	unp_bind __P((struct unpcb *unp, struct mbuf *nam, struct proc *p));
26 int	unp_connect __P((struct socket *so, struct mbuf *nam, struct proc *p));
27 int	unp_connect2 __P((struct socket *so, struct socket *so2));
28 void	unp_detach __P((struct unpcb *unp));
29 void	unp_discard __P((struct file *fp));
30 void	unp_disconnect __P((struct unpcb *unp));
31 void	unp_drop __P((struct unpcb *unp, int errno));
32 void	unp_gc __P((void));
33 void	unp_mark __P((struct file *fp));
34 void	unp_scan __P((struct mbuf *m0, void (*op) __P((struct file *))));
35 void	unp_shutdown __P((struct unpcb *unp));
36 #else /* !KERNEL */
37 
38 /* actual length of an initialized sockaddr_un */
39 #define SUN_LEN(su) \
40 	(sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path))
41 #endif /* KERNEL */
42