diff options
author | Niels Provos <provos@cvs.openbsd.org> | 2002-08-08 19:12:34 +0000 |
---|---|---|
committer | Niels Provos <provos@cvs.openbsd.org> | 2002-08-08 19:12:34 +0000 |
commit | 902a09b2538c9089336c280bd19ec80dd9a56d83 (patch) | |
tree | a8a897cb086b80e0329e845974a15838bf69d3fa /sys | |
parent | 7523475543ac033d44426cc3af0dbf3f0422a0dc (diff) |
missed in last commit
Diffstat (limited to 'sys')
-rw-r--r-- | sys/sys/socketvar.h | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/sys/sys/socketvar.h b/sys/sys/socketvar.h index 3fc8db55c9b..500278148b6 100644 --- a/sys/sys/socketvar.h +++ b/sys/sys/socketvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: socketvar.h,v 1.28 2002/07/03 21:19:08 miod Exp $ */ +/* $OpenBSD: socketvar.h,v 1.29 2002/08/08 19:12:33 provos Exp $ */ /* $NetBSD: socketvar.h,v 1.18 1996/02/09 18:25:38 christos Exp $ */ /*- @@ -88,7 +88,10 @@ struct socket { u_long sb_mbcnt; /* chars of mbufs used */ u_long sb_mbmax; /* max chars of mbufs to use */ long sb_lowat; /* low water mark */ - struct mbuf *sb_mb; /* the mbuf chain */ + 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 */ struct selinfo sb_sel; /* process selecting read/write */ short sb_flags; /* flags, see below */ short sb_timeo; /* timeout for read/write */ @@ -109,6 +112,14 @@ struct socket { gid_t so_egid, so_rgid; }; +#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. */ @@ -237,6 +248,7 @@ int soo_stat(struct file *, struct stat *, struct proc *); int uipc_usrreq(struct socket *, int , struct mbuf *, struct mbuf *, struct mbuf *); 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, @@ -293,4 +305,15 @@ int sendit(struct proc *, int, struct msghdr *, int, register_t *); int recvit(struct proc *, int, struct msghdr *, caddr_t, register_t *); +#ifdef SOCKBUF_DEBUG +void sblastrecordchk(struct sockbuf *, const char *); +#define SBLASTRECORDCHK(sb, where) sblastrecordchk((sb), (where)) + +void sblastmbufchk(struct sockbuf *, const char *); +#define SBLASTMBUFCHK(sb, where) sblastmbufchk((sb), (where)) +#else +#define SBLASTRECORDCHK(sb, where) /* nothing */ +#define SBLASTMBUFCHK(sb, where) /* nothing */ +#endif /* SOCKBUF_DEBUG */ + #endif /* _KERNEL */ |