/* Create a new socket, initialise the fields It is the responsibility of the caller to insque() it into the correct linked-list  */
struct socket* socreate(Slirp *slirp)
/* Create a new socket, initialise the fields It is the responsibility of the caller to insque() it into the correct linked-list  */
struct socket* socreate(Slirp *slirp)
{
  struct socket *so;
  so = (struct socket *)malloc(sizeof(struct socket));
  if(so) {
    memset(so, 0, sizeof(struct socket));
    so->so_state = SS_NOFDREF;
    so->s = -1;
    so->slirp = slirp;
    so->pollfds_idx = -1;
  }
  return(so);
}