VirtualBox

Changeset 28147 in vbox


Ignore:
Timestamp:
Apr 9, 2010 2:24:34 PM (15 years ago)
Author:
vboxsync
Message:

NAT: Fixed missing setting of time_fasttimo in ip_icmp.c. Removed slirp_arm_fast_timer and slirp_arm_slow_timer.

Location:
trunk/src/VBox
Files:
5 edited

Legend:

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

    r28146 r28147  
    196196    volatile uint32_t       cUrgPkt;
    197197    volatile uint32_t       cPkt;
    198     PTMTIMERR3              pTmrSlow;
    199     PTMTIMERR3              pTmrFast;
    200198} DRVNAT;
    201199AssertCompileMemberAlignment(DRVNAT, StatNATRecvWakeups, 8);
     
    832830#endif /* VBOX_WITH_SLIRP_MT */
    833831
    834 
    835 /**
    836  * The callback for the fast (2 ms) NAT timer.
    837  *
    838  * @param   pDrvIns             The driver instance.
    839  * @param   pTimer              The timer handle.
    840  * @param   pvUser              The NAT instance data.
    841  */
    842 static DECLCALLBACK(void) drvNATFastTimer(PPDMDRVINS pDrvIns, PTMTIMER pTimer, void *pvUser)
    843 {
    844     PDRVNAT pThis = (PDRVNAT)pvUser;
    845     drvNATNotifyNATThread(pThis, "drvNATFastTimer");
    846 }
    847 
    848 void slirp_arm_fast_timer(void *pvUser)
    849 {
    850 #if 0
    851     PDRVNAT pThis = (PDRVNAT)pvUser;
    852     AssertPtr(pThis);
    853     TMTimerSetMillies(pThis->pTmrFast, 2);
    854 #endif
    855 }
    856 
    857 /**
    858  * The callback for the slow (500 ms) NAT timer.
    859  *
    860  * @param   pDrvIns             The driver instance.
    861  * @param   pTimer              The timer handle.
    862  * @param   pvUser              The NAT instance data.
    863  */
    864 static DECLCALLBACK(void) drvNATSlowTimer(PPDMDRVINS pDrvIns, PTMTIMER pTimer, void *pvUser)
    865 {
    866     PDRVNAT pThis = (PDRVNAT)pvUser;
    867     drvNATNotifyNATThread(pThis, "drvNATSlowTimer");
    868 }
    869 
    870 void slirp_arm_slow_timer(void *pvUser)
    871 {
    872 #if 0
    873     PDRVNAT pThis = (PDRVNAT)pvUser;
    874     AssertPtr(pThis);
    875 
    876     TMTimerSetMillies(pThis->pTmrSlow, 500);
    877 #endif
    878 }
    879 
    880832/**
    881833 * Function called by slirp to check if it's possible to feed incoming data to the network port.
     
    12761228            rc = RTSemEventCreate(&pThis->EventUrgRecv);
    12771229            rc = RTCritSectInit(&pThis->csDevAccess);
    1278             rc = PDMDrvHlpTMTimerCreate(pThis->pDrvIns, TMCLOCK_REAL/*enmClock*/, drvNATSlowTimer,
    1279                     pThis, TMTIMER_FLAGS_NO_CRIT_SECT/*flags*/, "NATSlowTmr", &pThis->pTmrSlow);
    1280             rc = PDMDrvHlpTMTimerCreate(pThis->pDrvIns, TMCLOCK_REAL/*enmClock*/, drvNATFastTimer,
    1281                     pThis, TMTIMER_FLAGS_NO_CRIT_SECT/*flags*/, "NATFastTmr", &pThis->pTmrFast);
    12821230
    12831231#ifndef RT_OS_WINDOWS
  • trunk/src/VBox/Devices/Network/slirp/ip_icmp.c

    r27976 r28147  
    423423                        icmp_error(pData, m, ICMP_UNREACH, ICMP_UNREACH_NET, 0, strerror(errno));
    424424                    }
    425                     else
    426                         slirp_arm_fast_timer(pData->pvUser);
     425                    else if (!time_fasttimo)
     426                    {
     427                        time_fasttimo = curtime; /* Flag when we want a fasttimo */
     428                    }
    427429
    428430                }
  • trunk/src/VBox/Devices/Network/slirp/libslirp.h

    r27848 r28147  
    5454/* you must provide the following functions: */
    5555void slirp_arm_fast_timer(void *pvUser);
    56 void slirp_arm_slow_timer(void *pvUser);
    5756int slirp_can_output(void * pvUser);
    5857void slirp_output(void * pvUser, struct mbuf *m, const uint8_t *pkt, int pkt_len);
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r28146 r28147  
    836836            {
    837837                do_slowtimo = 1;
    838                 slirp_arm_slow_timer(pData->pvUser);
    839838                break;
    840839            }
     
    875874        {
    876875            time_fasttimo = curtime; /* Flag when we want a fasttimo */
    877             slirp_arm_fast_timer(pData->pvUser);
    878876        }
    879877
     
    977975            {
    978976                do_slowtimo = 1; /* Let socket expire */
    979                 slirp_arm_slow_timer(pData->pvUser);
    980977            }
    981978        }
  • trunk/src/VBox/NetworkServices/NAT/VBoxNetNAT.cpp

    r28146 r28147  
    108108    volatile uint32_t       cUrgPkt;
    109109    volatile uint32_t       cPkt;
    110 
    111     PRTTIMER              pTmrSlow;
    112     PRTTIMER              pTmrFast;
    113     bool                  fIsRunning;
     110    bool                    fIsRunning;
    114111};
    115112
     
    126123static void SendWorker(struct mbuf *m, size_t cb);
    127124static void IntNetSendWorker(bool urg, const void *pvFrame, size_t cbFrame, struct mbuf *m);
    128 static void natNotifyNATThread();
    129 
    130 void slirp_arm_fast_timer(void *pvUser)
    131 {
    132     RTTimerStart(g_pNAT->pTmrFast, 2);
    133 }
    134 
    135 void slirp_arm_slow_timer(void *pvUser)
    136 {
    137     RTTimerStart(g_pNAT->pTmrSlow, 500);
    138 }
    139 
    140 static DECLCALLBACK(void) natSlowTimer(PRTTIMER ppTimer, void *pvUser, uint64_t iTick)
    141 {
    142     natNotifyNATThread();
    143 }
    144 
    145 static DECLCALLBACK(void) natFastTimer(PRTTIMER ppTimer, void *pvUser, uint64_t iTick)
    146 {
    147     natNotifyNATThread();
    148 }
    149 
    150 static void natNotifyNATThread()
     125
     126
     127static void natNotifyNATThread(void)
    151128{
    152129    int rc;
     
    222199    rc = RTThreadCreate(&m_ThrSndNAT, natSndThread, this, 128 * _1K, RTTHREADTYPE_DEFAULT, 0, "SndNAT");
    223200    rc = RTThreadCreate(&m_ThrUrgSndNAT, natUrgSndThread, this, 128 * _1K, RTTHREADTYPE_DEFAULT, 0, "UrgSndNAT");
    224     rc = RTTimerCreate(&pTmrSlow, 0 /* one-shot */, natSlowTimer, this);
    225     rc = RTTimerCreate(&pTmrFast, 0 /* one-shot */ , natFastTimer, this);
    226201    rc = RTSemEventCreate(&m_EventSend);
    227202    rc = RTSemEventCreate(&m_EventUrgSend);
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