VirtualBox

Changeset 559 in vbox


Ignore:
Timestamp:
Feb 2, 2007 3:24:29 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
18178
Message:

Added INetworkConnector callback for sending multiple packets

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

Legend:

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

    r1 r559  
    154154}
    155155
     156
     157/**
     158 * Send multiple data packets to the network.
     159 *
     160 * @returns VBox status code.
     161 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     162 * @param   cPackets        Number of packets
     163 * @param   paPacket        Packet description array
     164 * @thread  EMT
     165 */
     166static DECLCALLBACK(int) drvIntNetSendEx(PPDMINETWORKCONNECTOR pInterface, uint32_t cPackets, PPDMINETWORKPACKET paPacket)
     167{
     168    int rc = VERR_INVALID_PARAMETER;
     169
     170    for (uint32_t i=0;i<cPackets;i++)
     171    {
     172        rc = drvIntNetSend(pInterface, paPacket[i].pvBuf, paPacket[i].cb);
     173        if (VBOX_FAILURE(rc))
     174            break;
     175    }
     176    return rc;
     177}
    156178
    157179/**
     
    611633    /* INetwork */
    612634    pThis->INetworkConnector.pfnSend                = drvIntNetSend;
     635    pThis->INetworkConnector.pfnSendEx              = drvIntNetSendEx;
    613636    pThis->INetworkConnector.pfnSetPromiscuousMode  = drvIntNetSetPromiscuousMode;
    614637    pThis->INetworkConnector.pfnNotifyLinkChanged   = drvIntNetNotifyLinkChanged;
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r530 r559  
    9999
    100100/**
     101 * Send multiple data packets to the network.
     102 *
     103 * @returns VBox status code.
     104 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     105 * @param   cPackets        Number of packets
     106 * @param   paPacket        Packet description array
     107 * @thread  EMT
     108 */
     109static DECLCALLBACK(int) drvNATSendEx(PPDMINETWORKCONNECTOR pInterface, uint32_t cPackets, PPDMINETWORKPACKET paPacket)
     110{
     111    int rc = VERR_INVALID_PARAMETER;
     112
     113    for (uint32_t i=0;i<cPackets;i++)
     114    {
     115        rc = drvNATSend(pInterface, paPacket[i].pvBuf, paPacket[i].cb);
     116        if (VBOX_FAILURE(rc))
     117            break;
     118    }
     119    return rc;
     120}
     121
     122/**
    101123 * Set promiscuous mode.
    102124 *
     
    355377    pDrvIns->IBase.pfnQueryInterface    = drvNATQueryInterface;
    356378    /* INetwork */
    357     pData->INetworkConnector.pfnSend    = drvNATSend;
     379    pData->INetworkConnector.pfnSend               = drvNATSend;
     380    pData->INetworkConnector.pfnSendEx             = drvNATSendEx;
    358381    pData->INetworkConnector.pfnSetPromiscuousMode = drvNATSetPromiscuousMode;
    359     pData->INetworkConnector.pfnNotifyLinkChanged = drvNATNotifyLinkChanged;
    360     pData->INetworkConnector.pfnNotifyCanReceive = drvNATNotifyCanReceive;
     382    pData->INetworkConnector.pfnNotifyLinkChanged  = drvNATNotifyLinkChanged;
     383    pData->INetworkConnector.pfnNotifyCanReceive   = drvNATNotifyCanReceive;
    361384
    362385    /*
  • trunk/src/VBox/Devices/Network/DrvNetSniffer.cpp

    r1 r559  
    149149
    150150/**
     151 * Send multiple data packets to the network.
     152 *
     153 * @returns VBox status code.
     154 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     155 * @param   cPackets        Number of packets
     156 * @param   paPacket        Packet description array
     157 * @thread  EMT
     158 */
     159static DECLCALLBACK(int) drvNetSnifferSendEx(PPDMINETWORKCONNECTOR pInterface, uint32_t cPackets, PPDMINETWORKPACKET paPacket)
     160{
     161    int rc = VERR_INVALID_PARAMETER;
     162
     163    for (uint32_t i=0;i<cPackets;i++)
     164    {
     165        rc = drvNetSnifferSend(pInterface, paPacket[i].pvBuf, paPacket[i].cb);
     166        if (VBOX_FAILURE(rc))
     167            break;
     168    }
     169    return rc;
     170}
     171
     172
     173/**
    151174 * Set promiscuous mode.
    152175 *
     
    334357    /* INetworkConnector */
    335358    pData->INetworkConnector.pfnSend                = drvNetSnifferSend;
     359    pData->INetworkConnector.pfnSendEx              = drvNetSnifferSendEx;
    336360    pData->INetworkConnector.pfnSetPromiscuousMode  = drvNetSnifferSetPromiscuousMode;
    337361    pData->INetworkConnector.pfnNotifyLinkChanged   = drvNetSnifferNotifyLinkChanged;
  • trunk/src/VBox/Devices/Network/DrvTAP.cpp

    r1 r559  
    157157}
    158158
     159/**
     160 * Send multiple data packets to the network.
     161 *
     162 * @returns VBox status code.
     163 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     164 * @param   cPackets        Number of packets
     165 * @param   paPacket        Packet description array
     166 * @thread  EMT
     167 */
     168static DECLCALLBACK(int) drvTAPSendEx(PPDMINETWORKCONNECTOR pInterface, uint32_t cPackets, PPDMINETWORKPACKET paPacket)
     169{
     170    int rc = VERR_INVALID_PARAMETER;
     171
     172    for (uint32_t i=0;i<cPackets;i++)
     173    {
     174        rc = drvTAPSend(pInterface, paPacket[i].pvBuf, paPacket[i].cb);
     175        if (VBOX_FAILURE(rc))
     176            break;
     177    }
     178    return rc;
     179}
    159180
    160181/**
     
    509530    /* INetwork */
    510531    pData->INetworkConnector.pfnSend                = drvTAPSend;
     532    pData->INetworkConnector.pfnSendEx              = drvTAPSendEx;
    511533    pData->INetworkConnector.pfnSetPromiscuousMode  = drvTAPSetPromiscuousMode;
    512534    pData->INetworkConnector.pfnNotifyLinkChanged   = drvTAPNotifyLinkChanged;
  • trunk/src/VBox/Devices/Network/DrvTAPWin32.cpp

    r557 r559  
    165165}
    166166
     167/**
     168 * Send multiple data packets to the network.
     169 *
     170 * @returns VBox status code.
     171 * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     172 * @param   cPackets        Number of packets
     173 * @param   paPacket        Packet description array
     174 * @thread  EMT
     175 */
     176static DECLCALLBACK(int) drvTAPW32SendEx(PPDMINETWORKCONNECTOR pInterface, uint32_t cPackets, PPDMINETWORKPACKET paPacket)
     177{
     178    int rc = VERR_INVALID_PARAMETER;
     179
     180    for (uint32_t i=0;i<cPackets;i++)
     181    {
     182        rc = drvTAPW32Send(pInterface, paPacket[i].pvBuf, paPacket[i].cb);
     183        if (VBOX_FAILURE(rc))
     184            break;
     185    }
     186    return rc;
     187}
     188
    167189
    168190/**
     
    466488    /* INetwork */
    467489    pData->INetworkConnector.pfnSend                = drvTAPW32Send;
     490    pData->INetworkConnector.pfnSendEx              = drvTAPW32SendEx;
    468491    pData->INetworkConnector.pfnSetPromiscuousMode  = drvTAPW32SetPromiscuousMode;
    469492    pData->INetworkConnector.pfnNotifyLinkChanged   = drvTAPW32NotifyLinkChanged;
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