VirtualBox

Changeset 37744 in vbox for trunk


Ignore:
Timestamp:
Jul 4, 2011 4:55:43 AM (13 years ago)
Author:
vboxsync
Message:

NAT/debug: introduces %R[sbuf] prints sbuf fields' values.

File:
1 edited

Legend:

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

    r37742 r37744  
    335335    AssertReturn(RTStrCmp(pszType, "tcpstate") == 0, 0);
    336336    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s", pszTcpStateName);
     337    return cb;
     338}
     339
     340/*
     341 * Prints sbuf state
     342 */
     343static DECLCALLBACK(size_t)
     344printSbuf(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     345                 const char *pszType, void const *pvValue,
     346                 int cchWidth, int cchPrecision, unsigned fFlags,
     347                 void *pvUser)
     348{
     349    size_t cb = 0;
     350    const struct sbuf *sb = (struct sbuf *)pvValue;
     351    AssertReturn(RTStrCmp(pszType, "sbuf") == 0, 0);
     352    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "[sbuf:%p cc:%d, datalen:%d, wprt:%p, rptr:%p data:%p]",
     353                      sb, sb->sb_cc, sb->sb_datalen, sb->sb_wptr, sb->sb_rptr, sb->sb_data);
    337354    return cb;
    338355}
     
    407424        rc = RTStrFormatTypeRegister("tcpstate", printTcpState, NULL);
    408425        AssertRC(rc);
     426        rc = RTStrFormatTypeRegister("sbuf", printSbuf, NULL);
     427        AssertRC(rc);
    409428        g_fFormatRegistered = 1;
    410429    }
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