2017-06-26 14:22:27 +03:00
|
|
|
package vnc
|
|
|
|
|
|
|
|
import "encoding/binary"
|
|
|
|
|
|
|
|
func readTightTunnels(c Conn) (uint32, error) {
|
|
|
|
var n uint32
|
|
|
|
if err := binary.Read(c, binary.BigEndian, &n); err != nil {
|
|
|
|
return 0, err
|
|
|
|
}
|
|
|
|
return n, nil
|
|
|
|
}
|
2017-06-29 00:09:31 +03:00
|
|
|
|
|
|
|
func readTightCaps(c Conn) (int32, []byte, []byte, error) {
|
|
|
|
var code int32
|
|
|
|
var vendor [4]byte
|
|
|
|
var signature [8]byte
|
|
|
|
if err := binary.Read(c, binary.BigEndian, &code); err != nil {
|
|
|
|
return 0, nil, nil, err
|
|
|
|
}
|
|
|
|
if err := binary.Read(c, binary.BigEndian, &vendor); err != nil {
|
|
|
|
return 0, nil, nil, err
|
|
|
|
}
|
|
|
|
if err := binary.Read(c, binary.BigEndian, &signature); err != nil {
|
|
|
|
return 0, nil, nil, err
|
|
|
|
}
|
|
|
|
return code, vendor[:], signature[:], nil
|
|
|
|
}
|