Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/socketvar.h
Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | struct socket { | ||||
int so_options; /* (b) from socket call, see socket.h */ | int so_options; /* (b) from socket call, see socket.h */ | ||||
short so_linger; /* time to linger close(2) */ | short so_linger; /* time to linger close(2) */ | ||||
short so_state; /* (b) internal state flags SS_* */ | short so_state; /* (b) internal state flags SS_* */ | ||||
void *so_pcb; /* protocol control block */ | void *so_pcb; /* protocol control block */ | ||||
struct vnet *so_vnet; /* (a) network stack instance */ | struct vnet *so_vnet; /* (a) network stack instance */ | ||||
struct protosw *so_proto; /* (a) protocol handle */ | struct protosw *so_proto; /* (a) protocol handle */ | ||||
short so_timeo; /* (g) connection timeout */ | short so_timeo; /* (g) connection timeout */ | ||||
u_short so_error; /* (f) error affecting connection */ | u_short so_error; /* (f) error affecting connection */ | ||||
u_short so_rerror; /* (f) error affecting connection */ | |||||
struct sigio *so_sigio; /* [sg] information for async I/O or | struct sigio *so_sigio; /* [sg] information for async I/O or | ||||
out of band data (SIGURG) */ | out of band data (SIGURG) */ | ||||
struct ucred *so_cred; /* (a) user credentials */ | struct ucred *so_cred; /* (a) user credentials */ | ||||
struct label *so_label; /* (b) MAC label for socket */ | struct label *so_label; /* (b) MAC label for socket */ | ||||
/* NB: generation count must not be first. */ | /* NB: generation count must not be first. */ | ||||
so_gen_t so_gencnt; /* (h) generation count */ | so_gen_t so_gencnt; /* (h) generation count */ | ||||
void *so_emuldata; /* (b) private data for emulators */ | void *so_emuldata; /* (b) private data for emulators */ | ||||
so_dtor_t *so_dtor; /* (b) optional destructor */ | so_dtor_t *so_dtor; /* (b) optional destructor */ | ||||
▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | #define sb_notify(sb) (((sb)->sb_flags & (SB_WAIT | SB_SEL | SB_ASYNC | \ | ||||
SB_UPCALL | SB_AIO | SB_KNOTE)) != 0) | SB_UPCALL | SB_AIO | SB_KNOTE)) != 0) | ||||
/* do we have to send all at once on a socket? */ | /* do we have to send all at once on a socket? */ | ||||
#define sosendallatonce(so) \ | #define sosendallatonce(so) \ | ||||
((so)->so_proto->pr_flags & PR_ATOMIC) | ((so)->so_proto->pr_flags & PR_ATOMIC) | ||||
/* can we read something from so? */ | /* can we read something from so? */ | ||||
#define soreadabledata(so) \ | #define soreadabledata(so) \ | ||||
(sbavail(&(so)->so_rcv) >= (so)->so_rcv.sb_lowat || (so)->so_error) | (sbavail(&(so)->so_rcv) >= (so)->so_rcv.sb_lowat || \ | ||||
(so)->so_error || (so)->so_rerror) | |||||
#define soreadable(so) \ | #define soreadable(so) \ | ||||
(soreadabledata(so) || ((so)->so_rcv.sb_state & SBS_CANTRCVMORE)) | (soreadabledata(so) || ((so)->so_rcv.sb_state & SBS_CANTRCVMORE)) | ||||
/* can we write something to so? */ | /* can we write something to so? */ | ||||
#define sowriteable(so) \ | #define sowriteable(so) \ | ||||
((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \ | ((sbspace(&(so)->so_snd) >= (so)->so_snd.sb_lowat && \ | ||||
(((so)->so_state&SS_ISCONNECTED) || \ | (((so)->so_state&SS_ISCONNECTED) || \ | ||||
((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \ | ((so)->so_proto->pr_flags&PR_CONNREQUIRED)==0)) || \ | ||||
▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | |||||
void soisconnected(struct socket *so); | void soisconnected(struct socket *so); | ||||
void soisconnecting(struct socket *so); | void soisconnecting(struct socket *so); | ||||
void soisdisconnected(struct socket *so); | void soisdisconnected(struct socket *so); | ||||
void soisdisconnecting(struct socket *so); | void soisdisconnecting(struct socket *so); | ||||
void socantrcvmore(struct socket *so); | void socantrcvmore(struct socket *so); | ||||
void socantrcvmore_locked(struct socket *so); | void socantrcvmore_locked(struct socket *so); | ||||
void socantsendmore(struct socket *so); | void socantsendmore(struct socket *so); | ||||
void socantsendmore_locked(struct socket *so); | void socantsendmore_locked(struct socket *so); | ||||
void soroverflow(struct socket *so); | |||||
void soroverflow_locked(struct socket *so); | |||||
/* | /* | ||||
* Accept filter functions (duh). | * Accept filter functions (duh). | ||||
*/ | */ | ||||
int accept_filt_add(struct accept_filter *filt); | int accept_filt_add(struct accept_filter *filt); | ||||
int accept_filt_del(char *name); | int accept_filt_del(char *name); | ||||
struct accept_filter *accept_filt_get(char *name); | struct accept_filter *accept_filt_get(char *name); | ||||
#ifdef ACCEPT_FILTER_MOD | #ifdef ACCEPT_FILTER_MOD | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |