Changeset 39101 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Oct 25, 2011 2:44:01 AM (13 years ago)
- Location:
- trunk/src/VBox/Devices/Network/slirp
- Files:
-
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/slirp/bootp.c
r39085 r39101 392 392 }; 393 393 394 static int dhcp_decode_request(PNATState pData, struct bootp_t *bp, const uint8_t *buf, int size,struct mbuf *m)394 static int dhcp_decode_request(PNATState pData, struct bootp_t *bp, struct mbuf *m) 395 395 { 396 396 BOOTPClient *bc = NULL; … … 508 508 } 509 509 510 static int dhcp_decode_discover(PNATState pData, struct bootp_t *bp, const uint8_t *buf, int size,int fDhcpDiscover, struct mbuf *m)510 static int dhcp_decode_discover(PNATState pData, struct bootp_t *bp, int fDhcpDiscover, struct mbuf *m) 511 511 { 512 512 BOOTPClient *bc; … … 551 551 } 552 552 553 static int dhcp_decode_release(PNATState pData, struct bootp_t *bp , const uint8_t *buf, int size)553 static int dhcp_decode_release(PNATState pData, struct bootp_t *bp) 554 554 { 555 555 int rc = release_addr(pData, &bp->bp_ciaddr); … … 682 682 /* fall through */ 683 683 case DHCPINFORM: 684 rc = dhcp_decode_discover(pData, bp, buf, size,fDhcpDiscover, m);684 rc = dhcp_decode_discover(pData, bp, fDhcpDiscover, m); 685 685 if (rc > 0) 686 686 goto reply; … … 688 688 689 689 case DHCPREQUEST: 690 rc = dhcp_decode_request(pData, bp, buf, size,m);690 rc = dhcp_decode_request(pData, bp, m); 691 691 if (rc > 0) 692 692 goto reply; … … 694 694 695 695 case DHCPRELEASE: 696 rc = dhcp_decode_release(pData, bp , buf, size);696 rc = dhcp_decode_release(pData, bp); 697 697 /* no reply required */ 698 698 break; -
trunk/src/VBox/Devices/Network/slirp/bsd/kern/kern_mbuf.c
r36608 r39101 131 131 SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL); 132 132 133 #ifndef VBOX 133 134 /* XXX: These should be tuneables. Can't change UMA limits on the fly. */ 134 135 static int … … 222 223 * Zones from which we allocate. 223 224 */ 224 #ifndef VBOX225 225 uma_zone_t zone_mbuf; 226 226 uma_zone_t zone_clust; … … 470 470 int flags; 471 471 short type; 472 #ifdef VBOX 473 NOREF(pData); 474 #endif 472 475 473 476 #ifdef INVARIANTS 474 477 trash_ctor(mem, size, arg, how); 478 #elif defined(VBOX) 479 NOREF(size); 480 NOREF(how); 475 481 #endif 476 482 m = (struct mbuf *)mem; … … 524 530 struct mbuf *m; 525 531 unsigned long flags; 532 #ifdef VBOX 533 NOREF(pData); 534 #endif 526 535 527 536 m = (struct mbuf *)mem; … … 534 543 #ifdef INVARIANTS 535 544 trash_dtor(mem, size, arg); 545 #elif defined(VBOX) 546 NOREF(size); 547 NOREF(arg); 536 548 #endif 537 549 } … … 563 575 #ifdef INVARIANTS 564 576 trash_dtor(m->m_ext.ext_buf, MCLBYTES, arg); 577 #elif defined(VBOX) 578 NOREF(size); 579 NOREF(arg); 565 580 #endif 566 581 /* … … 593 608 int type; 594 609 uma_zone_t zone; 610 #ifdef VBOX 611 NOREF(how); 612 #endif 595 613 596 614 #ifdef INVARIANTS 597 615 trash_ctor(mem, size, arg, how); 616 #elif defined(VBOX) 617 NOREF(how); 598 618 #endif 599 619 switch (size) { … … 657 677 658 678 trash_dtor(mem, size, arg); 679 #elif defined(VBOX) 680 NOREF(pData); 681 NOREF(mem); 682 NOREF(size); 683 NOREF(arg); 659 684 #endif 660 685 } … … 680 705 #ifdef INVARIANTS 681 706 trash_init(m->m_ext.ext_buf, MCLBYTES, how); 707 #elif defined(VBOX) 708 NOREF(size); 682 709 #endif 683 710 return (0); … … 704 731 #ifdef INVARIANTS 705 732 trash_dtor(mem, size, NULL); 733 #elif defined(VBOX) 734 NOREF(size); 706 735 #endif 707 736 } … … 724 753 int flags; 725 754 short type; 755 #ifdef VBOX 756 NOREF(pData); 757 NOREF(size); 758 #endif 726 759 727 760 m = (struct mbuf *)mem; … … 732 765 #ifdef INVARIANTS 733 766 trash_ctor(m->m_ext.ext_buf, MCLBYTES, arg, how); 767 #elif defined(VBOX) 768 NOREF(how); 734 769 #endif 735 770 m->m_next = NULL; … … 782 817 if (pr->pr_drain != NULL) 783 818 (*pr->pr_drain)(); 784 #endif 785 } 819 #else 820 NOREF(junk); 821 #endif 822 } -
trunk/src/VBox/Devices/Network/slirp/bsd/kern/uipc_mbuf2.c
r28188 r39101 406 406 t = malloc(len + sizeof(struct m_tag), M_PACKET_TAGS, fWait); 407 407 #else 408 NOREF(fWait); 408 409 t = RTMemAllocZ(len + sizeof(struct m_tag)); 409 410 #endif -
trunk/src/VBox/Devices/Network/slirp/debug.c
r39085 r39101 304 304 size_t cb = 0; 305 305 const struct tcpcb *tp = (const struct tcpcb *)pvValue; 306 NOREF(cchWidth); 307 NOREF(cchPrecision); 308 NOREF(fFlags); 309 NOREF(pvUser); 306 310 AssertReturn(RTStrCmp(pszType, "tcpcb793") == 0, 0); 307 311 if (tp) … … 328 332 size_t cb = 0; 329 333 const struct tcpiphdr *ti = (const struct tcpiphdr *)pvValue; 334 NOREF(cchWidth); 335 NOREF(cchPrecision); 336 NOREF(fFlags); 337 NOREF(pvUser); 330 338 AssertReturn(RTStrCmp(pszType, "tcpseg793") == 0 && ti, 0); 331 339 cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SEG[ACK: %x, SEQ: %x, LEN: %x, WND: %x, UP: %x]", … … 346 354 const int idxTcpState = (int)(uintptr_t)pvValue; 347 355 char *pszTcpStateName = (idxTcpState >= 0 && idxTcpState < TCP_NSTATES) ? g_apszTcpStates[idxTcpState] : "TCPS_INVALIDE_STATE"; 356 NOREF(cchWidth); 357 NOREF(cchPrecision); 358 NOREF(fFlags); 359 NOREF(pvUser); 348 360 AssertReturn(RTStrCmp(pszType, "tcpstate") == 0, 0); 349 361 cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s", pszTcpStateName); … … 362 374 size_t cb = 0; 363 375 const struct sbuf *sb = (struct sbuf *)pvValue; 376 NOREF(cchWidth); 377 NOREF(cchPrecision); 378 NOREF(fFlags); 379 NOREF(pvUser); 364 380 AssertReturn(RTStrCmp(pszType, "sbuf") == 0, 0); 365 381 cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "[sbuf:%p cc:%d, datalen:%d, wprt:%p, rptr:%p data:%p]", … … 379 395 size_t cb = 0; 380 396 const uma_zone_t zone = (const uma_zone_t)pvValue; 397 NOREF(cchWidth); 398 NOREF(cchPrecision); 399 NOREF(fFlags); 400 NOREF(pvUser); 381 401 AssertReturn(RTStrCmp(pszType, "mzone") == 0, 0); 382 402 if (!zone) … … 399 419 size_t cb = 0; 400 420 const struct item *it = (const struct item *)pvValue; 421 NOREF(cchWidth); 422 NOREF(cchPrecision); 423 NOREF(fFlags); 424 NOREF(pvUser); 401 425 AssertReturn(RTStrCmp(pszType, "mzoneitem") == 0, 0); 402 426 if (!it) … … 415 439 { 416 440 size_t cb = 0; 441 NOREF(cchWidth); 442 NOREF(cchPrecision); 443 NOREF(fFlags); 444 NOREF(pvUser); 417 445 #ifdef RT_OS_WINDOWS 418 446 WSANETWORKEVENTS *pNetworkEvents = (WSANETWORKEVENTS*)pvValue; … … 440 468 # undef DO_BIT 441 469 cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, ")"); 470 #else 471 NOREF(pfnOutput); 472 NOREF(pvArgOutput); 473 NOREF(pszType); 474 NOREF(pvValue); 442 475 #endif 443 476 return cb; -
trunk/src/VBox/Devices/Network/slirp/ext.h
r39085 r39101 64 64 #endif 65 65 66 # ifndef vbox_slirp_printf66 # ifndef vbox_slirp_printf 67 67 static void vbox_slirp_printf(char *format, ...) 68 68 { … … 72 72 va_end(args); 73 73 } 74 # endif74 # endif 75 75 76 # ifndef vbox_slirp_fprintf76 # ifndef vbox_slirp_fprintf 77 77 static void vbox_slirp_fprintf(void *ignored, char *format, ...) 78 78 { 79 # ifdef LOG_ENABLED79 # ifdef LOG_ENABLED 80 80 va_list args; 81 81 NOREF(ignored); … … 83 83 vbox_slirp_printV(format, args); 84 84 va_end(args); 85 # endif 86 } 85 87 # endif 86 }87 88 #endif 88 #endif -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r39085 r39101 54 54 */ 55 55 56 #define NEED_SOME_m_getjcl 56 57 #include "slirp.h" 57 58 #include "ip_icmp.h" … … 749 750 return; 750 751 751 end_error_free_m:752 m_freem(pData, m);753 754 752 end_error: 755 753 -
trunk/src/VBox/Devices/Network/slirp/ip_input.c
r39085 r39101 626 626 register caddr_t opts; 627 627 int olen; 628 NOREF(mopt); /* @todo: do we really will need this options buffer? */ 628 629 629 630 olen = (ip->ip_hl<<2) - sizeof(struct ip); -
trunk/src/VBox/Devices/Network/slirp/libalias/alias.c
r30016 r39101 1641 1641 1642 1642 LibAliasAttachHandlers(m); 1643 #endif /* !VBOX */ 1643 #else /* !VBOX */ 1644 NOREF(path); 1645 #endif /* VBOX */ 1644 1646 return (0); 1645 1647 } -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c
r38345 r39101 508 508 va_list args; 509 509 char buffer[1024]; 510 NOREF(stream); 510 511 memset(buffer, 0, 1024); 511 512 va_start(args, format); … … 726 727 struct sockaddr sa_addr; 727 728 socklen_t socklen = sizeof(struct sockaddr); 729 NOREF(sockfd); 728 730 #endif 729 731 … … 3024 3026 { 3025 3027 3028 #ifdef VBOX 3029 NOREF(la); 3030 NOREF(base); 3031 NOREF(num); 3032 #endif 3026 3033 LIBALIAS_LOCK(la); 3027 3034 #ifndef NO_FW_PUNCH -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c
r39085 r39101 76 76 { 77 77 78 NOREF(la); 79 NOREF(pip); 78 80 if (!ah->dport || !ah->sport || !ah->lnk) 79 81 return -1; … … 91 93 } 92 94 93 static void doanswer( struct libalias *la,union dnsmsg_header *hdr, struct dns_meta_data *pReqMeta, char *qname, struct ip *pip, struct hostent *h)95 static void doanswer(union dnsmsg_header *hdr, struct dns_meta_data *pReqMeta, char *qname, struct ip *pip, struct hostent *h) 94 96 { 95 97 int i; … … 185 187 } 186 188 } 189 187 190 static int 188 191 protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah) … … 198 201 struct udphdr *udp = NULL; 199 202 union dnsmsg_header *hdr = NULL; 203 NOREF(la); 204 NOREF(ah); 200 205 udp = (struct udphdr *)ip_next(pip); 201 206 hdr = (union dnsmsg_header *)udp_next(udp); … … 239 244 h = gethostbyname(cname); 240 245 fprintf(stderr, "cname:%s\n", cname); 241 doanswer( la,hdr, meta, qw_qname, pip, h);246 doanswer(hdr, meta, qw_qname, pip, h); 242 247 } 243 248 -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_ftp.c
r26495 r39101 116 116 { 117 117 118 #ifdef VBOX 119 NOREF(la); 120 NOREF(pip); 121 #endif 118 122 if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 119 123 ah->maxpktsize == 0) -
trunk/src/VBox/Devices/Network/slirp/libalias/alias_nbt.c
r25992 r39101 88 88 { 89 89 90 #ifdef VBOX 91 NOREF(la); 92 NOREF(pip); 93 #endif 90 94 if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 91 95 ah->aaddr == NULL || ah->aport == NULL) … … 109 113 { 110 114 115 #ifdef VBOX 116 NOREF(la); 117 NOREF(pip); 118 #endif 111 119 if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL || 112 120 ah->aaddr == NULL || ah->aport == NULL) -
trunk/src/VBox/Devices/Network/slirp/misc.c
r39085 r39101 61 61 register struct quehead *element = (struct quehead *) a; 62 62 register struct quehead *head = (struct quehead *) b; 63 NOREF(pData); 63 64 element->qh_link = head->qh_link; 64 65 head->qh_link = (struct quehead *)element; … … 71 72 { 72 73 register struct quehead *element = (struct quehead *) a; 74 NOREF(pData); 73 75 ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink; 74 76 ((struct quehead *)(element->qh_rlink))->qh_link = element->qh_link; -
trunk/src/VBox/Devices/Network/slirp/sbuf.c
r37936 r39101 74 74 sbreserve(PNATState pData, struct sbuf *sb, int size) 75 75 { 76 NOREF(pData); 76 77 if (sb->sb_data) 77 78 { -
trunk/src/VBox/Devices/Network/slirp/slirp.c
r39085 r39101 273 273 274 274 #ifdef RT_OS_WINDOWS 275 static int get_dns_addr_domain(PNATState pData, bool fVerbose, 276 struct in_addr *pdns_addr, 275 static int get_dns_addr_domain(PNATState pData, 277 276 const char **ppszDomain) 278 277 { … … 421 420 } 422 421 423 static int get_dns_addr_domain(PNATState pData, bool fVerbose, 424 struct in_addr *pdns_addr, 425 const char **ppszDomain) 422 static int get_dns_addr_domain(PNATState pData, const char **ppszDomain) 426 423 { 427 424 char buff[512]; … … 553 550 TAILQ_INIT(&pData->pDnsList); 554 551 LIST_INIT(&pData->pDomainList); 555 return get_dns_addr_domain(pData, true, NULL,NULL);552 return get_dns_addr_domain(pData, NULL); 556 553 } 557 554 … … 578 575 } 579 576 580 int get_dns_addr(PNATState pData , struct in_addr *pdns_addr)581 { 582 return get_dns_addr_domain(pData, false, pdns_addr,NULL);577 int get_dns_addr(PNATState pData) 578 { 579 return get_dns_addr_domain(pData, NULL); 583 580 } 584 581 … … 2192 2189 struct arp_cache_entry *ac; 2193 2190 struct port_forward_rule *rule; 2191 NOREF(pszArgs); 2194 2192 2195 2193 pHlp->pfnPrintf(pHlp, "NAT parameters: MTU=%d\n", if_mtu); -
trunk/src/VBox/Devices/Network/slirp/slirp.h
r39085 r39101 293 293 #define DEFAULT_BAUD 115200 294 294 295 int get_dns_addr(PNATState pData , struct in_addr *pdns_addr);295 int get_dns_addr(PNATState pData); 296 296 297 297 /* cksum.c */ -
trunk/src/VBox/Devices/Network/slirp/socket.c
r39085 r39101 39 39 40 40 41 static void send_icmp_to_guest(PNATState, char *, size_t, struct socket *,const struct sockaddr_in *);41 static void send_icmp_to_guest(PNATState, char *, size_t, const struct sockaddr_in *); 42 42 #ifdef RT_OS_WINDOWS 43 43 static void sorecvfrom_icmp_win(PNATState, struct socket *); … … 1079 1079 * Just write() the data to the socket 1080 1080 * XXX not yet... 1081 * @todo do we really need this function, what it's intended to do? 1081 1082 */ 1082 1083 void 1083 1084 sorwakeup(struct socket *so) 1084 1085 { 1086 NOREF(so); 1085 1087 #if 0 1086 1088 sowrite(so); … … 1097 1099 sowwakeup(struct socket *so) 1098 1100 { 1101 NOREF(so); 1099 1102 } 1100 1103 … … 1151 1154 soisfdisconnected(struct socket *so) 1152 1155 { 1156 NOREF(so); 1153 1157 #if 0 1154 1158 so->so_state &= ~(SS_ISFCONNECTING|SS_ISFCONNECTED); … … 1175 1179 1176 1180 static void 1177 send_icmp_to_guest(PNATState pData, char *buff, size_t len, struct socket *so,const struct sockaddr_in *addr)1181 send_icmp_to_guest(PNATState pData, char *buff, size_t len, const struct sockaddr_in *addr) 1178 1182 { 1179 1183 struct ip *ip; … … 1577 1581 } 1578 1582 /* len is modified in 2nd read, when the rest of the datagramm was read */ 1579 send_icmp_to_guest(pData, buff, len, so,&addr);1583 send_icmp_to_guest(pData, buff, len, &addr); 1580 1584 RTMemFree(buff); 1581 1585 } -
trunk/src/VBox/Devices/Network/slirp/tcp_input.c
r37936 r39101 857 857 goto dropwithreset; 858 858 } 859 cont_input: 860 LogFlowFunc(("cont_input:\n")); 859 861 860 tcp_template(tp); 862 861 -
trunk/src/VBox/Devices/Network/slirp/tcp_subr.c
r37936 r39101 244 244 { 245 245 */ 246 LogFlowFunc(("ENTER: tp = %R[tcpcb793], errno = %d\n", tp, err no));246 LogFlowFunc(("ENTER: tp = %R[tcpcb793], errno = %d\n", tp, err)); 247 247 248 248 if (TCPS_HAVERCVDSYN(tp->t_state)) -
trunk/src/VBox/Devices/Network/slirp/tftp.c
r36901 r39101 390 390 } 391 391 392 static void tftp_handle_ack(PNATState pData, struct tftp_t *tp , int pktlen)392 static void tftp_handle_ack(PNATState pData, struct tftp_t *tp) 393 393 { 394 394 int s; … … 416 416 417 417 case TFTP_ACK: 418 tftp_handle_ack(pData, tp , m->m_len);418 tftp_handle_ack(pData, tp); 419 419 break; 420 420 }
Note:
See TracChangeset
for help on using the changeset viewer.