mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
slirp: Drop dead code
After all its years inside the qemu tree, there is no point in keeping the dead code paths of slirp. This patch is a first round of removing usually commented out code parts. More cleanups need to follow (and maybe finally a proper reindention). Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
6dbe553fe9
commit
0d62c4cfe2
26 changed files with 22 additions and 1650 deletions
80
slirp/if.c
80
slirp/if.c
|
@ -36,89 +36,9 @@ if_init(void)
|
|||
{
|
||||
if_fastq.ifq_next = if_fastq.ifq_prev = &if_fastq;
|
||||
if_batchq.ifq_next = if_batchq.ifq_prev = &if_batchq;
|
||||
// sl_compress_init(&comp_s);
|
||||
next_m = &if_batchq;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* This shouldn't be needed since the modem is blocking and
|
||||
* we don't expect any signals, but what the hell..
|
||||
*/
|
||||
inline int
|
||||
writen(fd, bptr, n)
|
||||
int fd;
|
||||
char *bptr;
|
||||
int n;
|
||||
{
|
||||
int ret;
|
||||
int total;
|
||||
|
||||
/* This should succeed most of the time */
|
||||
ret = send(fd, bptr, n,0);
|
||||
if (ret == n || ret <= 0)
|
||||
return ret;
|
||||
|
||||
/* Didn't write everything, go into the loop */
|
||||
total = ret;
|
||||
while (n > total) {
|
||||
ret = send(fd, bptr+total, n-total,0);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
total += ret;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
/*
|
||||
* if_input - read() the tty, do "top level" processing (ie: check for any escapes),
|
||||
* and pass onto (*ttyp->if_input)
|
||||
*
|
||||
* XXXXX Any zeros arriving by themselves are NOT placed into the arriving packet.
|
||||
*/
|
||||
#define INBUFF_SIZE 2048 /* XXX */
|
||||
void
|
||||
if_input(ttyp)
|
||||
struct ttys *ttyp;
|
||||
{
|
||||
u_char if_inbuff[INBUFF_SIZE];
|
||||
int if_n;
|
||||
|
||||
DEBUG_CALL("if_input");
|
||||
DEBUG_ARG("ttyp = %lx", (long)ttyp);
|
||||
|
||||
if_n = recv(ttyp->fd, (char *)if_inbuff, INBUFF_SIZE,0);
|
||||
|
||||
DEBUG_MISC((dfd, " read %d bytes\n", if_n));
|
||||
|
||||
if (if_n <= 0) {
|
||||
if (if_n == 0 || (errno != EINTR && errno != EAGAIN)) {
|
||||
if (ttyp->up)
|
||||
link_up--;
|
||||
tty_detached(ttyp, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (if_n == 1) {
|
||||
if (*if_inbuff == '0') {
|
||||
ttyp->ones = 0;
|
||||
if (++ttyp->zeros >= 5)
|
||||
slirp_exit(0);
|
||||
return;
|
||||
}
|
||||
if (*if_inbuff == '1') {
|
||||
ttyp->zeros = 0;
|
||||
if (++ttyp->ones >= 5)
|
||||
tty_detached(ttyp, 0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
ttyp->ones = ttyp->zeros = 0;
|
||||
|
||||
(*ttyp->if_input)(ttyp, if_inbuff, if_n);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* if_output: Queue packet into an output queue.
|
||||
* There are 2 output queue's, if_fastq and if_batchq.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue