//***************************************************************************
//
// 
//  Module: iScsi Discovery api
//
//  Purpose: 
//
//  Copyright (c) 2001 Microsoft Corporation
//
//***************************************************************************

#pragma autorecover
#pragma namespace("\\\\.\\Root")

[Locale(1033) : ToInstance] 
Instance of __Namespace
{
  Name = "WMI";
};
#pragma namespace("\\\\.\\Root\\WMI")

Instance of __Win32Provider as $P
{
  Name = "MSiSCSIInitiatorProvider";
  ClsId = "{d0520b5d-1b5f-4ecf-a940-6e57476ae4b0}";
  HostingModel = "NetworkServiceHost";
};

Instance of __InstanceProviderRegistration
{
  Provider = $P;
  SupportsGet = TRUE;
  SupportsPut = TRUE;
  SupportsDelete = TRUE;
  SupportsEnumeration = TRUE;
};

Instance of __MethodProviderRegistration
{
  Provider = $P;
};

class MSiSCSIInitiator_Portal
{
  [key,read] uint32 Index;
  [read] string SymbolicName;
  [read] string Address;
  [read] uint16 Port;
};

class MSiSCSIInitiator_PortalGroup
{
  [key,read] uint32 Index;
  [read] MSiSCSIInitiator_Portal Portals[];
};

class MSiSCSIInitiator_TargetAddress
{
  [read] string OSDeviceName;
  [read] uint32 OSBusNumber;
  [read] uint32 OSTargetNumber;
  [read] uint32 OSLunNumber;
};

class MSiSCSIInitiator_LUNList
{
  [read] uint32 OSLunNumber;
  [read] uint64 TargetLun;
};

class MSiSCSIInitiator_TargetMappings
{
  [read] string InitiatorName;
  [read] string TargetName;
  [read] string OSDeviceName;
  [read] uint32 OSBusNumber;
  [read] uint32 OSTargetNumber;
  [read] MSiSCSIInitiator_LUNList LUNList[];
};

class MSiSCSIInitiator_TargetLoginOptions
{
  [read] uint32 Version;
  [read] uint32 InformationSpecified;
  [read,write,BitValues{"Require IPSEC", "Multipath Enabled", "Reserved1", "Allow Portal Hopping"},BitMap{"0x00000001", "0x00000002", "0x00000004", "0x00000008"}] uint32 LoginFlags;
  [read,write,ValueMap{"0", "1", "2"}] uint32 AuthType;
  [read,write,ValueMap{"0", "1"},Values{"None", "CRC32C"}] uint32 HeaderDigest;
  [read,write,ValueMap{"0", "1"},Values{"None", "CRC32C"}] uint32 DataDigest;
  [read,write] uint32 MaximumConnections;
  [read,write] uint32 DefaultTime2Wait;
  [read,write] uint32 DefaultTime2Retain;
  [read,write] uint8 Username[];
  [read,write] uint8 Password[];
};

class MSiSCSIInitiator_ConnectionInformation
{
  [read] string ConnectionID;
  [read] string InitiatorAddress;
  [read] string TargetAddress;
  [read] uint16 InitiatorPort;
  [read] uint16 TargetPort;
  [read] uint8 CID[];
};

class MSiSCSIInitiator_IKEPresharedKeyAuthenticationInfo
{
  [read,ValueMap{"1"},Values{"IKE_AUTHENTICATION_PRESHARED_KEY_METHOD"}] uint32 AuthMethod;
  [read,ISCSI_SECURITY_FLAGS_QUALIFIERS] uint64 SecurityFlags;
  [read,ValueMap{"1", "2", "3", "5"},Values{"ID_IPV4_ADDR", "ID_FQDN", "ID_USER_FQDN", "ID_IPV6_ADDR"}] uint32 IdType;
  [read] uint8 Id[];
  [read] uint8 Key[];
};

[Dynamic : ToInstance ToSubclass,Provider("MSiSCSIInitiatorProvider") : ToInstance ToSubclass,UUID("{cb7ac2e4-33f5-4ea2-8a44-cb18fdfa0597}") : ToInstance] 
class MSiSCSIInitiator_TargetClass
{
  [key : ToSubclass,read : ToSubclass] string TargetName;
  [key : ToSubclass,read : ToSubclass] string DiscoveryMechanism;
  [read : ToSubclass] string InitiatorName;
  [read : ToSubclass,ValueMap{"0"},Values{"ISCSI_TCP_PROTOCOL_TYPE"}] uint32 ProtocolType;
  [read : ToSubclass,write : ToSubclass] string TargetAlias;
  [read : ToSubclass,write : ToSubclass] MSiSCSIInitiator_PortalGroup PortalGroups[];
  [read : ToSubclass,write : ToSubclass] MSiSCSIInitiator_TargetMappings Mappings;
  [read : ToSubclass,write : ToSubclass] uint32 TargetFlags;
  [read : ToSubclass,write : ToSubclass] MSiSCSIInitiator_TargetLoginOptions LoginOptions;
  [Implemented : ToInstance ToSubclass] uint32 Login([in] boolean IsInformationalSession,[in] uint32 InitiatorPortNumber,[in] MSiSCSIInitiator_Portal TargetPortal,[in,ISCSI_SECURITY_FLAGS_QUALIFIERS] uint64 SecurityFlags,[in] MSiSCSIInitiator_TargetMappings Mappings[],[in] MSiSCSIInitiator_TargetLoginOptions LoginOptions,[in] uint8 Key[],[in] boolean IsPersistent,[out] string UniqueSessionId,[out] string UniqueConnectionId);
};

[Dynamic : ToInstance,Provider("MSiSCSIInitiatorProvider") : ToInstance,UUID("{cfa35540-a5a6-4e4b-8fbf-60a3458a6733}") : ToInstance] 
class MSiSCSIInitiator_PersistentLoginClass
{
  [key,read] string TargetName;
  [read] boolean IsInformationalSession;
  [read] string InitiatorInstance;
  [read] uint32 InitiatorPortNumber;
  [read] MSiSCSIInitiator_Portal TargetPortal;
  [read,ISCSI_SECURITY_FLAGS_QUALIFIERS] uint64 SecurityFlags;
  [read] MSiSCSIInitiator_TargetMappings Mappings;
  [read] MSiSCSIInitiator_TargetLoginOptions LoginOptions;
};

[Dynamic : ToInstance ToSubclass,Provider("MSiSCSIInitiatorProvider") : ToInstance ToSubclass,UUID("{32b94816-661a-4d68-a9d8-cd4831eb3d66}") : ToInstance] 
class MSiSCSIInitiator_iSNSServerClass
{
  [key : ToSubclass,read : ToSubclass] string iSNSServerAddress;
  [Implemented] uint32 Refresh();
};

[Dynamic : ToInstance ToSubclass,Provider("MSiSCSIInitiatorProvider") : ToInstance ToSubclass,UUID("{01f89130-95ae-4b6c-a6d3-71982562263e}") : ToInstance] 
class MSiSCSIInitiator_SendTargetPortalClass
{
  [key : ToSubclass,read : ToSubclass] string PortalIdentifierString;
  [read : ToSubclass] string InitiatorName;
  [read : ToSubclass] uint32 InitiatorPortNumber;
  [read : ToSubclass] string PortalSymbolicName;
  [read : ToSubclass] string PortalAddress;
  [read : ToSubclass] uint16 PortalPort;
  [read : ToSubclass] MSiSCSIInitiator_TargetLoginOptions LoginOptions;
  [read : ToSubclass,ISCSI_SECURITY_FLAGS_QUALIFIERS] uint64 SecurityFlags;
  [Implemented] uint32 Refresh();
};

[Dynamic : ToInstance ToSubclass,Provider("MSiSCSIInitiatorProvider") : ToInstance ToSubclass,UUID("{424721e1-4662-4828-ba3a-f354dd170c96}") : ToInstance] 
class MSiSCSIInitiator_InitiatorClass
{
  [key : ToSubclass,read : ToSubclass] string InitiatorName;
};

