VirtualBox

Changeset 14476 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Nov 21, 2008 4:54:24 PM (16 years ago)
Author:
vboxsync
Message:

slirp: more dead code

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/debug.c

    r14470 r14476  
    3030#endif
    3131
    32 #if 0
    33 /*
    34  * Statistic routines
    35  *
    36  * These will print statistics to the screen, the debug file (dfd), or
    37  * a buffer, depending on "type", so that the stats can be sent over
    38  * the link as well.
    39  */
    40 
    41 void
    42 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         else
    55            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_PPP
    59                ttyp->proto==PROTO_PPP?"PPP":
    60 #endif
    61                "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_BOLT
    66         lprint("  towrite is %d bytes\r\n", ttyp->towrite);
    67 #endif
    68         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 void
    81 allttystats()
    82 {
    83         struct ttys *ttyp;
    84 
    85         for (ttyp = ttys; ttyp; ttyp = ttyp->next)
    86            ttystats(ttyp);
    87 }
    88 #endif
    8932
    9033void
     
    11255}
    11356
    114 #if 0
    115 void
    116 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 #endif
    13257
    13358void
  • trunk/src/VBox/Devices/Network/slirp/debug.h

    r14470 r14476  
    6363
    6464void debug_init _P((char *, int));
    65 /*void ttystats _P((struct ttys *)); */
    66 void allttystats _P((void));
    6765void ipstats _P((PNATState));
    6866void tcpstats _P((PNATState));
  • trunk/src/VBox/Devices/Network/slirp/if.h

    r14470 r14476  
    3030#define ifs_init(ifm) ((ifm)->ifs_next = (ifm)->ifs_prev = (ifm))
    3131
    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 link
    45                                  * because of compression */
    46        
    47         u_int in_mbad;          /* Bad incoming packets */
    48 };
    49 
    5032#endif
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r14470 r14476  
    379379{
    380380    struct socket *so, *so_next;
    381     struct timeval timeout;
    382381    int nfds;
    383     int tmp_time;
    384382#if defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) && defined(RT_OS_WINDOWS)
    385383    int rc;
     
    571569        }
    572570
    573         /*
    574          * Setup timeout to use minimum CPU usage, especially when idle
    575          */
    576 
    577         /*
    578          * First, see the timeout needed by *timo
    579          */
    580         timeout.tv_sec = 0;
    581         timeout.tv_usec = -1;
    582         /*
    583          * If a slowtimo is needed, set timeout to 500ms from the last
    584          * slow timeout. If a fast timeout is needed, set timeout within
    585          * 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         }
    606571#if !defined(VBOX_WITH_SIMPLIFIED_SLIRP_SYNC) || !defined(RT_OS_WINDOWS)
    607572        *pnfds = nfds;
  • trunk/src/VBox/Devices/Network/slirp/tcp_input.c

    r14470 r14476  
    421421        int iss = 0;
    422422        u_long tiwin;
    423         int ret;
    424423/*      int ts_present = 0; */
    425424        int mbuf_freed = 0;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette