VirtualBox

Changeset 19802 in vbox


Ignore:
Timestamp:
May 19, 2009 6:16:26 AM (16 years ago)
Author:
vboxsync
Message:

NAT: line lenght: 80

File:
1 edited

Legend:

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

    r16448 r19802  
    246246    uint32_t ip;
    247247    struct sockaddr addr;
     248    struct sockaddr_in *in_addr;
    248249    socklen_t socklen = sizeof(struct sockaddr);
    249250    int status = 0;
     
    251252    AssertReturn(strcmp(pszType, "natsock") == 0, 0);
    252253    if (so == NULL)
    253         return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket is null");
     254        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
     255                "socket is null");
    254256    if (so->so_state == SS_NOFDREF || so->s == -1)
    255         return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket(%d) SS_NODREF",so->s);
     257        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
     258                "socket(%d) SS_NODREF",so->s);
    256259    status = getsockname(so->s, &addr, &socklen);
    257260
    258261    if(status != 0 || addr.sa_family != AF_INET)
    259262    {
    260         return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket(%d) is invalid(probably closed)",so->s);
    261     }
    262 
     263        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
     264                "socket(%d) is invalid(probably closed)",so->s);
     265    }
     266
     267    in_addr = (struct sockaddr_in *)&addr;
    263268    ip = ntohl(so->so_faddr.s_addr);
    264269    return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket %4d:(proto:%u) "
    265             "state=%04x ip=" IP4_ADDR_PRINTF_FORMAT ":%d name=" IP4_ADDR_PRINTF_FORMAT ":%d",
    266             so->s, so->so_type, so->so_state, IP4_ADDR_PRINTF_DECOMP(ip), ntohs(so->so_fport),
    267             IP4_ADDR_PRINTF_DECOMP(ntohl(((struct sockaddr_in *)&addr)->sin_addr.s_addr)),
    268             ntohs(((struct sockaddr_in *)&addr)->sin_port));
     270            "state=%04x ip=" IP4_ADDR_PRINTF_FORMAT ":%d "
     271            "name=" IP4_ADDR_PRINTF_FORMAT ":%d",
     272            so->s, so->so_type, so->so_state, IP4_ADDR_PRINTF_DECOMP(ip),
     273            ntohs(so->so_fport),
     274            IP4_ADDR_PRINTF_DECOMP(ntohl(in_addr->sin_addr.s_addr)),
     275            ntohs(in_addr->sin_port));
    269276}
    270277
     
    282289    AssertReturn(strcmp(pszType, "natwinnetevents") == 0, 0);
    283290
    284     cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "events=%02x (", pNetworkEvents->lNetworkEvents);
     291    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "events=%02x (",
     292            pNetworkEvents->lNetworkEvents);
    285293# define DO_BIT(bit) \
    286     if (pNetworkEvents->lNetworkEvents & FD_ ## bit) \
    287     { \
    288         cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s" #bit "(%d)", \
    289                           fDelim ? "," : "", pNetworkEvents->iErrorCode[FD_ ## bit ## _BIT]); \
    290         fDelim = true; \
     294    if (pNetworkEvents->lNetworkEvents & FD_ ## bit)                        \
     295    {                                                                       \
     296        cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,                  \
     297              "%s" #bit "(%d)", fDelim ? "," : "",                          \
     298              pNetworkEvents->iErrorCode[FD_ ## bit ## _BIT]);              \
     299        fDelim = true;                                                      \
    291300    }
    292301    DO_BIT(READ);
     
    325334    {
    326335        /*
    327          * XXX Move this to IPRT using RTNETADDRIPV4. Use the specifier %RNAipv4.
     336         * XXX(r - frank): Move this to IPRT using RTNETADDRIPV4.
     337         * Use the specifier %RNAipv4.
    328338         */
    329339        rc = RTStrFormatTypeRegister("IP4", print_ipv4_address, NULL);
     
    331341        rc = RTStrFormatTypeRegister("natsock", print_socket, NULL);
    332342        AssertRC(rc);
    333         rc = RTStrFormatTypeRegister("natwinnetevents", print_networkevents, NULL);
     343        rc = RTStrFormatTypeRegister("natwinnetevents",
     344            print_networkevents, NULL);
    334345        AssertRC(rc);
    335346        g_fFormatRegistered = 1;
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