}
}
+void sockpushdata(struct socket *sk, void *buf, size_t size)
+{
+ switch(sk->type)
+ {
+ case SOCK_STREAM:
+ sizebuf(&sk->inbuf.s.buf, &sk->inbuf.s.bufsize, sk->inbuf.s.datasize + size, 1, 1);
+ memmove(sk->inbuf.s.buf + size, sk->inbuf.s.buf, sk->inbuf.s.datasize);
+ memcpy(sk->inbuf.s.buf, buf, size);
+ sk->inbuf.s.datasize += size;
+ break;
+ case SOCK_DGRAM:
+ /* XXX */
+ break;
+ }
+ return;
+}
+
void *sockgetinbuf(struct socket *sk, size_t *size)
{
void *buf;
int getpublicaddr(int af, struct sockaddr **addr, socklen_t *lenbuf);
int socksettos(struct socket *sk, int tos);
char *formataddress(struct sockaddr *arg, socklen_t arglen);
+void sockpushdata(struct socket *sk, void *buf, size_t size);
#endif