VirtualBox

Changeset 18706 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Apr 3, 2009 5:25:02 PM (16 years ago)
Author:
vboxsync
Message:

TAP -> NetAdp rename for linux NetFlt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c

    r18541 r18706  
    159159
    160160/*
    161  * TAP-related part
    162  */
    163 
    164 #define VBOX_TAP_NAME "vboxnet%d"
     161 * NetAdp-related part
     162 */
     163
     164#define VBOX_NETADP_NAME "vboxnet%d"
    165165
    166166struct net_device *g_pNetDev;
    167167
    168 struct VBoxTapPriv
     168struct VBoxNetAdpPriv
    169169{
    170170    struct net_device_stats Stats;
    171171};
    172 typedef struct VBoxTapPriv VBOXTAPPRIV;
    173 typedef VBOXTAPPRIV *PVBOXTAPPRIV;
    174 
    175 static int vboxTapOpen(struct net_device *pNetDev)
     172typedef struct VBoxNetAdpPriv VBOXNETADPPRIV;
     173typedef VBOXNETADPPRIV *PVBOXNETADPPRIV;
     174
     175static int vboxNetAdpOpen(struct net_device *pNetDev)
    176176{
    177177    netif_start_queue(pNetDev);
    178     printk("vboxTapOpen returns 0\n");
     178    printk("vboxNetAdpOpen returns 0\n");
    179179    return 0;
    180180}
    181181
    182 static int vboxTapStop(struct net_device *pNetDev)
     182static int vboxNetAdpStop(struct net_device *pNetDev)
    183183{
    184184    netif_stop_queue(pNetDev);
     
    186186}
    187187
    188 static int vboxTapXmit(struct sk_buff *pSkb, struct net_device *pNetDev)
    189 {
    190     PVBOXTAPPRIV pPriv = netdev_priv(pNetDev);
     188static int vboxNetAdpXmit(struct sk_buff *pSkb, struct net_device *pNetDev)
     189{
     190    PVBOXNETADPPRIV pPriv = netdev_priv(pNetDev);
    191191
    192192    /* Update the stats. */
     
    200200}
    201201
    202 struct net_device_stats *vboxTapGetStats(struct net_device *pNetDev)
    203 {
    204     PVBOXTAPPRIV pPriv = netdev_priv(pNetDev);
     202struct net_device_stats *vboxNetAdpGetStats(struct net_device *pNetDev)
     203{
     204    PVBOXNETADPPRIV pPriv = netdev_priv(pNetDev);
    205205    return &pPriv->Stats;
    206206}
    207207
    208 /* Currently not referenced in vboxTapNetDevInit
    209 static int vboxTapValidateAddr(struct net_device *dev)
    210 {
    211     Log(("vboxTapValidateAddr: %02x:%02x:%02x:%02x:%02x:%02x\n",
     208/* Currently not referenced in vboxNetAdpNetDevInit
     209static int vboxNetAdpValidateAddr(struct net_device *dev)
     210{
     211    Log(("vboxNetAdpValidateAddr: %02x:%02x:%02x:%02x:%02x:%02x\n",
    212212         dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
    213213         dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]));
     
    215215} */
    216216
    217 static void vboxTapNetDevInit(struct net_device *pNetDev)
    218 {
    219     PVBOXTAPPRIV pPriv;
     217static void vboxNetAdpNetDevInit(struct net_device *pNetDev)
     218{
     219    PVBOXNETADPPRIV pPriv;
    220220
    221221    ether_setup(pNetDev);
    222222    /// @todo Use Sun vendor id
    223223    memcpy(pNetDev->dev_addr, "\0vbnet", ETH_ALEN);
    224     Log(("vboxTapNetDevInit: pNetDev->dev_addr = %.6Rhxd\n", pNetDev->dev_addr));
    225     pNetDev->open = vboxTapOpen;
    226     pNetDev->stop = vboxTapStop;
    227     pNetDev->hard_start_xmit = vboxTapXmit;
    228     pNetDev->get_stats = vboxTapGetStats;
    229     //pNetDev->validate_addr = vboxTapValidateAddr;
    230 /*    pNetDev-> = vboxTap;
    231     pNetDev-> = vboxTap;
    232     pNetDev-> = vboxTap;
    233     pNetDev-> = vboxTap;
    234     pNetDev-> = vboxTap;*/
     224    Log(("vboxNetAdpNetDevInit: pNetDev->dev_addr = %.6Rhxd\n", pNetDev->dev_addr));
     225    pNetDev->open = vboxNetAdpOpen;
     226    pNetDev->stop = vboxNetAdpStop;
     227    pNetDev->hard_start_xmit = vboxNetAdpXmit;
     228    pNetDev->get_stats = vboxNetAdpGetStats;
     229    //pNetDev->validate_addr = vboxNetAdpValidateAddr;
     230/*    pNetDev-> = vboxNetAdp;
     231    pNetDev-> = vboxNetAdp;
     232    pNetDev-> = vboxNetAdp;
     233    pNetDev-> = vboxNetAdp;
     234    pNetDev-> = vboxNetAdp;*/
    235235
    236236    pPriv = netdev_priv(pNetDev);
     
    238238}
    239239
    240 static int vboxTapRegisterNetDev(void)
     240static int vboxNetAdpRegisterNetDev(void)
    241241{
    242242    int rc = VINF_SUCCESS;
     
    244244
    245245    /* No need for private data. */
    246     pNetDev = alloc_netdev(sizeof(VBOXTAPPRIV), VBOX_TAP_NAME, vboxTapNetDevInit);
     246    pNetDev = alloc_netdev(sizeof(VBOXNETADPPRIV), VBOX_NETADP_NAME, vboxNetAdpNetDevInit);
    247247    if (pNetDev)
    248248    {
     
    259259}
    260260
    261 static int vboxTapUnregisterNetDev(void)
     261static int vboxNetAdpUnregisterNetDev(void)
    262262{
    263263    unregister_netdev(g_pNetDev);
     
    301301        if (RT_SUCCESS(rc))
    302302        {
    303             rc = vboxTapRegisterNetDev();
     303            rc = vboxNetAdpRegisterNetDev();
    304304            if (RT_SUCCESS(rc))
    305305            {
     
    336336     * Undo the work done during start (in reverse order).
    337337     */
    338     rc = vboxTapUnregisterNetDev();
     338    rc = vboxNetAdpUnregisterNetDev();
    339339    AssertRC(rc);
    340340    rc = vboxNetFltTryDeleteIdcAndGlobals(&g_VBoxNetFltGlobals);
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