VirtualBox

Ignore:
Timestamp:
Jan 31, 2009 7:16:03 AM (16 years ago)
Author:
vboxsync
Message:

NAT:MT

  1. slirp queue inroduced
  2. main points of thread interactions are saved with critical sections
  3. slirp polling routine and timers communicates with NAT guest IO thread via queue

TODO: not works well, not compilable on Unixes.

File:
1 edited

Legend:

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

    r15683 r16443  
    185185    char buff[256];
    186186    int n;
    187     struct socket *so;
     187    struct socket *so, *so_next;
    188188
    189189    lprint(" \n");
     
    192192           "Proto[state]     Sock     Local Address, Port  Remote Address, Port RecvQ SendQ\n");
    193193
    194     for (so = tcb.so_next; so != &tcb; so = so->so_next)
    195     {
     194    QSOCKET_FOREACH(so, so_next, tcp)
     195    /* { */
    196196        n = sprintf(buff, "tcp[%s]", so->so_tcpcb?tcpstates[so->so_tcpcb->t_state]:"NONE");
    197197        while (n < 17)
     
    203203                inet_ntoa(so->so_faddr), ntohs(so->so_fport),
    204204                so->so_rcv.sb_cc, so->so_snd.sb_cc);
     205    LOOP_LABEL(tcp, so, so_next);
    205206    }
    206207
    207     for (so = udb.so_next; so != &udb; so = so->so_next)
    208     {
     208    QSOCKET_FOREACH(so, so_next, udp)
     209    /* { */
    209210        n = sprintf(buff, "udp[%d sec]", (so->so_expire - curtime) / 1000);
    210211        while (n < 17)
     
    216217                inet_ntoa(so->so_faddr), ntohs(so->so_fport),
    217218                so->so_rcv.sb_cc, so->so_snd.sb_cc);
     219    LOOP_LABEL(udp, so, so_next);
    218220    }
    219221}
     
    248250
    249251    AssertReturn(strcmp(pszType, "natsock") == 0, 0);
    250 
     252    if (so->so_state == SS_NOFDREF || so->s == -1)
     253        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket SS_NODREF");
    251254    status = getsockname(so->s, &addr, &socklen);
    252255
     
    257260            "state=%04x ip=" IP4_ADDR_PRINTF_FORMAT ":%d name=" IP4_ADDR_PRINTF_FORMAT ":%d",
    258261            so->s, so->so_type, so->so_state, IP4_ADDR_PRINTF_DECOMP(ip), ntohs(so->so_fport),
    259             IP4_ADDR_PRINTF_DECOMP(((struct sockaddr_in *)&addr)->sin_addr.s_addr),
     262            IP4_ADDR_PRINTF_DECOMP(ntohl(((struct sockaddr_in *)&addr)->sin_addr.s_addr)),
    260263            ntohs(((struct sockaddr_in *)&addr)->sin_port));
    261264}
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