Documentation ¶
Overview ¶
The swn package implements the SWN client protocol.
Introduction ¶
The Service Witness Protocol is a remote procedure call (RPC)-based protocol that is used to promptly notify a client of resource changes that have occurred on a highly available server.
Overview ¶
In highly available systems, there can be many instances of a service (for instance an SMB3 file service [MS-SMB2]) running on a server or group of servers. These service instances are accessed by clients through network DNS names and associated IP addresses.
The Service Witness Protocol enables a client application (for instance, an SMB3 client) to receive prompt and explicit notifications about the failure or recovery of a network name and associated services, rather than relying on slower detection mechanisms such as time-outs and keep-alives.
The Service Witness Protocol is an independent protocol which is used alongside other protocols, as illustrated by the following figure.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
// import guard
GoPackage = "swn"
)
Functions ¶
This section is empty.
Types ¶
type InterfaceInfo ¶
type InterfaceInfo struct { // InterfaceGroupName: The null-terminated string that specifies a name of the interface // group. InterfaceGroupName []uint16 `idl:"name:InterfaceGroupName" json:"interface_group_name"` // Version: The current version of the Witness Service running on the server. Version uint32 `idl:"name:Version" json:"version"` // State: The current state of the interface. This field MUST contain one of the following // values: // // +--------------------+----------------------------------------+ // | | | // | VALUE | MEANING | // | | | // +--------------------+----------------------------------------+ // +--------------------+----------------------------------------+ // | UNKNOWN 0x0000 | The state of the interface is unknown. | // +--------------------+----------------------------------------+ // | AVAILABLE 0x0001 | The interface is available. | // +--------------------+----------------------------------------+ // | UNAVAILABLE 0x00FF | The interface is unavailable. | // +--------------------+----------------------------------------+ State uint16 `idl:"name:State" json:"state"` // IPV4: The IPv4 address of the interface, if the IPv4 flag is set in Flags field. IPv4 uint32 `idl:"name:IPV4" json:"ipv4"` // IPV6: The IPv6 address of the interface, if the IPv6 flag is set in Flags field. IPv6 []uint16 `idl:"name:IPV6" json:"ipv6"` // Flags: The Flags field specifies information about the interface. This field MUST // be set to combination of zero or more of the following values: // // +------------------------------+----------------------------------------------------------------------------------+ // | | | // | VALUE | MEANING | // | | | // +------------------------------+----------------------------------------------------------------------------------+ // +------------------------------+----------------------------------------------------------------------------------+ // | IPv4 0x00000001 | If set, the IPV4 field contains a valid address. | // +------------------------------+----------------------------------------------------------------------------------+ // | IPv6 0x00000002 | If set, the IPV6 field contains a valid address. | // +------------------------------+----------------------------------------------------------------------------------+ // | INTERFACE_WITNESS 0x00000004 | If set, the interface is available for witness registration. If not set, the | // | | interface MUST NOT be used for witness registration. | // +------------------------------+----------------------------------------------------------------------------------+ Flags uint32 `idl:"name:Flags" json:"flags"` }
InterfaceInfo structure represents WITNESS_INTERFACE_INFO RPC structure.
The WITNESS_INTERFACE_INFO structure specifies the IP addresses of the interface.
func (*InterfaceInfo) MarshalNDR ¶
func (*InterfaceInfo) UnmarshalNDR ¶
type InterfaceList ¶
type InterfaceList struct { // NumberOfInterfaces: The number of WITNESS_INTERFACE_INFO structures in InterfaceInfo. NumberOfInterfaces uint32 `idl:"name:NumberOfInterfaces" json:"number_of_interfaces"` // InterfaceInfo: Contains an array of WITNESS_INTERFACE_INFO structures, as specified // in section 2.2.2.5. InterfaceInfo []*InterfaceInfo `idl:"name:InterfaceInfo;size_is:(NumberOfInterfaces);pointer:unique" json:"interface_info"` }
InterfaceList structure represents WITNESS_INTERFACE_LIST RPC structure.
The WITNESS_INTERFACE_LIST structure specifies the list of interfaces available for witness registration.
func (*InterfaceList) MarshalNDR ¶
func (*InterfaceList) UnmarshalNDR ¶
type ResponseAsyncNotify ¶
type ResponseAsyncNotify struct { // MessageType: Specifies the notification type. This field MUST contain one of the // following values. // // +-------+----------------------------------------------------------------------------------+ // | | | // | VALUE | MEANING | // | | | // +-------+----------------------------------------------------------------------------------+ // +-------+----------------------------------------------------------------------------------+ // | 1 | RESOURCE_CHANGE_NOTIFICATION | // +-------+----------------------------------------------------------------------------------+ // | 2 | CLIENT_MOVE_NOTIFICATION | // +-------+----------------------------------------------------------------------------------+ // | 3 | SHARE_MOVE_NOTIFICATION This value is applicable only for the server | // | | implementing version 2. | // +-------+----------------------------------------------------------------------------------+ // | 4 | IP_CHANGE_NOTIFICATION This value is applicable only for the server implementing | // | | version 2. | // +-------+----------------------------------------------------------------------------------+ MessageType uint32 `idl:"name:MessageType" json:"message_type"` // Length: Specifies the size of the MessageBuffer field, in bytes. Length uint32 `idl:"name:Length" json:"length"` // NumberOfMessages: Total number of notifications in the MessageBuffer field. NumberOfMessages uint32 `idl:"name:NumberOfMessages" json:"number_of_messages"` // MessageBuffer: Contains an array of notification information structures whose type // is determined by the MessageType field. MessageBuffer []byte `idl:"name:MessageBuffer;size_is:(Length);pointer:unique" json:"message_buffer"` }
ResponseAsyncNotify structure represents RESP_ASYNC_NOTIFY RPC structure.
The RESP_ASYNC_NOTIFY structure contains the resource change type.
func (*ResponseAsyncNotify) MarshalNDR ¶
func (*ResponseAsyncNotify) UnmarshalNDR ¶
type Shared ¶
type Shared dcetypes.ContextHandle
Shared structure represents PCONTEXT_HANDLE_SHARED RPC structure.
func (*Shared) ContextHandle ¶
func (o *Shared) ContextHandle() *dcetypes.ContextHandle