Changeset 15238 in vbox
- Timestamp:
- Dec 10, 2008 10:37:57 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/debug.c
r15117 r15238 233 233 } 234 234 235 static DECLCALLBACK(size_t) 236 print_socket(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, 237 const char *pszType, void const *pvValue, 238 int cchWidth, int cchPrecision, unsigned fFlags, 239 void *pvUser) 240 { 241 struct socket *so = (struct socket*)pvValue; 242 uint32_t ip; 243 244 AssertReturn(strcmp(pszType, "natsock") == 0, 0); 245 246 ip = ntohl(so->so_faddr.s_addr); 247 return RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "socket %4d: state=%04x ip=%u.%u.%u.%u", 248 so->s, so->so_state, (ip >> 24), (ip >> 16) & 0xff, (ip >> 8) & 0xff, ip & 0xff); 249 } 250 235 251 int 236 252 debug_init() … … 247 263 rc = RTStrFormatTypeRegister("IP4", print_ipv4_address, NULL); 248 264 AssertRC(rc); 265 rc = RTStrFormatTypeRegister("natsock", print_socket, NULL); 266 AssertRC(rc); 249 267 g_fFormatRegistered = 1; 250 268 }
Note:
See TracChangeset
for help on using the changeset viewer.