# Updating the Configuration

In most cases, to update the configuration, the client application will need to get a client handle from the IANet_NetService class and store this handle in an IWbemContext context object. Changes to the configuration will only occur when the “Apply” method on the IANet_NetService is called.

## Changing the Adapter, Team or VLAN Settings

To change an adapter, VLAN or Team setting, the client must first get the object path of the setting that it will change. This is best done by enumerating the settings on the object and storing the __PATH attribute of the setting (see above).

The easiest way for the client to update a setting, is to: (1) get an instance of the setting object from WMI, (2) modify the CurrentValue attribute (using IWbemClassObject::Put() ), and (3) call IWbemServices::PutInstance() to pass the modified instance back to the Provider. PutInstance must be called with the flag WBEM_FLAG_UPDATE_ONLY.

The Provider will validate the CurrentValue and return WBEM_E_FAIL if the validation failed. The exact reason for the failure will be returned in the Description attribute of the IANet_ExtendedStatus object.

Setting specific descriptions include:

- The integer setting value was less than the minimum allowed
- The integer setting value was greater than the maximum allowed
- The integer setting value is not one of the allowable steps
- The length of the string setting is bigger than the maximum allowed
- The setting value is not one of the allowable values

The last description is returned whenever the current value for IANet_SettingEnum, IANet_SettingSlider or IANet_SettingMultiSelection is not one of the allowable values.

The only attribute for a setting that the client can change is CurrentValue. The Provider will ignore changes made to any of the other values.

There are no supported methods on the setting class. To make changes to a setting modify the CurrentValue property, then call PutInstance.

## Creating a New Team

To create a new team, create an instance of IANet_TeamOfAdapters (i.e., use IWbemServices::GetObject() to get a class object for IANet_TeamOfAdapters, and then use IWbemServices::SpawnInstance() to create an instance of this object).

Then, use IWbemClassObject::Put to set the TeamMode attribute in the instance to be the desired team type (e.g., AFT). Finally, call IWbemServices::PutInstance() to create the team, passing the flag WBEM_FLAG_CREATE_ONLY.

The object path for the new team is stored in the IWbemCallResultObject that is passed back to the user when the call has completed. The method IWbemCallResult::GetResultString will get the new object path.

If this action fails, the client should check the IANet_ExtendedStatus to get the failure reasons.

## Adding an Adapter to a Team

To add an adapter to a team create an instance of IANet_TeamedMemberAdapter (i.e., use IWbemServices::GetObject() to get a class object for IANet_TeamedMemberAdapter , and then use IWbemServices::SpawnInstance() to create an instance of this object).

The following attributes in the object must be set using IWbemClassObject::Put() :

- GroupComponent must be set to be the full object path of the IANet_TeamOfAdapters to which the adapter is to be added;
- PartComponent must be set to be the full object path of the IANet_EthernetAdapter that is to be added to the team.

The following attributes may optionally be set:

- Can be used to set the priority for the adapter in the team.

Finally, call IWbemServices::PutInstance() to add the adapter to the team, passing the flag WBEM_FLAG_CREATE_ONLY.

If this action fails, check IANet_ExtendedStatus for the error code.

## Removing an Adapter from a Team

To remove an adapter from a team, delete the IANet_TeamedMemberAdapter instance that associates the adapter to the team using IWbemServices::DeleteInstance()

If this action fails, check IANet_ExtendedStatus for the error code.

## Deleting a Team

To delete a team, delete the IANet_TeamOfAdapters instance using IWbemServices::DeleteInstance()

If this action fails, check IANet_ExtendedStatus to get the error code.

## Changing the Mode of a Team

To change the mode of a team, get the instance of IANet_TeamOfAdapters for the team (e.g., use IWbemServices::GetObject using the object path of the team).

Then, use IWbemClassObject::Put to change the TeamMode attribute for the team. Finally, call IWbemClassObject:: PutInstance to tell the Provider to update the team mode, passing the flag WBEM_FLAG_UPDATE_ONLY.

If this action fails, check IANet_ExtendedStatus to get the error code.

## Changing an Adapter’s Priority Within a Team

To change the priority of an adapter the client should first get the instance of IANet_TeamedMemberAdapter for the adapter. (e.g. use IWbemServices::GetObject using the object path).

The client can then use IWbemClassObject::Put to change the AdapterFunction attribute for the adapter. Finally the client needs to call IWbemClassObject:: PutInstance to tell the Provider to update adapter’s priority.

If this action fails the client should check the IANet_ExtendedStatus for the error code.

## Uninstalling an Adapter

To uninstall an adapter, call IWbemServices::DeleteInstance passing the object path of the adapter to uninstall.

## Creating a VLAN

To create a VLAN, call the CreateVLAN method on the IANet_802dot1QVLANService for the adapter to which the VLAN is to be added. The following arguments must be passed to the method:

