/// <summary> /// Create VSEM switch extension infos. /// </summary> /// <returns>List of VSEMSwitchExtensionInfo instances.</returns> private static List<VSEMSwitchExtensionInfo> CreateSwitchExtensionInfos() { ODLVSEMETW.EventWriteCreateSwitchExtensionInfo( "Creating switch extension information.", string.Empty); List<VSEMSwitchExtensionInfo> info = new List<VSEMSwitchExtensionInfo>(); VSEMSwitchExtensionInfo pf1000 = new VSEMSwitchExtensionInfo(); pf1000.Id = VSEMODLConstants.SWITCH_EXTENSION_INFO_ID; pf1000.DriverNetCfgInstanceId = VSEMODLConstants.PF1000_NETCFG_INSTANCE_ID; pf1000.Name = VSEMODLConstants.SWITCH_EXTENSION_INFO_NAME; pf1000.MinVersion = VSEMODLConstants.SWITCH_EXTENSION_INFO_MIN_VERSION; pf1000.MaxVersion = VSEMODLConstants.SWITCH_EXTENSION_INFO_MAX_VERSION; pf1000.ExtensionType = VSEMODLConstants.SWITCH_EXTENSION_TYPE; pf1000.IsSwitchTeamSupported = VSEMODLConstants.SWITCH_EXTENSION_INFO_SUPPORT_SWITCH_TEAMING; pf1000.DefaultVirtualPortProfileId = VSEMODLConstants.VIRTUAL_PORT_PROFILE_ID; pf1000.MandatoryFeatureId = VSEMODLConstants.SWITCH_EXTENSION_INFO_MANDATORY_FEATURE_ID; pf1000.MaxNumberOfPorts = VSEMODLConstants.SWITCH_EXTENSION_INFO_MAX_NUMBER_OF_PORTS; pf1000.MaxNumberOfPortsPerHost = VSEMODLConstants.SWITCH_EXTENSION_INFO_MAX_NUMBER_OF_PORTS_PER_HOST; pf1000.SwitchExtSwitchFeatureConfigs = new VSEMSwitchExtSwitchFeatureConfig[0]; pf1000.IsChildOfWFPSwitchExtension = VSEMODLConstants.SWITCH_EXTENSION_INFO_IS_CHILD_OF_WFP_SWITCH_EXTENSION; pf1000.LastModifiedTimeStamp = DateTime.Now; // Add this to the list to be returned info.Add(pf1000); return info; }
/// <summary> /// Add switch extension switch feature config to /// the specified switch extension info. /// </summary> /// <param name="info">Switch extension info to add switch feature config.</param> /// <param name="CoordinatorUri">URI to VTNCoordinator.</param> private static void AddSwitchFeatureToSwitchExtInfos(VSEMSwitchExtensionInfo info, string CoordinatorUri) { if (info == null) { throw new ArgumentException("The parameter 'info' is null or invalid."); } if (string.IsNullOrEmpty(CoordinatorUri)) { throw new ArgumentException("The parameter 'VTNCoordinatorUri' is null or invalid."); } info.SwitchExtSwitchFeatureConfigs = new VSEMSwitchExtSwitchFeatureConfig[1]; info.SwitchExtSwitchFeatureConfigs[0] = CreateSwitchExtSwitchFeatureConfig(CoordinatorUri); }