VirtualBox

Changeset 37200 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
May 24, 2011 3:34:06 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
71896
Message:

API+Frontends: Generic network attachment driver support which obsoletes the special case for VDE. Big API cleanup in the same area. Adapt all frontends to these changes (full implementation in VBoxManage, minimum implementation in GUI).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/NetworkAdapterImpl.h

    r36275 r37200  
    77
    88/*
    9  * Copyright (C) 2006-2010 Oracle Corporation
     9 * Copyright (C) 2006-2011 Oracle Corporation
    1010 *
    1111 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    4747                 mPromiscModePolicy(NetworkAdapterPromiscModePolicy_Deny),
    4848                 mTraceEnabled(FALSE),
    49                  mHostInterface("") /* cannot be null */,
    50 #ifdef VBOX_WITH_VDE
    51                  mVDENetwork("") /* can be null */,
    52 #endif
     49                 mBridgedInterface("") /* cannot be null */,
     50                 mHostOnlyInterface("") /* cannot be null */,
    5351                 mNATNetwork("") /* cannot be null */,
    5452                 mBootPriority(0)
     
    6563        BOOL mTraceEnabled;
    6664        Bstr mTraceFile;
    67         Bstr mHostInterface;
     65        Bstr mBridgedInterface;
     66        Bstr mHostOnlyInterface;
    6867        Bstr mInternalNetwork;
    69 #ifdef VBOX_WITH_VDE
    70         Bstr mVDENetwork;
    71 #endif
    7268        Bstr mNATNetwork;
     69        Bstr mGenericDriver;
     70        settings::StringsMap mGenericProperties;
    7371        ULONG mBootPriority;
    7472        ComObjPtr<BandwidthGroup> mBandwidthGroup;
     
    8280
    8381    BEGIN_COM_MAP(NetworkAdapter)
    84         VBOX_DEFAULT_INTERFACE_ENTRIES (INetworkAdapter)
     82        VBOX_DEFAULT_INTERFACE_ENTRIES(INetworkAdapter)
    8583    END_COM_MAP()
    8684
    87     DECLARE_EMPTY_CTOR_DTOR (NetworkAdapter)
     85    DECLARE_EMPTY_CTOR_DTOR(NetworkAdapter)
    8886
    8987    HRESULT FinalConstruct();
     
    9189
    9290    // public initializer/uninitializer for internal purposes only
    93     HRESULT init (Machine *aParent, ULONG aSlot);
    94     HRESULT init (Machine *aParent, NetworkAdapter *aThat);
    95     HRESULT initCopy (Machine *aParent, NetworkAdapter *aThat);
     91    HRESULT init(Machine *aParent, ULONG aSlot);
     92    HRESULT init(Machine *aParent, NetworkAdapter *aThat);
     93    HRESULT initCopy(Machine *aParent, NetworkAdapter *aThat);
    9694    void uninit();
    9795
     
    9997    STDMETHOD(COMGETTER(AdapterType))(NetworkAdapterType_T *aAdapterType);
    10098    STDMETHOD(COMSETTER(AdapterType))(NetworkAdapterType_T aAdapterType);
    101     STDMETHOD(COMGETTER(Slot)) (ULONG *aSlot);
    102     STDMETHOD(COMGETTER(Enabled)) (BOOL *aEnabled);
    103     STDMETHOD(COMSETTER(Enabled)) (BOOL aEnabled);
    104     STDMETHOD(COMGETTER(MACAddress)) (BSTR *aMACAddress);
    105     STDMETHOD(COMSETTER(MACAddress)) (IN_BSTR aMACAddress);
    106     STDMETHOD(COMGETTER(AttachmentType)) (NetworkAttachmentType_T *aAttachmentType);
    107     STDMETHOD(COMGETTER(HostInterface)) (BSTR *aHostInterface);
    108     STDMETHOD(COMSETTER(HostInterface)) (IN_BSTR aHostInterface);
    109     STDMETHOD(COMGETTER(InternalNetwork)) (BSTR *aInternalNetwork);
    110     STDMETHOD(COMSETTER(InternalNetwork)) (IN_BSTR aInternalNetwork);
    111     STDMETHOD(COMGETTER(NATNetwork)) (BSTR *aNATNetwork);
    112     STDMETHOD(COMSETTER(NATNetwork)) (IN_BSTR aNATNetwork);
    113     STDMETHOD(COMGETTER(VDENetwork)) (BSTR *aVDENetwork);
    114     STDMETHOD(COMSETTER(VDENetwork)) (IN_BSTR aVDENetwork);
    115     STDMETHOD(COMGETTER(CableConnected)) (BOOL *aConnected);
    116     STDMETHOD(COMSETTER(CableConnected)) (BOOL aConnected);
    117     STDMETHOD(COMGETTER(TraceEnabled)) (BOOL *aEnabled);
    118     STDMETHOD(COMSETTER(TraceEnabled)) (BOOL aEnabled);
    119     STDMETHOD(COMGETTER(LineSpeed)) (ULONG *aSpeed);
    120     STDMETHOD(COMSETTER(LineSpeed)) (ULONG aSpeed);
     99    STDMETHOD(COMGETTER(Slot))(ULONG *aSlot);
     100    STDMETHOD(COMGETTER(Enabled))(BOOL *aEnabled);
     101    STDMETHOD(COMSETTER(Enabled))(BOOL aEnabled);
     102    STDMETHOD(COMGETTER(MACAddress))(BSTR *aMACAddress);
     103    STDMETHOD(COMSETTER(MACAddress))(IN_BSTR aMACAddress);
     104    STDMETHOD(COMGETTER(AttachmentType))(NetworkAttachmentType_T *aAttachmentType);
     105    STDMETHOD(COMSETTER(AttachmentType))(NetworkAttachmentType_T aAttachmentType);
     106    STDMETHOD(COMGETTER(BridgedInterface))(BSTR *aBridgedInterface);
     107    STDMETHOD(COMSETTER(BridgedInterface))(IN_BSTR aBridgedInterface);
     108    STDMETHOD(COMGETTER(HostOnlyInterface))(BSTR *aHostOnlyInterface);
     109    STDMETHOD(COMSETTER(HostOnlyInterface))(IN_BSTR aHostOnlyInterface);
     110    STDMETHOD(COMGETTER(InternalNetwork))(BSTR *aInternalNetwork);
     111    STDMETHOD(COMSETTER(InternalNetwork))(IN_BSTR aInternalNetwork);
     112    STDMETHOD(COMGETTER(NATNetwork))(BSTR *aNATNetwork);
     113    STDMETHOD(COMSETTER(NATNetwork))(IN_BSTR aNATNetwork);
     114    STDMETHOD(COMGETTER(GenericDriver))(BSTR *aGenericDriver);
     115    STDMETHOD(COMSETTER(GenericDriver))(IN_BSTR aGenericDriver);
     116    STDMETHOD(COMGETTER(CableConnected))(BOOL *aConnected);
     117    STDMETHOD(COMSETTER(CableConnected))(BOOL aConnected);
     118    STDMETHOD(COMGETTER(TraceEnabled))(BOOL *aEnabled);
     119    STDMETHOD(COMSETTER(TraceEnabled))(BOOL aEnabled);
     120    STDMETHOD(COMGETTER(LineSpeed))(ULONG *aSpeed);
     121    STDMETHOD(COMSETTER(LineSpeed))(ULONG aSpeed);
    121122    STDMETHOD(COMGETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T *aPromiscModePolicy);
    122123    STDMETHOD(COMSETTER(PromiscModePolicy))(NetworkAdapterPromiscModePolicy_T aPromiscModePolicy);
    123     STDMETHOD(COMGETTER(TraceFile)) (BSTR *aTraceFile);
    124     STDMETHOD(COMSETTER(TraceFile)) (IN_BSTR aTraceFile);
    125     STDMETHOD(COMGETTER(NatDriver)) (INATEngine **aNatDriver);
    126     STDMETHOD(COMGETTER(BootPriority)) (ULONG *aBootPriority);
    127     STDMETHOD(COMSETTER(BootPriority)) (ULONG aBootPriority);
    128     STDMETHOD(COMGETTER(BandwidthGroup)) (IBandwidthGroup **aBwGroup);
    129     STDMETHOD(COMSETTER(BandwidthGroup)) (IBandwidthGroup *aBwGroup);
     124    STDMETHOD(COMGETTER(TraceFile))(BSTR *aTraceFile);
     125    STDMETHOD(COMSETTER(TraceFile))(IN_BSTR aTraceFile);
     126    STDMETHOD(COMGETTER(NatDriver))(INATEngine **aNatDriver);
     127    STDMETHOD(COMGETTER(BootPriority))(ULONG *aBootPriority);
     128    STDMETHOD(COMSETTER(BootPriority))(ULONG aBootPriority);
     129    STDMETHOD(COMGETTER(BandwidthGroup))(IBandwidthGroup **aBwGroup);
     130    STDMETHOD(COMSETTER(BandwidthGroup))(IBandwidthGroup *aBwGroup);
    130131
    131132    // INetworkAdapter methods
    132     STDMETHOD(AttachToNAT)();
    133     STDMETHOD(AttachToBridgedInterface)();
    134     STDMETHOD(AttachToInternalNetwork)();
    135     STDMETHOD(AttachToHostOnlyInterface)();
    136     STDMETHOD(AttachToVDE)();
    137     STDMETHOD(Detach)();
     133    STDMETHOD(GetProperty)(IN_BSTR aName, BSTR *aValue);
     134    STDMETHOD(SetProperty)(IN_BSTR aName, IN_BSTR aValue);
     135    STDMETHOD(GetProperties)(IN_BSTR aNames,
     136                             ComSafeArrayOut(BSTR, aReturnNames),
     137                             ComSafeArrayOut(BSTR, aReturnValues));
    138138
    139139    // public methods only for internal purposes
     
    145145    void rollback();
    146146    void commit();
    147     void copyFrom (NetworkAdapter *aThat);
    148     void applyDefaults (GuestOSType *aOsType);
     147    void copyFrom(NetworkAdapter *aThat);
     148    void applyDefaults(GuestOSType *aOsType);
    149149
    150150private:
    151151
    152     void detach();
    153152    void generateMACAddress();
    154153    HRESULT updateMacAddress(Utf8Str aMacAddress);
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