Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/socketvar.h
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
* handle on protocol and pointer to protocol | * handle on protocol and pointer to protocol | ||||
* private data and error information. | * private data and error information. | ||||
*/ | */ | ||||
typedef int so_upcall_t(struct socket *, void *, int); | typedef int so_upcall_t(struct socket *, void *, int); | ||||
typedef void so_dtor_t(struct socket *); | typedef void so_dtor_t(struct socket *); | ||||
struct socket; | struct socket; | ||||
enum socket_qstate { | |||||
SQ_NONE = 0, | |||||
SQ_INCOMP = 0x0800, /* on sol_incomp */ | |||||
SQ_COMP = 0x1000, /* on sol_comp */ | |||||
}; | |||||
/*- | /*- | ||||
* Locking key to struct socket: | * Locking key to struct socket: | ||||
* (a) constant after allocation, no locking required. | * (a) constant after allocation, no locking required. | ||||
* (b) locked by SOCK_LOCK(so). | * (b) locked by SOCK_LOCK(so). | ||||
* (cr) locked by SOCKBUF_LOCK(&so->so_rcv). | * (cr) locked by SOCKBUF_LOCK(&so->so_rcv). | ||||
* (cs) locked by SOCKBUF_LOCK(&so->so_snd). | * (cs) locked by SOCKBUF_LOCK(&so->so_snd). | ||||
* (e) locked by SOLISTEN_LOCK() of corresponding listening socket. | * (e) locked by SOLISTEN_LOCK() of corresponding listening socket. | ||||
* (f) not locked since integer reads/writes are atomic. | * (f) not locked since integer reads/writes are atomic. | ||||
Show All 39 Lines | union { | ||||
/* Regular (data flow) socket. */ | /* Regular (data flow) socket. */ | ||||
struct { | struct { | ||||
/* (cr, cs) Receive and send buffers. */ | /* (cr, cs) Receive and send buffers. */ | ||||
struct sockbuf so_rcv, so_snd; | struct sockbuf so_rcv, so_snd; | ||||
/* (e) Our place on accept queue. */ | /* (e) Our place on accept queue. */ | ||||
TAILQ_ENTRY(socket) so_list; | TAILQ_ENTRY(socket) so_list; | ||||
struct socket *so_listen; /* (b) */ | struct socket *so_listen; /* (b) */ | ||||
enum { | enum socket_qstate so_qstate; /* (b) */ | ||||
SQ_NONE = 0, | |||||
SQ_INCOMP = 0x0800, /* on sol_incomp */ | |||||
SQ_COMP = 0x1000, /* on sol_comp */ | |||||
} so_qstate; /* (b) */ | |||||
/* (b) cached MAC label for peer */ | /* (b) cached MAC label for peer */ | ||||
struct label *so_peerlabel; | struct label *so_peerlabel; | ||||
u_long so_oobmark; /* chars to oob mark */ | u_long so_oobmark; /* chars to oob mark */ | ||||
}; | }; | ||||
/* | /* | ||||
* Listening socket, where accepts occur, is so_listen in all | * Listening socket, where accepts occur, is so_listen in all | ||||
* subsidiary sockets. If so_listen is NULL, socket is not | * subsidiary sockets. If so_listen is NULL, socket is not | ||||
* related to an accept. For a listening socket itself | * related to an accept. For a listening socket itself | ||||
▲ Show 20 Lines • Show All 388 Lines • Show Last 20 Lines |