witness

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Syntax UUID
	WitnessSyntaxUUID = &uuid.UUID{TimeLow: 0xccd8c074, TimeMid: 0xd0e5, TimeHiAndVersion: 0x4a40, ClockSeqHiAndReserved: 0x92, ClockSeqLow: 0xb4, Node: [6]uint8{0xd0, 0x74, 0xfa, 0xa6, 0xba, 0x28}}
	// Syntax ID
	WitnessSyntaxV1_1 = &dcerpc.SyntaxID{IfUUID: WitnessSyntaxUUID, IfVersionMajor: 1, IfVersionMinor: 1}
)
View Source
var (
	// import guard
	GoPackage = "swn"
)

Functions

func NewWitnessServerHandle

func NewWitnessServerHandle(o WitnessServer) dcerpc.ServerHandle

func RegisterWitnessServer

func RegisterWitnessServer(conn dcerpc.Conn, o WitnessServer, opts ...dcerpc.Option)

func WitnessServerHandle

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

Types

type AsyncNotifyRequest

type AsyncNotifyRequest struct {
	// pContext: A context handle of type PCONTEXT_HANDLE_SHARED, as specified in section
	// 2.2.1.3, that identifies the client on the server.
	Context *swn.Shared `idl:"name:pContext" json:"context"`
}

AsyncNotifyRequest structure represents the WitnessrAsyncNotify operation request

func (*AsyncNotifyRequest) MarshalNDR

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

func (*AsyncNotifyRequest) UnmarshalNDR

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

type AsyncNotifyResponse

