Documentation
¶
Overview ¶
Package plugin is the virtual channel framework.
A virtual channel is a named byte stream multiplexed over the RDP connection and framed in chunks of at most CHANNEL_CHUNK_LENGTH bytes. Channels registers a ChannelTransport under the name it reports, reassembles the chunks of each channel separately, and hands each complete message to that transport's Process method.
Most callers never use this package directly: the concrete channels built on it are plugin/cliprdr (clipboard), plugin/drdynvc (dynamic channels) and plugin/rdpgfx (graphics). Implement ChannelTransport to add another.
The exported names here mirror the C virtual channel API that FreeRDP and Windows implement, which is why they keep its capitalisation.
Trap: this package imports "C" and uses no C, so cgo is required for no reason, and with it the whole module: the RDP client imports this package, and CGO_ENABLED=0 go build ./... fails with "build constraints exclude all Go files" for plugin. Deleting the stray import in channel.go is what would let the module build without cgo again.
Index ¶
- Constants
- Variables
- type CHANNEL_INIT_EVENT_EX_FN
- type CHANNEL_OPEN_EVENT_EX_FN
- type ChannelClient
- type ChannelDef
- type ChannelEntryPointsEx
- type ChannelTransport
- type Channels
- type VIRTUALCHANNELCLOSEEX
- type VIRTUALCHANNELENTRYEX
- type VIRTUALCHANNELINITEX
- type VIRTUALCHANNELOPENEX
- type VIRTUALCHANNELWRITEEX
Constants ¶
const ( CHANNEL_RC_OK = 0 CHANNEL_RC_ALREADY_INITIALIZED = 1 CHANNEL_RC_NOT_INITIALIZED = 2 CHANNEL_RC_ALREADY_CONNECTED = 3 CHANNEL_RC_NOT_CONNECTED = 4 CHANNEL_RC_TOO_MANY_CHANNELS = 5 CHANNEL_RC_BAD_CHANNEL = 6 CHANNEL_RC_BAD_CHANNEL_HANDLE = 7 CHANNEL_RC_NO_BUFFER = 8 CHANNEL_RC_BAD_INIT_HANDLE = 9 CHANNEL_RC_NOT_OPEN = 10 CHANNEL_RC_BAD_PROC = 11 CHANNEL_RC_NO_MEMORY = 12 CHANNEL_RC_UNKNOWN_CHANNEL_NAME = 13 CHANNEL_RC_ALREADY_OPEN = 14 CHANNEL_RC_NOT_IN_VIRTUALCHANNELENTRY = 15 CHANNEL_RC_NULL_DATA = 16 CHANNEL_RC_ZERO_LENGTH = 17 CHANNEL_RC_INVALID_INSTANCE = 18 CHANNEL_RC_UNSUPPORTED_VERSION = 19 CHANNEL_RC_INITIALIZATION_ERROR = 20 )
const ( CHANNEL_EVENT_INITIALIZED = 0 CHANNEL_EVENT_CONNECTED = 1 CHANNEL_EVENT_V1_CONNECTED = 2 CHANNEL_EVENT_DISCONNECTED = 3 CHANNEL_EVENT_TERMINATED = 4 CHANNEL_EVENT_REMOTE_CONTROL_START = 5 CHANNEL_EVENT_REMOTE_CONTROL_STOP = 6 CHANNEL_EVENT_ATTACHED = 7 CHANNEL_EVENT_DETACHED = 8 CHANNEL_EVENT_DATA_RECEIVED = 10 CHANNEL_EVENT_WRITE_COMPLETE = 11 CHANNEL_EVENT_WRITE_CANCELLED = 12 )
const ( CHANNEL_OPTION_INITIALIZED = 0x80000000 CHANNEL_OPTION_ENCRYPT_RDP = 0x40000000 CHANNEL_OPTION_ENCRYPT_SC = 0x20000000 CHANNEL_OPTION_ENCRYPT_CS = 0x10000000 CHANNEL_OPTION_PRI_HIGH = 0x08000000 CHANNEL_OPTION_PRI_MED = 0x04000000 CHANNEL_OPTION_PRI_LOW = 0x02000000 CHANNEL_OPTION_COMPRESS_RDP = 0x00800000 CHANNEL_OPTION_COMPRESS = 0x00400000 CHANNEL_OPTION_SHOW_PROTOCOL = 0x00200000 CHANNEL_OPTION_REMOTE_CONTROL_PERSISTENT = 0x00100000 )
const ( CLIPRDR_SVC_CHANNEL_NAME = "cliprdr" //剪切板 RDPDR_SVC_CHANNEL_NAME = "rdpdr" //设备重定向(打印机,磁盘,端口,智能卡等) RDPSND_SVC_CHANNEL_NAME = "rdpsnd" //音频输出 RAIL_SVC_CHANNEL_NAME = "rail" //远程应用 DRDYNVC_SVC_CHANNEL_NAME = "drdynvc" //动态虚拟通道 REMDESK_SVC_CHANNEL_NAME = "remdesk" //远程协助 )
static channel name
const ( CHANNEL_CHUNK_LENGTH = 1600 CHANNEL_FLAG_FIRST = 0x01 CHANNEL_FLAG_LAST = 0x02 CHANNEL_FLAG_SHOW_PROTOCOL = 0x10 )
const (
RDPGFX_DVC_CHANNEL_NAME = "Microsoft::Windows::RDS::Graphics" //图形扩展
)
const (
VIRTUAL_CHANNEL_VERSION_WIN2000 = 1
)
Variables ¶
var StaticVirtualChannels = map[string]int{ CLIPRDR_SVC_CHANNEL_NAME: CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL, RDPDR_SVC_CHANNEL_NAME: CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP, RDPSND_SVC_CHANNEL_NAME: CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL, RAIL_SVC_CHANNEL_NAME: CHANNEL_OPTION_INITIALIZED | CHANNEL_OPTION_ENCRYPT_RDP | CHANNEL_OPTION_COMPRESS_RDP | CHANNEL_OPTION_SHOW_PROTOCOL, }
Functions ¶
This section is empty.
Types ¶
type ChannelClient ¶
type ChannelClient struct {
ChannelDef
// contains filtered or unexported fields
}
type ChannelDef ¶
type ChannelEntryPointsEx ¶
type ChannelEntryPointsEx struct {
CbSize uint32
ProtocolVersion uint32
PVirtualChannelInitEx VIRTUALCHANNELINITEX
PVirtualChannelOpenEx VIRTUALCHANNELOPENEX
PVirtualChannelCloseEx VIRTUALCHANNELCLOSEEX
PVirtualChannelWriteEx VIRTUALCHANNELWRITEEX
}
func NewChannelEntryPointsEx ¶
func NewChannelEntryPointsEx() *ChannelEntryPointsEx
type ChannelTransport ¶
type ChannelTransport interface {
GetType() (string, uint32)
Sender(core.ChannelSender)
Process(s []byte)
}
type Channels ¶
func NewChannels ¶
func (*Channels) Register ¶
func (c *Channels) Register(t ChannelTransport)
func (*Channels) SendToChannel ¶
func (*Channels) SetChannelSender ¶
func (c *Channels) SetChannelSender(f core.ChannelSender)
type VIRTUALCHANNELCLOSEEX ¶
type VIRTUALCHANNELENTRYEX ¶
type VIRTUALCHANNELENTRYEX func(pEntryPointsEx *ChannelEntryPointsEx, pInitHandle interface{}) error
type VIRTUALCHANNELINITEX ¶
type VIRTUALCHANNELINITEX func(lpUserParam interface{}, clientContext interface{},
pInitHandle interface{}, pChannel []ChannelDef,
channelCount int, versionRequested uint32,
pChannelInitEventProcEx CHANNEL_INIT_EVENT_EX_FN) uint
type VIRTUALCHANNELOPENEX ¶
type VIRTUALCHANNELOPENEX func(pInitHandle interface{}, pOpenHandle *uint32,
pChannelName string,
pChannelOpenEventProcEx *CHANNEL_OPEN_EVENT_EX_FN) uint
type VIRTUALCHANNELWRITEEX ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package disp implements the display control dynamic virtual channel (MS-RDPEDISP), which is how a client asks the server to change the desktop size while a session is running.
|
Package disp implements the display control dynamic virtual channel (MS-RDPEDISP), which is how a client asks the server to change the desktop size while a session is running. |
|
Package drdynvc implements the dynamic virtual channel channel (MS-RDPEDYC).
|
Package drdynvc implements the dynamic virtual channel channel (MS-RDPEDYC). |
|
rail.go
|
rail.go |
|
Package rdpgfx implements the RDP Graphics Pipeline Extension channel (MS-RDPEGFX), the modern drawing path where a server composites surfaces and sends them as compressed bitmaps.
|
Package rdpgfx implements the RDP Graphics Pipeline Extension channel (MS-RDPEGFX), the modern drawing path where a server composites surfaces and sends them as compressed bitmaps. |