1 #ifndef __LINUX_NET_AFUNIX_H
2 #define __LINUX_NET_AFUNIX_H
3 extern void unix_proto_init(struct net_proto *pro);
4 extern void unix_inflight(struct file *fp);
5 extern void unix_notinflight(struct file *fp);
6 typedef struct sock unix_socket;
7 extern void unix_gc(void);
9 #define UNIX_HASH_SIZE 256
11 extern unix_socket *unix_socket_table[UNIX_HASH_SIZE+1];
12 extern rwlock_t unix_table_lock;
14 extern atomic_t unix_tot_inflight;
17 #define forall_unix_sockets(i, s) for (i=0; i<=UNIX_HASH_SIZE; i++) \
18 for (s=unix_socket_table[i]; s; s=s->next)
25 struct sockaddr_un name[0];
30 struct ucred creds; /* Skb credentials */
31 struct scm_fp_list *fp; /* Passed files */
34 #define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb))
35 #define UNIXCREDS(skb) (&UNIXCB((skb)).creds)
37 #define unix_state_rlock(s) read_lock(&(s)->protinfo.af_unix.lock)
38 #define unix_state_runlock(s) read_unlock(&(s)->protinfo.af_unix.lock)
39 #define unix_state_wlock(s) write_lock(&(s)->protinfo.af_unix.lock)
40 #define unix_state_wunlock(s) write_unlock(&(s)->protinfo.af_unix.lock)