VirtualBox

Changeset 19838 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
May 19, 2009 6:55:08 PM (16 years ago)
Author:
vboxsync
Message:

NAT: Ether address debug printing

File:
1 edited

Legend:

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

    r19802 r19838  
    238238
    239239static DECLCALLBACK(size_t)
     240print_ether_address(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
     241                   const char *pszType, void const *pvValue,
     242                   int cchWidth, int cchPrecision, unsigned fFlags,
     243                   void *pvUser)
     244{
     245    char *ether = (char *)pvUser;
     246
     247    AssertReturn(strcmp(pszType, "ether") == 0, 0);
     248    if (ether != NULL)
     249        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0,
     250            "[ether %hhx:%hhx:%hhx:%hhx:%hhx:%hhx]",
     251            ether[0], ether[1], ether[2],
     252            ether[3], ether[4], ether[5]);
     253    else
     254        return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "[ether null]");
     255}
     256
     257static DECLCALLBACK(size_t)
    240258print_socket(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput,
    241259             const char *pszType, void const *pvValue,
     
    339357        rc = RTStrFormatTypeRegister("IP4", print_ipv4_address, NULL);
    340358        AssertRC(rc);
     359        rc = RTStrFormatTypeRegister("ether", print_ether_address, NULL);
     360        AssertRC(rc);
    341361        rc = RTStrFormatTypeRegister("natsock", print_socket, NULL);
    342362        AssertRC(rc);
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