Changeset 14476 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Nov 21, 2008 4:54:24 PM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/debug.c
r14470 r14476 30 30 #endif 31 31 32 #if 033 /*34 * Statistic routines35 *36 * These will print statistics to the screen, the debug file (dfd), or37 * a buffer, depending on "type", so that the stats can be sent over38 * the link as well.39 */40 41 void42 ttystats(ttyp)43 struct ttys *ttyp;44 {45 struct slirp_ifstats *is = &ttyp->ifstats;46 char buff[512];47 48 lprint(" \r\n");49 50 if (if_comp & IF_COMPRESS)51 strcpy(buff, "on");52 else if (if_comp & IF_NOCOMPRESS)53 strcpy(buff, "off");54 else55 strcpy(buff, "off (for now)");56 lprint("Unit %d:\r\n", ttyp->unit);57 lprint(" using %s encapsulation (VJ compression is %s)\r\n", (58 #ifdef USE_PPP59 ttyp->proto==PROTO_PPP?"PPP":60 #endif61 "SLIP"), buff);62 lprint(" %d baudrate\r\n", ttyp->baud);63 lprint(" interface is %s\r\n", ttyp->up?"up":"down");64 lprint(" using fd %d, guardian pid is %d\r\n", ttyp->fd, ttyp->pid);65 #ifndef FULL_BOLT66 lprint(" towrite is %d bytes\r\n", ttyp->towrite);67 #endif68 if (ttyp->zeros)69 lprint(" %d zeros have been typed\r\n", ttyp->zeros);70 else if (ttyp->ones)71 lprint(" %d ones have been typed\r\n", ttyp->ones);72 lprint("Interface stats:\r\n");73 lprint(" %6d output packets sent (%d bytes)\r\n", is->out_pkts, is->out_bytes);74 lprint(" %6d output packets dropped (%d bytes)\r\n", is->out_errpkts, is->out_errbytes);75 lprint(" %6d input packets received (%d bytes)\r\n", is->in_pkts, is->in_bytes);76 lprint(" %6d input packets dropped (%d bytes)\r\n", is->in_errpkts, is->in_errbytes);77 lprint(" %6d bad input packets\r\n", is->in_mbad);78 }79 80 void81 allttystats()82 {83 struct ttys *ttyp;84 85 for (ttyp = ttys; ttyp; ttyp = ttyp->next)86 ttystats(ttyp);87 }88 #endif89 32 90 33 void … … 112 55 } 113 56 114 #if 0115 void116 vjstats()117 {118 lprint(" \r\n");119 120 lprint("VJ compression stats:\r\n");121 122 lprint(" %6d outbound packets (%d compressed)\r\n",123 comp_s.sls_packets, comp_s.sls_compressed);124 lprint(" %6d searches for connection stats (%d misses)\r\n",125 comp_s.sls_searches, comp_s.sls_misses);126 lprint(" %6d inbound uncompressed packets\r\n", comp_s.sls_uncompressedin);127 lprint(" %6d inbound compressed packets\r\n", comp_s.sls_compressedin);128 lprint(" %6d inbound unknown type packets\r\n", comp_s.sls_errorin);129 lprint(" %6d inbound packets tossed due to error\r\n", comp_s.sls_tossed);130 }131 #endif132 57 133 58 void -
trunk/src/VBox/Devices/Network/slirp/debug.h
r14470 r14476 63 63 64 64 void debug_init _P((char *, int)); 65 /*void ttystats _P((struct ttys *)); */66 void allttystats _P((void));67 65 void ipstats _P((PNATState)); 68 66 void tcpstats _P((PNATState)); -
trunk/src/VBox/Devices/Network/slirp/if.h
r14470 r14476 30 30 #define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm)) 31 31 32 /* Interface statistics */33 struct slirp_ifstats {34 u_int out_pkts; /* Output packets */35 u_int out_bytes; /* Output bytes */36 u_int out_errpkts; /* Output Error Packets */37 u_int out_errbytes; /* Output Error Bytes */38 u_int in_pkts; /* Input packets */39 u_int in_bytes; /* Input bytes */40 u_int in_errpkts; /* Input Error Packets */41 u_int in_errbytes; /* Input Error Bytes */42 43 u_int bytes_saved; /* Number of bytes that compression "saved" */44 /* ie: number of bytes that didn't need to be sent over the link45 * because of compression */46 47 u_int in_mbad; /* Bad incoming packets */48 };49 50 32 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r14470 r14476 379 379 { 380 380 struct socket *so, *so_next; 381 struct timeval timeout;382 381 int nfds; 383 int tmp_time;384 382 #if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS) 385 383 int rc; … … 571 569 } 572 570 573 /*574 * Setup timeout to use minimum CPU usage, especially when idle575 */576 577 /*578 * First, see the timeout needed by *timo579 */580 timeout.tv_sec = 0;581 timeout.tv_usec = -1;582 /*583 * If a slowtimo is needed, set timeout to 500ms from the last584 * slow timeout. If a fast timeout is needed, set timeout within585 * 200ms of when it was requested.586 */587 if (do_slowtimo) {588 /* XXX + 10000 because some select()'s aren't that accurate */589 timeout.tv_usec = ((500 - (curtime - last_slowtimo)) * 1000) + 10000;590 if (timeout.tv_usec < 0)591 timeout.tv_usec = 0;592 else if (timeout.tv_usec > 510000)593 timeout.tv_usec = 510000;594 595 /* Can only fasttimo if we also slowtimo */596 if (time_fasttimo) {597 tmp_time = (200 - (curtime - time_fasttimo)) * 1000;598 if (tmp_time < 0)599 tmp_time = 0;600 601 /* Choose the smallest of the 2 */602 if (tmp_time < timeout.tv_usec)603 timeout.tv_usec = (u_int)tmp_time;604 }605 }606 571 #if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS) 607 572 *pnfds = nfds; -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r14470 r14476 421 421 int iss = 0; 422 422 u_long tiwin; 423 int ret;424 423 /* int ts_present = 0; */ 425 424 int mbuf_freed = 0;
Note:
See TracChangeset
for help on using the changeset viewer.