LibVNCServer/LibVNCClient
rfbclient.h
Go to the documentation of this file.
1 #ifndef RFBCLIENT_H
2 #define RFBCLIENT_H
3 
9 /*
10  * Copyright (C) 2017 D. R. Commander. All Rights Reserved.
11  * Copyright (C) 2000, 2001 Const Kaplinsky. All Rights Reserved.
12  * Copyright (C) 2000 Tridia Corporation. All Rights Reserved.
13  * Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
14  *
15  * This is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or
18  * (at your option) any later version.
19  *
20  * This software is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this software; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
28  * USA.
29  */
30 
35 #ifdef WIN32
36 #define WIN32_LEAN_AND_MEAN /* Prevent loading any Winsock 1.x headers from windows.h */
37 #ifdef _MSC_VER
38 #pragma warning(disable:4996)
39 #endif
40 #endif
41 
42 #if defined(ANDROID) || defined(LIBVNCSERVER_HAVE_ANDROID)
43 #include <arpa/inet.h>
44 #include <sys/select.h>
45 #endif
46 
47 #include <stdio.h>
48 #include <stdlib.h>
49 #include <string.h>
50 #if LIBVNCSERVER_HAVE_SYS_TIME_H
51 #include <sys/time.h>
52 #endif
53 #if LIBVNCSERVER_HAVE_UNISTD_H
54 #include <unistd.h>
55 #endif
56 #include <rfb/rfbproto.h>
57 #include <rfb/keysym.h>
58 #include <rfb/threading.h>
59 
60 #ifdef LIBVNCSERVER_HAVE_SASL
61 #include <sasl/sasl.h>
62 #endif /* LIBVNCSERVER_HAVE_SASL */
63 
64 #define rfbClientSwap16IfLE(s) \
65  (*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
66 
67 #define rfbClientSwap32IfLE(l) \
68  (*(char *)&client->endianTest ? ((((l) >> 24) & 0x000000ff) | \
69  (((l) & 0x00ff0000) >> 8) | \
70  (((l) & 0x0000ff00) << 8) | \
71  (((l) & 0x000000ff) << 24)) : (l))
72 
73 #define rfbClientSwap64IfLE(l) \
74  (*(char *)&client->endianTest ? ((((l) >> 56 ) & 0x00000000000000ffULL) | \
75  (((l) & 0x00ff000000000000ULL) >> 40) | \
76  (((l) & 0x0000ff0000000000ULL) >> 24) | \
77  (((l) & 0x000000ff00000000ULL) >> 8) | \
78  (((l) & 0x00000000ff000000ULL) << 8) | \
79  (((l) & 0x0000000000ff0000ULL) << 24) | \
80  (((l) & 0x000000000000ff00ULL) << 40) | \
81  (((l) & 0x00000000000000ffULL) << 56)) : (l))
82 
83 #define FLASH_PORT_OFFSET 5400
84 #define LISTEN_PORT_OFFSET 5500
85 #define TUNNEL_PORT_OFFSET 5500
86 #define SERVER_PORT_OFFSET 5900
87 
88 #define DEFAULT_CONNECT_TIMEOUT 60
89 #define DEFAULT_READ_TIMEOUT 0
90 
91 #define DEFAULT_SSH_CMD "/usr/bin/ssh"
92 #define DEFAULT_TUNNEL_CMD \
93  (DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20")
94 #define DEFAULT_VIA_CMD \
95  (DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20")
96 
97 #if(defined __cplusplus)
98 extern "C"
99 {
100 #endif
101 
104 typedef struct {
105  FILE* file;
106  struct timeval tv;
109 } rfbVNCRec;
110 
113 typedef struct rfbClientData {
114  void* tag;
115  void* data;
117 } rfbClientData;
118 
121 typedef struct {
124 
125  const char* encodingsString;
126 
128  int nColours;
132 
139 } AppData;
140 
142 typedef union _rfbCredential
143 {
145  struct
146  {
151  uint8_t x509CrlVerifyMode; /* Only required for OpenSSL - see meanings below */
152  } x509Credential;
154  struct
155  {
156  char *username;
157  char *password;
158  } userCredential;
159 } rfbCredential;
160 
161 #define rfbCredentialTypeX509 1
162 #define rfbCredentialTypeUser 2
163 
164 /* When using OpenSSL, CRLs can be included in both the x509CACrlFile and appended
165  to the x509CACertFile as is common with OpenSSL. When rfbX509CrlVerifyAll is
166  specified the CRL list must include CRLs for all certificates in the chain */
167 #define rfbX509CrlVerifyNone 0 /* No CRL checking is performed */
168 #define rfbX509CrlVerifyClient 1 /* Only the leaf server certificate is checked */
169 #define rfbX509CrlVerifyAll 2 /* All certificates in the server chain are checked */
170 
171 struct _rfbClient;
172 
183 typedef void (*HandleTextChatProc)(struct _rfbClient* client, int value, char *text);
193 typedef void (*HandleXvpMsgProc)(struct _rfbClient* client, uint8_t version, uint8_t opcode);
194 typedef void (*HandleKeyboardLedStateProc)(struct _rfbClient* client, int value, int pad);
195 typedef rfbBool (*HandleCursorPosProc)(struct _rfbClient* client, int x, int y);
196 typedef void (*SoftCursorLockAreaProc)(struct _rfbClient* client, int x, int y, int w, int h);
197 typedef void (*SoftCursorUnlockScreenProc)(struct _rfbClient* client);
208 typedef void (*GotFrameBufferUpdateProc)(struct _rfbClient* client, int x, int y, int w, int h);
215 typedef void (*FinishedFrameBufferUpdateProc)(struct _rfbClient* client);
216 typedef char* (*GetPasswordProc)(struct _rfbClient* client);
217 typedef rfbCredential* (*GetCredentialProc)(struct _rfbClient* client, int credentialType);
218 typedef rfbBool (*MallocFrameBufferProc)(struct _rfbClient* client);
219 typedef void (*GotXCutTextProc)(struct _rfbClient* client, const char *text, int textlen);
220 typedef void (*BellProc)(struct _rfbClient* client);
228 typedef void (*GotCursorShapeProc)(struct _rfbClient* client, int xhot, int yhot, int width, int height, int bytesPerPixel);
229 typedef void (*GotCopyRectProc)(struct _rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y);
230 typedef void (*GotFillRectProc)(struct _rfbClient* client, int x, int y, int w, int h, uint32_t colour);
231 typedef void (*GotBitmapProc)(struct _rfbClient* client, const uint8_t* buffer, int x, int y, int w, int h);
232 typedef rfbBool (*GotJpegProc)(struct _rfbClient* client, const uint8_t* buffer, int length, int x, int y, int w, int h);
233 typedef rfbBool (*LockWriteToTLSProc)(struct _rfbClient* client);
234 typedef rfbBool (*UnlockWriteToTLSProc)(struct _rfbClient* client);
236 #ifdef LIBVNCSERVER_HAVE_SASL
237 typedef char* (*GetUserProc)(struct _rfbClient* client);
238 typedef char* (*GetSASLMechanismProc)(struct _rfbClient* client, char* mechlist);
239 #endif /* LIBVNCSERVER_HAVE_SASL */
240 
241 typedef struct _rfbClient {
242  uint8_t* frameBuffer;
243  int width, height;
244 
246 
248 
249  const char* programName;
250  char* serverHost;
253  int listenPort, flashPort;
254 
255  struct {
256  int x, y, w, h;
257  } updateRect;
258 
264 #define RFB_BUFFER_SIZE (640*480)
265  char buffer[RFB_BUFFER_SIZE];
266 
267  /* rfbproto.c */
268 
272  char *desktopName;
275 
276  /* sockets.c */
277 #define RFB_BUF_SIZE 8192
278  char buf[RFB_BUF_SIZE];
279  char *bufoutptr;
280  unsigned int buffered;
281 
282  /* The zlib encoding requires expansion/decompression/deflation of the
283  compressed data in the "buffer" above into another, result buffer.
284  However, the size of the result buffer can be determined precisely
285  based on the bitsPerPixel, height and width of the rectangle. We
286  allocate this buffer one time to be the full size of the buffer. */
287 
288  /* Ultra Encoding uses this buffer too */
289 
292 
294  char *raw_buffer;
295 
296 #ifdef LIBVNCSERVER_HAVE_LIBZ
297  z_stream decompStream;
298  rfbBool decompStreamInited;
299 #endif
300 
301 
302 #ifdef LIBVNCSERVER_HAVE_LIBZ
303  /*
304  * Variables for the ``tight'' encoding implementation.
305  */
306 
308 #define ZLIB_BUFFER_SIZE 30000
309  char zlib_buffer[ZLIB_BUFFER_SIZE];
310 
311  /* Four independent compression streams for zlib library. */
312  z_stream zlibStream[4];
313  rfbBool zlibStreamActive[4];
314 
315  /* Filter stuff. Should be initialized by filter initialization code. */
316  rfbBool cutZeros;
317  int rectWidth, rectColors;
318  char tightPalette[256*4];
319  uint8_t tightPrevRow[2048*3*sizeof(uint16_t)];
320 
321 #ifdef LIBVNCSERVER_HAVE_LIBJPEG
323  rfbBool jpegError;
324 
325  struct jpeg_source_mgr* jpegSrcManager;
326  void* jpegBufferPtr;
327  size_t jpegBufferLen;
328 
329 #endif
330 #endif
331 
332 
333  /* cursor.c */
335  uint8_t *rcSource, *rcMask;
336 
339 
341 
342  /* Keyboard State support (is 'Caps Lock' set on the remote display???) */
345 
347 
348  /* hooks */
360 
363 
373 
375  int major, minor;
376 
378  uint32_t authScheme, subAuthScheme;
379 
381  void* tlsSession;
382 
390 
393  uint32_t *clientAuthSchemes;
394 
396  char *destHost;
397  int destPort;
398 
400  int QoS_DSCP;
401 
404 
405  /* listen.c */
407 
409 
411  /* IPv6 listen socket, address and port*/
415 
416  /* Output Window ID. When set, client application enables libvncclient to perform direct rendering in its window */
417  unsigned long outputWindow;
418 
427 
440 
441 #ifdef LIBVNCSERVER_HAVE_SASL
442  sasl_conn_t *saslconn;
443  const char *saslDecoded;
444  unsigned int saslDecodedLength;
445  unsigned int saslDecodedOffset;
446  sasl_secret_t *saslSecret;
447 
448  /* Callback to allow the client to choose a preferred mechanism. The string returned will
449  be freed once no longer required. */
450  GetSASLMechanismProc GetSASLMechanism;
451  GetUserProc GetUser;
452 
453 #endif /* LIBVNCSERVER_HAVE_SASL */
454 
455 #ifdef LIBVNCSERVER_HAVE_LIBZ
456 #ifdef LIBVNCSERVER_HAVE_LIBJPEG
458  void *tjhnd;
459 
460 #endif
461 #endif
462  /* timeout in seconds for select() after connect() */
463  unsigned int connectTimeout;
464 
465  /* timeout in seconds when reading from half-open connections in
466  * ReadFromRFBServer() - keep at 0 to disable timeout detection and handling */
467  unsigned int readTimeout;
468 
473  MUTEX(tlsRwMutex);
474 
480 } rfbClient;
481 
482 /* cursor.c */
489 extern rfbBool HandleCursorShape(rfbClient* client,int xhot, int yhot, int width, int height, uint32_t enc);
490 
491 /* listen.c */
492 
494 extern int listenForIncomingConnectionsNoFork(rfbClient* viewer, int usec_timeout);
495 
496 /* rfbproto.c */
497 
499 typedef void (*rfbClientLogProc)(const char *format, ...);
501 extern rfbBool ConnectToRFBServer(rfbClient* client,const char *hostname, int port);
502 extern rfbBool ConnectToRFBRepeater(rfbClient* client,const char *repeaterHost, int repeaterPort, const char *destHost, int destPort);
503 extern void SetClientAuthSchemes(rfbClient* client,const uint32_t *authSchemes, int size);
545  int x, int y, int w, int h,
546  rfbBool incremental);
547 extern rfbBool SendScaleSetting(rfbClient* client,int scaleSetting);
568 extern rfbBool SendPointerEvent(rfbClient* client,int x, int y, int buttonMask);
576 extern rfbBool SendExtDesktopSize(rfbClient* client, uint16_t width, uint16_t height);
586 extern rfbBool SendKeyEvent(rfbClient* client,uint32_t key, rfbBool down);
597 extern rfbBool SendExtendedKeyEvent(rfbClient* client, uint32_t keysym, uint32_t keycode, rfbBool down);
610 extern rfbBool SendClientCutText(rfbClient* client,char *str, int len);
622 
629 extern rfbBool TextChatSend(rfbClient* client, char *text);
644 extern rfbBool SendXvpMsg(rfbClient* client, uint8_t version, uint8_t code);
645 
646 extern void PrintPixelFormat(rfbPixelFormat *format);
647 
648 extern rfbBool SupportsClient2Server(rfbClient* client, int messageType);
649 extern rfbBool SupportsServer2Client(rfbClient* client, int messageType);
650 
651 /* client data */
652 
666 void rfbClientSetClientData(rfbClient* client, void* tag, void* data);
676 
677 /* protocol extensions */
678 
679 typedef struct _rfbClientProtocolExtension {
680  int* encodings;
682  rfbBool (*handleEncoding)(rfbClient* cl,
685  rfbBool (*handleMessage)(rfbClient* cl,
686  rfbServerToClientMsg* message);
687  struct _rfbClientProtocolExtension* next;
688  uint32_t const* securityTypes;
690  rfbBool (*handleAuthentication)(rfbClient* cl, uint32_t authScheme);
692 
694 
695 /* sockets.c */
696 
698 
699 extern rfbBool ReadFromRFBServer(rfbClient* client, char *out, unsigned int n);
700 extern rfbBool WriteToRFBServer(rfbClient* client, const char *buf, unsigned int n);
701 extern int FindFreeTcpPort(void);
702 extern rfbSocket ListenAtTcpPort(int port);
703 extern rfbSocket ListenAtTcpPortAndAddress(int port, const char *address);
710 extern rfbSocket ConnectClientToTcpAddr(unsigned int host, int port);
717 extern rfbSocket ConnectClientToTcpAddr6(const char *hostname, int port);
723 extern rfbSocket ConnectClientToUnixSock(const char *sockFile);
731 extern rfbSocket ConnectClientToTcpAddrWithTimeout(unsigned int host, int port, unsigned int timeout);
739 extern rfbSocket ConnectClientToTcpAddr6WithTimeout(const char *hostname, int port, unsigned int timeout);
746 extern rfbSocket ConnectClientToUnixSockWithTimeout(const char *sockFile, unsigned int timeout);
750 extern rfbBool SetDSCP(rfbSocket sock, int dscp);
751 
752 extern rfbBool StringToIPAddr(const char *str, unsigned int *addr);
764 extern int WaitForMessage(rfbClient* client,unsigned int usecs);
765 
766 /* vncviewer.c */
791 rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,int bytesPerPixel);
823 rfbBool rfbInitClient(rfbClient* client,int* argc,char** argv);
832 
833 #if(defined __cplusplus)
834 }
835 #endif
836 
847 #endif
int y
Definition: SDLvncviewer.c:34
int x
Definition: SDLvncviewer.c:34
void(* GotCursorShapeProc)(struct _rfbClient *client, int xhot, int yhot, int width, int height, int bytesPerPixel)
Called when a cursor shape update was received from the server.
Definition: rfbclient.h:228
rfbBool SendClientCutText(rfbClient *client, char *str, int len)
Places a string on the server's clipboard.
rfbSocket ConnectClientToTcpAddr6(const char *hostname, int port)
Tries to connect to an IPv4 or IPv6 host.
rfbBool SetDSCP(rfbSocket sock, int dscp)
void(* GotFillRectProc)(struct _rfbClient *client, int x, int y, int w, int h, uint32_t colour)
Definition: rfbclient.h:230
void(* HandleXvpMsgProc)(struct _rfbClient *client, uint8_t version, uint8_t opcode)
Handles XVP server messages.
Definition: rfbclient.h:193
rfbBool InitialiseRFBConnection(rfbClient *client)
rfbClient * rfbGetClient(int bitsPerSample, int samplesPerPixel, int bytesPerPixel)
Allocates and returns a pointer to an rfbClient structure.
int WaitForMessage(rfbClient *client, unsigned int usecs)
Waits for an RFB message to arrive from the server.
rfbBool HandleCursorShape(rfbClient *client, int xhot, int yhot, int width, int height, uint32_t enc)
Handles XCursor and RichCursor shape updates from the server.
rfbSocket ConnectClientToUnixSockWithTimeout(const char *sockFile, unsigned int timeout)
Tries to connect to a Unix socket using the given timeout value.
void(* FinishedFrameBufferUpdateProc)(struct _rfbClient *client)
Callback indicating that a client has completely processed an rfbFramebufferUpdate message sent by a ...
Definition: rfbclient.h:215
rfbBool WriteToRFBServer(rfbClient *client, const char *buf, unsigned int n)
rfbSocket ConnectClientToTcpAddr(unsigned int host, int port)
Tries to connect to an IPv4 host.
rfbBool TextChatOpen(rfbClient *client)
Opens a text chat window on the server.
void(* SoftCursorLockAreaProc)(struct _rfbClient *client, int x, int y, int w, int h)
Definition: rfbclient.h:196
rfbBool TextChatFinish(rfbClient *client)
rfbSocket ConnectClientToUnixSock(const char *sockFile)
Tries to connect to a Unix socket.
void listenForIncomingConnections(rfbClient *viewer)
rfbBool ConnectToRFBRepeater(rfbClient *client, const char *repeaterHost, int repeaterPort, const char *destHost, int destPort)
rfbBool(* HandleCursorPosProc)(struct _rfbClient *client, int x, int y)
Definition: rfbclient.h:195
rfbBool PermitServerInput(rfbClient *client, int enabled)
void(* rfbClientLogProc)(const char *format,...)
Definition: rfbclient.h:499
rfbBool errorMessageOnReadFailure
rfbSocket ListenAtTcpPortAndAddress(int port, const char *address)
rfbClientLogProc rfbClientLog
int FindFreeTcpPort(void)
void rfbClientCleanup(rfbClient *client)
Cleans up the client structure and releases the memory allocated for it.
void(* GotBitmapProc)(struct _rfbClient *client, const uint8_t *buffer, int x, int y, int w, int h)
Definition: rfbclient.h:231
void(* BellProc)(struct _rfbClient *client)
Definition: rfbclient.h:220
rfbBool SetNonBlocking(rfbSocket sock)
rfbBool SendExtendedKeyEvent(rfbClient *client, uint32_t keysym, uint32_t keycode, rfbBool down)
The same as SendKeyEvent, except a key code will be sent along with the symbol if the server supports...
rfbBool TextChatSend(rfbClient *client, char *text)
Sends a text chat message to the server.
void(* GotCopyRectProc)(struct _rfbClient *client, int src_x, int src_y, int w, int h, int dest_x, int dest_y)
Definition: rfbclient.h:229
rfbBool(* MallocFrameBufferProc)(struct _rfbClient *client)
Definition: rfbclient.h:218
rfbBool SendExtDesktopSize(rfbClient *client, uint16_t width, uint16_t height)
Sends a SetDesktopSize event to the server.
void(* GotFrameBufferUpdateProc)(struct _rfbClient *client, int x, int y, int w, int h)
Callback indicating that a rectangular area of the client's framebuffer was updated.
Definition: rfbclient.h:208
rfbSocket AcceptTcpConnection(rfbSocket listenSock)
rfbSocket ListenAtTcpPort(int port)
rfbBool(* GotJpegProc)(struct _rfbClient *client, const uint8_t *buffer, int length, int x, int y, int w, int h)
Definition: rfbclient.h:232
rfbBool TextChatClose(rfbClient *client)
Closes the text chat window on the server.
void(* HandleKeyboardLedStateProc)(struct _rfbClient *client, int value, int pad)
Definition: rfbclient.h:194
rfbBool SendScaleSetting(rfbClient *client, int scaleSetting)
void rfbClientRegisterExtension(rfbClientProtocolExtension *e)
void(* HandleTextChatProc)(struct _rfbClient *client, int value, char *text)
Handles a text chat message.
Definition: rfbclient.h:183
rfbSocket ConnectClientToTcpAddr6WithTimeout(const char *hostname, int port, unsigned int timeout)
Tries to connect to an IPv4 or IPv6 host using the given timeout value.
rfbBool HandleRFBServerMessage(rfbClient *client)
Handles messages from the RFB server.
rfbBool StringToIPAddr(const char *str, unsigned int *addr)
rfbBool SendPointerEvent(rfbClient *client, int x, int y, int buttonMask)
Sends a pointer event to the server.
void(* GotXCutTextProc)(struct _rfbClient *client, const char *text, int textlen)
Definition: rfbclient.h:219
rfbBool rfbInitClient(rfbClient *client, int *argc, char **argv)
Initializes the client.
rfbBool SendKeyEvent(rfbClient *client, uint32_t key, rfbBool down)
Sends a key event to the server.
rfbSocket ConnectClientToTcpAddrWithTimeout(unsigned int host, int port, unsigned int timeout)
Tries to connect to an IPv4 host using the given timeout value.
void(* SoftCursorUnlockScreenProc)(struct _rfbClient *client)
Definition: rfbclient.h:197
rfbBool SendXvpMsg(rfbClient *client, uint8_t version, uint8_t code)
rfbCredential *(* GetCredentialProc)(struct _rfbClient *client, int credentialType)
Definition: rfbclient.h:217
char *(* GetPasswordProc)(struct _rfbClient *client)
Definition: rfbclient.h:216
rfbBool(* LockWriteToTLSProc)(struct _rfbClient *client)
Definition: rfbclient.h:233
rfbBool SendFramebufferUpdateRequest(rfbClient *client, int x, int y, int w, int h, rfbBool incremental)
Sends a framebuffer update request to the server.
void SetClientAuthSchemes(rfbClient *client, const uint32_t *authSchemes, int size)
rfbBool SetBlocking(rfbSocket sock)
rfbBool ReadFromRFBServer(rfbClient *client, char *out, unsigned int n)
rfbBool SupportsServer2Client(rfbClient *client, int messageType)
rfbBool ConnectToRFBServer(rfbClient *client, const char *hostname, int port)
void * rfbClientGetClientData(rfbClient *client, void *tag)
Returns a pointer to the client data associated with the given tag.
int listenForIncomingConnectionsNoFork(rfbClient *viewer, int usec_timeout)
rfbClientLogProc rfbClientErr
Definition: rfbclient.h:500
rfbBool(* UnlockWriteToTLSProc)(struct _rfbClient *client)
Definition: rfbclient.h:234
void rfbClientSetClientData(rfbClient *client, void *tag, void *data)
Associates a client data tag with the given pointer.
rfbBool SendIncrementalFramebufferUpdateRequest(rfbClient *client)
rfbBool rfbEnableClientLogging
rfbBool SetFormatAndEncodings(rfbClient *client)
Sends format and encoding parameters to the server.
rfbBool SameMachine(rfbSocket sock)
rfbBool SupportsClient2Server(rfbClient *client, int messageType)
void PrintPixelFormat(rfbPixelFormat *format)
#define RFB_BUF_SIZE
Definition: rfbclient.h:277
#define RFB_BUFFER_SIZE
Note that the CoRRE encoding uses this buffer and assumes it is big enough to hold 255 * 255 * 32 bit...
Definition: rfbclient.h:264
int8_t rfbBool
Definition: rfbproto.h:108
#define rfbSocket
Definition: rfbproto.h:104
app data (belongs into rfbClient?)
Definition: rfbclient.h:121
rfbBool enableJPEG
Definition: rfbclient.h:135
rfbBool shareDesktop
Definition: rfbclient.h:122
rfbBool palmVNC
use palmvnc specific SetScale (vs ultravnc)
Definition: rfbclient.h:137
rfbBool useBGR233
Definition: rfbclient.h:127
rfbBool useRemoteCursor
Definition: rfbclient.h:136
rfbBool forceOwnCmap
Definition: rfbclient.h:129
int scaleSetting
0 means no scale set, else 1/scaleSetting
Definition: rfbclient.h:138
int qualityLevel
Definition: rfbclient.h:134
rfbBool forceTrueColour
Definition: rfbclient.h:130
int nColours
Definition: rfbclient.h:128
int compressLevel
Definition: rfbclient.h:133
int requestedDepth
Definition: rfbclient.h:131
const char * encodingsString
Definition: rfbclient.h:125
rfbBool viewOnly
Definition: rfbclient.h:123
client data
Definition: rfbclient.h:113
void * tag
Definition: rfbclient.h:114
struct rfbClientData * next
Definition: rfbclient.h:116
void * data
Definition: rfbclient.h:115
char * desktopName
Definition: rfbclient.h:272
rfbSupportedMessages supportedMessages
Which messages are supported by the server This is a guess for most servers.
Definition: rfbclient.h:372
unsigned int connectTimeout
Definition: rfbclient.h:463
char * ultra_buffer
Definition: rfbclient.h:291
HandleCursorPosProc HandleCursorPos
Definition: rfbclient.h:351
int KeyboardLedStateEnabled
Definition: rfbclient.h:343
const char * programName
Definition: rfbclient.h:249
BellProc Bell
Definition: rfbclient.h:359
int endianTest
Definition: rfbclient.h:245
rfbSocket listenSock
Definition: rfbclient.h:406
int listen6Port
Definition: rfbclient.h:414
GotFrameBufferUpdateProc GotFrameBufferUpdate
Definition: rfbclient.h:354
UnlockWriteToTLSProc UnlockWriteToTLS
Definition: rfbclient.h:426
rfbVNCRec * vncRec
Definition: rfbclient.h:340
SoftCursorUnlockScreenProc SoftCursorUnlockScreen
Definition: rfbclient.h:353
void * tlsSession
The TLS session for Anonymous TLS and VeNCrypt.
Definition: rfbclient.h:381
MUTEX(tlsRwMutex)
Mutex to protect concurrent TLS read/write.
LockWriteToTLSProc LockWriteToTLS
These lock/unlock hooks are not used anymore.
Definition: rfbclient.h:425
rfbClientData * clientData
private data pointer
Definition: rfbclient.h:338
rfbExtDesktopScreen screen
Used for intended dimensions, rfbClient.width and rfbClient.height are used to manage the real frameb...
Definition: rfbclient.h:479
char * raw_buffer
Definition: rfbclient.h:294
char * listenAddress
Definition: rfbclient.h:410
GotXCutTextProc GotXCutText
Definition: rfbclient.h:358
HandleTextChatProc HandleTextChat
Definition: rfbclient.h:349
rfbBool canUseHextile
Definition: rfbclient.h:271
char * bufoutptr
Definition: rfbclient.h:279
unsigned long outputWindow
Definition: rfbclient.h:417
rfbBool listenSpecified
Definition: rfbclient.h:252
FinishedFrameBufferUpdateProc FinishedFrameBufferUpdate
Definition: rfbclient.h:408
rfbBool canUseCoRRE
Definition: rfbclient.h:270
GotFillRectProc GotFillRect
Hooks for custom rendering.
Definition: rfbclient.h:436
rfbBool requestedResize
Definition: rfbclient.h:475
int ultra_buffer_size
Definition: rfbclient.h:290
unsigned int buffered
Definition: rfbclient.h:280
GotBitmapProc GotBitmap
Definition: rfbclient.h:437
char * listen6Address
Definition: rfbclient.h:413
uint8_t * frameBuffer
Definition: rfbclient.h:242
int raw_buffer_size
Definition: rfbclient.h:293
GetCredentialProc GetCredential
To support security types that requires user input (except VNC password authentication),...
Definition: rfbclient.h:389
HandleXvpMsgProc HandleXvpMsg
hook to handle xvp server messages
Definition: rfbclient.h:403
uint32_t * clientAuthSchemes
The 0-terminated security types supported by the client.
Definition: rfbclient.h:393
uint8_t * rcMask
Definition: rfbclient.h:335
HandleKeyboardLedStateProc HandleKeyboardLedState
Definition: rfbclient.h:350
uint32_t authScheme
The selected security types.
Definition: rfbclient.h:378
rfbSocket sock
Definition: rfbclient.h:269
int canHandleNewFBSize
Definition: rfbclient.h:346
unsigned int readTimeout
Definition: rfbclient.h:467
char * serverHost
Definition: rfbclient.h:250
int flashPort
Definition: rfbclient.h:253
GetPasswordProc GetPassword
the pointer returned by GetPassword will be freed after use!
Definition: rfbclient.h:356
int major
negotiated protocol version
Definition: rfbclient.h:375
int height
Definition: rfbclient.h:243
char * destHost
When the server is a repeater, this specifies the final destination.
Definition: rfbclient.h:396
int QoS_DSCP
the QoS IP DSCP for this client
Definition: rfbclient.h:400
GotCursorShapeProc GotCursorShape
Definition: rfbclient.h:361
GotCopyRectProc GotCopyRect
Definition: rfbclient.h:362
GotJpegProc GotJpeg
Hook for custom JPEG decoding and rendering.
Definition: rfbclient.h:439
rfbServerInitMsg si
Definition: rfbclient.h:274
AppData appData
Definition: rfbclient.h:247
MallocFrameBufferProc MallocFrameBuffer
Definition: rfbclient.h:357
int serverPort
if -1, then use file recorded by vncrec
Definition: rfbclient.h:251
SoftCursorLockAreaProc SoftCursorLockArea
Definition: rfbclient.h:352
int CurrentKeyboardLedState
Definition: rfbclient.h:344
rfbSocket listen6Sock
Definition: rfbclient.h:412
rfbPixelFormat format
Definition: rfbclient.h:273
int destPort
Definition: rfbclient.h:397
uint32_t const * securityTypes
Definition: rfbclient.h:688
struct _rfbClientProtocolExtension * next
Definition: rfbclient.h:687
vncrec
Definition: rfbclient.h:104
FILE * file
Definition: rfbclient.h:105
rfbBool readTimestamp
Definition: rfbclient.h:107
rfbBool doNotSleep
Definition: rfbclient.h:108
For GetCredentialProc callback function to return.
Definition: rfbclient.h:143
char * x509CACrlFile
Definition: rfbclient.h:148
char * password
Definition: rfbclient.h:157
char * x509ClientKeyFile
Definition: rfbclient.h:150
char * username
Definition: rfbclient.h:156
char * x509ClientCertFile
Definition: rfbclient.h:149
uint8_t x509CrlVerifyMode
Definition: rfbclient.h:151
char * x509CACertFile
Definition: rfbclient.h:147
rfbClient * client
Definition: vnc2mpg.c:358
#define height
Definition: vncev.c:19
#define width
Definition: vncev.c:18