1 /*
2 * Copyright (c) 2004 Robert N. M. Watson
3 * Copyright (c) 1990,1994 Regents of The University of Michigan.
4 * All Rights Reserved. See COPYRIGHT.
5 *
6 * $FreeBSD: releng/5.3/sys/netatalk/ddp_pcb.h 136588 2004-10-16 08:43:07Z cvs2svn $
7 */
8
9 #ifndef _NETATALK_DDP_PCB_H_
10 #define _NETATALK_DDP_PCB_H_
11
12 int at_pcballoc(struct socket *so);
13 int at_pcbconnect(struct ddpcb *ddp, struct sockaddr *addr,
14 struct thread *td);
15 void at_pcbdetach(struct socket *so, struct ddpcb *ddp);
16 void at_pcbdisconnect(struct ddpcb *ddp);
17 int at_pcbsetaddr(struct ddpcb *ddp, struct sockaddr *addr,
18 struct thread *td);
19 void at_sockaddr(struct ddpcb *ddp, struct sockaddr **addr);
20
21 /* Lock macros for per-pcb locks. */
22 #define DDP_LOCK_INIT(ddp) mtx_init(&(ddp)->ddp_mtx, "ddp_mtx", \
23 NULL, MTX_DEF)
24 #define DDP_LOCK_DESTROY(ddp) mtx_destroy(&(ddp)->ddp_mtx)
25 #define DDP_LOCK(ddp) mtx_lock(&(ddp)->ddp_mtx)
26 #define DDP_UNLOCK(ddp) mtx_unlock(&(ddp)->ddp_mtx)
27 #define DDP_LOCK_ASSERT(ddp) mtx_assert(&(ddp)->ddp_mtx, MA_OWNED)
28
29 /* Lock macros for global pcb list lock. */
30 #define DDP_LIST_LOCK_INIT() mtx_init(&ddp_list_mtx, "ddp_list_mtx", \
31 NULL, MTX_DEF)
32 #define DDP_LIST_LOCK_DESTROY() mtx_destroy(&ddp_list_mtx)
33 #define DDP_LIST_XLOCK() mtx_lock(&ddp_list_mtx)
34 #define DDP_LIST_XUNLOCK() mtx_unlock(&ddp_list_mtx)
35 #define DDP_LIST_XLOCK_ASSERT() mtx_assert(&ddp_list_mtx, MA_OWNED)
36 #define DDP_LIST_SLOCK() mtx_lock(&ddp_list_mtx)
37 #define DDP_LIST_SUNLOCK() mtx_unlock(&ddp_list_mtx)
38 #define DDP_LIST_SLOCK_ASSERT() mtx_assert(&ddp_list_mtx, MA_OWNED)
39
40 #endif
Cache object: da4126d754037bfef3e1c9f602ba8ae1
|