42#ifndef __BASE_VNC_VNC_SERVER_HH__
43#define __BASE_VNC_VNC_SERVER_HH__
52#include "params/VncServer.hh"
75 const static uint32_t
VncOK = 0;
105 return "RFB 003.008\n";
229 bool read(uint8_t *buf,
size_t len);
239 bool read1(uint8_t *buf,
size_t len);
246 template <
typename T>
bool read(T*
val);
254 bool write(
const uint8_t *buf,
size_t len);
260 template <
typename T>
bool write(T*
val);
265 bool write(
const char* str);
Configurable RGB pixel converter.
DataEvent to read data from vnc.
ListenEvent to accept a vnc client connection.
void recvKeyboardInput()
Receive message from client providing new keyboard input.
bool read1(uint8_t *buf, size_t len)
Read len -1 bytes from the client into the buffer provided + 1 assert that we read enough bytes.
void sendServerInit()
Send client our idea about what the frame buffer looks like.
void setEncodings()
Receive encodings message from client and process it.
ListenEvent * listenEvent
bool write(const uint8_t *buf, size_t len)
Write a buffer to the client.
bool supportsResizeEnc
If the vnc client supports the desktop resize command.
void frameBufferResized() override
void sendFrameBufferResized()
Tell the client that the frame buffer resized.
void setPixelFormat()
Receive pixel foramt message from client and process it.
void checkSecurity()
Check that the security exchange was successful.
void sendError(std::string error_msg)
Send an error message to the client when something goes wrong.
void requestFbUpdate()
Receive message from client asking for updated frame buffer.
void sendFrameBufferUpdate()
Send a updated frame buffer to the client.
void recvPointerInput()
Recv message from client providing new mouse movement or button click.
void recvCutText()
Receive message from client that there is text in it's paste buffer.
bool supportsRawEnc
If the vnc client supports receiving raw data.
void setDirty() override
The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a...
static const PixelConverter pixelConverter
void sendError(const char *error_msg)
vnc client Interface
void checkProtocolVersion()
Check the client's protocol verion for compatibility and send the security types we support.
bool read(uint8_t *buf, size_t len)
Read some data from the client.
PixelFormat pixelFormat
The one and only pixel format we support.
VncServer(const Params &p)
VncServer.
ConnectionState curState
The rfb prototol state the connection is in.
bool sendUpdate
An update needs to be sent to the client.
EncodingTypes
Encoding types.
ServerMessages
Server -> Client message IDs.
MouseEvents
keyboard/mouse support
static const uint32_t VncOK
Error conditions.
const char * vncVersion() const
static const uint32_t AuthInvalid
Authentication modes.
static const uint32_t AuthNone
@ ServerSetColorMapEntries
@ ServerFrameBufferUpdate
@ WaitForSecurityResponse
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::unique_ptr< ListenSocket > ListenSocketPtr
const std::string & name()