qmmgmt

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
	QmmgmtSyntaxUUID = &uuid.UUID{TimeLow: 0x41208ee0, TimeMid: 0xe970, TimeHiAndVersion: 0x11d1, ClockSeqHiAndReserved: 0x9b, ClockSeqLow: 0x9e, Node: [6]uint8{0x0, 0xe0, 0x2c, 0x6, 0x4c, 0x39}}
	// Syntax ID
	QmmgmtSyntaxV1_0 = &dcerpc.SyntaxID{IfUUID: QmmgmtSyntaxUUID, IfVersionMajor: 1, IfVersionMinor: 0}
)
View Source
var (
	// import guard
	GoPackage = "mqmr"
)

Functions

func NewQmmgmtServerHandle

func NewQmmgmtServerHandle(o QmmgmtServer) dcerpc.ServerHandle

func QmmgmtServerHandle

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

func RegisterQmmgmtServer

func RegisterQmmgmtServer(conn dcerpc.Conn, o QmmgmtServer, opts ...dcerpc.Option)

Types

type ManagementActionRequest

type ManagementActionRequest struct {
	// pObjectFormat: A pointer to a MGMT_OBJECT structure that specifies the queue or computer
	// to which the action is being applied.
	ObjectFormat *ManagementObject `idl:"name:pObjectFormat" json:"object_format"`
	// lpwszAction:  A pointer to a null-terminated Unicode string that specifies the action
	// to perform on the computer. The lpwszAction value MUST be one of the following (the
	// value is not case-sensitive).
	//
	//	+--------------+----------------------------------------------------------------------------------+
	//	|              |                                                                                  |
	//	|    VALUE     |                                     MEANING                                      |
	//	|              |                                                                                  |
	//	+--------------+----------------------------------------------------------------------------------+
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "CONNECT"    | A machine action. Connects the computer to the network and the MSMQ Directory    |
	//	|              | Service server.                                                                  |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "DISCONNECT" | A machine action. Disconnects the computer from the network and the MSMQ         |
	//	|              | Directory Service server.                                                        |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "TIDY"       | A machine action. Cleans up empty message files. MSMQ does this every 6 hours.   |
	//	|              | It is helpful when a large number of messages are deleted (purged or received by |
	//	|              | an application), and the application needs the disk space immediately.           |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "PAUSE"      | A queue action. Valid for outgoing queues only. Stops the sending of messages    |
	//	|              | from the computer. The queue manager will not send messages to the applicable    |
	//	|              | destination queue until a RESUME action is initiated.                            |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "RESUME"     | A queue action. Valid for outgoing queues only. Restarts the sending of messages |
	//	|              | after a PAUSE action is initiated.                                               |
	//	+--------------+----------------------------------------------------------------------------------+
	//	| "EOD_RESEND" | A queue action. Resends the pending transaction sequence.                        |
	//	+--------------+----------------------------------------------------------------------------------+
	Action string `idl:"name:lpwszAction;string" json:"action"`
}

ManagementActionRequest structure represents the R_QMMgmtAction operation request

func (*ManagementActionRequest) MarshalNDR

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

func (*ManagementActionRequest) UnmarshalNDR