[UUID("{180F6B35-6C1B-403b-ABA2-16FB4F935AC3}") : ToInstance] 
class MSiSCSIInitiator_DeviceOnSession
{
  [Description("Name of initiator")] string InitiatorName;
  [Description("Name of target")] string TargetName;
  [Description("OS SCSI port number")] uint8 ScsiPortNumber;
  [Description("OS SCSI path identifier or bus number")] uint8 ScsiPathId;
  [Description("OS SCSI Target Id")] uint8 ScsiTargetId;
  [Description("OS SCSI Logical Unit Number")] uint8 ScsiLun;
  [Description("PNP Device interface guid")] string DeviceInterfaceGuid;
  [Description("PNP Device interface name")] string DeviceInterfaceName;
  [Description("Legacy Device interface name")] string LegacyName;
  [Description("The FILE_DEVICE_XXX type for this device.")] uint32 DeviceType;
  [Description("The number of this device")] uint32 DeviceNumber;
  [Description("If the device is partitionable, the partition number of the device. Otherwise -1")] uint32 PartitionNumber;
};

[Dynamic : ToInstance,Provider("MSiSCSIInitiatorProvider") : ToInstance,UUID("{9fe00cf7-e26e-483d-9493-4d826980c079}") : ToInstance] 
class MSiSCSIInitiator_SessionClass
{
  [key,read] string SessionId;
  [read] string InitiatorName;
  [read] string TargetNodeName;
  [read] string TargetName;
  [read] uint8 ISID[];
  [read] uint8 TSID[];
  [read,Description("Information about the connections for this session")] MSiSCSIInitiator_ConnectionInformation ConnectionInformation[];
  [read,Description("Information about the devices exposed by this session")] MSiSCSIInitiator_DeviceOnSession Devices[];
  [Implemented] uint32 Logout();
  [Implemented] uint32 SendScsiInquiry([in] uint64 Lun,[in] uint8 EvpdCmddt,[in] uint8 PageCode,[out] uint8 ScsiStatus,[out] uint8 ResponseBuffer[],[out] uint8 SenseBuffer[]);
  [Implemented] uint32 SendScsiReadCapacity([in] uint64 Lun,[out] uint8 ScsiStatus,[out] uint8 ResponseBuffer[],[out] uint8 SenseBuffer[]);
  [Implemented] uint32 SendScsiReportLuns([out] uint8 ScsiStatus,[out] uint8 ResponseBuffer[],[out] uint8 SenseBuffer[]);
  [Implemented : ToInstance ToSubclass] uint32 AddConnection([in] uint32 InitiatorPortNumber,[in] MSiSCSIInitiator_Portal TargetPortal,[in,ISCSI_SECURITY_FLAGS_QUALIFIERS] uint64 SecurityFlags,[in] MSiSCSIInitiator_TargetLoginOptions LoginOptions,[in] uint8 Key[],[out] string UniqueConnectionId);
  [Implemented : ToInstance ToSubclass] uint32 RemoveConnection([in] string UniqueConnectionId);
};

#pragma deleteclass("MSiSCSIInitiator_MethodClass",NOFAIL)

[Dynamic : ToInstance,singleton,Provider("MSiSCSIInitiatorProvider") : ToInstance,UUID("{123afe1d-a270-414f-9e6b-5c241811e66f}")] 
class MSiSCSIInitiator_MethodClass
{
  [read] string iSCSINodeName;
  [Implemented] uint32 RefreshTargetList();
  [Implemented] uint32 SetIScsiTunnelModeOuterAddress([in] string InitiatorName,[in] uint32 InitiatorPortNumber,[in] string DestinationAddress,[in] string OuterModeAddress,[in] boolean Persist);
  [Implemented] uint32 SetIScsiIKEInfo([in] string InitiatorName,[in] uint32 InitiatorPortNumber,[in] MSiSCSIInitiator_IKEPresharedKeyAuthenticationInfo AuthInfo,[in] boolean Persist);
  [Implemented] uint32 SetIScsiGroupPresharedKey([in] uint8 Key[],[in] boolean Persist);
  [Implemented] uint32 SetIScsiInitiatorCHAPSharedSecret([in] uint8 SharedSecret[]);
  [Implemented] uint32 SetIScsiInitiatorRADIUSSharedSecret([in] uint8 SharedSecret[]);
  [Implemented] uint32 SetIScsiInitiatorNodeName([in] string InitiatorNodeName);
  [Implemented] uint32 SetupPersistentIScsiVolumes();
  [Implemented] uint32 ClearPersistentIScsiVolumes();
};

[Dynamic : ToInstance,Provider("MSiSCSIInitiatorProvider") : ToInstance,UUID("{E068FEBB-6D51-4c15-9725-CB96A3746838}")] 
class MSiSCSIInitiator_PersistentDevices
{
  [key,read] string DevicePath;
};