- VLANNumber the number of the VLAN. (Range 1- 4094)
- Name a user definable name to identify the VLAN.

The function will return the object path of the newly created VLAN in the out parameter VLANpath.

If this action fails, check IANet_ExtendedStatus for the error code.

## Changing the Attributes of a VLAN

The client can change the VLANNumber and VLANName attributes for a VLAN. To change the priority of an adapter, first get the instance of IANet_VLAN for the adapter (e.g. use IWbemServices::GetObject using the object path).

Then, change VLANNumber or VLANName to the desired values. Finally, call IWbemClassObject:: PutInstance to tell the Provider to update the attributes, passing the flag WBEM_FLAG_UPDATE_ONLY.

If this action fails, check the IANet_ExtendedStatus for the error code.

## Deleting a VLAN

To delete a VLAN, call IWbemServices::DeleteInstance passing the object path of the VLAN to delete.

## Updating the Boot Agent

The client can update the Boot Agent Image by using methods calls. To read/write flash image, first get the instance of IANet_BootAgent for the adapter (e.g., use IWbemServices::GetObject using the object path).

Then, execute ReadFlash() to read the existing flash boot ROM image or ProgramFlash() to update the flash boot ROM image.

If this action fails, check the IANet_ExtendedStatus for the error code.

Task | WMI methods | Result | Comments
Update or Insert a boot ROM image for the adapter | uint32 ProgramFlash( [IN, ValueMap {"0","1"} , Values {"Check Version", "Write Flash"}: Amended ] uint32 Action, [IN] uint8 NewFlashData[], [OUT] uint32 FlashRetCode ); | If “Check Version” action is specified, this method will return with a warning message, if boot ROM image being updated as in NewFlashData[] is older than one already present on NIC. If “Write” action is specified, this updates the FLASH ROM on the NIC with NewFlashData[]. | This method is used to update the Flash ROM on the NIC. This will cause the NIC to stop communicating with the network while the flash is updated.
Read boot ROM image | uint32 ReadFlash( [OUT] uint8 FlashData[] ); | FlashData[] contains the Flash ROM image on the NIC | This method reads the Flash ROM on the NIC which can be saved into a file.

## Executing Methods in IANet_DiagTest

The RunTest method from the MOF file is as follows:

uint32 RunTest([IN] CIM_ManagedSystemElement ref SystemElement,
[IN] CIM_DiagnosticSetting ref Setting,
[OUT] CIM_DiagnosticResult ref Result);

The first two parameters are parameters. You must get the object path of both objects referenced. You must also get the object path of the IANet_DiagTest object, which is exporting the RunTest object.

1. From the main WBEM test dialog box, click Connect.
2. Enter the appropriate Server\Namespace. Namespaces IntelNCS2 and CimV2 are supported.
3. Click the Enum Instances button of WBEM test and enter `IANet_EthernetAdapter`
4. Double click on the adapter to be tested.
5. The following is an example of the object path retrieved.
   `\\MYCOMPUTER\root\cimv2:IANet_EthernetAdapter.DeviceID="{4A0CDABE-F6C3-45D0-B60D-F6E7BAFA2C2C}"`
6. Save the object path.
7. Click the Enum Instances button of WBEM test and enter `IANet_DiagTest`
8. Double click the desired instance of IANet_DiagTest. The name will be in the form X@[AdapterGUID}, where X is the test name and AdapterGUID will be the Adapter Name, which is the same as the Name key of the IANet_EthernetAdapter.
9. The following is an example of the object path retrieved:
   `\\MYCOMPUTER\root\Cimv2:IANet_DiagTest.Name="1@{4A0CDABE-F6C3-45D0-B60D-F6E7BAFA2C2C}"`
10. Save the object path.
11. Click the Enum Instances button of WBEM test and enter `IANet_DiagSetting`
12. Double click on the setting which represents the desired adapter/test combination.
13. Following is an example of the object path retrieved:
    `\\MYCOMPUTER\root\cimv2:IANet_DiagSetting.SettingID="1@{4A0CDABE-F6C3-45D0-B60D-F6E7BAFA2C2C}"`
14. Save the object path.
15. From the main WBEM test dialog box, click Execute Method
16. Paste the IANet_DiagTest object path into the dialog box. Click OK.
17. Select the test in the drop down box under method.
18. Click the Edit In Parameters button.
19. For RunTest, Setting and SystemElement are the parameters. Paste the previously saved Setting and Adapter object paths. Save objects and close.
20. Click the Execute button.
21. Enumerate the IANet_DiagResult class, in the same manner as the parameters.
22. Examine the selected result object as needed.
23. Scroll down to check for test status. If = 2 then the test passed.

Home

Copyright© 2004 Intel Corporation. Legal Information