diff options
Diffstat (limited to 'sys/sys/socketvar.h')
| -rw-r--r-- | sys/sys/socketvar.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 1bc4c339ec40..2b0a0cb1511b 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -102,6 +102,9 @@ struct socket { struct selinfo sb_sel; /* process selecting read/write */ #define sb_startzero sb_mb struct mbuf *sb_mb; /* the mbuf chain */ + struct mbuf *sb_mbtail; /* the last mbuf in the chain */ + struct mbuf *sb_lastrecord; /* first mbuf of last record in + * socket buffer */ u_int sb_cc; /* actual chars in buffer */ u_int sb_hiwat; /* max actual char count */ u_int sb_mbcnt; /* chars of mbufs used */ @@ -137,6 +140,13 @@ struct socket { } *so_accf; }; +#define SB_EMPTY_FIXUP(sb) do { \ + if ((sb)->sb_mb == NULL) { \ + (sb)->sb_mbtail = NULL; \ + (sb)->sb_lastrecord = NULL; \ + } \ +} while (/*CONSTCOND*/0) + /* * Socket state bits. */ @@ -353,6 +363,7 @@ struct sockaddr *dup_sockaddr(struct sockaddr *sa, int canwait); int sockargs(struct mbuf **mp, caddr_t buf, int buflen, int type); int getsockaddr(struct sockaddr **namp, caddr_t uaddr, size_t len); void sbappend(struct sockbuf *sb, struct mbuf *m); +void sbappendstream(struct sockbuf *sb, struct mbuf *m); int sbappendaddr(struct sockbuf *sb, struct sockaddr *asa, struct mbuf *m0, struct mbuf *control); int sbappendcontrol(struct sockbuf *sb, struct mbuf *m0, @@ -422,6 +433,17 @@ int soshutdown(struct socket *so, int how); void sotoxsocket(struct socket *so, struct xsocket *xso); void sowakeup(struct socket *so, struct sockbuf *sb); +#ifdef SOCKBUF_DEBUG +void sblastrecordchk(struct sockbuf *, const char *, int); +#define SBLASTRECORDCHK(sb) sblastrecordchk((sb), __FILE__, __LINE__) + +void sblastmbufchk(struct sockbuf *, const char *, int); +#define SBLASTMBUFCHK(sb) sblastmbufchk((sb), __FILE__, __LINE__) +#else +#define SBLASTRECORDCHK(sb) /* nothing */ +#define SBLASTMBUFCHK(sb) /* nothing */ +#endif /* SOCKBUF_DEBUG */ + /* * Accept filter functions (duh). */ |
