Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/sys/socketvar.h,v rcsdiff: /ftp/cvs/cvsroot/src/sys/sys/socketvar.h,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.51 retrieving revision 1.51.2.1 diff -u -p -r1.51 -r1.51.2.1 --- src/sys/sys/socketvar.h 2002/05/02 17:55:52 1.51 +++ src/sys/sys/socketvar.h 2002/07/15 10:37:16 1.51.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: socketvar.h,v 1.51 2002/05/02 17:55:52 thorpej Exp $ */ +/* $NetBSD: socketvar.h,v 1.51.2.1 2002/07/15 10:37:16 gehenna Exp $ */ /*- * Copyright (c) 1982, 1986, 1990, 1993 @@ -93,6 +93,9 @@ struct socket { 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_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 */ @@ -125,6 +128,14 @@ struct socket { struct mbuf *so_pendfree; /* loaned-page mbufs w/ frees pending */ }; +#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. */ @@ -266,6 +277,7 @@ int uipc_usrreq(struct socket *, int , s struct mbuf *, struct mbuf *, struct proc *); int uipc_ctloutput(int, struct socket *, int, int, 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, @@ -320,6 +332,17 @@ int sockargs(struct mbuf **, const void 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 */ #endif /* !_SYS_SOCKETVAR_H_ */