Changeset 14882 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 2, 2008 6:12:45 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/debug.c
r14476 r14882 8 8 9 9 #include <slirp.h> 10 #include <iprt/string.h> 11 #include <iprt/stream.h> 10 12 11 13 … … 215 217 } 216 218 } 217 219 static size_t 220 print_ipv4_address(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, 221 const char *pszType, void const *pvValue, 222 int cchWidth, int cchPrecision, unsigned fFlags, 223 void *pvUser) 224 { 225 uint32_t ip; 226 size_t cch = 0; 227 size_t cchNum = 0; 228 char szNum[64]; 229 if (strncmp(pszType, "IP4", 3) != 0) { 230 RTPrintf("%s: IP4 expected\n", __FUNCTION__); 231 } 232 ip = (uint32_t)pvValue; 233 234 cchNum = RTStrFormatNumber(szNum, ip & ((1 << 8) - 1), 0, cchWidth, cchPrecision, fFlags); 235 cch += pfnOutput(pvArgOutput, szNum, cchNum); 236 cch += pfnOutput(pvArgOutput, ".", 1); 237 238 cchNum = RTStrFormatNumber(szNum, (ip >> 8) & ((1 << 8) - 1), 0, cchWidth, cchPrecision, fFlags); 239 cch += pfnOutput(pvArgOutput, szNum, cchNum); 240 cch += pfnOutput(pvArgOutput, ".", 1); 241 242 cchNum = RTStrFormatNumber(szNum, (ip >> 16) & ((1 << 8) - 1), 0, cchWidth, cchPrecision, fFlags); 243 cch += pfnOutput(pvArgOutput, szNum, cchNum); 244 cch += pfnOutput(pvArgOutput, ".", 1); 245 246 cchNum = RTStrFormatNumber(szNum, (ip >> 24) & ((1 << 8) - 1), 0, cchWidth, cchPrecision, fFlags); 247 cch += pfnOutput(pvArgOutput, szNum, cchNum); 248 return (cch); 249 } 250 251 int 252 debug_init() 253 { 254 int status = VINF_SUCCESS; 255 status = RTStrFormatTypeRegister("IP4", print_ipv4_address, NULL); 256 AssertRC(status); 257 return (status); 258 } -
trunk/src/VBox/Devices/Network/slirp/debug.h
r14476 r14882 62 62 #endif /* !LOG_ENABLED */ 63 63 64 void debug_init _P((char *, int));64 int debug_init _P((void)); 65 65 void ipstats _P((PNATState)); 66 66 void tcpstats _P((PNATState)); -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r14642 r14882 243 243 link_up = 1; 244 244 245 debug_init(); 245 246 if_init(pData); 246 247 ip_init(pData);
Note:
See TracChangeset
for help on using the changeset viewer.