func (o *ManagementActionRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type ManagementActionResponse

type ManagementActionResponse struct {
	// Return: The R_QMMgmtAction return value.
	Return int32 `idl:"name:Return" json:"return"`
}

ManagementActionResponse structure represents the R_QMMgmtAction operation response

func (*ManagementActionResponse) MarshalNDR

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

func (*ManagementActionResponse) UnmarshalNDR

func (o *ManagementActionResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type ManagementGetInfoRequest

type ManagementGetInfoRequest struct {
	// pObjectFormat: A pointer to an MGMT_OBJECT structure that defines the queue or computer
	// on which to return information.
	ObjectFormat *ManagementObject `idl:"name:pObjectFormat" json:"object_format"`
	// cp: The length (in elements) of the arrays aProp and apVar MUST be at least 1, and
	// MUST be at most 128.
	CreatePartition uint32 `idl:"name:cp" json:"create_partition"`
	// aProp: Points to an array of property identifiers associated with the array of property
	// values. This array MUST contain at least one element. Each element MUST specify a
	// value from the property identifiers table, as specified in section 2.2.3. Each element
	// MUST specify the property identifier for the corresponding property value at the
	// same element index in apVar. This array and the array to which apVar points MUST
	// be of the same length.
	Property []uint32 `idl:"name:aProp;size_is:(cp)" json:"property"`
	// apVar: Points to an array that specifies the property values associated with the
	// array of property identifiers. Each element in this array specifies the property
	// value for the corresponding property identifier at the same element index in the
	// array to which aProp points. This array MUST contain at least one element. The property
	// value in each element MUST correspond accordingly to the property identifier from
	// aProp, as specified in section 2.2.3, and MUST be set to VT_NULL<14> (as specified
	// in [MS-MQMQ] section 2.2.12) before each call to R_QMMgmtGetInfo. This array and
	// the array to which aProp points MUST be of the same length.
	Var []*mqmq.PropertyVariant `idl:"name:apVar;size_is:(cp)" json:"var"`
}

ManagementGetInfoRequest structure represents the R_QMMgmtGetInfo operation request

func (*ManagementGetInfoRequest) MarshalNDR

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

func (*ManagementGetInfoRequest) UnmarshalNDR

func (o *ManagementGetInfoRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type ManagementGetInfoResponse

type ManagementGetInfoResponse struct {
	// apVar: Points to an array that specifies the property values associated with the
	// array of property identifiers. Each element in this array specifies the property
	// value for the corresponding property identifier at the same element index in the
	// array to which aProp points. This array MUST contain at least one element. The property
	// value in each element MUST correspond accordingly to the property identifier from
	// aProp, as specified in section 2.2.3, and MUST be set to VT_NULL<14> (as specified
	// in [MS-MQMQ] section 2.2.12) before each call to R_QMMgmtGetInfo. This array and
	// the array to which aProp points MUST be of the same length.
	Var []*mqmq.PropertyVariant `idl:"name:apVar;size_is:(cp)" json:"var"`
	// Return: The R_QMMgmtGetInfo return value.
	Return int32 `idl:"name:Return" json:"return"`
}

ManagementGetInfoResponse structure represents the R_QMMgmtGetInfo operation response

func (*ManagementGetInfoResponse) MarshalNDR

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

func (*ManagementGetInfoResponse) UnmarshalNDR

func (o *ManagementGetInfoResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error

type ManagementObject

type ManagementObject struct {
	// type:  An integer discriminator for the embedded discriminated union. The value of
	// this field MUST be 1, 2, or 3, as specified in section 2.2.2.1.
	Type             ManagementObjectType               `idl:"name:type" json:"type"`
	ManagementObject *ManagementObject_ManagementObject `idl:"name:ManagementObject;switch_is:type" json:"management_object"`
}

ManagementObject structure represents MGMT_OBJECT RPC structure.

The MGMT_OBJECT structure defines information on a queue, a computer, or a session. The structure includes an embedded discriminated union.

func (*ManagementObject) MarshalNDR

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

func (*ManagementObject) UnmarshalNDR

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

type ManagementObjectType

type ManagementObjectType uint16

ManagementObjectType type represents MgmtObjectType RPC enumeration.

The MgmtObjectType enumeration identifies the type of management object (as specified in section 2.2.1.2) being used.

var (
	// MGMT_MACHINE:  A machine management object.
	ManagementObjectTypeMachine ManagementObjectType = 1
	// MGMT_QUEUE:  A queue management object.
	ManagementObjectTypeQueue ManagementObjectType = 2
	// MGMT_SESSION:   A session management object.
	ManagementObjectTypeSession ManagementObjectType = 3
)

func (ManagementObjectType) String

func (o ManagementObjectType) String() string

type ManagementObject_ManagementObject

type ManagementObject_ManagementObject struct {
	// Types that are assignable to Value
	//
	// *ManagementObject_QueueFormat
	// *ManagementObject_Reserved1
	// *ManagementObject_Reserved2
	Value is_ManagementObject_ManagementObject `json:"value"`
}

ManagementObject_ManagementObject structure represents MGMT_OBJECT union anonymous member.

The MGMT_OBJECT structure defines information on a queue, a computer, or a session. The structure includes an embedded discriminated union.

func (*ManagementObject_ManagementObject) GetValue

func (o *ManagementObject_ManagementObject) GetValue() any

func (*ManagementObject_ManagementObject) MarshalUnionNDR

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

func (*ManagementObject_ManagementObject) NDRSwitchValue

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

func (*ManagementObject_ManagementObject) UnmarshalUnionNDR

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

type ManagementObject_QueueFormat

type ManagementObject_QueueFormat struct {
	// pQueueFormat:  A pointer to a QUEUE_FORMAT ([MS-MQMQ] section 2.2.7) structure that
	// describes the type of the queue.
	QueueFormat *mqmq.QueueFormat `idl:"name:pQueueFormat" json:"queue_format"`
}

ManagementObject_QueueFormat structure represents ManagementObject_ManagementObject RPC union arm.

It has following labels: 2

func (*ManagementObject_QueueFormat) MarshalNDR

func (*ManagementObject_QueueFormat) UnmarshalNDR

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

type ManagementObject_Reserved1

type ManagementObject_Reserved1 struct {
	// contains filtered or unexported fields
}

ManagementObject_Reserved1 structure represents ManagementObject_ManagementObject RPC union arm.

It has following labels: 1

func (*ManagementObject_Reserved1) MarshalNDR

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

func (*ManagementObject_Reserved1) UnmarshalNDR

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

type ManagementObject_Reserved2

type ManagementObject_Reserved2 struct {
	// contains filtered or unexported fields
}

ManagementObject_Reserved2 structure represents ManagementObject_ManagementObject RPC union arm.

It has following labels: 3

func (*ManagementObject_Reserved2) MarshalNDR

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

func (*ManagementObject_Reserved2) UnmarshalNDR

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

type QmmgmtClient

type QmmgmtClient interface {

	// The R_QMMgmtGetInfo method requests information on an MSMQ installation on a server
	// or on a specific queue.
	//
	// Return Values: On success, this method MUST return MQ_OK (0x00000000).
	//
	//	+---------------------+----------------------------------------------------------------------------------+
	//	|       RETURN        |                                                                                  |
	//	|     VALUE/CODE      |                                   DESCRIPTION                                    |
	//	|                     |                                                                                  |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| 0x00000000 MQ_OK    |                                                                                  |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| 0xC00E0001 MQ_ERROR | Generic error code. This error code is also the first of several error codes     |
	//	|                     | beginning with the string "MQ_ERR". A list of the errors prefaced with "MQ-ERR"  |
	//	|                     | is specified in 2.4.                                                             |
	//	+---------------------+----------------------------------------------------------------------------------+
	//
	// Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying
	// RPC protocol, as specified in [MS-RPCE].
	//
	// If an error occurs, the server MUST return a failure HRESULT and MUST NOT set any
	// [out] parameter values.
	//
	// The opnum field value for this method MUST be 0 and is received at a dynamically
	// assigned endpoint supplied by the RPC endpoint mapper, as specified in [MS-RPCE].
	//
	// If the pObjectFormat parameter specifies an MgmtObjectType of MGMT_MACHINE, the server
	// MUST return only those properties that pertain to the MSMQ installation. If pObjectFormat
	// specifies an MgmtObjectType of MGMT_QUEUE, the server MUST return only those properties
	// that pertain to a queue. If pObjectFormat specifies an MgmtObjectType of MGMT_SESSION,
	// the call MUST fail, and the error message MAY be MQ_ERROR_INVALID_PARAMETER (0xC00E0006).<15>
	//
	// If the pObjectFormat parameter specifies a computer, and one or more of the properties
	// specified in aProp are different than those specified in section 2.2.3.1, the call
	// MAY fail with MQ_ERROR_ILLEGAL_PROPID (0xC00E0039). If the pObjectFormat parameter
	// specifies a queue, and one or more of the properties specified in aProp are different
	// than those specified in section 2.2.3.2, the call MAY fail with MQ_ERROR_ILLEGAL_PROPID
	// (0xC00E0039).<16>
	//
	// MSMQ properties are specified in [MS-MQMQ] section 2.
	//
	// For MSMQ error codes, see [MSDN-MQEIC]. The structure and sequence of data on the
	// wire are specified in [C706] Transfer Syntax NDR.
	ManagementGetInfo(context.Context, *ManagementGetInfoRequest, ...dcerpc.CallOption) (*ManagementGetInfoResponse, error)

	// The R_QMMgmtAction method requests the server to perform a management function on
	// a specific queue or MSMQ installation.
	//
	// Return Values: On success, this method MUST return MQ_OK (0x00000000).
	//
	// MQ_OK (0x00000000)
	//
	// MQ_ERROR (0xC00E0001)
	//
	// Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying
	// RPC protocol, as specified in [MS-RPCE].
	//
	// If pObjectFormat specifies an MgmtObjectType of MGMT_SESSION or an lpwszAction has
	// different value than those in the table above, the call MUST fail and the error message
	// MAY be MQ_ERROR_INVALID_PARAMETER (0xC00E0006).<17>
	//
	// If an error occurs, the server MUST return a failure HRESULT.
	//
	// The opnum field value for this method MUST be 1 and is received at a dynamically
	// assigned endpoint supplied by the RPC endpoint mapper, as specified in [MS-RPCE].
	//
	// For MSMQ error codes, see [MSDN-MQEIC]. The structure and sequence of data on the
	// wire are specified in the Transfer Syntax NDR section in [C706].
	ManagementAction(context.Context, *ManagementActionRequest, ...dcerpc.CallOption) (*ManagementActionResponse, error)

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

qmmgmt interface.

func NewQmmgmtClient

func NewQmmgmtClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (QmmgmtClient, error)

type QmmgmtServer

type QmmgmtServer interface {

	// The R_QMMgmtGetInfo method requests information on an MSMQ installation on a server
	// or on a specific queue.
	//
	// Return Values: On success, this method MUST return MQ_OK (0x00000000).
	//
	//	+---------------------+----------------------------------------------------------------------------------+
	//	|       RETURN        |                                                                                  |
	//	|     VALUE/CODE      |                                   DESCRIPTION                                    |
	//	|                     |                                                                                  |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| 0x00000000 MQ_OK    |                                                                                  |
	//	+---------------------+----------------------------------------------------------------------------------+
	//	| 0xC00E0001 MQ_ERROR | Generic error code. This error code is also the first of several error codes     |
	//	|                     | beginning with the string "MQ_ERR". A list of the errors prefaced with "MQ-ERR"  |
	//	|                     | is specified in 2.4.                                                             |
	//	+---------------------+----------------------------------------------------------------------------------+
	//
	// Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying
	// RPC protocol, as specified in [MS-RPCE].
	//
	// If an error occurs, the server MUST return a failure HRESULT and MUST NOT set any
	// [out] parameter values.
	//
	// The opnum field value for this method MUST be 0 and is received at a dynamically
	// assigned endpoint supplied by the RPC endpoint mapper, as specified in [MS-RPCE].
	//
	// If the pObjectFormat parameter specifies an MgmtObjectType of MGMT_MACHINE, the server
	// MUST return only those properties that pertain to the MSMQ installation. If pObjectFormat
	// specifies an MgmtObjectType of MGMT_QUEUE, the server MUST return only those properties
	// that pertain to a queue. If pObjectFormat specifies an MgmtObjectType of MGMT_SESSION,
	// the call MUST fail, and the error message MAY be MQ_ERROR_INVALID_PARAMETER (0xC00E0006).<15>
	//
	// If the pObjectFormat parameter specifies a computer, and one or more of the properties
	// specified in aProp are different than those specified in section 2.2.3.1, the call
	// MAY fail with MQ_ERROR_ILLEGAL_PROPID (0xC00E0039). If the pObjectFormat parameter
	// specifies a queue, and one or more of the properties specified in aProp are different
	// than those specified in section 2.2.3.2, the call MAY fail with MQ_ERROR_ILLEGAL_PROPID
	// (0xC00E0039).<16>
	//
	// MSMQ properties are specified in [MS-MQMQ] section 2.
	//
	// For MSMQ error codes, see [MSDN-MQEIC]. The structure and sequence of data on the
	// wire are specified in [C706] Transfer Syntax NDR.
	ManagementGetInfo(context.Context, *ManagementGetInfoRequest) (*ManagementGetInfoResponse, error)

	// The R_QMMgmtAction method requests the server to perform a management function on
	// a specific queue or MSMQ installation.
	//
	// Return Values: On success, this method MUST return MQ_OK (0x00000000).
	//
	// MQ_OK (0x00000000)
	//
	// MQ_ERROR (0xC00E0001)
	//
	// Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying
	// RPC protocol, as specified in [MS-RPCE].
	//
	// If pObjectFormat specifies an MgmtObjectType of MGMT_SESSION or an lpwszAction has
	// different value than those in the table above, the call MUST fail and the error message
	// MAY be MQ_ERROR_INVALID_PARAMETER (0xC00E0006).<17>
	//
	// If an error occurs, the server MUST return a failure HRESULT.
	//
	// The opnum field value for this method MUST be 1 and is received at a dynamically
	// assigned endpoint supplied by the RPC endpoint mapper, as specified in [MS-RPCE].
	//
	// For MSMQ error codes, see [MSDN-MQEIC]. The structure and sequence of data on the
	// wire are specified in the Transfer Syntax NDR section in [C706].
	ManagementAction(context.Context, *ManagementActionRequest) (*ManagementActionResponse, error)
}

qmmgmt server interface.

Jump to

Keyboard shortcuts

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