1#ifndef __LINUX_NET_AFUNIX_H 2#define __LINUX_NET_AFUNIX_H 3extern void unix_proto_init(struct net_proto *pro); 4extern void unix_inflight(struct file *fp); 5extern void unix_notinflight(struct file *fp); 6typedef struct sock unix_socket; 7extern void unix_gc(void); 8 9#define UNIX_HASH_SIZE 256 10 11extern unix_socket *unix_socket_table[UNIX_HASH_SIZE+1]; 12extern rwlock_t unix_table_lock; 13 14extern atomic_t unix_tot_inflight; 15 16 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) 19 20struct unix_address 21{ 22 atomic_t refcnt; 23 int len; 24 unsigned hash; 25 struct sockaddr_un name[0]; 26}; 27 28struct unix_skb_parms 29{ 30 struct ucred creds; /* Skb credentials */ 31 struct scm_fp_list *fp; /* Passed files */ 32}; 33 34#define UNIXCB(skb) (*(struct unix_skb_parms*)&((skb)->cb)) 35#define UNIXCREDS(skb) (&UNIXCB((skb)).creds) 36 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) 41 42#endif 43