VirtualBox

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


Ignore:
Timestamp:
Oct 7, 2013 9:41:00 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
89644
Message:

Devices: Whitespace and svn:keyword cleanups by scm.

Location:
trunk/src/VBox/Devices/Network
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevINIP.cpp

    r47933 r48947  
    116116    bool                    fLnkUp;
    117117#ifndef VBOX_WITH_NEW_LWIP
    118     /** 
    119      * This hack-flag for spliting initialization logic in devINIPTcpipInitDone, 
     118    /**
     119     * This hack-flag for spliting initialization logic in devINIPTcpipInitDone,
    120120     * this is the only place when during initialization we can be called from TCPIP
    121      * thread. 
     121     * thread.
    122122     * This callback used for Initialization and Finalization with old lwip.
    123123     */
     
    127127     * In callback we're getting status of interface adding operation (TCPIP thread),
    128128     * but we need inform constructing routine whether it was success or not(EMT thread).
    129      */ 
     129     */
    130130    int rcInitialization;
    131131} DEVINTNETIP, *PDEVINTNETIP;
     
    342342#else
    343343    netif->output = devINIPOutput;
    344    
     344
    345345    lwip_etharp_init();
    346346    TMTimerSetMillies(g_pDevINIPData->ARPTimer, ARP_TMR_INTERVAL);
     
    363363        PDMDEV_SET_ERROR(pDevIns, rc,
    364364                         N_("Configuration error: Failed to get the \"IP\" value"));
    365         /* @todo: perhaps we should panic if IPv4 address isn't specify, with assumtion that 
    366          * ISCSI target specified in IPv6 form. 
     365        /* @todo: perhaps we should panic if IPv4 address isn't specify, with assumtion that
     366         * ISCSI target specified in IPv6 form.
    367367         */
    368368        return rc;
     
    490490/**
    491491 * Signals the end of lwIP TCPIP initialization.
    492  * 
     492 *
    493493 * @note: TCPIP thread, corresponding EMT waiting on semaphore.
    494494 * @param   arg     opaque argument, here the pointer to the PDEVINTNETIP.
     
    512512        {
    513513            pThis->rcInitialization = VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
    514             PDMDEV_SET_ERROR(pThis->pDevIns, 
     514            PDMDEV_SET_ERROR(pThis->pDevIns,
    515515                             pThis->rcInitialization,
    516516                             N_("Configuration error: Invalid \"IP\" value"));
     
    518518        }
    519519        memcpy(&ipaddr, &ip, sizeof(ipaddr));
    520        
     520
    521521        if (!inet_aton(pThis->pszNetmask, &ip))
    522522        {
    523523            pThis->rcInitialization = VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
    524             PDMDEV_SET_ERROR(pThis->pDevIns, 
     524            PDMDEV_SET_ERROR(pThis->pDevIns,
    525525                             pThis->rcInitialization,
    526526                             N_("Configuration error: Invalid \"Netmask\" value"));
     
    534534            {
    535535                pThis->rcInitialization = VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES;
    536                 PDMDEV_SET_ERROR(pThis->pDevIns, 
     536                PDMDEV_SET_ERROR(pThis->pDevIns,
    537537                                 pThis->rcInitialization,
    538538                                 N_("Configuration error: Invalid \"Gateway\" value"));
     
    549549        pThis->IntNetIF.name[0] = 'I';
    550550        pThis->IntNetIF.name[1] = 'N';
    551    
     551
    552552        ret = netif_add(&pThis->IntNetIF, &ipaddr, &netmask, &gw, NULL,
    553553                        devINIPInterface, lwip_tcpip_input);
     
    555555        if (!ret)
    556556        {
    557            
     557
    558558            pThis->rcInitialization = VERR_NET_NO_NETWORK;
    559             PDMDEV_SET_ERROR(pThis->pDevIns, 
     559            PDMDEV_SET_ERROR(pThis->pDevIns,
    560560                             pThis->rcInitialization,
    561561                             N_("netif_add failed"));
     
    565565        lwip_netif_set_default(&pThis->IntNetIF);
    566566        lwip_netif_set_up(&pThis->IntNetIF);
    567        
     567
    568568#ifndef VBOX_WITH_NEW_LWIP
    569569    }
     
    581581 * XXX: We do it only for new LWIP, old LWIP will stay broken for now.
    582582 */
    583 static DECLCALLBACK(void) devINIPTcpipFiniDone(void *arg) 
     583static DECLCALLBACK(void) devINIPTcpipFiniDone(void *arg)
    584584{
    585585    PDEVINTNETIP pThis = (PDEVINTNETIP)arg;
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r47499 r48947  
    10891089                Frame.Hdr.DstMac.au16[2] = 0xffff;
    10901090                Frame.Hdr.EtherType      = RT_H2BE_U16_C(0x801e);
    1091                 int rc = pThis->pIAboveConfigR3->pfnGetMac(pThis->pIAboveConfigR3, 
     1091                int rc = pThis->pIAboveConfigR3->pfnGetMac(pThis->pIAboveConfigR3,
    10921092                                                           &Frame.Hdr.SrcMac);
    10931093                if (RT_SUCCESS(rc))
    10941094                    rc = drvR3IntNetResumeSend(pThis, &Frame, sizeof(Frame));
    10951095                if (RT_FAILURE(rc))
    1096                     LogRel(("IntNet#%u: Sending dummy frame failed: %Rrc\n", 
     1096                    LogRel(("IntNet#%u: Sending dummy frame failed: %Rrc\n",
    10971097                            pDrvIns->iInstance, rc));
    10981098            }
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r48526 r48947  
    10501050             */
    10511051#ifndef RT_OS_DARWIN
    1052             pThis->pIAboveConfig->pfnSetLinkState(pThis->pIAboveConfig, 
     1052            pThis->pIAboveConfig->pfnSetLinkState(pThis->pIAboveConfig,
    10531053                                                  PDMNETWORKLINKSTATE_DOWN_RESUME);
    10541054#endif
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r46921 r48947  
    12721272            break;
    12731273        case kIntNetAddrType_IPv6:
    1274             Log(("intnetR0IfAddrCacheAddIt: hIf=%#x MAC=%.6Rhxs IPv6 added #%d %RTnaipv6 %s\n", 
     1274            Log(("intnetR0IfAddrCacheAddIt: hIf=%#x MAC=%.6Rhxs IPv6 added #%d %RTnaipv6 %s\n",
    12751275                 pIf->hIf, &pIf->MacAddr, pCache->cEntries, pAddr->IPv6, pszMsg));
    12761276            break;
     
    28582858        }
    28592859        else if (pEthHdr->EtherType == RT_H2BE_U16(RTNET_ETHERTYPE_IPV6))
    2860         { 
     2860        {
    28612861            /*
    2862              * IPV6 ICMP Neighbor Discovery : replace 
     2862             * IPV6 ICMP Neighbor Discovery : replace
    28632863             * 1) the advertised source mac address in outgoing neighbor sollicitations
    28642864             *    with the HW MAC address of the trunk interface,
     
    28682868             * Note that this only applies to traffic going out on the trunk. Incoming
    28692869             * NS/NA will never advertise any VM mac address, so we do not need to touch
    2870              * them. Other VMs on this bridge as well as the host will see and use the VM's 
     2870             * them. Other VMs on this bridge as well as the host will see and use the VM's
    28712871             * actual mac addresses.
    28722872             *
     
    28742874
    28752875            PRTNETIPV6 pIPv6            = (PRTNETIPV6)(pEthHdr + 1);
    2876             PRTNETNDP pNd               = (PRTNETNDP)(pIPv6 + 1); 
    2877             PRTNETNDP_SLLA_OPT pLLAOpt  = (PRTNETNDP_SLLA_OPT)(pNd + 1); 
     2876            PRTNETNDP pNd               = (PRTNETNDP)(pIPv6 + 1);
     2877            PRTNETNDP_SLLA_OPT pLLAOpt  = (PRTNETNDP_SLLA_OPT)(pNd + 1);
    28782878
    28792879            /* make sure we have enough bytes to work with */
     
    28822882               pIPv6->ip6_hlim == 0xff &&
    28832883               /* protocol has to be icmpv6 */
    2884                 pIPv6->ip6_nxt == RTNETIPV6_PROT_ICMPV6 && 
     2884                pIPv6->ip6_nxt == RTNETIPV6_PROT_ICMPV6 &&
    28852885               /* we either have a sollicitation with source link layer addr. opt, or */
    28862886                ((pNd->icmp6_type == RTNETIPV6_ICMP_NS_TYPE &&
     
    29002900                pNd->icmp6_cksum = computeIPv6FullChecksum(pIPv6);
    29012901            }
    2902            
     2902
    29032903        }
    29042904    }
     
    29332933 * @param   pNetwork        The network the frame is being sent to.
    29342934 * @param   pSG             Pointer to the gather list for the frame.
    2935  * @param   pEthHdr         Pointer to the ethernet header. 
     2935 * @param   pEthHdr         Pointer to the ethernet header.
    29362936 */
    29372937static bool intnetR0NetworkDetectAndFixNdBroadcast(PINTNETNETWORK pNetwork, PINTNETSG pSG, PRTNETETHERHDR pEthHdr)
     
    29432943     * using the temporary buffer if necessary.
    29442944     */
    2945     if (RT_UNLIKELY(pSG->cbTotal < sizeof(RTNETETHERHDR) + sizeof(RTNETIPV6) + 
     2945    if (RT_UNLIKELY(pSG->cbTotal < sizeof(RTNETETHERHDR) + sizeof(RTNETIPV6) +
    29462946                                            sizeof(RTNETNDP)))
    29472947        return false;
     
    29982998 * @param   pNetwork        The network the frame is being sent to.
    29992999 * @param   pSG             Pointer to the gather list for the frame.
    3000  * @param   pEthHdr         Pointer to the ethernet header. 
     3000 * @param   pEthHdr         Pointer to the ethernet header.
    30013001 */
    30023002static void intnetR0NetworkSnoopNAFromWire(PINTNETNETWORK pNetwork, PINTNETSG pSG, PRTNETETHERHDR pEthHdr)
     
    30063006     * using the temporary buffer if necessary.
    30073007     */
    3008     if (RT_UNLIKELY(pSG->cbTotal < sizeof(RTNETETHERHDR) + sizeof(RTNETIPV6) + 
     3008    if (RT_UNLIKELY(pSG->cbTotal < sizeof(RTNETETHERHDR) + sizeof(RTNETIPV6) +
    30093009                                            sizeof(RTNETNDP)))
    30103010        return;
     
    30373037        &&  pIPv6->ip6_src.QWords.qw1 == 0)
    30383038    {
    3039        
    3040         intnetR0NetworkAddrCacheDelete(pNetwork, (PCRTNETADDRU) &pNd->target_address, 
     3039
     3040        intnetR0NetworkAddrCacheDelete(pNetwork, (PCRTNETADDRU) &pNd->target_address,
    30413041                                        kIntNetAddrType_IPv6, sizeof(RTNETADDRIPV6), "tif/ip6");
    30423042    }
     
    52635263        case kIntNetTrunkType_WhateverNone:
    52645264#ifdef VBOX_WITH_NAT_SERVICE
    5265             /* 
     5265            /*
    52665266             * Well, here we don't want load anything special,
    5267              * just communicate between processes via internal network. 
     5267             * just communicate between processes via internal network.
    52685268             */
    52695269        case kIntNetTrunkType_SrvNat:
     
    52885288#endif /* VBOXNETADP_DO_NOT_USE_NETFLT */
    52895289            break;
    5290 #ifndef VBOX_WITH_NAT_SERVICE   
     5290#ifndef VBOX_WITH_NAT_SERVICE
    52915291        case kIntNetTrunkType_SrvNat:
    52925292            pszName = "VBoxSrvNat";
  • trunk/src/VBox/Devices/Network/slirp/dnsproxy/dnsproxy.c

    r48526 r48947  
    120120    /* be paranoid */
    121121    AssertPtrReturnVoid(arg);
    122    
     122
    123123    de = TAILQ_PREV(req->dns_server, dns_list_head, de_list);
    124    
     124
    125125    if (de == NULL)
    126126    {
     
    137137        struct mbuf *m = NULL;
    138138        char *data;
    139        
     139
    140140        m = slirpDnsMbufAlloc(pData);
    141141        if (m == NULL)
     
    168168
    169169        /* expiration will be bumped in dnsproxy_query */
    170        
     170
    171171        dnsproxy_query(pData, so, m, iphlen);
    172172        /* should we free so->so_m ? */
    173173        return;
    174174    }
    175  
    176  socket_clean_up:   
     175
     176 socket_clean_up:
    177177    /* This socket (so) will be detached, so we need to remove timeout(&_arg) references
    178      * before leave 
     178     * before leave
    179179     */
    180180    so->so_timeout = NULL;
     
    309309#else /* VBOX */
    310310    AssertPtr(pData);
    311    
     311
    312312    /* m->m_data points to IP header */
    313313#if 0
     
    340340
    341341
    342     req = so->so_timeout_arg; 
     342    req = so->so_timeout_arg;
    343343
    344344    if (!req)
     
    347347        Assert(!so->so_timeout_arg);
    348348
    349         if ((req = RTMemAllocZ(sizeof(struct request) + byte)) == NULL) 
     349        if ((req = RTMemAllocZ(sizeof(struct request) + byte)) == NULL)
    350350        {
    351351            LogRel(("calloc failed\n"));
     
    382382
    383383    req->recursion = 0;
    384        
     384
    385385    DPRINTF(("External query RD=%d\n", RD(buf)));
    386        
     386
    387387    if (retransmit == 0)
    388388        hash_add_request(pData, req);
     
    394394    /* let's slirp to care about expiration */
    395395    so->so_expire = curtime + recursive_timeout * 1000;
    396  
     396
    397397    memset(&addr, 0, sizeof(struct sockaddr_in));
    398398    addr.sin_family = AF_INET;
     
    408408    /* send it to our authoritative server */
    409409    Log2(("NAT: request will be sent to %RTnaipv4 on %R[natsock]\n", addr.sin_addr, so));
    410    
     410
    411411    byte = sendto(so->s, buf, (unsigned int)byte, 0,
    412412                  (struct sockaddr *)&addr,
    413413                  sizeof(struct sockaddr_in));
    414     if (byte == -1) 
     414    if (byte == -1)
    415415    {
    416416        /* XXX: is it really enough? */
     
    425425    ++authoritative_queries;
    426426
    427 # if 0   
    428     /* XXX: this stuff for _debugging_ only, 
    429      * first enforce guest to send next request 
    430      * and second for faster getting timeout callback 
    431      * other option is adding couple entries in resolv.conf with 
     427# if 0
     428    /* XXX: this stuff for _debugging_ only,
     429     * first enforce guest to send next request
     430     * and second for faster getting timeout callback
     431     * other option is adding couple entries in resolv.conf with
    432432     * invalid nameservers.
    433433     *
    434      * For testing purposes could be used 
    435      * namebench -S -q 10000 -m random or -m chunk 
     434     * For testing purposes could be used
     435     * namebench -S -q 10000 -m random or -m chunk
    436436     */
    437437    /* RTThreadSleep(3000); */
     
    497497        LogRel(("sendto failed: %s\n", strerror(errno)));
    498498        ++dropped_answers;
    499     } 
     499    }
    500500    else
    501501        ++answered_queries;
     
    509509
    510510    AssertPtr(pData);
    511    
     511
    512512    /* XXX: mbuf->data points to ??? */
    513513    byte = m->m_len;
     
    524524
    525525    /* find corresponding query */
    526     if (query == NULL) 
     526    if (query == NULL)
    527527    {
    528         /* XXX: if we haven't found anything for this request ... 
     528        /* XXX: if we haven't found anything for this request ...
    529529         * What we are expecting later?
    530530         */
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r48526 r48947  
    354354    /* set default addresses */
    355355    inet_aton("127.0.0.1", &loopback_addr);
    356    
     356
    357357    if (!fUseHostResolver)
    358358    {
     
    744744                if (so->so_timeout != NULL)
    745745                {
    746                     /* so_timeout - might change the so_expire value or 
    747                      * drop so_timeout* from so. 
     746                    /* so_timeout - might change the so_expire value or
     747                     * drop so_timeout* from so.
    748748                     */
    749749                    so->so_timeout(pData, so, so->so_timeout_arg);
    750                     /* on 4.2 so-> 
     750                    /* on 4.2 so->
    751751                     */
    752752                    if (   so_next->so_prev != so /* so_timeout freed the socket */
Note: See TracChangeset for help on using the changeset viewer.

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