VirtualBox

Changeset 39101 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Oct 25, 2011 2:44:01 AM (13 years ago)
Author:
vboxsync
Message:

NAT: warnings.

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/bootp.c

    r39085 r39101  
    392392};
    393393
    394 static int dhcp_decode_request(PNATState pData, struct bootp_t *bp, const uint8_t *buf, int size, struct mbuf *m)
     394static int dhcp_decode_request(PNATState pData, struct bootp_t *bp, struct mbuf *m)
    395395{
    396396    BOOTPClient *bc = NULL;
     
    508508}
    509509
    510 static int dhcp_decode_discover(PNATState pData, struct bootp_t *bp, const uint8_t *buf, int size, int fDhcpDiscover, struct mbuf *m)
     510static int dhcp_decode_discover(PNATState pData, struct bootp_t *bp, int fDhcpDiscover, struct mbuf *m)
    511511{
    512512    BOOTPClient *bc;
     
    551551}
    552552
    553 static int dhcp_decode_release(PNATState pData, struct bootp_t *bp, const uint8_t *buf, int size)
     553static int dhcp_decode_release(PNATState pData, struct bootp_t *bp)
    554554{
    555555    int rc = release_addr(pData, &bp->bp_ciaddr);
     
    682682            /* fall through */
    683683        case DHCPINFORM:
    684             rc = dhcp_decode_discover(pData, bp, buf, size, fDhcpDiscover, m);
     684            rc = dhcp_decode_discover(pData, bp, fDhcpDiscover, m);
    685685            if (rc > 0)
    686686                goto reply;
     
    688688
    689689        case DHCPREQUEST:
    690             rc = dhcp_decode_request(pData, bp, buf, size, m);
     690            rc = dhcp_decode_request(pData, bp, m);
    691691            if (rc > 0)
    692692                goto reply;
     
    694694
    695695        case DHCPRELEASE:
    696             rc = dhcp_decode_release(pData, bp, buf, size);
     696            rc = dhcp_decode_release(pData, bp);
    697697            /* no reply required */
    698698            break;
  • trunk/src/VBox/Devices/Network/slirp/bsd/kern/kern_mbuf.c

    r36608 r39101  
    131131SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_MIDDLE, tunable_mbinit, NULL);
    132132
     133#ifndef VBOX
    133134/* XXX: These should be tuneables. Can't change UMA limits on the fly. */
    134135static int
     
    222223 * Zones from which we allocate.
    223224 */
    224 #ifndef VBOX
    225225uma_zone_t      zone_mbuf;
    226226uma_zone_t      zone_clust;
     
    470470        int flags;
    471471        short type;
     472#ifdef VBOX
     473    NOREF(pData);
     474#endif
    472475
    473476#ifdef INVARIANTS
    474477        trash_ctor(mem, size, arg, how);
     478#elif defined(VBOX)
     479    NOREF(size);
     480    NOREF(how);
    475481#endif
    476482        m = (struct mbuf *)mem;
     
    524530        struct mbuf *m;
    525531        unsigned long flags;
     532#ifdef VBOX
     533    NOREF(pData);
     534#endif
    526535
    527536        m = (struct mbuf *)mem;
     
    534543#ifdef INVARIANTS
    535544        trash_dtor(mem, size, arg);
     545#elif defined(VBOX)
     546    NOREF(size);
     547    NOREF(arg);
    536548#endif
    537549}
     
    563575#ifdef INVARIANTS
    564576        trash_dtor(m->m_ext.ext_buf, MCLBYTES, arg);
     577#elif defined(VBOX)
     578    NOREF(size);
     579    NOREF(arg);
    565580#endif
    566581        /*
     
    593608        int type;
    594609        uma_zone_t zone;
     610#ifdef VBOX
     611    NOREF(how);
     612#endif
    595613
    596614#ifdef INVARIANTS
    597615        trash_ctor(mem, size, arg, how);
     616#elif defined(VBOX)
     617    NOREF(how);
    598618#endif
    599619        switch (size) {
     
    657677
    658678        trash_dtor(mem, size, arg);
     679#elif defined(VBOX)
     680    NOREF(pData);
     681    NOREF(mem);
     682    NOREF(size);
     683    NOREF(arg);
    659684#endif
    660685}
     
    680705#ifdef INVARIANTS
    681706        trash_init(m->m_ext.ext_buf, MCLBYTES, how);
     707#elif defined(VBOX)
     708    NOREF(size);
    682709#endif
    683710        return (0);
     
    704731#ifdef INVARIANTS
    705732        trash_dtor(mem, size, NULL);
     733#elif defined(VBOX)
     734    NOREF(size);
    706735#endif
    707736}
     
    724753        int flags;
    725754        short type;
     755#ifdef VBOX
     756    NOREF(pData);
     757    NOREF(size);
     758#endif
    726759
    727760        m = (struct mbuf *)mem;
     
    732765#ifdef INVARIANTS
    733766        trash_ctor(m->m_ext.ext_buf, MCLBYTES, arg, how);
     767#elif defined(VBOX)
     768    NOREF(how);
    734769#endif
    735770        m->m_next = NULL;
     
    782817                        if (pr->pr_drain != NULL)
    783818                                (*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  
    406406        t = malloc(len + sizeof(struct m_tag), M_PACKET_TAGS, fWait);
    407407#else
     408        NOREF(fWait);
    408409        t = RTMemAllocZ(len + sizeof(struct m_tag));
    409410#endif
  • trunk/src/VBox/Devices/Network/slirp/debug.c

    r39085 r39101  
    304304    size_t cb = 0;
    305305    const struct tcpcb *tp = (const struct tcpcb *)pvValue;
     306    NOREF(cchWidth);
     307    NOREF(cchPrecision);
     308    NOREF(fFlags);
     309    NOREF(pvUser);
    306310    AssertReturn(RTStrCmp(pszType, "tcpcb793") == 0, 0);
    307311    if (tp)
     
    328332    size_t cb = 0;
    329333    const struct tcpiphdr *ti = (const struct tcpiphdr *)pvValue;
     334    NOREF(cchWidth);
     335    NOREF(cchPrecision);
     336    NOREF(fFlags);
     337    NOREF(pvUser);
    330338    AssertReturn(RTStrCmp(pszType, "tcpseg793") == 0 && ti, 0);
    331339    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "SEG[ACK: %x, SEQ: %x, LEN: %x, WND: %x, UP: %x]",
     
    346354    const int idxTcpState = (int)(uintptr_t)pvValue;
    347355    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);
    348360    AssertReturn(RTStrCmp(pszType, "tcpstate") == 0, 0);
    349361    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "%s", pszTcpStateName);
     
    362374    size_t cb = 0;
    363375    const struct sbuf *sb = (struct sbuf *)pvValue;
     376    NOREF(cchWidth);
     377    NOREF(cchPrecision);
     378    NOREF(fFlags);
     379    NOREF(pvUser);
    364380    AssertReturn(RTStrCmp(pszType, "sbuf") == 0, 0);
    365381    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, "[sbuf:%p cc:%d, datalen:%d, wprt:%p, rptr:%p data:%p]",
     
    379395    size_t cb = 0;
    380396    const uma_zone_t zone = (const uma_zone_t)pvValue;
     397    NOREF(cchWidth);
     398    NOREF(cchPrecision);
     399    NOREF(fFlags);
     400    NOREF(pvUser);
    381401    AssertReturn(RTStrCmp(pszType, "mzone") == 0, 0);
    382402    if (!zone)
     
    399419    size_t cb = 0;
    400420    const struct item *it = (const struct item *)pvValue;
     421    NOREF(cchWidth);
     422    NOREF(cchPrecision);
     423    NOREF(fFlags);
     424    NOREF(pvUser);
    401425    AssertReturn(RTStrCmp(pszType, "mzoneitem") == 0, 0);
    402426    if (!it)
     
    415439{
    416440    size_t cb = 0;
     441    NOREF(cchWidth);
     442    NOREF(cchPrecision);
     443    NOREF(fFlags);
     444    NOREF(pvUser);
    417445#ifdef RT_OS_WINDOWS
    418446    WSANETWORKEVENTS *pNetworkEvents = (WSANETWORKEVENTS*)pvValue;
     
    440468# undef DO_BIT
    441469    cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, 0, ")");
     470#else
     471    NOREF(pfnOutput);
     472    NOREF(pvArgOutput);
     473    NOREF(pszType);
     474    NOREF(pvValue);
    442475#endif
    443476    return cb;
  • trunk/src/VBox/Devices/Network/slirp/ext.h

    r39085 r39101  
    6464#endif
    6565
    66 #ifndef vbox_slirp_printf
     66# ifndef vbox_slirp_printf
    6767static void vbox_slirp_printf(char *format, ...)
    6868{
     
    7272    va_end(args);
    7373}
    74 #endif
     74# endif
    7575
    76 #ifndef vbox_slirp_fprintf
     76# ifndef vbox_slirp_fprintf
    7777static void vbox_slirp_fprintf(void *ignored, char *format, ...)
    7878{
    79 # ifdef LOG_ENABLED
     79#  ifdef LOG_ENABLED
    8080    va_list args;
    8181    NOREF(ignored);
     
    8383    vbox_slirp_printV(format, args);
    8484    va_end(args);
     85#  endif
     86}
    8587# endif
    86 }
    8788#endif
    88 #endif
  • trunk/src/VBox/Devices/Network/slirp/ip_icmp.c

    r39085 r39101  
    5454 */
    5555
     56#define NEED_SOME_m_getjcl
    5657#include "slirp.h"
    5758#include "ip_icmp.h"
     
    749750    return;
    750751
    751 end_error_free_m:
    752     m_freem(pData, m);
    753 
    754752end_error:
    755753
  • trunk/src/VBox/Devices/Network/slirp/ip_input.c

    r39085 r39101  
    626626    register caddr_t opts;
    627627    int olen;
     628    NOREF(mopt); /* @todo: do we really will need this options buffer? */
    628629
    629630    olen = (ip->ip_hl<<2) - sizeof(struct ip);
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias.c

    r30016 r39101  
    16411641
    16421642    LibAliasAttachHandlers(m);
    1643 #endif /* !VBOX */
     1643#else /* !VBOX */
     1644    NOREF(path);
     1645#endif /* VBOX */
    16441646    return (0);
    16451647}
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_db.c

    r38345 r39101  
    508508    va_list args;
    509509    char buffer[1024];
     510    NOREF(stream);
    510511    memset(buffer, 0, 1024);
    511512    va_start(args, format);
     
    726727    struct sockaddr sa_addr;
    727728    socklen_t socklen = sizeof(struct sockaddr);
     729    NOREF(sockfd);
    728730#endif
    729731
     
    30243026{
    30253027
     3028#ifdef VBOX
     3029    NOREF(la);
     3030    NOREF(base);
     3031    NOREF(num);
     3032#endif
    30263033    LIBALIAS_LOCK(la);
    30273034#ifndef NO_FW_PUNCH
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_dns.c

    r39085 r39101  
    7676{
    7777
     78    NOREF(la);
     79    NOREF(pip);
    7880    if (!ah->dport || !ah->sport || !ah->lnk)
    7981        return -1;
     
    9193}
    9294
    93 static void doanswer(struct libalias *la, union dnsmsg_header *hdr, struct dns_meta_data *pReqMeta, char *qname, struct ip *pip, struct hostent *h)
     95static void doanswer(union dnsmsg_header *hdr, struct dns_meta_data *pReqMeta, char *qname, struct ip *pip, struct hostent *h)
    9496{
    9597    int i;
     
    185187    }
    186188}
     189
    187190static int
    188191protohandler(struct libalias *la, struct ip *pip, struct alias_data *ah)
     
    198201    struct udphdr *udp = NULL;
    199202    union dnsmsg_header *hdr = NULL;
     203    NOREF(la);
     204    NOREF(ah);
    200205    udp = (struct udphdr *)ip_next(pip);
    201206    hdr = (union dnsmsg_header *)udp_next(udp);
     
    239244        h = gethostbyname(cname);
    240245        fprintf(stderr, "cname:%s\n", cname);
    241         doanswer(la, hdr, meta, qw_qname, pip, h);
     246        doanswer(hdr, meta, qw_qname, pip, h);
    242247    }
    243248
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_ftp.c

    r26495 r39101  
    116116{
    117117
     118#ifdef VBOX
     119    NOREF(la);
     120    NOREF(pip);
     121#endif
    118122    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    119123        ah->maxpktsize == 0)
  • trunk/src/VBox/Devices/Network/slirp/libalias/alias_nbt.c

    r25992 r39101  
    8888{
    8989
     90#ifdef VBOX
     91    NOREF(la);
     92    NOREF(pip);
     93#endif
    9094    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    9195        ah->aaddr == NULL || ah->aport == NULL)
     
    109113{
    110114
     115#ifdef VBOX
     116    NOREF(la);
     117    NOREF(pip);
     118#endif
    111119    if (ah->dport == NULL || ah->sport == NULL || ah->lnk == NULL ||
    112120        ah->aaddr == NULL || ah->aport == NULL)
  • trunk/src/VBox/Devices/Network/slirp/misc.c

    r39085 r39101  
    6161    register struct quehead *element = (struct quehead *) a;
    6262    register struct quehead *head = (struct quehead *) b;
     63    NOREF(pData);
    6364    element->qh_link = head->qh_link;
    6465    head->qh_link = (struct quehead *)element;
     
    7172{
    7273    register struct quehead *element = (struct quehead *) a;
     74    NOREF(pData);
    7375    ((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink;
    7476    ((struct quehead *)(element->qh_rlink))->qh_link = element->qh_link;
  • trunk/src/VBox/Devices/Network/slirp/sbuf.c

    r37936 r39101  
    7474sbreserve(PNATState pData, struct sbuf *sb, int size)
    7575{
     76    NOREF(pData);
    7677    if (sb->sb_data)
    7778    {
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r39085 r39101  
    273273
    274274#ifdef RT_OS_WINDOWS
    275 static int get_dns_addr_domain(PNATState pData, bool fVerbose,
    276                                struct in_addr *pdns_addr,
     275static int get_dns_addr_domain(PNATState pData,
    277276                               const char **ppszDomain)
    278277{
     
    421420}
    422421
    423 static int get_dns_addr_domain(PNATState pData, bool fVerbose,
    424                                struct in_addr *pdns_addr,
    425                                const char **ppszDomain)
     422static int get_dns_addr_domain(PNATState pData, const char **ppszDomain)
    426423{
    427424    char buff[512];
     
    553550    TAILQ_INIT(&pData->pDnsList);
    554551    LIST_INIT(&pData->pDomainList);
    555     return get_dns_addr_domain(pData, true, NULL, NULL);
     552    return get_dns_addr_domain(pData, NULL);
    556553}
    557554
     
    578575}
    579576
    580 int get_dns_addr(PNATState pData, struct in_addr *pdns_addr)
    581 {
    582     return get_dns_addr_domain(pData, false, pdns_addr, NULL);
     577int get_dns_addr(PNATState pData)
     578{
     579    return get_dns_addr_domain(pData, NULL);
    583580}
    584581
     
    21922189    struct arp_cache_entry *ac;
    21932190    struct port_forward_rule *rule;
     2191    NOREF(pszArgs);
    21942192
    21952193    pHlp->pfnPrintf(pHlp, "NAT parameters: MTU=%d\n", if_mtu);
  • trunk/src/VBox/Devices/Network/slirp/slirp.h

    r39085 r39101  
    293293#define DEFAULT_BAUD 115200
    294294
    295 int get_dns_addr(PNATState pData, struct in_addr *pdns_addr);
     295int get_dns_addr(PNATState pData);
    296296
    297297/* cksum.c */
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r39085 r39101  
    3939
    4040
    41 static void send_icmp_to_guest(PNATState, char *, size_t, struct socket *, const struct sockaddr_in *);
     41static void send_icmp_to_guest(PNATState, char *, size_t, const struct sockaddr_in *);
    4242#ifdef RT_OS_WINDOWS
    4343static void sorecvfrom_icmp_win(PNATState, struct socket *);
     
    10791079 * Just write() the data to the socket
    10801080 * XXX not yet...
     1081 * @todo do we really need this function, what it's intended to do?
    10811082 */
    10821083void
    10831084sorwakeup(struct socket *so)
    10841085{
     1086    NOREF(so);
    10851087#if 0
    10861088    sowrite(so);
     
    10971099sowwakeup(struct socket *so)
    10981100{
     1101    NOREF(so);
    10991102}
    11001103
     
    11511154soisfdisconnected(struct socket *so)
    11521155{
     1156    NOREF(so);
    11531157#if 0
    11541158    so->so_state &= ~(SS_ISFCONNECTING|SS_ISFCONNECTED);
     
    11751179
    11761180static void
    1177 send_icmp_to_guest(PNATState pData, char *buff, size_t len, struct socket *so, const struct sockaddr_in *addr)
     1181send_icmp_to_guest(PNATState pData, char *buff, size_t len, const struct sockaddr_in *addr)
    11781182{
    11791183    struct ip *ip;
     
    15771581    }
    15781582    /* 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);
    15801584    RTMemFree(buff);
    15811585}
  • trunk/src/VBox/Devices/Network/slirp/tcp_input.c

    r37936 r39101  
    857857                goto dropwithreset;
    858858            }
    859 cont_input:
    860             LogFlowFunc(("cont_input:\n"));
     859
    861860            tcp_template(tp);
    862861
  • trunk/src/VBox/Devices/Network/slirp/tcp_subr.c

    r37936 r39101  
    244244{
    245245*/
    246     LogFlowFunc(("ENTER: tp = %R[tcpcb793], errno = %d\n", tp, errno));
     246    LogFlowFunc(("ENTER: tp = %R[tcpcb793], errno = %d\n", tp, err));
    247247
    248248    if (TCPS_HAVERCVDSYN(tp->t_state))
  • trunk/src/VBox/Devices/Network/slirp/tftp.c

    r36901 r39101  
    390390}
    391391
    392 static void tftp_handle_ack(PNATState pData, struct tftp_t *tp, int pktlen)
     392static void tftp_handle_ack(PNATState pData, struct tftp_t *tp)
    393393{
    394394    int s;
     
    416416
    417417        case TFTP_ACK:
    418             tftp_handle_ack(pData, tp, m->m_len);
     418            tftp_handle_ack(pData, tp);
    419419            break;
    420420    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette