dssetup

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Syntax UUID
	DssetupSyntaxUUID = &uuid.UUID{TimeLow: 0x3919286a, TimeMid: 0xb10c, TimeHiAndVersion: 0x11d0, ClockSeqHiAndReserved: 0x9b, ClockSeqLow: 0xa8, Node: [6]uint8{0x0, 0xc0, 0x4f, 0xd9, 0x2e, 0xf5}}
	// Syntax ID
	DssetupSyntaxV0_0 = &dcerpc.SyntaxID{IfUUID: DssetupSyntaxUUID, IfVersionMajor: 0, IfVersionMinor: 0}
)
View Source
var (
	// import guard
	GoPackage = "dssp"
)

Functions

func DssetupServerHandle

func DssetupServerHandle(ctx context.Context, o DssetupServer, opNum int, r ndr.Reader) (dcerpc.Operation, error)

func NewDssetupServerHandle

func NewDssetupServerHandle(o DssetupServer) dcerpc.ServerHandle

func RegisterDssetupServer

func RegisterDssetupServer(conn dcerpc.Conn, o DssetupServer, opts ...dcerpc.Option)

Types

type DssetupClient

type DssetupClient interface {

	// The DsRolerGetPrimaryDomainInformation (Opnum 0) method returns the requested information
	// about the current configuration or state of the computer on which the server is running.
	//
	// Return Values: The method returns 0 if successful; if failed, it returns a nonzero
	// error code as specified in [MS-ERREF]. Specifically, in addition to any other error
	// codes, the server MUST return the following error codes for the following error conditions.
	// Any other values transmitted in this field are implementation-specific. All nonzero
	// values MUST be treated the same for protocol purposes.
	//
	//	+------------------------------------+---------------------------------------+
	//	|               RETURN               |                                       |
	//	|             VALUE/CODE             |              DESCRIPTION              |
	//	|                                    |                                       |
	//	+------------------------------------+---------------------------------------+
	//	+------------------------------------+---------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER | One or more parameters are invalid.   |
	//	+------------------------------------+---------------------------------------+
	//	| 0x00000008 ERROR_NOT_ENOUGH_MEMORY | A memory allocation failure occurred. |
	//	+------------------------------------+---------------------------------------+
	GetPrimaryDomainInformation(context.Context, *GetPrimaryDomainInformationRequest, ...dcerpc.CallOption) (*GetPrimaryDomainInformationResponse, error)

	// AlterContext alters the client context.
	AlterContext(context.Context, ...dcerpc.Option) error
}

dssetup interface.

func NewDssetupClient

func NewDssetupClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (DssetupClient, error)

type DssetupServer

type DssetupServer interface {

	// The DsRolerGetPrimaryDomainInformation (Opnum 0) method returns the requested information
	// about the current configuration or state of the computer on which the server is running.
	//
	// Return Values: The method returns 0 if successful; if failed, it returns a nonzero
	// error code as specified in [MS-ERREF]. Specifically, in addition to any other error
	// codes, the server MUST return the following error codes for the following error conditions.
	// Any other values transmitted in this field are implementation-specific. All nonzero
	// values MUST be treated the same for protocol purposes.
	//
	//	+------------------------------------+---------------------------------------+
	//	|               RETURN               |                                       |
	//	|             VALUE/CODE             |              DESCRIPTION              |
	//	|                                    |                                       |
	//	+------------------------------------+---------------------------------------+
	//	+------------------------------------+---------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER | One or more parameters are invalid.   |
	//	+------------------------------------+---------------------------------------+
	//	| 0x00000008 ERROR_NOT_ENOUGH_MEMORY | A memory allocation failure occurred. |
	//	+------------------------------------+---------------------------------------+
	GetPrimaryDomainInformation(context.Context, *GetPrimaryDomainInformationRequest) (*GetPrimaryDomainInformationResponse, error)
}

dssetup server interface.

type GetPrimaryDomainInformationRequest

type GetPrimaryDomainInformationRequest struct {
	// InfoLevel: The type of data requested by the client. For possible values in this
	// enumeration, see section 2.2.7.
	InfoLevel PrimaryDomainInfoLevel `idl:"name:InfoLevel" json:"info_level"`
}

GetPrimaryDomainInformationRequest structure represents the DsRolerGetPrimaryDomainInformation operation request

func (*GetPrimaryDomainInformationRequest) MarshalNDR

func (*GetPrimaryDomainInformationRequest) UnmarshalNDR

type GetPrimaryDomainInformationResponse

type GetPrimaryDomainInformationResponse struct {
	// DomainInfo: The requested information that the server provides to the client. The
	// value of the InfoLevel parameter indicates the type of information that is requested;
	// information is returned in the corresponding member of the DSROLER_PRIMARY_DOMAIN_INFORMATION
	// union.
	DomainInfo *PrimaryDomainInformation `idl:"name:DomainInfo;switch_is:InfoLevel" json:"domain_info"`
	// Return: The DsRolerGetPrimaryDomainInformation return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

GetPrimaryDomainInformationResponse structure represents the DsRolerGetPrimaryDomainInformation operation response

func (*GetPrimaryDomainInformationResponse) MarshalNDR

func (*GetPrimaryDomainInformationResponse) UnmarshalNDR

type MachineRole

type MachineRole uint16

MachineRole type represents DSROLE_MACHINE_ROLE RPC enumeration.

The DSROLE_MACHINE_ROLE enumeration specifies the current role of the computer.

var (
	// DsRole_RoleStandaloneWorkstation:  The computer is a stand-alone workstation.
	MachineRoleStandaloneWorkstation MachineRole = 0
	// DsRole_RoleMemberWorkstation:  The computer is a workstation that is joined to a
	// domain.
	MachineRoleMemberWorkstation MachineRole = 1
	// DsRole_RoleStandaloneServer:  The computer is a stand-alone server.
	MachineRoleStandaloneServer MachineRole = 2
	// DsRole_RoleMemberServer:  The computer is a server that is joined to a domain.
	MachineRoleMemberServer MachineRole = 3
	// DsRole_RoleBackupDomainController:  The computer is a server that is a backup domain
	// controller or a read-only domain controller.<3>
	MachineRoleBackupDomainController MachineRole = 4
	// DsRole_RolePrimaryDomainController:  The computer is a server that is the primary
	// domain controller emulator.
	MachineRolePrimaryDomainController MachineRole = 5
)

func (MachineRole) String

func (o MachineRole) String() string

type OperationState

type OperationState uint16

OperationState type represents DSROLE_OPERATION_STATE RPC enumeration.

The DSROLE_OPERATION_STATE enumeration specifies values that determine whether a DC promotion or demotion operation is currently being performed on a computer.<4>

var (
	// DsRoleOperationIdle:  No promotion or demotion operation is currently being performed
	// on the computer.
	OperationStateIdle OperationState = 0
	// DsRoleOperationActive:  A promotion or demotion operation is in progress.
	OperationStateActive OperationState = 1
	// DsRoleOperationNeedReboot:  A promotion or demotion operation has been performed.
	// The computer MUST be restarted to function in the new role.
	OperationStateNeedReboot OperationState = 2
)

func (OperationState) String

func (o OperationState) String() string

type OperationStateInfo

type OperationStateInfo struct {
	// OperationState:   The domain membership role change status of the computer, as specified
	// by a DSROLE_OPERATION_STATE enumeration.
	OperationState OperationState `idl:"name:OperationState" json:"operation_state"`
}

OperationStateInfo structure represents DSROLE_OPERATION_STATE_INFO RPC structure.

The DSROLE_OPERATION_STATE_INFO structure contains the status of a pending domain controller (DC) domain membership role change operation, if any, for the computer.

func (*OperationStateInfo) MarshalNDR

func (o *OperationStateInfo) MarshalNDR(ctx context.Context, w ndr.Writer) error

func (*OperationStateInfo) UnmarshalNDR

func (o *OperationStateInfo) UnmarshalNDR(ctx context.Context, w ndr.Reader) error

type PrimaryDomainInfoBasic

type PrimaryDomainInfoBasic struct {
	// MachineRole:  The current role of the computer, expressed as a DSROLE_MACHINE_ROLE
	// data type.
	MachineRole MachineRole `idl:"name:MachineRole" json:"machine_role"`
	// Flags:  The value that indicates the state of the directory service and validity
	// of the information contained in the DomainGuid member. The value of this parameter
	// MUST be zero or a combination of one or more individual flags in the following table.
	// The combination is the result of a bitwise OR of the flags that apply to the computer
	// for which information is being retrieved. All undefined bits MUST be 0.
	//
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	|                                               |                                                                                  |
	//	|                     VALUE                     |                                     MEANING                                      |
	//	|                                               |                                                                                  |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| DSROLE_PRIMARY_DS_RUNNING 0x00000001          | The directory service is running on this computer. If this flag is not set, the  |
	//	|                                               | directory service is not running on this computer.                               |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| DSROLE_PRIMARY_DS_MIXED_MODE 0x00000002       | The directory service is running in mixed mode. This flag is valid only if the   |
	//	|                                               | DSROLE_PRIMARY_DS_RUNNING flag is set and the DSROLE_PRIMARY_DS_READONLY flag is |
	//	|                                               | not set.                                                                         |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| DSROLE_PRIMARY_DS_READONLY 0x00000008         | The computer holds a read-only copy of the directory. This flag is valid only if |
	//	|                                               | the DSROLE_PRIMARY_DS_RUNNING flag is set and the DSROLE_PRIMARY_DS_MIXED_MODE   |
	//	|                                               | flag is not set.                                                                 |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	//	| DSROLE_PRIMARY_DOMAIN_GUID_PRESENT 0x01000000 | The DomainGuid member contains a valid domain GUID. If this bit is not set, the  |
	//	|                                               | value in DomainGuid member is undefined.                                         |
	//	+-----------------------------------------------+----------------------------------------------------------------------------------+
	Flags uint32 `idl:"name:Flags" json:"flags"`
	// DomainNameFlat:  The NetBIOS name of the domain or non-domain workgroup to which
	// the computer belongs.
	DomainNameFlat string `idl:"name:DomainNameFlat;string;pointer:unique" json:"domain_name_flat"`
	// DomainNameDns:  The domain name of the computer. This member MUST be NULL if the
	// MachineRole member is DsRole_RoleStandaloneWorkstation or DsRole_RoleStandaloneServer
	// and MUST NOT be NULL otherwise.
	DomainNameDNS string `idl:"name:DomainNameDns;string;pointer:unique" json:"domain_name_dns"`
	// DomainForestName:  The name of the forest to which the computer belongs. This member
	// MUST be NULL, if the computer is a stand-alone workstation or server.
	DomainForestName string `idl:"name:DomainForestName;string;pointer:unique" json:"domain_forest_name"`
	// DomainGuid:   The UUID of the domain to which the computer belongs. The value of
	// this member is valid only if the DSROLE_PRIMARY_DOMAIN_GUID_PRESENT flag is set.
	DomainGUID *dtyp.GUID `idl:"name:DomainGuid" json:"domain_guid"`
}

PrimaryDomainInfoBasic structure represents DSROLER_PRIMARY_DOMAIN_INFO_BASIC RPC structure.

The DSROLER_PRIMARY_DOMAIN_INFO_BASIC structure contains basic information, including the role of the computer, domain name, and GUID of the domain.

func (*PrimaryDomainInfoBasic) MarshalNDR

func (o *PrimaryDomainInfoBasic) MarshalNDR(ctx context.Context, w ndr.Writer) error

func (*PrimaryDomainInfoBasic) UnmarshalNDR

func (o *PrimaryDomainInfoBasic) UnmarshalNDR(ctx context.Context, w ndr.Reader) error

type PrimaryDomainInfoLevel

type PrimaryDomainInfoLevel uint16

PrimaryDomainInfoLevel type represents DSROLE_PRIMARY_DOMAIN_INFO_LEVEL RPC enumeration.

The DSROLE_PRIMARY_DOMAIN_INFO_LEVEL enumeration defines the information level that the client requests.

var (
	// DsRolePrimaryDomainInfoBasic:  Request for information about the domain to which
	// the computer belongs.
	PrimaryDomainInfoLevelBasic PrimaryDomainInfoLevel = 1
	// DsRoleUpgradeStatus:  Request for computer operating system upgrade status.
	PrimaryDomainInfoLevelUpgradeStatus PrimaryDomainInfoLevel = 2
	// DsRoleOperationState:  Request for computer operation state.
	PrimaryDomainInfoLevelOperationState PrimaryDomainInfoLevel = 3
)

func (PrimaryDomainInfoLevel) String

func (o PrimaryDomainInfoLevel) String() string

type PrimaryDomainInformation

type PrimaryDomainInformation struct {
	// Types that are assignable to Value
	//
	// *PrimaryDomainInformation_DomainInfoBasic
	// *PrimaryDomainInformation_UpgradeStatusInfo
	// *PrimaryDomainInformation_OperationStateInfo
	Value is_PrimaryDomainInformation `json:"value"`
}

PrimaryDomainInformation structure represents DSROLER_PRIMARY_DOMAIN_INFORMATION RPC union.

func (*PrimaryDomainInformation) GetValue

func (o *PrimaryDomainInformation) GetValue() any

func (*PrimaryDomainInformation) MarshalUnionNDR

func (o *PrimaryDomainInformation) MarshalUnionNDR(ctx context.Context, w ndr.Writer, sw uint16) error

func (*PrimaryDomainInformation) NDRSwitchValue

func (o *PrimaryDomainInformation) NDRSwitchValue(sw uint16) uint16

func (*PrimaryDomainInformation) UnmarshalUnionNDR

func (o *PrimaryDomainInformation) UnmarshalUnionNDR(ctx context.Context, w ndr.Reader, sw uint16) error

type PrimaryDomainInformation_DomainInfoBasic

type PrimaryDomainInformation_DomainInfoBasic struct {
	DomainInfoBasic *PrimaryDomainInfoBasic `idl:"name:DomainInfoBasic" json:"domain_info_basic"`
}

PrimaryDomainInformation_DomainInfoBasic structure represents DSROLER_PRIMARY_DOMAIN_INFORMATION RPC union arm.

It has following labels: 1

func (*PrimaryDomainInformation_DomainInfoBasic) MarshalNDR

func (*PrimaryDomainInformation_DomainInfoBasic) UnmarshalNDR

type PrimaryDomainInformation_OperationStateInfo

type PrimaryDomainInformation_OperationStateInfo struct {
	OperationStateInfo *OperationStateInfo `idl:"name:OperationStateInfo" json:"operation_state_info"`
}

PrimaryDomainInformation_OperationStateInfo structure represents DSROLER_PRIMARY_DOMAIN_INFORMATION RPC union arm.

It has following labels: 3

func (*PrimaryDomainInformation_OperationStateInfo) MarshalNDR

func (*PrimaryDomainInformation_OperationStateInfo) UnmarshalNDR

type PrimaryDomainInformation_UpgradeStatusInfo

type PrimaryDomainInformation_UpgradeStatusInfo struct {
	UpgradeStatusInfo *UpgradeStatusInfo `idl:"name:UpgradStatusInfo" json:"upgrade_status_info"`
}

PrimaryDomainInformation_UpgradeStatusInfo structure represents DSROLER_PRIMARY_DOMAIN_INFORMATION RPC union arm.

It has following labels: 2

func (*PrimaryDomainInformation_UpgradeStatusInfo) MarshalNDR

func (*PrimaryDomainInformation_UpgradeStatusInfo) UnmarshalNDR

type ServerState

type ServerState uint16

ServerState type represents DSROLE_SERVER_STATE RPC enumeration.

The DSROLE_SERVER_STATE enumeration specifies the role of the computer prior to the upgrade.

var (
	// DsRoleServerUnknown:  The previous role of the computer is unknown.
	ServerStateUnknown ServerState = 0
	// DsRoleServerPrimary:  The previous role of the computer was primary domain controller
	// in a legacy domain.
	ServerStatePrimary ServerState = 1
	// DsRoleServerBackup:  The previous role of the computer was backup domain controller
	// in a legacy domain.
	ServerStateBackup ServerState = 2
)

func (ServerState) String

func (o ServerState) String() string

type UpgradeStatusInfo

type UpgradeStatusInfo struct {
	// OperationState:  The current status of the upgrade. Valid values are shown in the
	// following table.<5>
	//
	//	+---------------------------------------+--------------------------------------+
	//	|                                       |                                      |
	//	|                 VALUE                 |               MEANING                |
	//	|                                       |                                      |
	//	+---------------------------------------+--------------------------------------+
	//	+---------------------------------------+--------------------------------------+
	//	| 0x00000000                            | No upgrade is currently in progress. |
	//	+---------------------------------------+--------------------------------------+
	//	| DSROLE_UPGRADE_IN_PROGRESS 0x00000004 | An upgrade is currently in progress. |
	//	+---------------------------------------+--------------------------------------+
	OperationState uint32 `idl:"name:OperationState" json:"operation_state"`
	// PreviousServerState:  The role of the computer prior to the upgrade. The value of
	// this member is valid only if an upgrade is in progress (that is, if the OperationState
	// member is set to DSROLE_UPGRADE_IN_PROGRESS).
	PreviousServerState ServerState `idl:"name:PreviousServerState" json:"previous_server_state"`
}

UpgradeStatusInfo structure represents DSROLE_UPGRADE_STATUS_INFO RPC structure.

The DSROLE_UPGRADE_STATUS_INFO structure contains information about the status of a pending operating system upgrade, if any, for the computer. This structure is intended to store only the status of an operating system upgrade of a legacy domain controller.

func (*UpgradeStatusInfo) MarshalNDR

func (o *UpgradeStatusInfo) MarshalNDR(ctx context.Context, w ndr.Writer) error

func (*UpgradeStatusInfo) UnmarshalNDR

func (o *UpgradeStatusInfo) UnmarshalNDR(ctx context.Context, w ndr.Reader) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL