36 #if(defined __cplusplus)
46 #if defined(ANDROID) || defined(LIBVNCSERVER_HAVE_ANDROID)
47 #include <arpa/inet.h>
48 #include <sys/select.h>
51 #ifdef LIBVNCSERVER_HAVE_SYS_TYPES_H
52 #include <sys/types.h>
56 typedef 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
88 struct _rfbScreenInfo;
107 #ifdef LIBVNCSERVER_HAVE_LIBZ
108 typedef void (*rfbSetXCutTextUTF8ProcPtr) (
char* str,
int len,
struct _rfbClientRec* cl);
110 typedef struct rfbCursor* (*rfbGetCursorProcPtr) (
struct _rfbClientRec* pScreen);
139 typedef void (*
rfbSetTextChat) (
struct _rfbClientRec* cl,
int length,
char *string);
154 typedef struct _rfbSecurity {
156 void (*handler)(
struct _rfbClientRec* cl);
164 typedef 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;
189 typedef struct _rfbExtensionData {
192 struct _rfbExtensionData*
next;
201 typedef 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
373 rfbSetXCutTextUTF8ProcPtr setXCutTextUTF8;
384 char *iptr,
char *optr,
385 int bytesBetweenInputLines,
401 typedef struct _rfbFileTransferData {
411 typedef struct _rfbStatList {
423 typedef struct _wsCtx
wsCtx;
425 typedef struct _rfbClientRec {
452 #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
453 pthread_t client_thread;
454 #elif defined(LIBVNCSERVER_HAVE_WIN32THREADS)
455 uintptr_t client_thread;
551 struct timeval startDeferring;
552 struct timeval startPtrDeferring;
570 #define UPDATE_BUF_SIZE 32768
581 #ifdef LIBVNCSERVER_HAVE_LIBZ
584 struct z_stream_s compStream;
586 uint32_t zlibCompressLevel;
588 #if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
590 int tightQualityLevel;
592 #ifdef LIBVNCSERVER_HAVE_LIBJPEG
594 z_stream zsStruct[4];
597 int tightCompressLevel;
627 #if defined(LIBVNCSERVER_HAVE_LIBPTHREAD) || defined(LIBVNCSERVER_HAVE_WIN32THREADS)
634 MUTEX(refCountMutex);
642 #ifdef LIBVNCSERVER_HAVE_LIBZ
659 #if defined(LIBVNCSERVER_HAVE_LIBPTHREAD) || defined(LIBVNCSERVER_HAVE_WIN32THREADS)
660 #define LIBVNCSERVER_SEND_MUTEX
671 #if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG)
672 uint32_t tightEncoding;
673 #ifdef LIBVNCSERVER_HAVE_LIBJPEG
675 int turboSubsampLevel;
676 int turboQualityLevel;
682 #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
683 int pipe_notify_client_thread[2];
696 #ifdef LIBVNCSERVER_HAVE_LIBZ
697 rfbBool enableExtendedClipboard;
698 uint32_t extClipboardUserCap;
699 uint32_t extClipboardMaxUnsolicitedSize;
700 char *extClipboardData;
701 int extClipboardDataSize;
703 #ifdef LIBVNCSERVER_HAVE_LIBJPEG
707 int tightPngDstDataLen;
717 #define FB_UPDATE_PENDING(cl) \
718 (((cl)->enableCursorShapeUpdates && (cl)->cursorWasChanged) || \
719 (((cl)->enableCursorShapeUpdates == FALSE && \
720 ((cl)->cursorX != (cl)->screen->cursorX || \
721 (cl)->cursorY != (cl)->screen->cursorY))) || \
722 ((cl)->useNewFBSize && (cl)->newFBSizePending) || \
723 ((cl)->enableCursorPosUpdates && (cl)->cursorWasMoved) || \
724 !sraRgnEmpty((cl)->copyRegion) || !sraRgnEmpty((cl)->modifiedRegion))
730 #define Swap16(s) ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff))
732 #define Swap24(l) ((((l) & 0xff) << 16) | (((l) >> 16) & 0xff) | \
735 #define Swap32(l) ((((l) >> 24) & 0x000000ff)| \
736 (((l) & 0x00ff0000) >> 8) | \
737 (((l) & 0x0000ff00) << 8) | \
738 (((l) & 0x000000ff) << 24))
743 #define Swap16IfLE(s) (rfbEndianTest ? Swap16(s) : (s))
744 #define Swap24IfLE(l) (rfbEndianTest ? Swap24(l) : (l))
745 #define Swap32IfLE(l) (rfbEndianTest ? Swap32(l) : (l))
748 #define Swap16IfBE(s) (rfbEndianTest ? (s) : Swap16(s))
749 #define Swap24IfBE(l) (rfbEndianTest ? (l) : Swap24(l))
750 #define Swap32IfBE(l) (rfbEndianTest ? (l) : Swap32(l))
773 #ifdef LIBVNCSERVER_WITH_WEBSOCKETS
776 extern rfbBool webSocketsCheck(rfbClientPtr cl);
777 extern rfbBool webSocketCheckDisconnect(rfbClientPtr cl);
778 extern int webSocketsEncode(rfbClientPtr cl,
const char *src,
int len,
char **dst);
779 extern int webSocketsDecode(rfbClientPtr cl,
char *dst,
int len);
780 extern rfbBool webSocketsHasDataInBuffer(rfbClientPtr cl);
809 #ifdef LIBVNCSERVER_HAVE_LIBZ
810 extern void rfbSendServerCutTextUTF8(rfbScreenInfoPtr rfbScreen,
char *str,
int len,
char *fallbackLatin1Str,
int latin1Len);
834 char *iptr,
char *optr,
835 int bytesBetweenInputLines,
877 #define ULTRA_MAX_RECT_SIZE (128*256)
878 #define ULTRA_MAX_SIZE(min) ((( min * 2 ) > ULTRA_MAX_RECT_SIZE ) ? \
879 ( min * 2 ) : ULTRA_MAX_RECT_SIZE )
884 #ifdef LIBVNCSERVER_HAVE_LIBZ
890 #define VNC_ENCODE_ZLIB_MIN_COMP_SIZE (17)
895 #define ZLIB_MAX_RECT_SIZE (128*256)
896 #define ZLIB_MAX_SIZE(min) ((( min * 2 ) > ZLIB_MAX_RECT_SIZE ) ? \
897 ( min * 2 ) : ZLIB_MAX_RECT_SIZE )
899 extern rfbBool rfbSendRectEncodingZlib(rfbClientPtr cl,
int x,
int y,
int w,
902 #ifdef LIBVNCSERVER_HAVE_LIBJPEG
905 #define TIGHT_DEFAULT_COMPRESSION 6
906 #define TURBO_DEFAULT_SUBSAMP 0
908 extern int rfbNumCodedRectsTight(rfbClientPtr cl,
int x,
int y,
int w,
int h);
910 extern rfbBool rfbSendRectEncodingTight(rfbClientPtr cl,
int x,
int y,
int w,
int h);
911 extern rfbBool rfbSendTightHeader(rfbClientPtr cl,
int x,
int y,
int w,
int h);
912 extern rfbBool rfbSendCompressedDataTight(rfbClientPtr cl,
char *buf,
int compressedLen);
914 #if defined(LIBVNCSERVER_HAVE_LIBPNG)
915 extern rfbBool rfbSendRectEncodingTightPng(rfbClientPtr cl,
int x,
int y,
int w,
int h);
953 #ifdef LIBVNCSERVER_HAVE_LIBZ
954 extern rfbBool rfbSendRectEncodingZRLE(rfbClientPtr cl,
int x,
int y,
int w,
int h);
977 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);
978 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);
981 void rfbFontBBox(rfbFontDataPtr font,
unsigned char c,
int* x1,
int* y1,
int* x2,
int* y2);
1004 rfbFontDataPtr font,
char** list,
1005 int x1,
int y1,
int x2,
int y2,
1026 void rfbDoCopyRect(rfbScreenInfoPtr rfbScreen,
int x1,
int y1,
int x2,
int y2,
int dx,
int dy);
1047 int width,
int height,
int bitsPerSample,
int samplesPerPixel,
1052 int width,
int height,
int bitsPerSample,
int samplesPerPixel,
1126 #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 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)
char * rfbMakeMaskForXCursor(int width, int height, char *cursorString)
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)
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)
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[])
rfbBool rfbSendLastRectMarker(rfbClientPtr cl)
rfbBool rfbSetClientColourMap(rfbClientPtr cl, int firstColour, int nColours)
rfbStatList * rfbStatLookupEncoding(rfbClientPtr cl, uint32_t type)
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)
struct _rfbProtocolExtension * rfbGetExtensionIterator(void)
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)
rfbStatList * rfbStatLookupMessage(rfbClientPtr cl, uint32_t type)
void rfbIncrClientRef(rfbClientPtr cl)
char * rfbMakeMaskFromAlphaSource(int width, int height, unsigned char *alphaSource)
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.
char * encodingName(uint32_t enc, char *buf, int len)
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)
char * messageNameClient2Server(uint32_t type, char *buf, int len)
rfbBool(* rfbPasswordCheckProcPtr)(struct _rfbClientRec *cl, const char *encryptedPassWord, int len)
void * rfbGetExtensionClientData(rfbClientPtr cl, rfbProtocolExtension *extension)
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)
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)
char * messageNameServer2Client(uint32_t type, char *buf, int len)
void(* rfbSetTextChat)(struct _rfbClientRec *cl, int length, char *string)
Handle the textchat messages.
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)
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)
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.
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