Changeset 34305 in vbox
- Timestamp:
- Nov 24, 2010 6:21:52 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/debug.c
r34209 r34305 297 297 IP4_ADDR_PRINTF_DECOMP(RT_N2H_U32(in_addr->sin_addr.s_addr)), 298 298 RT_N2H_U16(in_addr->sin_port)); 299 } 300 301 /** 302 * Print callback dumping TCP Control Block in terms of RFC 793. 303 */ 304 static DECLCALLBACK(size_t) 305 printTcpcbRfc793(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, 306 const char *pszType, void const *pvValue, 307 int cchWidth, int cchPrecision, unsigned fFlags, 308 void *pvUser) 309 { 310 size_t cb = 0; 311 const struct tcpcb *tp = (const struct tcpcb *)pvValue; 312 AssertReturn(RTStrCmp(pszType, "tcpcb793") == 0 && tp, 0); 313 cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "TCB793[ SND(UNA: %x, NXT: %x, UP: %x, WND: %x, WL1:%x, WL2:%x, ISS:%x), ", 314 tp->snd_una, tp->snd_nxt, tp->snd_up, tp->snd_wnd, tp->snd_wl1, tp->snd_wl2, tp->iss); 315 cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "RCV(WND: %x, NXT: %x, UP: %x, IRS:%x)]", tp->rcv_wnd, tp->rcv_nxt, tp->rcv_up, tp->irs); 316 return cb; 317 } 318 /* 319 * Prints TCP segment in terms of RFC 793. 320 */ 321 static DECLCALLBACK(size_t) 322 printTcpSegmentRfc793(PFNRTSTROUTPUT pfnOutput, void *pvArgOutput, 323 const char *pszType, void const *pvValue, 324 int cchWidth, int cchPrecision, unsigned fFlags, 325 void *pvUser) 326 { 327 size_t cb = 0; 328 const struct tcpiphdr *ti = (const struct tcpiphdr *)pvValue; 329 AssertReturn(RTStrCmp(pszType, "tcpseg793") == 0 && ti, 0); 330 cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SEG[ACK: %x, SEQ: %x, LEN: %x, WND: %x, UP: %x]", 331 ti->ti_ack, ti->ti_seq, ti->ti_len, ti->ti_win, ti->ti_urp); 332 return cb; 299 333 } 300 334 … … 369 403 print_networkevents, NULL); 370 404 AssertRC(rc); 405 rc = RTStrFormatTypeRegister("tcpcb793", printTcpcbRfc793, NULL); 406 AssertRC(rc); 407 rc = RTStrFormatTypeRegister("tcpseg793", printTcpSegmentRfc793, NULL); 408 AssertRC(rc); 371 409 g_fFormatRegistered = 1; 372 410 }
Note:
See TracChangeset
for help on using the changeset viewer.