36#if(defined __cplusplus)
46#if defined(ANDROID) || defined(LIBVNCSERVER_HAVE_ANDROID)
48#include <sys/select.h>
51#ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
56typedef UINT32 in_addr_t;
58#ifdef LIBVNCSERVER_HAVE_WS2TCPIP_H
63#pragma warning(disable:4996)
73#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
74#ifdef LIBVNCSERVER_HAVE_LIBZ
75#define rfbInitServer rfbInitServerWithPthreadsAndZRLE
77#define rfbInitServer rfbInitServerWithPthreadsButWithoutZRLE
80#ifdef LIBVNCSERVER_HAVE_LIBZ
81#define rfbInitServer rfbInitServerWithoutPthreadsButWithZRLE
83#define rfbInitServer rfbInitServerWithoutPthreadsAndZRLE
107#ifdef LIBVNCSERVER_HAVE_LIBZ
108typedef void (*rfbSetXCutTextUTF8ProcPtr) (
char* str,
int len,
struct _rfbClientRec* cl);
110typedef struct rfbCursor* (*rfbGetCursorProcPtr) (
struct _rfbClientRec* pScreen);
139typedef void (*
rfbSetTextChat) (
struct _rfbClientRec* cl,
int length,
char *string);
154typedef struct _rfbSecurity {
156 void (*handler)(
struct _rfbClientRec* cl);
164typedef struct _rfbProtocolExtension {
177 void** data,
int encodingNumber);
182 void (*close)(
struct _rfbClientRec*
client,
void* data);
185 int (*processArgument)(
int argc,
char *argv[]);
186 struct _rfbProtocolExtension*
next;
189typedef struct _rfbExtensionData {
192 struct _rfbExtensionData*
next;
201typedef struct _rfbScreenInfo
237 struct fd_set allFds;
250 struct sockaddr_in udpRemoteAddr;
313#if defined(LIBVNCSERVER_HAVE_LIBPTHREAD) || defined(LIBVNCSERVER_HAVE_WIN32THREADS)
366#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
367 pthread_t listener_thread;
368 int pipe_notify_listener_thread[2];
369#elif defined(LIBVNCSERVER_HAVE_WIN32THREADS)
370 uintptr_t listener_thread;
372#ifdef LIBVNCSERVER_HAVE_LIBZ
375 rfbSetXCutTextUTF8ProcPtr setXCutTextUTF8;
388 char *iptr,
char *optr,
389 int bytesBetweenInputLines,
405typedef struct _rfbFileTransferData {
415typedef struct _rfbStatList {
429typedef struct _rfbClientRec {
456#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
457 pthread_t client_thread;
458#elif defined(LIBVNCSERVER_HAVE_WIN32THREADS)
459 uintptr_t client_thread;
555 struct timeval startDeferring;
556 struct timeval startPtrDeferring;
574#define UPDATE_BUF_SIZE 32768
585#ifdef LIBVNCSERVER_HAVE_LIBZ
588 struct z_stream_s compStream;
590 uint32_t zlibCompressLevel;
592#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
594 int tightQualityLevel;
596#ifdef LIBVNCSERVER_HAVE_LIBJPEG
598 z_stream zsStruct[4];
601 int tightCompressLevel;
631#if defined(LIBVNCSERVER_HAVE_LIBPTHREAD) || defined(LIBVNCSERVER_HAVE_WIN32THREADS)
638 MUTEX(refCountMutex);
646#ifdef LIBVNCSERVER_HAVE_LIBZ
663#if defined(LIBVNCSERVER_HAVE_LIBPTHREAD) || defined(LIBVNCSERVER_HAVE_WIN32THREADS)
664#define LIBVNCSERVER_SEND_MUTEX
675#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
676 uint32_t tightEncoding;
677#ifdef LIBVNCSERVER_HAVE_LIBJPEG
679 int turboSubsampLevel;
680 int turboQualityLevel;
686#ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
687 int pipe_notify_client_thread[2];
700#ifdef LIBVNCSERVER_HAVE_LIBZ
701 rfbBool enableExtendedClipboard;
702 uint32_t extClipboardUserCap;
703 uint32_t extClipboardMaxUnsolicitedSize;
704 char *extClipboardData;
705 int extClipboardDataSize;
707#ifdef LIBVNCSERVER_HAVE_LIBJPEG
711 int tightPngDstDataLen;
721#define FB_UPDATE_PENDING(cl) \
722 (((cl)->enableCursorShapeUpdates && (cl)->cursorWasChanged) || \
723 (((cl)->enableCursorShapeUpdates == FALSE && \
724 ((cl)->cursorX != (cl)->screen->cursorX || \
725 (cl)->cursorY != (cl)->screen->cursorY))) || \
726 ((cl)->useNewFBSize && (cl)->newFBSizePending) || \
727 ((cl)->enableCursorPosUpdates && (cl)->cursorWasMoved) || \
728 !sraRgnEmpty((cl)->copyRegion) || !sraRgnEmpty((cl)->modifiedRegion))
734#define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
736#define Swap24(l) ((((l) & 0xff) << 16) | (((l) >> 16) & 0xff) | \
739#define Swap32(l) ((((l) >> 24) & 0x000000ff)| \
740 (((l) & 0x00ff0000) >> 8) | \
741 (((l) & 0x0000ff00) << 8) | \
742 (((l) & 0x000000ff) << 24))
747#define Swap16IfLE(s) (rfbEndianTest ? Swap16(s) : (s))
748#define Swap24IfLE(l) (rfbEndianTest ? Swap24(l) : (l))
749#define Swap32IfLE(l) (rfbEndianTest ? Swap32(l) : (l))
752#define Swap16IfBE(s) (rfbEndianTest ? (s) : Swap16(s))
753#define Swap24IfBE(l) (rfbEndianTest ? (l) : Swap24(l))
754#define Swap32IfBE(l) (rfbEndianTest ? (l) : Swap32(l))
777#ifdef LIBVNCSERVER_WITH_WEBSOCKETS
780extern rfbBool webSocketsCheck(rfbClientPtr cl);
781extern rfbBool webSocketCheckDisconnect(rfbClientPtr cl);
782extern int webSocketsEncode(rfbClientPtr cl,
const char *src,
int len,
char **dst);
783extern int webSocketsDecode(rfbClientPtr cl,
char *dst,
int len);
784extern rfbBool webSocketsHasDataInBuffer(rfbClientPtr cl);
813#ifdef LIBVNCSERVER_HAVE_LIBZ
814extern void rfbSendServerCutTextUTF8(rfbScreenInfoPtr rfbScreen,
char *str,
int len,
char *fallbackLatin1Str,
int latin1Len);
838 char *iptr,
char *optr,
839 int bytesBetweenInputLines,
881#define ULTRA_MAX_RECT_SIZE (128*256)
882#define ULTRA_MAX_SIZE(min) ((( min * 2 ) > ULTRA_MAX_RECT_SIZE ) ? \
883 ( min * 2 ) : ULTRA_MAX_RECT_SIZE )
888#ifdef LIBVNCSERVER_HAVE_LIBZ
894#define VNC_ENCODE_ZLIB_MIN_COMP_SIZE (17)
899#define ZLIB_MAX_RECT_SIZE (128*256)
900#define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? \
901 ( min * 2 ) : ZLIB_MAX_RECT_SIZE )
903extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl,
int x,
int y,
int w,
906#ifdef LIBVNCSERVER_HAVE_LIBJPEG
909#define TIGHT_DEFAULT_COMPRESSION 6
910#define TURBO_DEFAULT_SUBSAMP 0
912extern int rfbNumCodedRectsTight(rfbClientPtr cl,
int x,
int y,
int w,
int h);
914extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl,
int x,
int y,
int w,
int h);
915extern rfbBool rfbSendTightHeader(rfbClientPtr cl,
int x,
int y,
int w,
int h);
916extern rfbBool rfbSendCompressedDataTight(rfbClientPtr cl,
char *buf,
int compressedLen);
918#if defined(LIBVNCSERVER_HAVE_LIBPNG)
919extern rfbBool rfbSendRectEncodingTightPng(rfbClientPtr cl,
int x,
int y,
int w,
int h);
957#ifdef LIBVNCSERVER_HAVE_LIBZ
958extern rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl,
int x,
int y,
int w,
int h);
981int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
int x,
int y,
unsigned char c,
int x1,
int y1,
int x2,
int y2,
rfbPixel colour,
rfbPixel backColour);
982void rfbDrawStringWithClip(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
int x,
int y,
const char*
string,
int x1,
int y1,
int x2,
int y2,
rfbPixel colour,
rfbPixel backColour);
985void rfbFontBBox(rfbFontDataPtr font,
unsigned char c,
int* x1,
int* y1,
int* x2,
int* y2);
1008 rfbFontDataPtr font,
char** list,
1009 int x1,
int y1,
int x2,
int y2,
1030void rfbDoCopyRect(rfbScreenInfoPtr rfbScreen,
int x1,
int y1,
int x2,
int y2,
int dx,
int dy);
1051 int width,
int height,
int bitsPerSample,
int samplesPerPixel,
1056 int width,
int height,
int bitsPerSample,
int samplesPerPixel,
1130#if(defined __cplusplus)
void rfbSetCursor(rfbScreenInfoPtr rfbScreen, rfbCursorPtr c)
void rfbPurgeArguments(int *argc, int *position, int count, char *argv[])
rfbBool(* rfbGetExtDesktopScreenPtr)(int seqnumber, struct rfbExtDesktopScreen *extDesktopScreen, struct _rfbClientRec *cl)
struct rfbClientIterator * rfbClientIteratorPtr
void rfbDoCopyRect(rfbScreenInfoPtr rfbScreen, int x1, int y1, int x2, int y2, int dx, int dy)
void rfbFreeFont(rfbFontDataPtr font)
free a dynamically loaded font
void(* rfbSetXCutTextProcPtr)(char *str, int len, struct _rfbClientRec *cl)
rfbClientIteratorPtr rfbGetClientIterator(rfbScreenInfoPtr rfbScreen)
int rfbStatGetMessageCountSent(rfbClientPtr cl, uint32_t type)
void rfbFreeCursor(rfbCursorPtr cursor)
void rfbHttpCheckFds(rfbScreenInfoPtr rfbScreen)
void rfbDisconnectUDPSock(rfbScreenInfoPtr rfbScreen)
rfbBool rfbSendRectEncodingRaw(rfbClientPtr cl, int x, int y, int w, int h)
rfbBool rfbSetTranslateFunction(rfbClientPtr cl)
rfbBool(* rfbSetTranslateFunctionProcPtr)(struct _rfbClientRec *cl)
int rfbStatGetSentBytesIfRaw(rfbClientPtr cl)
void rfbStartOnHoldClient(rfbClientPtr cl)
void * rfbGetExtensionClientData(rfbClientPtr cl, rfbProtocolExtension *extension)
void rfbRunEventLoop(rfbScreenInfoPtr screenInfo, long usec, rfbBool runInBackground)
enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl)
rfbClientPtr rfbNewUDPClient(rfbScreenInfoPtr rfbScreen)
int rfbDrawCharWithClip(rfbScreenInfoPtr rfbScreen, rfbFontDataPtr font, int x, int y, unsigned char c, int x1, int y1, int x2, int y2, rfbPixel colour, rfbPixel backColour)
if colour==backColour, background is transparent
rfbBool rfbProcessFileTransfer(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length)
rfbBool rfbDisableExtension(rfbClientPtr cl, rfbProtocolExtension *extension)
void rfbCloseClient(rfbClientPtr cl)
void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen, sraRegionPtr modRegion)
void rfbUnregisterProtocolExtension(rfbProtocolExtension *extension)
void rfbRegisterTightVNCFileTransferExtension(void)
Register the TightVNC-1.3.x file transfer extension.
rfbBool rfbSendFileTransferChunk(rfbClientPtr cl)
rfbBool rfbSendUpdateBuf(rfbClientPtr cl)
rfbSocket rfbListenOnTCPPort(int port, in_addr_t iface)
int rfbCheckFds(rfbScreenInfoPtr rfbScreen, long usec)
int rfbReadExact(rfbClientPtr cl, char *buf, int len)
int rfbStatGetEncodingCountRcvd(rfbClientPtr cl, uint32_t type)
rfbBool rfbSendRectEncodingCoRRE(rfbClientPtr cl, int x, int y, int w, int h)
char * rfbProcessFileTransferReadBuffer(rfbClientPtr cl, uint32_t length)
int rfbDrawChar(rfbScreenInfoPtr rfbScreen, rfbFontDataPtr font, int x, int y, unsigned char c, rfbPixel colour)
void rfbRefuseOnHoldClient(rfbClientPtr cl)
void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen, int x1, int y1, int x2, int y2)
void rfbResetStats(rfbClientPtr cl)
rfbStatList * rfbStatLookupMessage(rfbClientPtr cl, uint32_t type)
int(* rfbGetKeyboardLedStateHookPtr)(struct _rfbScreenInfo *screen)
support the capability to view the caps/num/scroll states of the X server
rfbBool rfbSetNonBlocking(rfbSocket sock)
void rfbScheduleCopyRegion(rfbScreenInfoPtr rfbScreen, sraRegionPtr copyRegion, int dx, int dy)
void rfbGotXCutText(rfbScreenInfoPtr rfbScreen, char *str, int len)
rfbBool rfbSendTextChatMessage(rfbClientPtr cl, uint32_t length, char *buffer)
send a TextChat message to a client
rfbFontDataPtr rfbLoadConsoleFont(char *filename)
dynamically load a linux console font (4096 bytes, 256 glyphs a 8x16
void rfbSetProtocolVersion(rfbScreenInfoPtr rfbScreen, int major_, int minor_)
Set which version you want to advertise 3.3, 3.6, 3.7 and 3.8 are currently supported.
int rfbSelectBox(rfbScreenInfoPtr rfbScreen, rfbFontDataPtr font, char **list, int x1, int y1, int x2, int y2, rfbPixel foreColour, rfbPixel backColour, int border, SelectionChangedHookPtr selChangedHook)
char * rfbMakeMaskFromAlphaSource(int width, int height, unsigned char *alphaSource)
void rfbMakeRichCursorFromXCursor(rfbScreenInfoPtr rfbScreen, rfbCursorPtr cursor)
void rfbNewClientConnection(rfbScreenInfoPtr rfbScreen, rfbSocket sock)
void rfbDrawStringWithClip(rfbScreenInfoPtr rfbScreen, rfbFontDataPtr font, int x, int y, const char *string, int x1, int y1, int x2, int y2, rfbPixel colour, rfbPixel backColour)
rfbBool rfbSendFramebufferUpdate(rfbClientPtr cl, sraRegionPtr updateRegion)
void rfbScheduleCopyRect(rfbScreenInfoPtr rfbScreen, int x1, int y1, int x2, int y2, int dx, int dy)
void rfbReleaseClientIterator(rfbClientIteratorPtr iterator)
void rfbDoNothingWithClient(rfbClientPtr cl)
int rfbWidthOfString(rfbFontDataPtr font, const char *string)
rfbStatList * rfbStatLookupEncoding(rfbClientPtr cl, uint32_t type)
void(* SelectionChangedHookPtr)(int _index)
this opens a modal select box.
void rfbHttpInitSockets(rfbScreenInfoPtr rfbScreen)
void rfbWholeFontBBox(rfbFontDataPtr font, int *x1, int *y1, int *x2, int *y2)
this returns the smallest box enclosing any character of font.
rfbBool rfbSendSetColourMapEntries(rfbClientPtr cl, int firstColour, int nColours)
void(* ClientGoneHookPtr)(struct _rfbClientRec *cl)
void rfbTranslateNone(char *table, rfbPixelFormat *in, rfbPixelFormat *out, char *iptr, char *optr, int bytesBetweenInputLines, int width, int height)
void rfbClientConnectionGone(rfbClientPtr cl)
rfbBool rfbProcessArguments(rfbScreenInfoPtr rfbScreen, int *argc, char *argv[])
char * encodingName(uint32_t enc, char *buf, int len)
rfbBool rfbSendLastRectMarker(rfbClientPtr cl)
rfbBool rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
void rfbUnregisterSecurityHandler(rfbSecurityHandler *handler)
struct sraRegion * sraRegionPtr
void rfbClientConnFailed(rfbClientPtr cl, const char *reason)
void rfbStatRecordMessageRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
rfbBool rfbSendRectEncodingRRE(rfbClientPtr cl, int x, int y, int w, int h)
rfbBool rfbProcessSizeArguments(int *width, int *height, int *bpp, int *argc, char *argv[])
rfbClientPtr rfbReverseConnection(rfbScreenInfoPtr rfbScreen, char *host, int port)
void rfbProcessClientMessage(rfbClientPtr cl)
int rfbStatGetRcvdBytes(rfbClientPtr cl)
void rfbConvertLSBCursorBitmapOrMask(int width, int height, unsigned char *bitmap)
void rfbShutdownServer(rfbScreenInfoPtr rfbScreen, rfbBool disconnectClients)
void rfbStatRecordEncodingSentAdd(rfbClientPtr cl, uint32_t type, int byteCount)
void rfbDrawLine(rfbScreenInfoPtr s, int x1, int y1, int x2, int y2, rfbPixel col)
void rfbAuthProcessClientMessage(rfbClientPtr cl)
void rfbDefaultPtrAddEvent(int buttonMask, int x, int y, rfbClientPtr cl)
cursor handling for the pointer
void rfbFillRect(rfbScreenInfoPtr s, int x1, int y1, int x2, int y2, rfbPixel col)
void(* ClientFramebufferUpdateRequestHookPtr)(struct _rfbClientRec *cl, rfbFramebufferUpdateRequestMsg *furMsg)
void rfbLogPerror(const char *str)
int rfbStringToAddr(char *string, in_addr_t *addr)
rfbBool rfbEnableExtension(rfbClientPtr cl, rfbProtocolExtension *extension, void *data)
void rfbScreenCleanup(rfbScreenInfoPtr screenInfo)
rfbBool rfbSendCursorPos(rfbClientPtr cl)
void(* rfbDisplayHookPtr)(struct _rfbClientRec *cl)
void rfbSetServerVersionIdentity(rfbScreenInfoPtr screen, char *fmt,...)
rfbBool rfbUpdateClient(rfbClientPtr cl)
int rfbWidthOfChar(rfbFontDataPtr font, unsigned char c)
rfbScreenInfoPtr rfbGetScreen(int *argc, char **argv, int width, int height, int bitsPerSample, int samplesPerPixel, int bytesPerPixel)
rfbBool rfbSendRectEncodingUltra(rfbClientPtr cl, int x, int y, int w, int h)
rfbBool rfbSendCursorShape(rfbClientPtr cl)
unsigned char rfbReverseByte[0x100]
void rfbRegisterProtocolExtension(rfbProtocolExtension *extension)
void rfbIncrClientRef(rfbClientPtr cl)
rfbBool rfbSendFileTransferMessage(rfbClientPtr cl, uint8_t contentType, uint8_t contentParam, uint32_t size, uint32_t length, const char *buffer)
void rfbNewUDPConnection(rfbScreenInfoPtr rfbScreen, rfbSocket sock)
void(* rfbSetSingleWindowProcPtr)(struct _rfbClientRec *cl, int x, int y)
If x==1 and y==1 then set the whole display else find the window underneath x and y and set the frame...
rfbBool rfbIsActive(rfbScreenInfoPtr screenInfo)
void rfbUnregisterTightVNCFileTransferExtension(void)
Unregister the TightVNC-1.3.x file transfer extension.
rfbBool rfbSendDirContent(rfbClientPtr cl, int length, char *buffer)
int(* rfbNumberOfExtDesktopScreensPtr)(struct _rfbClientRec *cl)
rfbBool rfbProcessEvents(rfbScreenInfoPtr screenInfo, long usec)
rfbSocket rfbListenOnTCP6Port(int port, const char *iface)
rfbBool(* rfbPasswordCheckProcPtr)(struct _rfbClientRec *cl, const char *encryptedPassWord, int len)
rfbBool rfbSendRectEncodingHextile(rfbClientPtr cl, int x, int y, int w, int h)
void rfbDoCopyRegion(rfbScreenInfoPtr rfbScreen, sraRegionPtr copyRegion, int dx, int dy)
rfbClientPtr rfbClientIteratorNext(rfbClientIteratorPtr iterator)
void rfbReleaseExtensionIterator(void)
void rfbAuthNewClient(rfbClientPtr cl)
void(* rfbSetServerInputProcPtr)(struct _rfbClientRec *cl, int status)
Status determines if the X11 server permits input from the local user status==0 or 1.
void(* rfbPtrAddEventProcPtr)(int buttonMask, int x, int y, struct _rfbClientRec *cl)
enum rfbNewClientAction(* rfbNewClientHookPtr)(struct _rfbClientRec *cl)
int rfbStatGetEncodingCountSent(rfbClientPtr cl, uint32_t type)
char * rfbMakeMaskForXCursor(int width, int height, char *cursorString)
void rfbDecrClientRef(rfbClientPtr cl)
rfbSocket rfbConnect(rfbScreenInfoPtr rfbScreen, char *host, int port)
void rfbDrawPixel(rfbScreenInfoPtr s, int x, int y, rfbPixel col)
rfbSocket rfbConnectToTcpAddr(char *host, int port)
rfbBool rfbEconomicTranslate
struct _rfbSslCtx rfbSslCtx
void rfbDrawString(rfbScreenInfoPtr rfbScreen, rfbFontDataPtr font, int x, int y, const char *string, rfbPixel colour)
int rfbWriteExact(rfbClientPtr cl, const char *buf, int len)
void rfbSetClientColourMaps(rfbScreenInfoPtr rfbScreen, int firstColour, int nColours)
rfbBool rfbProcessNewConnection(rfbScreenInfoPtr rfbScreen)
void rfbStatRecordMessageSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
int rfbStatGetSentBytes(rfbClientPtr cl)
void(* rfbTranslateFnType)(char *table, rfbPixelFormat *in, rfbPixelFormat *out, char *iptr, char *optr, int bytesBetweenInputLines, int width, int height)
rfbTranslateFnType is the type of translation functions.
void rfbNewFramebuffer(rfbScreenInfoPtr rfbScreen, char *framebuffer, int width, int height, int bitsPerSample, int samplesPerPixel, int bytesPerPixel)
void rfbHttpShutdownSockets(rfbScreenInfoPtr rfbScreen)
void(* rfbKbdReleaseAllKeysProcPtr)(struct _rfbClientRec *cl)
void rfbMakeXCursorFromRichCursor(rfbScreenInfoPtr rfbScreen, rfbCursorPtr cursor)
void rfbClientListInit(rfbScreenInfoPtr rfbScreen)
void rfbLogEnable(int enabled)
rfbBool(* rfbXvpHookPtr)(struct _rfbClientRec *cl, uint8_t, uint8_t)
void rfbPrintStats(rfbClientPtr cl)
rfbClientPtr rfbNewClient(rfbScreenInfoPtr rfbScreen, rfbSocket sock)
rfbBool rfbSendExtDesktopSize(rfbClientPtr cl, int w, int h)
void(* rfbKbdAddEventProcPtr)(rfbBool down, rfbKeySym keySym, struct _rfbClientRec *cl)
void rfbProcessClientSecurityType(rfbClientPtr cl)
rfbBool rfbSendNewFBSize(rfbClientPtr cl, int w, int h)
int(* rfbSetDesktopSizeHookPtr)(int width, int height, int numScreens, struct rfbExtDesktopScreen *extDesktopScreens, struct _rfbClientRec *cl)
int rfbReadExactTimeout(rfbClientPtr cl, char *buf, int len, int timeout)
int rfbStatGetMessageCountRcvd(rfbClientPtr cl, uint32_t type)
int rfbPeekExactTimeout(rfbClientPtr cl, char *buf, int len, int timeout)
rfbCursorPtr rfbMakeXCursor(int width, int height, char *cursorString, char *maskString)
void(* rfbSetTextChat)(struct _rfbClientRec *cl, int length, char *string)
Handle the textchat messages.
char * messageNameServer2Client(uint32_t type, char *buf, int len)
void(* rfbDisplayFinishedHookPtr)(struct _rfbClientRec *cl, int result)
void(* rfbLogProc)(const char *format,...)
rfbBool rfbCheckPasswordByList(rfbClientPtr cl, const char *response, int len)
to check against plain passwords
void rfbStatRecordEncodingRcvd(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
rfbSocket rfbListenOnUDPPort(int port, in_addr_t iface)
void rfbFontBBox(rfbFontDataPtr font, unsigned char c, int *x1, int *y1, int *x2, int *y2)
struct _rfbProtocolExtension * rfbGetExtensionIterator(void)
void rfbSendServerCutText(rfbScreenInfoPtr rfbScreen, char *str, int len)
void rfbProcessUDPInput(rfbScreenInfoPtr rfbScreen)
void rfbRegisterSecurityHandler(rfbSecurityHandler *handler)
void rfbSendBell(rfbScreenInfoPtr rfbScreen)
void rfbShutdownSockets(rfbScreenInfoPtr rfbScreen)
rfbBool rfbSendCopyRegion(rfbClientPtr cl, sraRegionPtr reg, int dx, int dy)
void rfbStatRecordEncodingSent(rfbClientPtr cl, uint32_t type, int byteCount, int byteIfRaw)
char * messageNameClient2Server(uint32_t type, char *buf, int len)
int rfbStatGetRcvdBytesIfRaw(rfbClientPtr cl)
int(* rfbFileTransferPermitted)(struct _rfbClientRec *cl)
Permit the server to allow or deny filetransfers.
void rfbInitSockets(rfbScreenInfoPtr rfbScreen)
#define UPDATE_BUF_SIZE
UPDATE_BUF_SIZE must be big enough to send at least one whole line of the framebuffer.
#define rfbZRLETileHeight
struct sraRegion sraRegion
rfbBool compStreamInitedLZO
struct _rfbClientRec * prev
rfbBool enableServerIdentity
client supports ServerIdentity encoding
char * translateLookupTable
rfbBool readyForSetColourMapEntries
struct _rfbClientRec * next
char * zrleBeforeBuf
for threaded zrle
ClientFramebufferUpdateRequestHookPtr clientFramebufferUpdateRequestHook
clientFramebufferUpdateRequestHook is called when a client requests a frame buffer update.
rfbBool enableCursorShapeUpdates
client supports cursor shape updates
rfbBool PalmVNC
how did the client tell us it wanted the screen changed? Ultra style or palm style?
void * clientData
private data.
rfbBool cursorWasChanged
cursor shape update should be sent
sraRegionPtr requestedRegion
As part of the FramebufferUpdateRequest, a client can express interest in a subrectangle of the whole...
char * beforeEncBuf
for thread safety for rfbSendFBUpdate()
int progressiveSliceY
if progressive updating is on, this variable holds the current y coordinate of the progressive slice.
rfbBool enableCursorPosUpdates
client supports cursor position updates
rfbBool enableSupportedEncodings
client supports SupportedEncodings encoding
rfbExtensionData * extensions
rfbBool useExtDesktopSize
rfbTranslateFnType translateFn
translateFn points to the translation function which is used to copy and translate a rectangle from t...
rfbBool useRichCursorEncoding
rfbEncodingRichCursor is preferred
rfbBool cursorWasMoved
cursor position update should be sent
rfbBool newFBSizePending
framebuffer size was changed
rfbBool useNewFBSize
client supports NewFBSize encoding
ClientGoneHookPtr clientGoneHook
struct _rfbStatList * statEncList
sraRegionPtr modifiedRegion
rfbScreenInfoPtr scaledScreen
points to a scaled version of the screen buffer in cl->scaledScreenList
struct _rfbStatList * statMsgList
sraRegionPtr copyRegion
the destination region of the copy
rfbBool enableLastRectEncoding
client supports LastRect encoding
rfbFileTransferData fileTransfer
rfbBool enableKeyboardLedState
client supports KeyboardState encoding
int lastKeyboardLedState
keep track of last value so we can send change events
int requestedDesktopSizeChange
int lastDesktopSizeChangeError
@ RFB_AUTHENTICATION
authenticating
@ RFB_SECURITY_TYPE
negotiating security (RFB v.3.7)
@ RFB_INITIALISATION
sending initialisation messages
@ RFB_PROTOCOL_VERSION
establishing protocol version
@ RFB_INITIALISATION_SHARED
sending initialisation messages with implicit shared-flag already true
@ RFB_NORMAL
normal protocol messages
rfbBool reverseConnection
rfbBool enableSupportedMessages
client supports SupportedMessages encoding
rfbScreenInfoPtr screen
back pointer to the screen
rfbBool is16
is the data format short?
unsigned short yhot
metrics
unsigned char * mask
points to bits
unsigned short backBlue
device-independent colour
unsigned short foreBlue
device-independent colour
unsigned char * source
points to bits
rfbBool cleanupRichSource
rfbBool cleanup
set this to true if LibVNCServer has to free this cursor
unsigned char * richSource
source bytes for a rich cursor
rfbBool alphaPreMultiplied
if richSource already has alpha applied
unsigned char * alphaSource
source for alpha blending info
rfbProtocolExtension * extension
struct _rfbExtensionData * next
int * metaData
metaData is a 256*5 array: for each character (offset,width,height,x,y)
Protocol extension handling.
struct _rfbProtocolExtension * next
int * pseudoEncodings
if pseudoEncodings is not NULL, it contains a 0 terminated list of the pseudo encodings handled by th...
Per-screen (framebuffer) structure.
rfbKbdReleaseAllKeysProcPtr kbdReleaseAllKeys
rfbSocket httpListen6Sock
rfbBool httpEnableProxyConnect
rfbPtrAddEventProcPtr ptrAddEvent
rfbGetCursorProcPtr getCursorPtr
in_addr_t listenInterface
int deferUpdateTime
this is the amount of milliseconds to wait at least before sending an update.
rfbBool ignoreSIGPIPE
if TRUE, an ignoring signal handler is installed for SIGPIPE
rfbSetSingleWindowProcPtr setSingleWindow
int maxRectsPerUpdate
send only this many rectangles in one update
rfbKbdAddEventProcPtr kbdAddEvent
rfbXvpHookPtr xvpHook
xvpHook is called to handle an xvp client message
int protocolMajorVersion
What does the server tell the new clients which version it supports.
rfbNumberOfExtDesktopScreensPtr numberOfExtDesktopScreensHook
Optional hooks to query ExtendedDesktopSize screen information.
rfbGetKeyboardLedStateHookPtr getKeyboardLedStateHook
These hooks are called to pass keyboard state back to the client.
rfbDisplayFinishedHookPtr displayFinishedHook
displayFinishedHook is called just after a frame buffer update
rfbSetServerInputProcPtr setServerInput
rfbDisplayHookPtr displayHook
displayHook is called just before a frame buffer update
rfbBool dontConvertRichCursorToXCursor
struct _rfbClientRec * clientHead
struct rfbCursor * cursor
rfbGetExtDesktopScreenPtr getExtDesktopScreenHook
rfbSetTranslateFunctionProcPtr setTranslateFunction
struct _rfbScreenInfo * scaledScreenNext
this structure has children that are scaled versions of this screen
int progressiveSliceHeight
if not zero, only a slice of this height is processed every time an update should be sent.
rfbSetXCutTextProcPtr setXCutText
rfbSetDesktopSizeHookPtr setDesktopSizeHook
hook to let client set resolution
rfbPixelFormat serverFormat
char * frameBuffer
the frameBuffer has to be supplied by the serving process.
enum rfbSocketState socketState
rfbPasswordCheckProcPtr passwordCheck
rfbSetTextChat setTextChat
struct _rfbClientRec * pointerClient
"Mutex" for pointer events
float fdQuota
This value between 0 and 1.0 defines which fraction of the maximum number of file descriptors LibVNCS...
char * versionString
rfbEncodingServerIdentity
rfbBool permitFileTransfer
command line authorization of file transfers
rfbColourMap colourMap
set this if rfbServerFormat.trueColour==FALSE
rfbBool handleEventsEagerly
handle as many input events as possible (default off)
int ipv6port
The port to listen on when using IPv6.
void * screenData
some screen specific data can be put into a struct where screenData points to.
int authPasswdFirstViewOnly
If rfbAuthPasswdData is given a list, this is the first view only password.
rfbNewClientHookPtr newClientHook
newClientHook is called just after a new client is created
rfbFileTransferPermitted getFileTransferPermission
struct _rfbClientRec * udpClient
Security handling (RFB protocol version 3.7)
struct _rfbSecurity * next
struct _rfbStatList * Next