type AsyncNotifyResponse struct {
	// pResp:  A pointer to a PRESP_ASYNC_NOTIFY structure, as specified in section 2.2.2.4.
	Response *swn.ResponseAsyncNotify `idl:"name:pResp" json:"response"`
	// Return: The WitnessrAsyncNotify return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

AsyncNotifyResponse structure represents the WitnessrAsyncNotify operation response

func (*AsyncNotifyResponse) MarshalNDR

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

func (*AsyncNotifyResponse) UnmarshalNDR

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

type GetInterfaceListRequest

type GetInterfaceListRequest struct {
}

GetInterfaceListRequest structure represents the WitnessrGetInterfaceList operation request

func (*GetInterfaceListRequest) MarshalNDR

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

func (*GetInterfaceListRequest) UnmarshalNDR

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

type GetInterfaceListResponse

type GetInterfaceListResponse struct {
	// InterfaceList:  A pointer to a PWITNESS_INTERFACE_LIST, as specified in section
	// 2.2.2.6.
	InterfaceList *swn.InterfaceList `idl:"name:InterfaceList" json:"interface_list"`
	// Return: The WitnessrGetInterfaceList return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

GetInterfaceListResponse structure represents the WitnessrGetInterfaceList operation response

func (*GetInterfaceListResponse) MarshalNDR

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

func (*GetInterfaceListResponse) UnmarshalNDR

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

type RegisterExRequest

type RegisterExRequest struct {
	// Version:  The version of the Witness protocol currently in use by the client.
	Version uint32 `idl:"name:Version" json:"version"`
	// NetName:  A pointer to a null-terminated string that specifies the name of the resource
	// for which the client requires notifications.
	NetName string `idl:"name:NetName;string;pointer:unique" json:"net_name"`
	// ShareName:  A pointer to a null-terminated string that specifies the name of the
	// share resource for which the client requires notifications.
	ShareName string `idl:"name:ShareName;string;pointer:unique" json:"share_name"`
	// IpAddress:  A pointer to a null-terminated string that specifies the IP address
	// to which the client application connection is established.
	IPAddress string `idl:"name:IpAddress;string;pointer:unique" json:"ip_address"`
	// ClientComputerName:  A pointer to a null-terminated string that is used to identify
	// the Witness client.
	ClientComputerName string `idl:"name:ClientComputerName;string;pointer:unique" json:"client_computer_name"`
	// Flags:  The type of Witness registration. This field MUST be set to one of the following
	// values:
	//
	//	+---------------------------------------------+--------------------------------------------------------------------------------+
	//	|                                             |                                                                                |
	//	|                    VALUE                    |                                    MEANING                                     |
	//	|                                             |                                                                                |
	//	+---------------------------------------------+--------------------------------------------------------------------------------+
	//	+---------------------------------------------+--------------------------------------------------------------------------------+
	//	| WITNESS_REGISTER_NONE 0x00000000            | If set, the client requests notifications only for the registered IP address.  |
	//	+---------------------------------------------+--------------------------------------------------------------------------------+
	//	| WITNESS_REGISTER_IP_NOTIFICATION 0x00000001 | If set, the client requests notifications of any eligible server IP addresses. |
	//	+---------------------------------------------+--------------------------------------------------------------------------------+
	Flags uint32 `idl:"name:Flags" json:"flags"`
	// KeepAliveTimeout: The maximum number of seconds for any notification response from
	// the server.
	KeepAliveTimeout uint32 `idl:"name:KeepAliveTimeout" json:"keep_alive_timeout"`
}

RegisterExRequest structure represents the WitnessrRegisterEx operation request

func (*RegisterExRequest) MarshalNDR

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

func (*RegisterExRequest) UnmarshalNDR

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

type RegisterExResponse

type RegisterExResponse struct {
	// ppContext:  A context handle of type PPCONTEXT_HANDLE, as specified in section 2.2.1.2,
	// that identifies the client on the server.
	Context *dcetypes.ContextHandle `idl:"name:ppContext" json:"context"`
	// Return: The WitnessrRegisterEx return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

RegisterExResponse structure represents the WitnessrRegisterEx operation response

func (*RegisterExResponse) MarshalNDR

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

func (*RegisterExResponse) UnmarshalNDR

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

type RegisterRequest

type RegisterRequest struct {
	// Version:  The version of the Witness protocol currently in use by the client.
	Version uint32 `idl:"name:Version" json:"version"`
	// NetName:  A pointer to a null-terminated string that specifies the name of the resource
	// for which the client requires notifications.
	NetName string `idl:"name:NetName;string;pointer:unique" json:"net_name"`
	// IpAddress:  A pointer to a null-terminated string that specifies the IP address
	// to which the client application connection is established.
	IPAddress string `idl:"name:IpAddress;string;pointer:unique" json:"ip_address"`
	// ClientComputerName:  A pointer to a null-terminated string that is used to identify
	// the Witness client.
	ClientComputerName string `idl:"name:ClientComputerName;string;pointer:unique" json:"client_computer_name"`
}

RegisterRequest structure represents the WitnessrRegister operation request

func (*RegisterRequest) MarshalNDR

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

func (*RegisterRequest) UnmarshalNDR

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

type RegisterResponse

type RegisterResponse struct {
	// ppContext: A context handle of type PPCONTEXT_HANDLE, as specified in section 2.2.1.2,
	// that identifies the client on the server.
	Context *dcetypes.ContextHandle `idl:"name:ppContext" json:"context"`
	// Return: The WitnessrRegister return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

RegisterResponse structure represents the WitnessrRegister operation response

func (*RegisterResponse) MarshalNDR

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

func (*RegisterResponse) UnmarshalNDR

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

type UnimplementedWitnessServer added in v1.1.5

type UnimplementedWitnessServer struct {
}

Unimplemented Witness

func (UnimplementedWitnessServer) AsyncNotify added in v1.1.5

func (UnimplementedWitnessServer) GetInterfaceList added in v1.1.5

func (UnimplementedWitnessServer) Register added in v1.1.5

func (UnimplementedWitnessServer) RegisterEx added in v1.1.5

func (UnimplementedWitnessServer) Unregister added in v1.1.5

type UnregisterRequest

type UnregisterRequest struct {
	// pContext: A context handle of type PCONTEXT_HANDLE, specified in section 2.2.1.1,
	// that identifies the client on the server.
	Context *dcetypes.ContextHandle `idl:"name:pContext" json:"context"`
}

UnregisterRequest structure represents the WitnessrUnRegister operation request

func (*UnregisterRequest) MarshalNDR

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

func (*UnregisterRequest) UnmarshalNDR

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

type UnregisterResponse

type UnregisterResponse struct {
	// Return: The WitnessrUnRegister return value.
	Return uint32 `idl:"name:Return" json:"return"`
}

UnregisterResponse structure represents the WitnessrUnRegister operation response

func (*UnregisterResponse) MarshalNDR

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

func (*UnregisterResponse) UnmarshalNDR

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

type WitnessClient

type WitnessClient interface {

	// The WitnessrGetInterfaceList method returns information about the interfaces to which
	// witness client connections can be made.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+------------------------------------+--------------------------------------------------------------+
	//	|               RETURN               |                                                              |
	//	|             VALUE/CODE             |                         DESCRIPTION                          |
	//	|                                    |                                                              |
	//	+------------------------------------+--------------------------------------------------------------+
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS           | The operation completed successfully.                        |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED     | Access is denied.                                            |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER | The parameter is incorrect.                                  |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000103 ERROR_NO_MORE_ITEMS     | No more data is available.                                   |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x0000000E ERROR_OUTOFMEMORY       | There is not enough storage space to complete the operation. |
	//	+------------------------------------+--------------------------------------------------------------+
	//
	// If there are no entries in the InterfaceList, the server MUST fail the request and
	// return the error code ERROR_NO_MORE_ITEMS.
	//
	// If no entry in the InterfaceList has a State of AVAILABLE, the server MUST wait until
	// at least one entry enters that State, as specified in section 3.1.6.1.
	//
	// For each Interface in the InterfaceList, the server MUST construct a WITNESS_INTERFACE_INFO
	// structure as follows:
	//
	// * The *InterfaceGroupName* field of the WITNESS_INTERFACE_INFO structure MUST be
	// set to *Interface.InterfaceGroupName*.
	//
	// * The *State* field MUST be set to *Interface.State*.
	//
	// * The *Version* field MUST be set to *WitnessServiceVersion*.
	//
	// * If *Interface.IPv4Address* is not empty, the *IPV4* field MUST be set to *Interface.IPv4Address*
	// , and IPv4 flag MUST be set in the *Flags* field.
	//
	// * If *Interface.IPv6Address* is not empty, the *IPV6* field MUST be set to *Interface.IPv6Address*
	// , and IPv6 flag MUST be set in the *Flags* field.
	//
	// * In an implementation-dependent manner, the server MUST determine if the *IPv4Address*
	// or *IPv6Address* match any interface which is hosted on the server and the server
	// is also running this Witness Service instance. If the address is not hosted on the
	// local server, the INTERFACE_WITNESS flag MUST be set in the *Flags* field. Otherwise,
	// the flag MUST NOT be set.
	GetInterfaceList(context.Context, *GetInterfaceListRequest, ...dcerpc.CallOption) (*GetInterfaceListResponse, error)

	// The WitnessrRegister method allows the witness client to register for resource state
	// change notifications of a NetName and IPAddress. The client can subsequently call
	// the WitnessrAsyncNotify method to receive notifications when there is a state change
	// on any of these resources.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	|                RETURN                |                                                                        |
	//	|              VALUE/CODE              |                              DESCRIPTION                               |
	//	|                                      |                                                                        |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS             | The operation completed successfully.                                  |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED       | Access is denied.                                                      |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x000005AA ERROR_NO_SYSTEM_RESOURCES | Insufficient system resources exist to complete the requested service. |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER   | The parameter is incorrect.                                            |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000139F ERROR_INVALID_STATE       | The specified resource state is invalid.                               |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000051A ERROR_REVISION_MISMATCH   | The client request contains an invalid Witness protocol version.       |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//
	// If the Version field of the request is not 0x00010001, the server MUST stop processing
	// the request and return the error code ERROR_REVISION_MISMATCH.
	//
	// If NetName, IpAddress or ClientComputerName is NULL, the server MUST fail the request
	// and return the error code ERROR_INVALID_PARAMETER.
	//
	// If the NetName parameter is not equal to ServerGlobalName, the server MUST fail the
	// request and return the error code ERROR_INVALID_PARAMETER.
	Register(context.Context, *RegisterRequest, ...dcerpc.CallOption) (*RegisterResponse, error)

	// The WitnessrUnRegister method allows the client to unregister for notifications from
	// the server. The Witness Service removes its internal state of the registration and
	// no longer notifies the client in the event of any resource state changes.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------+--------------------------------------------+
	//	|             RETURN             |                                            |
	//	|           VALUE/CODE           |                DESCRIPTION                 |
	//	|                                |                                            |
	//	+--------------------------------+--------------------------------------------+
	//	+--------------------------------+--------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS       | The operation completed successfully.      |
	//	+--------------------------------+--------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED | Access is denied.                          |
	//	+--------------------------------+--------------------------------------------+
	//	| 0x00000490 ERROR_NOT_FOUND     | The specified CONTEXT_HANDLE is not found. |
	//	+--------------------------------+--------------------------------------------+
	Unregister(context.Context, *UnregisterRequest, ...dcerpc.CallOption) (*UnregisterResponse, error)

	// The WitnessrAsyncNotify method is used by the client to request notification of registered
	// resource changes from the server.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	|                RETURN                |                                                                        |
	//	|              VALUE/CODE              |                              DESCRIPTION                               |
	//	|                                      |                                                                        |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS             | The operation completed successfully.                                  |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED       | Access is denied.                                                      |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x000005AA ERROR_NO_SYSTEM_RESOURCES | Insufficient system resources exist to complete the requested service. |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000490 ERROR_NOT_FOUND           | The specified resource name is not found.                              |
	//	+--------------------------------------+------------------------------------------------------------------------+
	AsyncNotify(context.Context, *AsyncNotifyRequest, ...dcerpc.CallOption) (*AsyncNotifyResponse, error)

	// The WitnessrRegisterEx method allows the witness client to register for resource
	// state change notifications of a NetName, ShareName and multiple IPAddresses. The
	// client can subsequently call the WitnessrAsyncNotify method to receive notifications
	// when there is a state change on any of these resources.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	|                RETURN                |                                                                        |
	//	|              VALUE/CODE              |                              DESCRIPTION                               |
	//	|                                      |                                                                        |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS             | The operation completed successfully.                                  |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED       | Access is denied.                                                      |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x000005AA ERROR_NO_SYSTEM_RESOURCES | Insufficient system resources exist to complete the requested service. |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER   | The parameter is incorrect.                                            |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000139F ERROR_INVALID_STATE       | The specified resource state is invalid.                               |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000051A ERROR_REVISION_MISMATCH   | The client request contains an invalid Witness protocol version.       |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//
	// This opnum is applicable only to servers that implement Witness protocol version
	// 2.
	//
	// If the Version field of the request is not 0x00020000, the server MUST stop processing
	// the request and return the error code ERROR_REVISION_MISMATCH.
	//
	// If NetName, IpAddress, or ClientComputerName is NULL, the server MUST fail the request
	// and return the error code ERROR_INVALID_PARAMETER.
	//
	// If the NetName parameter is not equal to ServerGlobalName, the server MUST fail the
	// request and return the error code ERROR_INVALID_PARAMETER.
	//
	// If ShareName is not NULL, the server MUST enumerate the shares by calling NetrShareEnum
	// as specified in [MS-SRVS] section 3.1.4.8. If the enumeration fails or if no shares
	// are returned, the server MUST return the error code ERROR_INVALID_STATE.
	//
	// If none of the shares in the list has shi*_type set to STYPE_CLUSTER_SOFS as specified
	// in [MS-SRVS] section 3.1.4.8, the server MUST ignore ShareName.
	//
	// Otherwise, the server MUST fail the request with the error code ERROR_INVALID_STATE
	// for the following:
	//
	// * *ShareName* does not exist in the enumerated list.
	//
	// * The server MUST search for an *Interface* in *InterfaceList* , where *Interface.IPv4Address*
	// or *Interface.IPv6Address* matches the IpAddress parameter based on its format. If
	// no matching entry is found and *ShareName* has shi*_type set to STYPE_CLUSTER_SOFS,
	// as specified in [MS-SRVS] section 2.2.2.4 ( ../ms-srvs/6069f8c0-c93f-43a0-a5b4-7ed447eb4b84
	// ) , the server MUST fail the request with ERROR_INVALID_STATE. **
	RegisterEx(context.Context, *RegisterExRequest, ...dcerpc.CallOption) (*RegisterExResponse, error)

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

	// Conn returns the client connection (unsafe)
	Conn() dcerpc.Conn
}

Witness interface.

func NewWitnessClient

func NewWitnessClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (WitnessClient, error)

type WitnessServer

type WitnessServer interface {

	// The WitnessrGetInterfaceList method returns information about the interfaces to which
	// witness client connections can be made.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+------------------------------------+--------------------------------------------------------------+
	//	|               RETURN               |                                                              |
	//	|             VALUE/CODE             |                         DESCRIPTION                          |
	//	|                                    |                                                              |
	//	+------------------------------------+--------------------------------------------------------------+
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS           | The operation completed successfully.                        |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED     | Access is denied.                                            |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER | The parameter is incorrect.                                  |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x00000103 ERROR_NO_MORE_ITEMS     | No more data is available.                                   |
	//	+------------------------------------+--------------------------------------------------------------+
	//	| 0x0000000E ERROR_OUTOFMEMORY       | There is not enough storage space to complete the operation. |
	//	+------------------------------------+--------------------------------------------------------------+
	//
	// If there are no entries in the InterfaceList, the server MUST fail the request and
	// return the error code ERROR_NO_MORE_ITEMS.
	//
	// If no entry in the InterfaceList has a State of AVAILABLE, the server MUST wait until
	// at least one entry enters that State, as specified in section 3.1.6.1.
	//
	// For each Interface in the InterfaceList, the server MUST construct a WITNESS_INTERFACE_INFO
	// structure as follows:
	//
	// * The *InterfaceGroupName* field of the WITNESS_INTERFACE_INFO structure MUST be
	// set to *Interface.InterfaceGroupName*.
	//
	// * The *State* field MUST be set to *Interface.State*.
	//
	// * The *Version* field MUST be set to *WitnessServiceVersion*.
	//
	// * If *Interface.IPv4Address* is not empty, the *IPV4* field MUST be set to *Interface.IPv4Address*
	// , and IPv4 flag MUST be set in the *Flags* field.
	//
	// * If *Interface.IPv6Address* is not empty, the *IPV6* field MUST be set to *Interface.IPv6Address*
	// , and IPv6 flag MUST be set in the *Flags* field.
	//
	// * In an implementation-dependent manner, the server MUST determine if the *IPv4Address*
	// or *IPv6Address* match any interface which is hosted on the server and the server
	// is also running this Witness Service instance. If the address is not hosted on the
	// local server, the INTERFACE_WITNESS flag MUST be set in the *Flags* field. Otherwise,
	// the flag MUST NOT be set.
	GetInterfaceList(context.Context, *GetInterfaceListRequest) (*GetInterfaceListResponse, error)

	// The WitnessrRegister method allows the witness client to register for resource state
	// change notifications of a NetName and IPAddress. The client can subsequently call
	// the WitnessrAsyncNotify method to receive notifications when there is a state change
	// on any of these resources.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	|                RETURN                |                                                                        |
	//	|              VALUE/CODE              |                              DESCRIPTION                               |
	//	|                                      |                                                                        |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS             | The operation completed successfully.                                  |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED       | Access is denied.                                                      |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x000005AA ERROR_NO_SYSTEM_RESOURCES | Insufficient system resources exist to complete the requested service. |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER   | The parameter is incorrect.                                            |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000139F ERROR_INVALID_STATE       | The specified resource state is invalid.                               |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000051A ERROR_REVISION_MISMATCH   | The client request contains an invalid Witness protocol version.       |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//
	// If the Version field of the request is not 0x00010001, the server MUST stop processing
	// the request and return the error code ERROR_REVISION_MISMATCH.
	//
	// If NetName, IpAddress or ClientComputerName is NULL, the server MUST fail the request
	// and return the error code ERROR_INVALID_PARAMETER.
	//
	// If the NetName parameter is not equal to ServerGlobalName, the server MUST fail the
	// request and return the error code ERROR_INVALID_PARAMETER.
	Register(context.Context, *RegisterRequest) (*RegisterResponse, error)

	// The WitnessrUnRegister method allows the client to unregister for notifications from
	// the server. The Witness Service removes its internal state of the registration and
	// no longer notifies the client in the event of any resource state changes.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------+--------------------------------------------+
	//	|             RETURN             |                                            |
	//	|           VALUE/CODE           |                DESCRIPTION                 |
	//	|                                |                                            |
	//	+--------------------------------+--------------------------------------------+
	//	+--------------------------------+--------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS       | The operation completed successfully.      |
	//	+--------------------------------+--------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED | Access is denied.                          |
	//	+--------------------------------+--------------------------------------------+
	//	| 0x00000490 ERROR_NOT_FOUND     | The specified CONTEXT_HANDLE is not found. |
	//	+--------------------------------+--------------------------------------------+
	Unregister(context.Context, *UnregisterRequest) (*UnregisterResponse, error)

	// The WitnessrAsyncNotify method is used by the client to request notification of registered
	// resource changes from the server.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	|                RETURN                |                                                                        |
	//	|              VALUE/CODE              |                              DESCRIPTION                               |
	//	|                                      |                                                                        |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS             | The operation completed successfully.                                  |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED       | Access is denied.                                                      |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x000005AA ERROR_NO_SYSTEM_RESOURCES | Insufficient system resources exist to complete the requested service. |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000490 ERROR_NOT_FOUND           | The specified resource name is not found.                              |
	//	+--------------------------------------+------------------------------------------------------------------------+
	AsyncNotify(context.Context, *AsyncNotifyRequest) (*AsyncNotifyResponse, error)

	// The WitnessrRegisterEx method allows the witness client to register for resource
	// state change notifications of a NetName, ShareName and multiple IPAddresses. The
	// client can subsequently call the WitnessrAsyncNotify method to receive notifications
	// when there is a state change on any of these resources.
	//
	// Return Values: Returns 0x00000000 (ERROR_SUCCESS) on success or a nonzero error code,
	// as specified in [MS-ERREF] section 2.2. The most common error codes are listed in
	// the following table.
	//
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	|                RETURN                |                                                                        |
	//	|              VALUE/CODE              |                              DESCRIPTION                               |
	//	|                                      |                                                                        |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000000 ERROR_SUCCESS             | The operation completed successfully.                                  |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000005 ERROR_ACCESS_DENIED       | Access is denied.                                                      |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x000005AA ERROR_NO_SYSTEM_RESOURCES | Insufficient system resources exist to complete the requested service. |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x00000057 ERROR_INVALID_PARAMETER   | The parameter is incorrect.                                            |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000139F ERROR_INVALID_STATE       | The specified resource state is invalid.                               |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//	| 0x0000051A ERROR_REVISION_MISMATCH   | The client request contains an invalid Witness protocol version.       |
	//	+--------------------------------------+------------------------------------------------------------------------+
	//
	// This opnum is applicable only to servers that implement Witness protocol version
	// 2.
	//
	// If the Version field of the request is not 0x00020000, the server MUST stop processing
	// the request and return the error code ERROR_REVISION_MISMATCH.
	//
	// If NetName, IpAddress, or ClientComputerName is NULL, the server MUST fail the request
	// and return the error code ERROR_INVALID_PARAMETER.
	//
	// If the NetName parameter is not equal to ServerGlobalName, the server MUST fail the
	// request and return the error code ERROR_INVALID_PARAMETER.
	//
	// If ShareName is not NULL, the server MUST enumerate the shares by calling NetrShareEnum
	// as specified in [MS-SRVS] section 3.1.4.8. If the enumeration fails or if no shares
	// are returned, the server MUST return the error code ERROR_INVALID_STATE.
	//
	// If none of the shares in the list has shi*_type set to STYPE_CLUSTER_SOFS as specified
	// in [MS-SRVS] section 3.1.4.8, the server MUST ignore ShareName.
	//
	// Otherwise, the server MUST fail the request with the error code ERROR_INVALID_STATE
	// for the following:
	//
	// * *ShareName* does not exist in the enumerated list.
	//
	// * The server MUST search for an *Interface* in *InterfaceList* , where *Interface.IPv4Address*
	// or *Interface.IPv6Address* matches the IpAddress parameter based on its format. If
	// no matching entry is found and *ShareName* has shi*_type set to STYPE_CLUSTER_SOFS,
	// as specified in [MS-SRVS] section 2.2.2.4 ( ../ms-srvs/6069f8c0-c93f-43a0-a5b4-7ed447eb4b84
	// ) , the server MUST fail the request with ERROR_INVALID_STATE. **
	RegisterEx(context.Context, *RegisterExRequest) (*RegisterExResponse, error)
}

Witness server interface.

Jump to

Keyboard shortcuts

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