Changeset 19977 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- May 25, 2009 12:16:47 AM (16 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r19759 r19977 45 45 #include <slirp.h> 46 46 #include "ip_icmp.h" 47 #ifdef VBOX_WITH_SLIRP_ALIAS 48 # include "alias.h" 49 #endif 47 50 48 51 … … 171 174 * Switch out to protocol's input routine. 172 175 */ 176 #ifdef VBOX_WITH_SLIRP_ALIAS 177 { 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 #endif 173 183 ipstat.ips_delivered++; 174 184 switch (ip->ip_p) -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r19839 r19977 17 17 # define _WINSOCK2API_ 18 18 # include <IPHlpApi.h> 19 #endif 20 #ifdef VBOX_WITH_SLIRP_ALIAS 21 # include<alias.h> 19 22 #endif 20 23 … … 662 665 #endif 663 666 #ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER 664 pData->slirp_ethaddr = &special_ethaddr ;667 pData->slirp_ethaddr = &special_ethaddr[0]; 665 668 #endif 666 669 alias_addr.s_addr = special_addr.s_addr | htonl(CTL_ALIAS); … … 682 685 683 686 getouraddr(pData); 687 688 #ifdef VBOX_WITH_SLIRP_ALIAS 689 { 690 struct libalias *lib = NULL; 691 lib = LibAliasInit(pData, NULL); 692 if (lib == NULL) 693 { 694 LogRel(("NAT: LibAlias default rule wasn't initialized\n")); 695 AssertMsgFailed(("NAT: LibAlias default rule wasn't initialized\n")); 696 } 697 LibAliasSetAddress(lib, special_addr); 698 699 } 700 #endif 684 701 return fNATfailed ? VINF_NAT_DNS : VINF_SUCCESS; 685 702 } -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r19839 r19977 36 36 #include <iprt/string.h> 37 37 #include <iprt/dir.h> 38 #include <iprt/rand.h> 38 39 #include <VBox/types.h> 39 40 … … 373 374 AssertCompileSize(struct ethhdr, 14); 374 375 # endif 375 #endif 376 #if defined(VBOX_WITH_SLIRP_ALIAS) && defined(VBOX_SLIRP_ALIAS) 377 # define ip_next(ip) (uintptr_t)((uint8_t *)(ip) + ((ip)->ip_hl << 2)) 378 # define bcopy(src, dst, len) memcpy((dst), (src), (len)) 379 # define NO_FW_PUNCH 380 # ifdef alias_addr 381 # error alias_addr has already defined!!! 382 # endif 383 # define arc4random() RTRandU32() 384 # undef malloc 385 # undef calloc 386 # undef free 387 # define malloc(x) RTMemAlloc((x)) 388 # define calloc(x, n) RTMemAllocZ((x)*(n)) 389 # define free(x) RTMemFree((x)) 390 # ifndef __unused 391 # define __unused 392 # endif 393 #endif 394 #endif -
trunk/src/VBox/Devices/Network/slirp/slirp_state.h
r19839 r19977 226 226 bool use_dns_proxy; 227 227 #endif 228 #ifdef VBOX_WITH_SLIRP_ALIAS 229 LIST_HEAD(, libalias) instancehead; 230 #endif 228 231 STAMPROFILE StatFill; 229 232 STAMPROFILE StatPoll; … … 308 311 #define tt pData->tt 309 312 #define our_addr pData->our_addr 310 #define alias_addr pData->alias_addr 313 #ifndef VBOX_SLIRP_ALIAS 314 # define alias_addr pData->alias_addr 315 #endif 311 316 #define special_addr pData->special_addr 312 317 #define dns_addr pData->dns_addr … … 665 670 #endif 666 671 672 #ifdef VBOX_WITH_SLIRP_ALIAS 673 # define instancehead pData->instancehead 674 #endif 675 667 676 #endif /* !_slirp_state_h_ */
Note:
See TracChangeset
for help on using the changeset viewer.