Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/sockbuf.h
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
#define SB_NOINTR 0x40 /* operations not interruptible */ | #define SB_NOINTR 0x40 /* operations not interruptible */ | ||||
#define SB_AIO 0x80 /* AIO operations queued */ | #define SB_AIO 0x80 /* AIO operations queued */ | ||||
#define SB_KNOTE 0x100 /* kernel note attached */ | #define SB_KNOTE 0x100 /* kernel note attached */ | ||||
#define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ | #define SB_NOCOALESCE 0x200 /* don't coalesce new data into existing mbufs */ | ||||
#define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */ | #define SB_IN_TOE 0x400 /* socket buffer is in the middle of an operation */ | ||||
#define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ | #define SB_AUTOSIZE 0x800 /* automatically size socket buffer */ | ||||
#define SB_STOP 0x1000 /* backpressure indicator */ | #define SB_STOP 0x1000 /* backpressure indicator */ | ||||
#define SB_AIO_RUNNING 0x2000 /* AIO operation running */ | #define SB_AIO_RUNNING 0x2000 /* AIO operation running */ | ||||
#define SB_TLS_IFNET 0x4000 /* has used / is using ifnet KTLS */ | |||||
#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 */ | ||||
#if defined(_KERNEL) || defined(_WANT_SOCKET) | #if defined(_KERNEL) || defined(_WANT_SOCKET) | ||||
#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 */ | ||||
struct ktls_session; | |||||
struct mbuf; | struct mbuf; | ||||
struct sockaddr; | struct sockaddr; | ||||
struct socket; | struct socket; | ||||
struct thread; | struct thread; | ||||
struct selinfo; | struct selinfo; | ||||
/* | /* | ||||
* 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(). | ||||
* (b) locked by sblock() | |||||
*/ | */ | ||||
struct sockbuf { | struct sockbuf { | ||||
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 */ | 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 */ | ||||
u_int sb_sndptroff; /* (a) byte offset of ptr into chain */ | u_int sb_sndptroff; /* (a) byte offset of ptr into chain */ | ||||
u_int sb_acc; /* (a) available chars in buffer */ | u_int sb_acc; /* (a) available chars in buffer */ | ||||
u_int sb_ccc; /* (a) claimed chars in buffer */ | u_int sb_ccc; /* (a) claimed chars in buffer */ | ||||
u_int sb_hiwat; /* (a) max actual char count */ | u_int sb_hiwat; /* (a) max actual char count */ | ||||
u_int sb_mbcnt; /* (a) chars of mbufs used */ | u_int sb_mbcnt; /* (a) chars of mbufs used */ | ||||
u_int sb_mcnt; /* (a) number of mbufs in buffer */ | u_int sb_mcnt; /* (a) number of mbufs in buffer */ | ||||
u_int sb_ccnt; /* (a) number of clusters in buffer */ | u_int sb_ccnt; /* (a) number of clusters in buffer */ | ||||
u_int sb_mbmax; /* (a) max chars of mbufs to use */ | u_int sb_mbmax; /* (a) max chars of mbufs to use */ | ||||
u_int sb_ctl; /* (a) non-data chars in buffer */ | u_int sb_ctl; /* (a) non-data chars in buffer */ | ||||
int sb_lowat; /* (a) low water mark */ | int sb_lowat; /* (a) low water mark */ | ||||
sbintime_t sb_timeo; /* (a) timeout for read/write */ | sbintime_t sb_timeo; /* (a) timeout for read/write */ | ||||
uint64_t sb_tls_seqno; /* (a) TLS seqno */ | |||||
struct ktls_session *sb_tls_info; /* (a + b) TLS state */ | |||||
short sb_flags; /* (a) flags, see above */ | short sb_flags; /* (a) flags, see above */ | ||||
int (*sb_upcall)(struct socket *, void *, int); /* (a) */ | int (*sb_upcall)(struct socket *, void *, int); /* (a) */ | ||||
void *sb_upcallarg; /* (a) */ | void *sb_upcallarg; /* (a) */ | ||||
TAILQ_HEAD(, kaiocb) sb_aiojobq; /* (a) pending AIO ops */ | TAILQ_HEAD(, kaiocb) sb_aiojobq; /* (a) pending AIO ops */ | ||||
struct task sb_aiotask; /* AIO task */ | struct task sb_aiotask; /* AIO task */ | ||||
}; | }; | ||||
#endif /* defined(_KERNEL) || defined(_WANT_SOCKET) */ | #endif /* defined(_KERNEL) || defined(_WANT_SOCKET) */ | ||||
▲ Show 20 Lines • Show All 143 Lines • Show Last 20 Lines |