Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/sockbuf.h
Show All 26 Lines | |||||
* SUCH DAMAGE. | * SUCH DAMAGE. | ||||
* | * | ||||
* @(#)socketvar.h 8.3 (Berkeley) 2/19/95 | * @(#)socketvar.h 8.3 (Berkeley) 2/19/95 | ||||
* | * | ||||
* $FreeBSD$ | * $FreeBSD$ | ||||
*/ | */ | ||||
#ifndef _SYS_SOCKBUF_H_ | #ifndef _SYS_SOCKBUF_H_ | ||||
#define _SYS_SOCKBUF_H_ | #define _SYS_SOCKBUF_H_ | ||||
#include <sys/selinfo.h> /* for struct selinfo */ | |||||
#include <sys/_lock.h> | #include <sys/_lock.h> | ||||
#include <sys/_mutex.h> | #include <sys/_mutex.h> | ||||
#include <sys/_sx.h> | #include <sys/_sx.h> | ||||
#include <sys/_task.h> | #include <sys/_task.h> | ||||
#define SB_MAX (2*1024*1024) /* default for max chars in sockbuf */ | #define SB_MAX (2*1024*1024) /* default for max chars in sockbuf */ | ||||
/* | /* | ||||
Show All 15 Lines | |||||
#define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */ | #define SBS_CANTSENDMORE 0x0010 /* can't send more data to peer */ | ||||
#define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ | #define SBS_CANTRCVMORE 0x0020 /* can't receive more data from peer */ | ||||
#define SBS_RCVATMARK 0x0040 /* at mark on input */ | #define SBS_RCVATMARK 0x0040 /* at mark on input */ | ||||
struct mbuf; | struct mbuf; | ||||
struct sockaddr; | struct sockaddr; | ||||
struct socket; | struct socket; | ||||
struct thread; | struct thread; | ||||
struct selinfo; | |||||
struct xsockbuf { | struct xsockbuf { | ||||
u_int sb_cc; | u_int sb_cc; | ||||
u_int sb_hiwat; | u_int sb_hiwat; | ||||
u_int sb_mbcnt; | u_int sb_mbcnt; | ||||
u_int sb_mcnt; | u_int sb_mcnt; | ||||
u_int sb_ccnt; | u_int sb_ccnt; | ||||
u_int sb_mbmax; | u_int sb_mbmax; | ||||
int sb_lowat; | int sb_lowat; | ||||
int sb_timeo; | int sb_timeo; | ||||
short sb_flags; | short sb_flags; | ||||
}; | }; | ||||
/* | /* | ||||
* Variables for socket buffering. | * Variables for socket buffering. | ||||
* | * | ||||
* Locking key to struct sockbuf: | * Locking key to struct sockbuf: | ||||
* (a) locked by SOCKBUF_LOCK(). | * (a) locked by SOCKBUF_LOCK(). | ||||
*/ | */ | ||||
struct sockbuf { | struct sockbuf { | ||||
struct selinfo sb_sel; /* process selecting read/write */ | |||||
struct mtx sb_mtx; /* sockbuf lock */ | struct mtx sb_mtx; /* sockbuf lock */ | ||||
struct sx sb_sx; /* prevent I/O interlacing */ | struct sx sb_sx; /* prevent I/O interlacing */ | ||||
struct selinfo *sb_sel; /* process selecting read/write */ | |||||
short sb_state; /* (a) socket state on sockbuf */ | short sb_state; /* (a) socket state on sockbuf */ | ||||
#define sb_startzero sb_mb | #define sb_startzero sb_mb | ||||
struct mbuf *sb_mb; /* (a) the mbuf chain */ | struct mbuf *sb_mb; /* (a) the mbuf chain */ | ||||
struct mbuf *sb_mbtail; /* (a) the last mbuf in the chain */ | struct mbuf *sb_mbtail; /* (a) the last mbuf in the chain */ | ||||
struct mbuf *sb_lastrecord; /* (a) first mbuf of last | struct mbuf *sb_lastrecord; /* (a) first mbuf of last | ||||
* record in socket buffer */ | * record in socket buffer */ | ||||
struct mbuf *sb_sndptr; /* (a) pointer into mbuf chain */ | struct mbuf *sb_sndptr; /* (a) pointer into mbuf chain */ | ||||
struct mbuf *sb_fnrdy; /* (a) pointer to first not ready buffer */ | struct mbuf *sb_fnrdy; /* (a) pointer to first not ready buffer */ | ||||
▲ Show 20 Lines • Show All 162 Lines • Show Last 20 Lines |