FreeBSD kernel kern code
uipc_usrreq.c File Reference
#include <sys/cdefs.h>
#include "opt_ddb.h"
#include <sys/param.h>
#include <sys/capsicum.h>
#include <sys/domain.h>
#include <sys/eventhandler.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/filedesc.h>
#include <sys/kernel.h>
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/mount.h>
#include <sys/mutex.h>
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/queue.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/signalvar.h>
#include <sys/stat.h>
#include <sys/sx.h>
#include <sys/sysctl.h>
#include <sys/systm.h>
#include <sys/taskqueue.h>
#include <sys/un.h>
#include <sys/unpcb.h>
#include <sys/vnode.h>
#include <net/vnet.h>
#include <security/mac/mac_framework.h>
#include <vm/uma.h>
Include dependency graph for uipc_usrreq.c:

Go to the source code of this file.

Data Structures

struct  unp_defer
 

Macros

#define PIPSIZ   8192
 
#define UNP_LINK_LOCK_INIT()
 
#define UNP_LINK_LOCK_ASSERT()
 
#define UNP_LINK_UNLOCK_ASSERT()
 
#define UNP_LINK_RLOCK()   rw_rlock(&unp_link_rwlock)
 
#define UNP_LINK_RUNLOCK()   rw_runlock(&unp_link_rwlock)
 
#define UNP_LINK_WLOCK()   rw_wlock(&unp_link_rwlock)
 
#define UNP_LINK_WUNLOCK()   rw_wunlock(&unp_link_rwlock)
 
#define UNP_LINK_WLOCK_ASSERT()
 
#define UNP_LINK_WOWNED()   rw_wowned(&unp_link_rwlock)
 
#define UNP_DEFERRED_LOCK_INIT()
 
#define UNP_DEFERRED_LOCK()   mtx_lock(&unp_defers_lock)
 
#define UNP_DEFERRED_UNLOCK()   mtx_unlock(&unp_defers_lock)
 
#define UNP_REF_LIST_LOCK()   UNP_DEFERRED_LOCK();
 
#define UNP_REF_LIST_UNLOCK()   UNP_DEFERRED_UNLOCK();
 
#define UNP_PCB_LOCK_INIT(unp)
 
#define UNP_PCB_LOCK_DESTROY(unp)   mtx_destroy(&(unp)->unp_mtx)
 
#define UNP_PCB_LOCKPTR(unp)   (&(unp)->unp_mtx)
 
#define UNP_PCB_LOCK(unp)   mtx_lock(&(unp)->unp_mtx)
 
#define UNP_PCB_TRYLOCK(unp)   mtx_trylock(&(unp)->unp_mtx)
 
#define UNP_PCB_UNLOCK(unp)   mtx_unlock(&(unp)->unp_mtx)
 
#define UNP_PCB_OWNED(unp)   mtx_owned(&(unp)->unp_mtx)
 
#define UNP_PCB_LOCK_ASSERT(unp)   mtx_assert(&(unp)->unp_mtx, MA_OWNED)
 
#define UNP_PCB_UNLOCK_ASSERT(unp)   mtx_assert(&(unp)->unp_mtx, MA_NOTOWNED)
 
#define OPTSET(bit, exclusive)
 

Functions

 __FBSDID ("$FreeBSD$")
 
 MALLOC_DECLARE (M_FILECAPS)
 
static SLIST_HEAD (unp_defer)
 
static SYSCTL_NODE (_net, PF_LOCAL, local, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "Local domain")
 
static SYSCTL_NODE (_net_local, SOCK_STREAM, stream, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "SOCK_STREAM")
 
static SYSCTL_NODE (_net_local, SOCK_DGRAM, dgram, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "SOCK_DGRAM")
 
static SYSCTL_NODE (_net_local, SOCK_SEQPACKET, seqpacket, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "SOCK_SEQPACKET")
 
 SYSCTL_ULONG (_net_local_stream, OID_AUTO, sendspace, CTLFLAG_RW, &unpst_sendspace, 0, "Default stream send space.")
 
 SYSCTL_ULONG (_net_local_stream, OID_AUTO, recvspace, CTLFLAG_RW, &unpst_recvspace, 0, "Default stream receive space.")
 
 SYSCTL_ULONG (_net_local_dgram, OID_AUTO, maxdgram, CTLFLAG_RW, &unpdg_sendspace, 0, "Default datagram send space.")
 
 SYSCTL_ULONG (_net_local_dgram, OID_AUTO, recvspace, CTLFLAG_RW, &unpdg_recvspace, 0, "Default datagram receive space.")
 
 SYSCTL_ULONG (_net_local_seqpacket, OID_AUTO, maxseqpacket, CTLFLAG_RW, &unpsp_sendspace, 0, "Default seqpacket send space.")
 
 SYSCTL_ULONG (_net_local_seqpacket, OID_AUTO, recvspace, CTLFLAG_RW, &unpsp_recvspace, 0, "Default seqpacket receive space.")
 
 SYSCTL_INT (_net_local, OID_AUTO, inflight, CTLFLAG_RD, &unp_rights, 0, "File descriptors in flight.")
 
 SYSCTL_INT (_net_local, OID_AUTO, deferred, CTLFLAG_RD, &unp_defers_count, 0, "File descriptors deferred to taskqueue for close.")
 
static int uipc_connect2 (struct socket *, struct socket *)
 
static int uipc_ctloutput (struct socket *, struct sockopt *)
 
static int unp_connect (struct socket *, struct sockaddr *, struct thread *)
 
static int unp_connectat (int, struct socket *, struct sockaddr *, struct thread *)
 
static int unp_connect2 (struct socket *so, struct socket *so2, int)
 
static void unp_disconnect (struct unpcb *unp, struct unpcb *unp2)
 
static void unp_dispose (struct socket *so)
 
static void unp_dispose_mbuf (struct mbuf *)
 
static void unp_shutdown (struct unpcb *)
 
static void unp_drop (struct unpcb *)
 
static void unp_gc (__unused void *, int)
 
static void unp_scan (struct mbuf *, void(*)(struct filedescent **, int))
 
static void unp_discard (struct file *)
 
static void unp_freerights (struct filedescent **, int)
 
static int unp_internalize (struct mbuf **, struct thread *)
 
static void unp_internalize_fp (struct file *)
 
static int unp_externalize (struct mbuf *, struct mbuf **, int)
 
static int unp_externalize_fp (struct file *)
 
static struct mbuf * unp_addsockcred (struct thread *, struct mbuf *, int)
 
static void unp_process_defers (void *__unused, int)
 
static void unp_pcb_hold (struct unpcb *unp)
 
static __result_use_check bool unp_pcb_rele (struct unpcb *unp)
 
static void unp_pcb_rele_notlast (struct unpcb *unp)
 
static void unp_pcb_lock_pair (struct unpcb *unp, struct unpcb *unp2)
 
static void unp_pcb_unlock_pair (struct unpcb *unp, struct unpcb *unp2)
 
static struct unpcb * unp_pcb_lock_peer (struct unpcb *unp)
 
 DOMAIN_SET (local)
 
static void uipc_abort (struct socket *so)
 
static int uipc_accept (struct socket *so, struct sockaddr **nam)
 
static int uipc_attach (struct socket *so, int proto, struct thread *td)
 
static int uipc_bindat (int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
 
static int uipc_bind (struct socket *so, struct sockaddr *nam, struct thread *td)
 
static int uipc_connect (struct socket *so, struct sockaddr *nam, struct thread *td)
 
static int uipc_connectat (int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
 
static void uipc_close (struct socket *so)
 
static void uipc_detach (struct socket *so)
 
static int uipc_disconnect (struct socket *so)
 
static int uipc_listen (struct socket *so, int backlog, struct thread *td)
 
static int uipc_peeraddr (struct socket *so, struct sockaddr **nam)
 
static int uipc_rcvd (struct socket *so, int flags)
 
static int uipc_send (struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td)
 
static bool uipc_ready_scan (struct socket *so, struct mbuf *m, int count, int *errorp)
 
static int uipc_ready (struct socket *so, struct mbuf *m, int count)
 
static int uipc_sense (struct socket *so, struct stat *sb)
 
static int uipc_shutdown (struct socket *so)
 
static int uipc_sockaddr (struct socket *so, struct sockaddr **nam)
 
void unp_copy_peercred (struct thread *td, struct unpcb *client_unp, struct unpcb *server_unp, struct unpcb *listen_unp)
 
static int unp_pcblist (SYSCTL_HANDLER_ARGS)
 
 SYSCTL_PROC (_net_local_dgram, OID_AUTO, pcblist, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE,(void *)(intptr_t) SOCK_DGRAM, 0, unp_pcblist, "S,xunpcb", "List of active local datagram sockets")
 
 SYSCTL_PROC (_net_local_stream, OID_AUTO, pcblist, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE,(void *)(intptr_t) SOCK_STREAM, 0, unp_pcblist, "S,xunpcb", "List of active local stream sockets")
 
 SYSCTL_PROC (_net_local_seqpacket, OID_AUTO, pcblist, CTLTYPE_OPAQUE|CTLFLAG_RD|CTLFLAG_MPSAFE,(void *)(intptr_t) SOCK_SEQPACKET, 0, unp_pcblist, "S,xunpcb", "List of active local seqpacket sockets")
 
static void unp_zone_change (void *tag)
 
static void unp_init (void *arg __unused)
 
 SYSINIT (unp_init, SI_SUB_PROTO_DOMAIN, SI_ORDER_SECOND, unp_init, NULL)
 
static void unp_internalize_cleanup_rights (struct mbuf *control)
 
static struct unpcb * fptounp (struct file *fp)
 
static void unp_process_defers (void *arg __unused, int pending)
 
static void unp_remove_dead_ref (struct filedescent **fdep, int fdcount)
 
static void unp_restore_undead_ref (struct filedescent **fdep, int fdcount)
 
static void unp_gc_scan (struct unpcb *unp, void(*op)(struct filedescent **, int))
 
 SYSCTL_INT (_net_local, OID_AUTO, recycled, CTLFLAG_RD, &unp_recycled, 0, "Number of unreachable sockets claimed by the garbage collector.")
 
 SYSCTL_INT (_net_local, OID_AUTO, taskcount, CTLFLAG_RD, &unp_taskcount, 0, "Number of times the garbage collector has run.")
 
 SYSCTL_UINT (_net_local, OID_AUTO, sockcount, CTLFLAG_RD, &unp_count, 0, "Number of active local sockets.")
 
void vfs_unp_reclaim (struct vnode *vp)
 

Variables

static uma_zone_t unp_zone
 
static unp_gen_t unp_gencnt
 
static u_int unp_count
 
static ino_t unp_ino
 
static int unp_rights
 
static struct unp_head unp_shead
 
static struct unp_head unp_dhead
 
static struct unp_head unp_sphead
 
static struct timeout_task unp_gc_task
 
static struct task unp_defer_task
 
static u_long unpst_sendspace = PIPSIZ
 
static u_long unpst_recvspace = PIPSIZ
 
static u_long unpdg_sendspace = 2*1024
 
static u_long unpdg_recvspace = 16*1024
 
static u_long unpsp_sendspace = PIPSIZ
 
static u_long unpsp_recvspace = PIPSIZ
 
static struct rwlock unp_link_rwlock
 
static struct mtx unp_defers_lock
 
static struct domain localdomain
 
static struct pr_usrreqs uipc_usrreqs_dgram uipc_usrreqs_stream
 
static struct pr_usrreqs uipc_usrreqs_seqpacket
 
static struct protosw localsw []
 
static struct pr_usrreqs uipc_usrreqs_dgram
 
static int unp_marked
 
static int unp_recycled
 
static int unp_taskcount
 

Macro Definition Documentation

◆ OPTSET

#define OPTSET (   bit,
  exclusive 
)
Value:
do { \
UNP_PCB_LOCK(unp); \
if (optval) { \
if ((unp->unp_flags & (exclusive)) != 0) { \
UNP_PCB_UNLOCK(unp); \
error = EINVAL; \
break; \
} \
unp->unp_flags |= (bit); \
} else \
unp->unp_flags &= ~(bit); \
UNP_PCB_UNLOCK(unp); \
} while (0)

◆ PIPSIZ

#define PIPSIZ   8192

Definition at line 155 of file uipc_usrreq.c.

◆ UNP_DEFERRED_LOCK

#define UNP_DEFERRED_LOCK ( )    mtx_lock(&unp_defers_lock)

Definition at line 272 of file uipc_usrreq.c.

◆ UNP_DEFERRED_LOCK_INIT

#define UNP_DEFERRED_LOCK_INIT ( )
Value:
mtx_init(&unp_defers_lock, \
"unp_defer", NULL, MTX_DEF)
static struct mtx unp_defers_lock
Definition: uipc_usrreq.c:252

Definition at line 270 of file uipc_usrreq.c.

◆ UNP_DEFERRED_UNLOCK

#define UNP_DEFERRED_UNLOCK ( )    mtx_unlock(&unp_defers_lock)

Definition at line 273 of file uipc_usrreq.c.

◆ UNP_LINK_LOCK_ASSERT

#define UNP_LINK_LOCK_ASSERT ( )
Value:
rw_assert(&unp_link_rwlock, \
RA_LOCKED)
static struct rwlock unp_link_rwlock
Definition: uipc_usrreq.c:251

Definition at line 257 of file uipc_usrreq.c.

◆ UNP_LINK_LOCK_INIT

#define UNP_LINK_LOCK_INIT ( )
Value:
rw_init(&unp_link_rwlock, \
"unp_link_rwlock")

Definition at line 254 of file uipc_usrreq.c.

◆ UNP_LINK_RLOCK

#define UNP_LINK_RLOCK ( )    rw_rlock(&unp_link_rwlock)

Definition at line 262 of file uipc_usrreq.c.

◆ UNP_LINK_RUNLOCK

#define UNP_LINK_RUNLOCK ( )    rw_runlock(&unp_link_rwlock)

Definition at line 263 of file uipc_usrreq.c.

◆ UNP_LINK_UNLOCK_ASSERT

#define UNP_LINK_UNLOCK_ASSERT ( )
Value:
rw_assert(&unp_link_rwlock, \
RA_UNLOCKED)

Definition at line 259 of file uipc_usrreq.c.

◆ UNP_LINK_WLOCK

#define UNP_LINK_WLOCK ( )    rw_wlock(&unp_link_rwlock)

Definition at line 264 of file uipc_usrreq.c.

◆ UNP_LINK_WLOCK_ASSERT

#define UNP_LINK_WLOCK_ASSERT ( )
Value:
rw_assert(&unp_link_rwlock, \
RA_WLOCKED)

Definition at line 266 of file uipc_usrreq.c.

◆ UNP_LINK_WOWNED

#define UNP_LINK_WOWNED ( )    rw_wowned(&unp_link_rwlock)

Definition at line 268 of file uipc_usrreq.c.

◆ UNP_LINK_WUNLOCK

#define UNP_LINK_WUNLOCK ( )    rw_wunlock(&unp_link_rwlock)

Definition at line 265 of file uipc_usrreq.c.

◆ UNP_PCB_LOCK

#define UNP_PCB_LOCK (   unp)    mtx_lock(&(unp)->unp_mtx)

Definition at line 283 of file uipc_usrreq.c.

◆ UNP_PCB_LOCK_ASSERT

#define UNP_PCB_LOCK_ASSERT (   unp)    mtx_assert(&(unp)->unp_mtx, MA_OWNED)

Definition at line 287 of file uipc_usrreq.c.

◆ UNP_PCB_LOCK_DESTROY

#define UNP_PCB_LOCK_DESTROY (   unp)    mtx_destroy(&(unp)->unp_mtx)

Definition at line 281 of file uipc_usrreq.c.

◆ UNP_PCB_LOCK_INIT

#define UNP_PCB_LOCK_INIT (   unp)
Value:
mtx_init(&(unp)->unp_mtx, \
"unp", "unp", \
MTX_DUPOK|MTX_DEF)

Definition at line 278 of file uipc_usrreq.c.

◆ UNP_PCB_LOCKPTR

#define UNP_PCB_LOCKPTR (   unp)    (&(unp)->unp_mtx)

Definition at line 282 of file uipc_usrreq.c.

◆ UNP_PCB_OWNED

#define UNP_PCB_OWNED (   unp)    mtx_owned(&(unp)->unp_mtx)

Definition at line 286 of file uipc_usrreq.c.

◆ UNP_PCB_TRYLOCK

#define UNP_PCB_TRYLOCK (   unp)    mtx_trylock(&(unp)->unp_mtx)

Definition at line 284 of file uipc_usrreq.c.

◆ UNP_PCB_UNLOCK

#define UNP_PCB_UNLOCK (   unp)    mtx_unlock(&(unp)->unp_mtx)

Definition at line 285 of file uipc_usrreq.c.

◆ UNP_PCB_UNLOCK_ASSERT

#define UNP_PCB_UNLOCK_ASSERT (   unp)    mtx_assert(&(unp)->unp_mtx, MA_NOTOWNED)

Definition at line 288 of file uipc_usrreq.c.

◆ UNP_REF_LIST_LOCK

#define UNP_REF_LIST_LOCK ( )    UNP_DEFERRED_LOCK();

Definition at line 275 of file uipc_usrreq.c.

◆ UNP_REF_LIST_UNLOCK

#define UNP_REF_LIST_UNLOCK ( )    UNP_DEFERRED_UNLOCK();

Definition at line 276 of file uipc_usrreq.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DOMAIN_SET()

DOMAIN_SET ( local  )

◆ fptounp()

static struct unpcb * fptounp ( struct file *  fp)
static

Definition at line 2465 of file uipc_usrreq.c.

References localdomain.

Referenced by unp_externalize_fp(), unp_internalize_fp(), unp_remove_dead_ref(), and unp_restore_undead_ref().

Here is the caller graph for this function:

◆ MALLOC_DECLARE()

MALLOC_DECLARE ( M_FILECAPS  )

◆ SLIST_HEAD()

static SLIST_HEAD ( unp_defer  )
static

Definition at line 125 of file uipc_usrreq.c.

Referenced by unp_process_defers().

Here is the caller graph for this function:

◆ SYSCTL_INT() [1/4]

SYSCTL_INT ( _net_local  ,
OID_AUTO  ,
deferred  ,
CTLFLAG_RD  ,
unp_defers_count,
,
"File descriptors deferred to taskqueue for close."   
)

◆ SYSCTL_INT() [2/4]

SYSCTL_INT ( _net_local  ,
OID_AUTO  ,
inflight  ,
CTLFLAG_RD  ,
unp_rights,
,
"File descriptors in flight."   
)

◆ SYSCTL_INT() [3/4]

SYSCTL_INT ( _net_local  ,
OID_AUTO  ,
recycled  ,
CTLFLAG_RD  ,
unp_recycled,
,
"Number of unreachable sockets claimed by the garbage collector."   
)

◆ SYSCTL_INT() [4/4]

SYSCTL_INT ( _net_local  ,
OID_AUTO  ,
taskcount  ,
CTLFLAG_RD  ,
unp_taskcount,
,
"Number of times the garbage collector has run."   
)

◆ SYSCTL_NODE() [1/4]

static SYSCTL_NODE ( _net  ,
PF_LOCAL  ,
local  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"Local domain  
)
static

◆ SYSCTL_NODE() [2/4]

static SYSCTL_NODE ( _net_local  ,
SOCK_DGRAM  ,
dgram  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"SOCK_DGRAM"   
)
static

◆ SYSCTL_NODE() [3/4]

static SYSCTL_NODE ( _net_local  ,
SOCK_SEQPACKET  ,
seqpacket  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"SOCK_SEQPACKET"   
)
static

◆ SYSCTL_NODE() [4/4]

static SYSCTL_NODE ( _net_local  ,
SOCK_STREAM  ,
stream  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"SOCK_STREAM"   
)
static

◆ SYSCTL_PROC() [1/3]

SYSCTL_PROC ( _net_local_dgram  ,
OID_AUTO  ,
pcblist  ,
CTLTYPE_OPAQUE|CTLFLAG_RD|  CTLFLAG_MPSAFE,
(void *)(intptr_t)  SOCK_DGRAM,
,
unp_pcblist  ,
S,
xunpcb"  ,
"List of active local datagram sockets"   
)

◆ SYSCTL_PROC() [2/3]

SYSCTL_PROC ( _net_local_seqpacket  ,
OID_AUTO  ,
pcblist  ,
CTLTYPE_OPAQUE|CTLFLAG_RD|  CTLFLAG_MPSAFE,
(void *)(intptr_t)  SOCK_SEQPACKET,
,
unp_pcblist  ,
S,
xunpcb"  ,
"List of active local seqpacket sockets"   
)

◆ SYSCTL_PROC() [3/3]

SYSCTL_PROC ( _net_local_stream  ,
OID_AUTO  ,
pcblist  ,
CTLTYPE_OPAQUE|CTLFLAG_RD|  CTLFLAG_MPSAFE,
(void *)(intptr_t)  SOCK_STREAM,
,
unp_pcblist  ,
S,
xunpcb"  ,
"List of active local stream sockets"   
)

◆ SYSCTL_UINT()

SYSCTL_UINT ( _net_local  ,
OID_AUTO  ,
sockcount  ,
CTLFLAG_RD  ,
unp_count,
,
"Number of active local sockets."   
)

◆ SYSCTL_ULONG() [1/6]

SYSCTL_ULONG ( _net_local_dgram  ,
OID_AUTO  ,
maxdgram  ,
CTLFLAG_RW  ,
unpdg_sendspace,
,
"Default datagram send space."   
)

◆ SYSCTL_ULONG() [2/6]

SYSCTL_ULONG ( _net_local_dgram  ,
OID_AUTO  ,
recvspace  ,
CTLFLAG_RW  ,
unpdg_recvspace,
,
"Default datagram receive space."   
)

◆ SYSCTL_ULONG() [3/6]

SYSCTL_ULONG ( _net_local_seqpacket  ,
OID_AUTO  ,
maxseqpacket  ,
CTLFLAG_RW  ,
unpsp_sendspace,
,
"Default seqpacket send space."   
)

◆ SYSCTL_ULONG() [4/6]

SYSCTL_ULONG ( _net_local_seqpacket  ,
OID_AUTO  ,
recvspace  ,
CTLFLAG_RW  ,
unpsp_recvspace,
,
"Default seqpacket receive space."   
)

◆ SYSCTL_ULONG() [5/6]

SYSCTL_ULONG ( _net_local_stream  ,
OID_AUTO  ,
recvspace  ,
CTLFLAG_RW  ,
unpst_recvspace,
,
"Default stream receive space."   
)

◆ SYSCTL_ULONG() [6/6]

SYSCTL_ULONG ( _net_local_stream  ,
OID_AUTO  ,
sendspace  ,
CTLFLAG_RW  ,
unpst_sendspace,
,
"Default stream send space."   
)

◆ SYSINIT()

SYSINIT ( unp_init  ,
SI_SUB_PROTO_DOMAIN  ,
SI_ORDER_SECOND  ,
unp_init  ,
NULL   
)

◆ uipc_abort()

static void uipc_abort ( struct socket *  so)
static

Definition at line 469 of file uipc_usrreq.c.

References unp_drop(), unp_pcb_hold(), UNP_PCB_LOCK, UNP_PCB_UNLOCK, and UNP_PCB_UNLOCK_ASSERT.

Here is the call graph for this function:

◆ uipc_accept()

static int uipc_accept ( struct socket *  so,
struct sockaddr **  nam 
)
static

Definition at line 488 of file uipc_usrreq.c.

References malloc(), UNP_PCB_LOCK, unp_pcb_lock_peer(), UNP_PCB_UNLOCK, and unp_pcb_unlock_pair().

Here is the call graph for this function:

◆ uipc_attach()

static int uipc_attach ( struct socket *  so,
int  proto,
struct thread *  td 
)
static

◆ uipc_bind()

static int uipc_bind ( struct socket *  so,
struct sockaddr *  nam,
struct thread *  td 
)
static

Definition at line 702 of file uipc_usrreq.c.

References uipc_bindat().

Here is the call graph for this function:

◆ uipc_bindat()

static int uipc_bindat ( int  fd,
struct socket *  so,
struct sockaddr *  nam,
struct thread *  td 
)
static

Definition at line 587 of file uipc_usrreq.c.

References buf, fd, free(), malloc(), namei(), NDFREE(), sodupsockaddr(), UNP_PCB_LOCK, UNP_PCB_UNLOCK, vn_finished_write(), vn_start_write(), vput(), vref(), and vrele().

Referenced by uipc_bind().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uipc_close()

static void uipc_close ( struct socket *  so)
static

Definition at line 730 of file uipc_usrreq.c.

References mtx, mtx_pool_find(), mtxpool_sleep, unp_disconnect(), UNP_PCB_LOCK, unp_pcb_lock_peer(), UNP_PCB_UNLOCK, and vrele().

Here is the call graph for this function:

◆ uipc_connect()

static int uipc_connect ( struct socket *  so,
struct sockaddr *  nam,
struct thread *  td 
)
static

Definition at line 709 of file uipc_usrreq.c.

References unp_connect().

Here is the call graph for this function:

◆ uipc_connect2()

static int uipc_connect2 ( struct socket *  so1,
struct socket *  so2 
)
static

Definition at line 764 of file uipc_usrreq.c.

References unp_connect2(), unp_pcb_lock_pair(), and unp_pcb_unlock_pair().

Here is the call graph for this function:

◆ uipc_connectat()

static int uipc_connectat ( int  fd,
struct socket *  so,
struct sockaddr *  nam,
struct thread *  td 
)
static

Definition at line 719 of file uipc_usrreq.c.

References fd, and unp_connectat().

Here is the call graph for this function:

◆ uipc_ctloutput()

static int uipc_ctloutput ( struct socket *  so,
struct sockopt *  sopt 
)
static

Definition at line 1384 of file uipc_usrreq.c.

References OPTSET, sooptcopyin(), sooptcopyout(), UNP_PCB_LOCK, and UNP_PCB_UNLOCK.

Here is the call graph for this function:

◆ uipc_detach()

◆ uipc_disconnect()

static int uipc_disconnect ( struct socket *  so)
static

Definition at line 866 of file uipc_usrreq.c.

References unp_disconnect(), UNP_PCB_LOCK, unp_pcb_lock_peer(), and UNP_PCB_UNLOCK.

Here is the call graph for this function:

◆ uipc_listen()

static int uipc_listen ( struct socket *  so,
int  backlog,
struct thread *  td 
)
static

Definition at line 882 of file uipc_usrreq.c.

References cru2xt(), solisten_proto(), solisten_proto_check(), UNP_PCB_LOCK, and UNP_PCB_UNLOCK.

Here is the call graph for this function:

◆ uipc_peeraddr()

static int uipc_peeraddr ( struct socket *  so,
struct sockaddr **  nam 
)
static

Definition at line 917 of file uipc_usrreq.c.

References malloc(), UNP_LINK_RLOCK, UNP_LINK_RUNLOCK, UNP_PCB_LOCK, and UNP_PCB_UNLOCK.

Here is the call graph for this function:

◆ uipc_rcvd()

static int uipc_rcvd ( struct socket *  so,
int  flags 
)
static

Definition at line 950 of file uipc_usrreq.c.

References UNP_PCB_LOCK, and UNP_PCB_UNLOCK.

◆ uipc_ready()

static int uipc_ready ( struct socket *  so,
struct mbuf *  m,
int  count 
)
static

Definition at line 1221 of file uipc_usrreq.c.

References count, sbready(), uipc_ready_scan(), UNP_LINK_RLOCK, UNP_LINK_RUNLOCK, UNP_PCB_LOCK, unp_pcb_lock_peer(), UNP_PCB_UNLOCK, and unp_shead.

Here is the call graph for this function:

◆ uipc_ready_scan()

static bool uipc_ready_scan ( struct socket *  so,
struct mbuf *  m,
int  count,
int *  errorp 
)
static

Definition at line 1188 of file uipc_usrreq.c.

References count, and sbready().

Referenced by uipc_ready().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uipc_send()

static int uipc_send ( struct socket *  so,
int  flags,
struct mbuf *  m,
struct sockaddr *  nam,
struct mbuf *  control,
struct thread *  td 
)
static

◆ uipc_sense()

static int uipc_sense ( struct socket *  so,
struct stat *  sb 
)
static

Definition at line 1268 of file uipc_usrreq.c.

◆ uipc_shutdown()

static int uipc_shutdown ( struct socket *  so)
static

Definition at line 1282 of file uipc_usrreq.c.

References socantsendmore(), UNP_PCB_LOCK, UNP_PCB_UNLOCK, and unp_shutdown().

Here is the call graph for this function:

◆ uipc_sockaddr()

static int uipc_sockaddr ( struct socket *  so,
struct sockaddr **  nam 
)
static

Definition at line 1297 of file uipc_usrreq.c.

References malloc(), UNP_PCB_LOCK, and UNP_PCB_UNLOCK.

Here is the call graph for this function:

◆ unp_addsockcred()

static struct mbuf * unp_addsockcred ( struct thread *  td,
struct mbuf *  control,
int  mode 
)
static

Definition at line 2392 of file uipc_usrreq.c.

References mode, and sbcreatecontrol().

Referenced by uipc_send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_connect()

static int unp_connect ( struct socket *  so,
struct sockaddr *  nam,
struct thread *  td 
)
static

Definition at line 1494 of file uipc_usrreq.c.

References unp_connectat().

Referenced by uipc_connect(), and uipc_send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_connect2()

static int unp_connect2 ( struct socket *  so,
struct socket *  so2,
int  req 
)
static

Definition at line 1686 of file uipc_usrreq.c.

References panic(), soisconnected(), soisconnecting(), unp_pcb_hold(), UNP_PCB_LOCK_ASSERT, UNP_REF_LIST_LOCK, and UNP_REF_LIST_UNLOCK.

Referenced by uipc_connect2(), and unp_connectat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_connectat()

static int unp_connectat ( int  fd,
struct socket *  so,
struct sockaddr *  nam,
struct thread *  td 
)
static

Definition at line 1501 of file uipc_usrreq.c.

References buf, fd, free(), malloc(), mtx, mtx_pool_find(), mtxpool_sleep, namei(), sonewconn(), unp_connect2(), unp_copy_peercred(), UNP_PCB_LOCK, unp_pcb_lock_pair(), UNP_PCB_LOCKPTR, UNP_PCB_UNLOCK, unp_pcb_unlock_pair(), and vput().

Referenced by uipc_connectat(), and unp_connect().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_copy_peercred()

void unp_copy_peercred ( struct thread *  td,
struct unpcb *  client_unp,
struct unpcb *  server_unp,
struct unpcb *  listen_unp 
)

Definition at line 1673 of file uipc_usrreq.c.

References cru2xt().

Referenced by kern_socketpair(), and unp_connectat().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_discard()

static void unp_discard ( struct file *  fp)
static

Definition at line 2479 of file uipc_usrreq.c.

References closef_nothread(), malloc(), taskqueue_enqueue(), unp_defer_task, UNP_DEFERRED_LOCK, UNP_DEFERRED_UNLOCK, and unp_externalize_fp().

Referenced by unp_freerights().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_disconnect()

static void unp_disconnect ( struct unpcb *  unp,
struct unpcb *  unp2 
)
static

Definition at line 1734 of file uipc_usrreq.c.

References soisdisconnected(), UNP_PCB_LOCK_ASSERT, unp_pcb_rele(), unp_pcb_rele_notlast(), UNP_PCB_UNLOCK, UNP_REF_LIST_LOCK, and UNP_REF_LIST_UNLOCK.

Referenced by uipc_close(), uipc_detach(), uipc_disconnect(), uipc_send(), and unp_drop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_dispose()

static void unp_dispose ( struct socket *  so)
static

Definition at line 2793 of file uipc_usrreq.c.

References unp_dispose_mbuf(), UNP_LINK_WLOCK, and UNP_LINK_WUNLOCK.

Here is the call graph for this function:

◆ unp_dispose_mbuf()

static void unp_dispose_mbuf ( struct mbuf *  m)
static

Definition at line 2782 of file uipc_usrreq.c.

References unp_freerights(), and unp_scan().

Referenced by uipc_send(), and unp_dispose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_drop()

static void unp_drop ( struct unpcb *  unp)
static

Definition at line 1968 of file uipc_usrreq.c.

References unp_disconnect(), UNP_PCB_LOCK, unp_pcb_lock_peer(), unp_pcb_rele(), unp_pcb_rele_notlast(), and UNP_PCB_UNLOCK.

Referenced by uipc_abort(), and uipc_detach().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_externalize()

static int unp_externalize ( struct mbuf *  control,
struct mbuf **  controlp,
int  flags 
)
static

Definition at line 2009 of file uipc_usrreq.c.

References _finstall(), data, fdallocn(), flags, free(), m_freem(), sbcreatecontrol(), unp_externalize_fp(), unp_freerights(), and UNP_LINK_UNLOCK_ASSERT.

Here is the call graph for this function:

◆ unp_externalize_fp()

static int unp_externalize_fp ( struct file *  fp)
static

Definition at line 2537 of file uipc_usrreq.c.

References fptounp(), UNP_LINK_WLOCK, UNP_LINK_WUNLOCK, and unp_rights.

Referenced by unp_discard(), and unp_externalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_freerights()

static void unp_freerights ( struct filedescent **  fdep,
int  fdcount 
)
static

Definition at line 1993 of file uipc_usrreq.c.

References filecaps_free(), free(), and unp_discard().

Referenced by unp_dispose_mbuf(), unp_externalize(), and unp_internalize_cleanup_rights().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_gc()

static void unp_gc ( __unused void *  arg,
int  pending 
)
static

Definition at line 2652 of file uipc_usrreq.c.

References free(), malloc(), sorflush(), unp_dhead, unp_gc_scan(), UNP_LINK_RLOCK, UNP_LINK_RUNLOCK, unp_marked, unp_recycled, unp_remove_dead_ref(), unp_restore_undead_ref(), unp_shead, unp_sphead, and unp_taskcount.

Referenced by unp_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_gc_scan()

static void unp_gc_scan ( struct unpcb *  unp,
void(*)(struct filedescent **, int)  op 
)
static

Definition at line 2610 of file uipc_usrreq.c.

References unp_scan().

Referenced by unp_gc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_init()

static void unp_init ( void *arg  __unused)
static

◆ unp_internalize()

static int unp_internalize ( struct mbuf **  controlp,
struct thread *  td 
)
static

Definition at line 2195 of file uipc_usrreq.c.

References bintime(), bt, data, filecaps_copy(), m_freem(), malloc(), microtime(), nanotime(), nanouptime(), sbcreatecontrol(), ts, unp_internalize_cleanup_rights(), unp_internalize_fp(), and UNP_LINK_UNLOCK_ASSERT.

Referenced by uipc_send().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_internalize_cleanup_rights()

static void unp_internalize_cleanup_rights ( struct mbuf *  control)
static

Definition at line 2176 of file uipc_usrreq.c.

References data, and unp_freerights().

Referenced by unp_internalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_internalize_fp()

static void unp_internalize_fp ( struct file *  fp)
static

Definition at line 2523 of file uipc_usrreq.c.

References fptounp(), UNP_LINK_WLOCK, UNP_LINK_WUNLOCK, and unp_rights.

Referenced by unp_internalize().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_pcb_hold()

static void unp_pcb_hold ( struct unpcb *  unp)
static

Definition at line 314 of file uipc_usrreq.c.

Referenced by uipc_abort(), uipc_detach(), unp_connect2(), unp_pcb_lock_peer(), and unp_pcblist().

Here is the caller graph for this function:

◆ unp_pcb_lock_pair()

static void unp_pcb_lock_pair ( struct unpcb *  unp,
struct unpcb *  unp2 
)
static

Definition at line 347 of file uipc_usrreq.c.

References UNP_PCB_LOCK, and UNP_PCB_UNLOCK_ASSERT.

Referenced by uipc_connect2(), and unp_connectat().

Here is the caller graph for this function:

◆ unp_pcb_lock_peer()

static struct unpcb * unp_pcb_lock_peer ( struct unpcb *  unp)
static

Definition at line 378 of file uipc_usrreq.c.

References unp_pcb_hold(), UNP_PCB_LOCK, UNP_PCB_LOCK_ASSERT, unp_pcb_rele(), UNP_PCB_TRYLOCK, UNP_PCB_UNLOCK, UNP_PCB_UNLOCK_ASSERT, and wakeup().

Referenced by uipc_accept(), uipc_close(), uipc_detach(), uipc_disconnect(), uipc_ready(), uipc_send(), and unp_drop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_pcb_rele()

static __result_use_check bool unp_pcb_rele ( struct unpcb *  unp)
static

Definition at line 323 of file uipc_usrreq.c.

References UNP_PCB_LOCK_ASSERT, UNP_PCB_LOCK_DESTROY, UNP_PCB_UNLOCK, and unp_zone.

Referenced by uipc_detach(), unp_disconnect(), unp_drop(), unp_pcb_lock_peer(), and unp_pcblist().

Here is the caller graph for this function:

◆ unp_pcb_rele_notlast()

static void unp_pcb_rele_notlast ( struct unpcb *  unp)
static

Definition at line 338 of file uipc_usrreq.c.

Referenced by unp_disconnect(), and unp_drop().

Here is the caller graph for this function:

◆ unp_pcb_unlock_pair()

static void unp_pcb_unlock_pair ( struct unpcb *  unp,
struct unpcb *  unp2 
)
static

Definition at line 364 of file uipc_usrreq.c.

References UNP_PCB_UNLOCK.

Referenced by uipc_accept(), uipc_connect2(), uipc_send(), and unp_connectat().

Here is the caller graph for this function:

◆ unp_pcblist()

static int unp_pcblist ( SYSCTL_HANDLER_ARGS  )
static

◆ unp_process_defers() [1/2]

static void unp_process_defers ( void *  __unused,
int   
)
static

Referenced by unp_init().

Here is the caller graph for this function:

◆ unp_process_defers() [2/2]

static void unp_process_defers ( void *arg  __unused,
int  pending 
)
static

Definition at line 2496 of file uipc_usrreq.c.

References closef_nothread(), count, free(), SLIST_HEAD(), UNP_DEFERRED_LOCK, and UNP_DEFERRED_UNLOCK.

Here is the call graph for this function:

◆ unp_remove_dead_ref()

static void unp_remove_dead_ref ( struct filedescent **  fdep,
int  fdcount 
)
static

Definition at line 2561 of file uipc_usrreq.c.

References fptounp(), taskqueue_member(), and UNP_LINK_LOCK_ASSERT.

Referenced by unp_gc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_restore_undead_ref()

static void unp_restore_undead_ref ( struct filedescent **  fdep,
int  fdcount 
)
static

Definition at line 2585 of file uipc_usrreq.c.

References fptounp(), taskqueue_member(), UNP_LINK_LOCK_ASSERT, and unp_marked.

Referenced by unp_gc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_scan()

static void unp_scan ( struct mbuf *  m0,
void(*)(struct filedescent **, int)  op 
)
static

Definition at line 2806 of file uipc_usrreq.c.

References data.

Referenced by unp_dispose_mbuf(), and unp_gc_scan().

Here is the caller graph for this function:

◆ unp_shutdown()

static void unp_shutdown ( struct unpcb *  unp)
static

Definition at line 1951 of file uipc_usrreq.c.

References socantrcvmore(), and UNP_PCB_LOCK_ASSERT.

Referenced by uipc_send(), and uipc_shutdown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ unp_zone_change()

static void unp_zone_change ( void *  tag)
static

Definition at line 2121 of file uipc_usrreq.c.

References maxsockets, and unp_zone.

Referenced by unp_init().

Here is the caller graph for this function:

◆ vfs_unp_reclaim()

void vfs_unp_reclaim ( struct vnode *  vp)

Definition at line 2855 of file uipc_usrreq.c.

References mtx, mtx_pool_find(), mtxpool_sleep, UNP_PCB_LOCK, UNP_PCB_UNLOCK, and vunref().

Referenced by vgonel().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ localdomain

static struct domain localdomain
static
Initial value:
= {
.dom_family = AF_LOCAL,
.dom_name = "local",
.dom_externalize = unp_externalize,
.dom_dispose = unp_dispose,
.dom_protosw = localsw,
.dom_protoswNPROTOSW = &localsw[nitems(localsw)]
}
static struct protosw localsw[]
Definition: uipc_usrreq.c:426
static void unp_dispose(struct socket *so)
Definition: uipc_usrreq.c:2793
static int unp_externalize(struct mbuf *, struct mbuf **, int)
Definition: uipc_usrreq.c:2009

Definition at line 423 of file uipc_usrreq.c.

Referenced by fptounp().

◆ localsw

struct protosw localsw[]
static
Initial value:
= {
{
.pr_type = SOCK_STREAM,
.pr_domain = &localdomain,
.pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS|
PR_CAPATTACH,
.pr_ctloutput = &uipc_ctloutput,
.pr_usrreqs = &uipc_usrreqs_stream
},
{
.pr_type = SOCK_DGRAM,
.pr_domain = &localdomain,
.pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS|PR_CAPATTACH,
.pr_ctloutput = &uipc_ctloutput,
.pr_usrreqs = &uipc_usrreqs_dgram
},
{
.pr_type = SOCK_SEQPACKET,
.pr_domain = &localdomain,
.pr_flags = PR_ADDR|PR_ATOMIC|PR_CONNREQUIRED|
PR_WANTRCVD|PR_RIGHTS|PR_CAPATTACH,
.pr_ctloutput = &uipc_ctloutput,
.pr_usrreqs = &uipc_usrreqs_seqpacket,
},
}
static struct pr_usrreqs uipc_usrreqs_dgram
Definition: uipc_usrreq.c:1316
static struct pr_usrreqs uipc_usrreqs_dgram uipc_usrreqs_stream
Definition: uipc_usrreq.c:424
static int uipc_ctloutput(struct socket *, struct sockopt *)
Definition: uipc_usrreq.c:1384
static struct pr_usrreqs uipc_usrreqs_seqpacket
Definition: uipc_usrreq.c:425
static struct domain localdomain
Definition: uipc_usrreq.c:423

Definition at line 426 of file uipc_usrreq.c.

◆ uipc_usrreqs_dgram

struct pr_usrreqs uipc_usrreqs_dgram
static
Initial value:
= {
.pru_abort = uipc_abort,
.pru_accept = uipc_accept,
.pru_attach = uipc_attach,
.pru_bind = uipc_bind,
.pru_bindat = uipc_bindat,
.pru_connect = uipc_connect,
.pru_connectat = uipc_connectat,
.pru_connect2 = uipc_connect2,
.pru_detach = uipc_detach,
.pru_disconnect = uipc_disconnect,
.pru_listen = uipc_listen,
.pru_peeraddr = uipc_peeraddr,
.pru_rcvd = uipc_rcvd,
.pru_send = uipc_send,
.pru_sense = uipc_sense,
.pru_shutdown = uipc_shutdown,
.pru_sockaddr = uipc_sockaddr,
.pru_soreceive = soreceive_dgram,
.pru_close = uipc_close,
}
int soreceive_dgram(struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
Definition: uipc_socket.c:2677
static int uipc_bind(struct socket *so, struct sockaddr *nam, struct thread *td)
Definition: uipc_usrreq.c:702
static int uipc_connect2(struct socket *, struct socket *)
Definition: uipc_usrreq.c:764
static int uipc_shutdown(struct socket *so)
Definition: uipc_usrreq.c:1282
static void uipc_abort(struct socket *so)
Definition: uipc_usrreq.c:469
static int uipc_sockaddr(struct socket *so, struct sockaddr **nam)
Definition: uipc_usrreq.c:1297
static int uipc_listen(struct socket *so, int backlog, struct thread *td)
Definition: uipc_usrreq.c:882
static int uipc_sense(struct socket *so, struct stat *sb)
Definition: uipc_usrreq.c:1268
static int uipc_disconnect(struct socket *so)
Definition: uipc_usrreq.c:866
static int uipc_accept(struct socket *so, struct sockaddr **nam)
Definition: uipc_usrreq.c:488
static void uipc_close(struct socket *so)
Definition: uipc_usrreq.c:730
static int uipc_rcvd(struct socket *so, int flags)
Definition: uipc_usrreq.c:950
static int uipc_peeraddr(struct socket *so, struct sockaddr **nam)
Definition: uipc_usrreq.c:917
static int uipc_bindat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
Definition: uipc_usrreq.c:587
static int uipc_attach(struct socket *so, int proto, struct thread *td)
Definition: uipc_usrreq.c:516
static int uipc_connect(struct socket *so, struct sockaddr *nam, struct thread *td)
Definition: uipc_usrreq.c:709
static void uipc_detach(struct socket *so)
Definition: uipc_usrreq.c:780
static int uipc_send(struct socket *so, int flags, struct mbuf *m, struct sockaddr *nam, struct mbuf *control, struct thread *td)
Definition: uipc_usrreq.c:1000
static int uipc_connectat(int fd, struct socket *so, struct sockaddr *nam, struct thread *td)
Definition: uipc_usrreq.c:719

Definition at line 1316 of file uipc_usrreq.c.

◆ uipc_usrreqs_seqpacket

static struct pr_usrreqs uipc_usrreqs_seqpacket
static
Initial value:
= {
.pru_abort = uipc_abort,
.pru_accept = uipc_accept,
.pru_attach = uipc_attach,
.pru_bind = uipc_bind,
.pru_bindat = uipc_bindat,
.pru_connect = uipc_connect,
.pru_connectat = uipc_connectat,
.pru_connect2 = uipc_connect2,
.pru_detach = uipc_detach,
.pru_disconnect = uipc_disconnect,
.pru_listen = uipc_listen,
.pru_peeraddr = uipc_peeraddr,
.pru_rcvd = uipc_rcvd,
.pru_send = uipc_send,
.pru_sense = uipc_sense,
.pru_shutdown = uipc_shutdown,
.pru_sockaddr = uipc_sockaddr,
.pru_soreceive = soreceive_generic,
.pru_close = uipc_close,
}
int soreceive_generic(struct socket *so, struct sockaddr **psa, struct uio *uio, struct mbuf **mp0, struct mbuf **controlp, int *flagsp)
Definition: uipc_socket.c:1961

Definition at line 425 of file uipc_usrreq.c.

◆ uipc_usrreqs_stream

static struct pr_usrreqs uipc_usrreqs_stream
static
Initial value:
= {
.pru_abort = uipc_abort,
.pru_accept = uipc_accept,
.pru_attach = uipc_attach,
.pru_bind = uipc_bind,
.pru_bindat = uipc_bindat,
.pru_connect = uipc_connect,
.pru_connectat = uipc_connectat,
.pru_connect2 = uipc_connect2,
.pru_detach = uipc_detach,
.pru_disconnect = uipc_disconnect,
.pru_listen = uipc_listen,
.pru_peeraddr = uipc_peeraddr,
.pru_rcvd = uipc_rcvd,
.pru_send = uipc_send,
.pru_ready = uipc_ready,
.pru_sense = uipc_sense,
.pru_shutdown = uipc_shutdown,
.pru_sockaddr = uipc_sockaddr,
.pru_soreceive = soreceive_generic,
.pru_close = uipc_close,
}
static int uipc_ready(struct socket *so, struct mbuf *m, int count)
Definition: uipc_usrreq.c:1221

Definition at line 424 of file uipc_usrreq.c.

◆ unp_count

u_int unp_count
static

Definition at line 114 of file uipc_usrreq.c.

Referenced by uipc_attach(), uipc_detach(), and unp_pcblist().

◆ unp_defer_task

struct task unp_defer_task
static

Definition at line 143 of file uipc_usrreq.c.

Referenced by unp_discard(), and unp_init().

◆ unp_defers_lock

struct mtx unp_defers_lock
static

Definition at line 252 of file uipc_usrreq.c.

◆ unp_dhead

struct unp_head unp_dhead
static

Definition at line 118 of file uipc_usrreq.c.

Referenced by uipc_attach(), unp_gc(), unp_init(), and unp_pcblist().

◆ unp_gc_task

struct timeout_task unp_gc_task
static

Definition at line 136 of file uipc_usrreq.c.

Referenced by uipc_detach(), and unp_init().

◆ unp_gencnt

unp_gen_t unp_gencnt
static

Definition at line 113 of file uipc_usrreq.c.

Referenced by uipc_attach(), uipc_detach(), and unp_pcblist().

◆ unp_ino

ino_t unp_ino
static

Definition at line 115 of file uipc_usrreq.c.

Referenced by uipc_attach().

◆ unp_link_rwlock

struct rwlock unp_link_rwlock
static

Definition at line 251 of file uipc_usrreq.c.

◆ unp_marked

int unp_marked
static

Definition at line 2558 of file uipc_usrreq.c.

Referenced by unp_gc(), and unp_restore_undead_ref().

◆ unp_recycled

int unp_recycled
static

Definition at line 2640 of file uipc_usrreq.c.

Referenced by unp_gc().

◆ unp_rights

int unp_rights
static

Definition at line 116 of file uipc_usrreq.c.

Referenced by uipc_detach(), unp_externalize_fp(), and unp_internalize_fp().

◆ unp_shead

struct unp_head unp_shead
static

Definition at line 117 of file uipc_usrreq.c.

Referenced by uipc_attach(), uipc_ready(), unp_gc(), unp_init(), and unp_pcblist().

◆ unp_sphead

struct unp_head unp_sphead
static

Definition at line 119 of file uipc_usrreq.c.

Referenced by uipc_attach(), unp_gc(), unp_init(), and unp_pcblist().

◆ unp_taskcount

int unp_taskcount
static

Definition at line 2644 of file uipc_usrreq.c.

Referenced by unp_gc().

◆ unp_zone

uma_zone_t unp_zone
static

Definition at line 112 of file uipc_usrreq.c.

Referenced by uipc_attach(), unp_init(), unp_pcb_rele(), and unp_zone_change().

◆ unpdg_recvspace

u_long unpdg_recvspace = 16*1024
static

Definition at line 160 of file uipc_usrreq.c.

Referenced by uipc_attach().

◆ unpdg_sendspace

u_long unpdg_sendspace = 2*1024
static

Definition at line 159 of file uipc_usrreq.c.

Referenced by uipc_attach().

◆ unpsp_recvspace

u_long unpsp_recvspace = PIPSIZ
static

Definition at line 162 of file uipc_usrreq.c.

Referenced by uipc_attach().

◆ unpsp_sendspace

u_long unpsp_sendspace = PIPSIZ
static

Definition at line 161 of file uipc_usrreq.c.

Referenced by uipc_attach().

◆ unpst_recvspace

u_long unpst_recvspace = PIPSIZ
static

Definition at line 158 of file uipc_usrreq.c.

Referenced by uipc_attach().

◆ unpst_sendspace

u_long unpst_sendspace = PIPSIZ
static

Definition at line 157 of file uipc_usrreq.c.

Referenced by uipc_attach().