VirtualBox

Changeset 28208 in vbox for trunk/include/VBox


Ignore:
Timestamp:
Apr 12, 2010 2:07:33 PM (15 years ago)
Author:
vboxsync
Message:

intnet,VBoxNetFlt-linux: Added INTNETTRUNKSWPORT::pfnPreRecv for doing filtering and switching in difficult contexts. It currently returns broadcast all the time, but that will be addressed before long.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/intnet.h

    r28120 r28208  
    353353/** @} */
    354354
     355/**
     356 * Switch decisions returned by INTNETTRUNKSWPORT::pfnPreRecv.
     357 */
     358typedef enum INTNETSWDECISION
     359{
     360    /** The usual invalid zero value. */
     361    INTNETSWDECISION_INVALID = 0,
     362    /** Everywhere. */
     363    INTNETSWDECISION_BROADCAST,
     364    /** Only to the internal network. */
     365    INTNETSWDECISION_INTNET,
     366    /** Only for the trunk (host/wire). */
     367    INTNETSWDECISION_TRUNK,
     368    /** The usual 32-bit type expansion. */
     369    INTNETSWDECISION_32BIT_HACK = 0x7fffffff
     370} INTNETSWDECISION;
     371
    355372
    356373/** Pointer to the switch side of a trunk port. */
     
    366383    /** Structure version number. (INTNETTRUNKSWPORT_VERSION) */
    367384    uint32_t u32Version;
     385
     386    /**
     387     * Examine the packet and figure out where it is going.
     388     *
     389     * This method is for making packet switching decisions in contexts where
     390     * pfnRecv cannot be called or is no longer applicable.  This method can be
     391     * called from any context.
     392     *
     393     * @returns INTNETSWDECISION_BROADCAST, INTNETSWDECISION_INTNET or
     394     *          INTNETSWDECISION_TRUNK.  The source is excluded from broadcast &
     395     *          trunk, of course.
     396     *
     397     * @param   pSwitchPort Pointer to this structure.
     398     * @param   pvHdrs      Pointer to the packet headers.
     399     * @param   cbHdrs      Size of the packet headers.  This must be at least 6
     400     *                      bytes (the destination MAC address), but should if
     401     *                      possibly also include any VLAN tag and network layer
     402     *                      header (wireless mac address sharing).
     403     * @param   fSrc        Where this frame comes from.  Only one bit should be
     404     *                      set!
     405     *
     406     * @remarks Will only grab the switch table spinlock (interrupt safe).
     407     */
     408    DECLR0CALLBACKMEMBER(INTNETSWDECISION, pfnPreRecv,(PINTNETTRUNKSWPORT pSwitchPort,
     409                                                       void const *pvHdrs, size_t cbHdrs, uint32_t fSrc));
    368410
    369411    /**
     
    376418     *
    377419     * @returns true if we've handled it and it should be dropped.
    378      *          false if it should hit the wire.
     420     *          false if it should hit the wire/host.
    379421     *
    380422     * @param   pSwitchPort Pointer to this structure.
     
    679721
    680722/** The UUID for the (current) trunk factory. (case sensitive) */
    681 #define INTNETTRUNKFACTORY_UUID_STR     "1d3810bc-0899-42b0-8ae1-346a08bffff7"
     723#define INTNETTRUNKFACTORY_UUID_STR     "b010afb2-cb4c-44b7-9da9-1e113cfcd47c"
    682724
    683725/** @name INTNETTRUNKFACTORY::pfnCreateAndConnect flags.
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