* SUCH DAMAGE.
*
* from: @(#)uipc_socket2.c 7.17 (Berkeley) 5/4/91
- * $Id$
+ * $Id: uipc_socket2.c,v 1.3 1993/11/25 01:33:35 wollman Exp $
*/
#include "param.h"
*/
/* strings for sleep message: */
-char netio[] = "netio";
-char netcon[] = "netcon";
-char netcls[] = "netcls";
+const char netio[] = "netio";
+const char netcon[] = "netcon";
+const char netcls[] = "netcls";
u_long sb_max = SB_MAX; /* patchable */
* cause software-interrupt process scheduling.
*/
+void
soisconnecting(so)
register struct socket *so;
{
so->so_state |= SS_ISCONNECTING;
}
+void
soisconnected(so)
register struct socket *so;
{
}
}
+void
soisdisconnecting(so)
register struct socket *so;
{
sorwakeup(so);
}
+void
soisdisconnected(so)
register struct socket *so;
{
(void) soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat);
soqinsque(head, so, soqueue);
if ((*so->so_proto->pr_usrreq)(so, PRU_ATTACH,
- (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0)) {
+ (struct mbuf *)0, (struct mbuf *)0, (struct mbuf *)0,
+ (struct mbuf *)0)) {
(void) soqremque(so, soqueue);
(void) free((caddr_t)so, M_SOCKET);
return ((struct socket *)0);
return (so);
}
+void
soqinsque(head, so, q)
register struct socket *head, *so;
int q;
*prev = so;
}
+int
soqremque(so, q)
register struct socket *so;
int q;
* Data queued for reading in the socket may yet be read.
*/
+void
socantsendmore(so)
struct socket *so;
{
sowwakeup(so);
}
+void
socantrcvmore(so)
struct socket *so;
{
/*
* Queue a process for a select on a socket buffer.
*/
+void
sbselqueue(sb, cp)
struct sockbuf *sb;
struct proc *cp;
/*
* Wait for data to arrive at/drain from a socket buffer.
*/
+int
sbwait(sb)
struct sockbuf *sb;
{
* Lock a sockbuf already known to be locked;
* return any error returned from sleep (EINTR).
*/
+int
sb_lock(sb)
register struct sockbuf *sb;
{
* Do asynchronous notification via SIGIO
* if the socket has the SS_ASYNC flag set.
*/
+void
sowakeup(so, sb)
register struct socket *so;
register struct sockbuf *sb;
* should be released by calling sbrelease() when the socket is destroyed.
*/
+int
soreserve(so, sndcc, rcvcc)
register struct socket *so;
u_long sndcc, rcvcc;
* Attempt to scale mbmax so that mbcnt doesn't become limiting
* if buffering efficiency is near the normal case.
*/
+int
sbreserve(sb, cc)
struct sockbuf *sb;
u_long cc;
/*
* Free mbufs held by a socket, and reserved mbuf space.
*/
+void
sbrelease(sb)
struct sockbuf *sb;
{
* the mbuf chain is recorded in sb. Empty mbufs are
* discarded and mbufs are compacted where possible.
*/
+void
sbappend(sb, m)
struct sockbuf *sb;
struct mbuf *m;
* As above, except the mbuf chain
* begins a new record.
*/
+void
sbappendrecord(sb, m0)
register struct sockbuf *sb;
register struct mbuf *m0;
* is inserted at the beginning of the sockbuf,
* but after any other OOB data.
*/
+void
sbinsertoob(sb, m0)
register struct sockbuf *sb;
register struct mbuf *m0;
* m0 must include a packet header with total length.
* Returns 0 if no space in sockbuf or insufficient mbufs.
*/
+int
sbappendaddr(sb, asa, m0, control)
register struct sockbuf *sb;
struct sockaddr *asa;
return (1);
}
+int
sbappendcontrol(sb, m0, control)
struct sockbuf *sb;
struct mbuf *control, *m0;
* buffer sb following mbuf n. If n
* is null, the buffer is presumed empty.
*/
+void
sbcompress(sb, m, n)
register struct sockbuf *sb;
register struct mbuf *m, *n;
* Free all mbufs in a sockbuf.
* Check that all resources are reclaimed.
*/
+void
sbflush(sb)
register struct sockbuf *sb;
{
/*
* Drop data from (the front of) a sockbuf.
*/
+void
sbdrop(sb, len)
register struct sockbuf *sb;
register int len;
* Drop a record off the front of a sockbuf
* and move the next record to the front.
*/
+void
sbdroprecord(sb)
register struct sockbuf *sb;
{