Changeset 20053 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- May 27, 2009 1:52:00 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r19074 r20053 385 385 /* only check for slow/fast timers */ 386 386 slirp_select_poll(pThis->pNATState, /* fTimeout=*/true, /*fIcmp=*/false); 387 Log2(("%s: timeout\n", __FUNCTION__));388 387 continue; 389 388 } -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r19977 r20053 83 83 84 84 ipstat.ips_total++; 85 #ifdef VBOX_WITH_SLIRP_ALIAS 86 { 87 int rc; 88 rc = LibAliasIn(LIST_FIRST(&instancehead), mtod(m, char *), m->m_len); 89 Log2(("NAT: LibAlias return %d\n", rc)); 90 } 91 #endif 85 92 86 93 if (m->m_len < sizeof(struct ip)) … … 174 181 * Switch out to protocol's input routine. 175 182 */ 176 #ifdef VBOX_WITH_SLIRP_ALIAS177 {178 int rc;179 rc = LibAliasIn(LIST_FIRST(&instancehead), mtod(m, char *), ip->ip_len);180 Log2(("NAT: LibAlias return %d\n", rc));181 }182 #endif183 183 ipstat.ips_delivered++; 184 184 switch (ip->ip_p) -
trunk/src/VBox/Devices/Network/slirp/ip_output.c
r19981 r20053 44 44 45 45 #include <slirp.h> 46 #ifdef VBOX_WITH_SLIRP_ALIAS 47 # include "alias.h" 48 #endif 46 49 47 50 #ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER … … 147 150 } 148 151 #endif 152 #ifdef VBOX_WITH_SLIRP_ALIAS 153 { 154 int rc; 155 rc = LibAliasOut(LIST_FIRST(&instancehead), mtod(m, char *), m->m_len); 156 Log2(("NAT: LibAlias return %d\n", rc)); 157 } 158 #endif 149 159 150 160 if_output(pData, so, m); … … 241 251 ip->ip_sum = 0; 242 252 ip->ip_sum = cksum(m, hlen); 253 #ifdef VBOX_WITH_SLIRP_ALIAS 254 { 255 int rc; 256 rc = LibAliasOut(LIST_FIRST(&instancehead), mtod(m, char *), m->m_len); 257 Log2(("NAT: LibAlias return %d\n", rc)); 258 } 259 #endif 243 260 244 261 sendorfree: … … 248 265 m->m_nextpkt = 0; 249 266 if (error == 0) 267 { 268 #ifdef VBOX_WITH_SLIRP_ALIAS 269 { 270 int rc; 271 rc = LibAliasOut(LIST_FIRST(&instancehead), mtod(m, char *), m->m_len); 272 Log2(("NAT: LibAlias return %d\n", rc)); 273 } 274 #endif 250 275 if_output(pData, so, m); 251 else 276 } 277 else 278 { 252 279 m_freem(pData, m); 280 } 253 281 } 254 282 -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r20016 r20053 687 687 { 688 688 struct libalias *lib = NULL; 689 int flags = 0; 689 690 lib = LibAliasInit(pData, NULL); 690 691 if (lib == NULL) … … 693 694 AssertMsgFailed(("NAT: LibAlias default rule wasn't initialized\n")); 694 695 } 696 flags = LibAliasSetMode(lib, 0, 0); 697 flags |= PKT_ALIAS_LOG; /* set logging */ 698 flags = LibAliasSetMode(lib, flags, ~0); 695 699 LibAliasSetAddress(lib, special_addr); 700 ftp_alias_load(); 696 701 697 702 } -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r19977 r20053 391 391 # define __unused 392 392 # endif 393 #endif 394 #endif 393 394 # define strncasecmp RTStrNICmp 395 396 # define LIBALIAS_DEBUG 397 # ifdef fprintf 398 # undef fprintf 399 # define fprintf vbox_slirp_fprintf 400 # endif /*fprintf*/ 401 static inline void vbox_slirp_fprintf(void *ignored, char *msg, ...) 402 { 403 /* define LogIt(pvInst, fFlags, iGroup, fmtargs) */ 404 va_list args; 405 register PRTLOGGER LogIt_pLogger; 406 char buffer[2048]; 407 memset(buffer, 0, 2048); 408 memcpy(buffer, "NAT: ALIAS:", 11); 409 va_start(args, msg); 410 RTStrPrintfV(&buffer[11], 2048 - 11, msg, args); 411 412 LogIt_pLogger = (PRTLOGGER)(LOG_INSTANCE) ? 413 (PRTLOGGER)(LOG_INSTANCE) : RTLogDefaultInstance(); 414 if (LogIt_pLogger) 415 { 416 RTLogPrintfEx(LogIt_pLogger, 417 ((RTLOGGRPFLAGS_LEVEL_2) | RTLOGGRPFLAGS_ENABLED), LOG_GROUP, 418 msg, buffer); 419 } 420 va_end(args); 421 } 422 #endif /*VBOX_WITH_SLIRP_ALIAS && VBOX_SLIRP_ALIAS*/ 423 424 #ifdef VBOX_WITH_SLIRP_ALIAS 425 int ftp_alias_load(); 426 int ftp_alias_unload(); 427 #endif /*VBOX_WITH_SLIRP_ALIAS*/ 428 429 #endif -
trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
r19313 r20053 659 659 tcp_emu(PNATState pData, struct socket *so, struct mbuf *m) 660 660 { 661 #ifndef VBOX_WITH_SLIRP_ALIAS 661 662 u_int n1, n2, n3, n4, n5, n6; 662 663 char buff[256]; … … 1007 1008 return 1; 1008 1009 } 1009 } 1010 #else /* !VBOX_WITH_SLIRP_ALIAS */ 1011 /*XXX: libalias should care about it */ 1012 so->so_emu = 0; 1013 return 1; 1014 #endif 1015 }
Note:
See TracChangeset
for help on using the changeset viewer.