Documentation
¶
Index ¶
- func BytesToUint64(b []byte) uint64
- func CVAL(p *[]uint8) int
- func CVAL2(p *[]uint8, v *uint16)
- func CVAL3(p *[]uint8, v *[3]uint8)
- func Decompress(input []uint8, width, height int, Bpp int) ([]uint8, error)
- func LittleEndianBytesToUTF16(u []byte) []uint16
- func PutUint16BE(data uint16) (uint8, uint8)
- func REPEAT(f func(), count *int, x *int, width int)
- func RGB555ToRGB(data uint16) (r, g, b uint8)
- func RGB565ToRGB(data uint16) (r, g, b uint8)
- func Random(n int) []byte
- func ReadByte(r io.Reader) (byte, error)
- func ReadBytes(length int, r io.Reader) ([]byte, error)
- func ReadUInt8(r io.Reader) (uint8, error)
- func ReadUInt32BE(r io.Reader) (uint32, error)
- func ReadUInt32LE(r io.Reader) (uint32, error)
- func ReadUint16BE(r io.Reader) (uint16, error)
- func ReadUint16LE(r io.Reader) (uint16, error)
- func Reverse(s []byte) []byte
- func StartReadBytes(length int, r io.Reader, cb ReadBytesComplete)
- func UTF16ToLittleEndianBytes(u []uint16) []byte
- func Uint16BE(d0, d1 uint8) uint16
- func UnicodeDecode(p []byte) string
- func UnicodeEncode(p string) []byte
- func WriteByte(data byte, w io.Writer) (int, error)
- func WriteBytes(data []byte, w io.Writer) (int, error)
- func WriteUInt8(data uint8, w io.Writer) (int, error)
- func WriteUInt16BE(data uint16, w io.Writer) (int, error)
- func WriteUInt16LE(data uint16, w io.Writer) (int, error)
- func WriteUInt32BE(data uint32, w io.Writer) (int, error)
- func WriteUInt32LE(data uint32, w io.Writer) (int, error)
- type ChannelSender
- type FastPathListener
- type FastPathSender
- type PublicKey
- type ReadBytesComplete
- type SocketLayer
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToUint64 ¶
func Decompress ¶
Decompress decodes one RDP 6.0 compressed bitmap. Bpp is bytes per pixel: 1, 2, 3 or 4 for 8, 16, 24 and 32 bits.
It returns whatever it decoded along with an error when it can tell the input is malformed, rather than a buffer of zeros. That distinction matters: a truncated stream used to leave the interleaved decoder spinning on a zero byte, which decodes as a run of nothing and so advances nothing. Callers can still render the partial result, but they can tell that it is partial.
Only the interleaved form reports an error for a stream that ends early, since it carries an explicit size. The other three are terminated by the buffer ending, so ending early is not distinguishable from ending on purpose.
func PutUint16BE ¶
func RGB555ToRGB ¶
func RGB565ToRGB ¶
func ReadBytes ¶
ReadBytes reads exactly len bytes. On a short read it returns the bytes that were read together with io.ErrUnexpectedEOF (or io.EOF when none were read).
func StartReadBytes ¶
func StartReadBytes(length int, r io.Reader, cb ReadBytesComplete)
StartReadBytes reads exactly length bytes from r in a background goroutine and then invokes cb(result, err) exactly once.
On any error - including io.EOF and io.ErrUnexpectedEOF - cb is invoked with that error and no further reads are scheduled by this function. Callers are responsible for stopping their own read chain and surfacing the error.
NOTE: this used to loop forever on io.EOF, spinning the CPU and leaking the goroutine whenever the peer closed the connection.
func UnicodeDecode ¶
Types ¶
type ChannelSender ¶
type FastPathListener ¶
type FastPathSender ¶
type ReadBytesComplete ¶
type SocketLayer ¶
type SocketLayer struct {
// contains filtered or unexported fields
}
func NewSocketLayer ¶
func NewSocketLayer(conn net.Conn) *SocketLayer
func (*SocketLayer) Close ¶
func (s *SocketLayer) Close() error
func (*SocketLayer) SetTLSConfig ¶
func (s *SocketLayer) SetTLSConfig(cfg *tls.Config)
SetTLSConfig overrides the TLS configuration used by StartTLS. When unset a default configuration is used that accepts the self-signed certificates RDP servers normally present. Callers that require verification should supply a config with InsecureSkipVerify=false and the appropriate RootCAs/ServerName.
func (*SocketLayer) StartTLS ¶
func (s *SocketLayer) StartTLS() error
func (*SocketLayer) TlsPubKey ¶
func (s *SocketLayer) TlsPubKey() ([]byte, error)