misc.c revision a95f70d764c350a95ff9d107e71590a65f19d5b0
/*
* Copyright (c) 1995 Danny Gasparovski.
*
* Please read the file COPYRIGHT for the
* terms and conditions of the copyright.
*/
#define WANT_SYS_IOCTL_H
#include <slirp.h>
#ifndef HAVE_INET_ATON
int
{
if (addr == 0xffffffff)
return 0;
return 1;
}
#endif
/*
* Get our IP address and put it in our_addr
*/
void
{
}
struct quehead
{
};
void
{
}
void
{
/* element->qh_link = NULL; TCP FIN1 crashes if you do this. Why ? */
}
int
{
/* First, check if the port is "bound" */
{
return -1;
}
return 0;
}
/*
* Set fd blocking and non-blocking
*/
void
fd_nonblock(int fd)
{
#ifdef FIONBIO
int opt = 1;
#else
int opt;
opt |= O_NONBLOCK;
#endif
}
void
{
#ifdef FIONBIO
int opt = 0;
#else
int opt;
opt &= ~O_NONBLOCK;
#endif
}
#ifdef VBOX_WITH_SLIRP_BSD_MBUF
#define ITEM_MAGIC 0xdead0001
struct item
{
};
#define ZONE_MAGIC 0xdead0002
struct uma_zone
{
const char *name;
int max_items;
int cur_items;
void *area;
};
{
int cChunk;
int i;
{
return (void *)&it[1];
}
{
/* We're on master zone and we cant allocate more */
return NULL;
}
/* we're on sub-zone we need get chunk of master zone and split
* it for sub-zone conforming chunks.
*/
{
/*No room on master*/
return NULL;
}
/* it's chunk descriptor of master zone we should remove it
* from the master list first
*/
/*@todo should we alter count of master counters ?*/
/*@todo '+ zone->size' should be depend on flag */
goto free_list_check;
}
{
}
{
return zone;
}
{
#if 0
#endif
return NULL;
return zone;
}
{
int i = 0;
for (; i < max; ++i)
{
}
}
{
}
{
}
{
/*@todo (vvl) this function supposed to work with special zone storing
reference counters */
/* for returning pointer to counter we need get 0 elemnt */
}
{
void *mem;
return NULL;
return mem;
}
{
}
{
return;
{
return;
}
}
{
return 0;
}
{
}
{
/*@todo (r=vvl) make it wiser*/
}
{
return NULL;
}
{
struct mbuf *m;
else if (cbMin < MJUM9BYTES)
size = MJUM9BYTES;
else if (cbMin < MJUM16BYTES)
size = MJUM16BYTES;
else
AssertMsgFailed(("Unsupported size"));
return m;
}
{
}
{
if (zone->master_zone)
}
{
/*@todo do finalize here.*/
}
#endif /* VBOX_WITH_SLIRP_BSD_MBUF */