Data Structures | Defines | Typedefs | Functions | Variables

rfb/rfbclient.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include <rfb/rfbproto.h>
#include <rfb/keysym.h>
Include dependency graph for rfbclient.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rfbVNCRec
 vncrec More...
struct  rfbClientData
 client data More...
struct  AppData
 app data (belongs into rfbClient?) More...
union  rfbCredential
 For GetCredentialProc callback function to return. More...
struct  rfbClient
struct  rfbClientProtocolExtension

Defines

#define rfbClientSwap16IfLE(s)   (*(char *)&client->endianTest ? ((((s) & 0xff) << 8) | (((s) >> 8) & 0xff)) : (s))
#define rfbClientSwap32IfLE(l)
#define rfbClientSwap64IfLE(l)
#define FLASH_PORT_OFFSET   5400
#define LISTEN_PORT_OFFSET   5500
#define TUNNEL_PORT_OFFSET   5500
#define SERVER_PORT_OFFSET   5900
#define DEFAULT_SSH_CMD   "/usr/bin/ssh"
#define DEFAULT_TUNNEL_CMD   (DEFAULT_SSH_CMD " -f -L %L:localhost:%R %H sleep 20")
#define DEFAULT_VIA_CMD   (DEFAULT_SSH_CMD " -f -L %L:%H:%R %G sleep 20")
#define rfbCredentialTypeX509   1
#define rfbCredentialTypeUser   2
#define RFB_BUFFER_SIZE   (640*480)
 Note that the CoRRE encoding uses this buffer and assumes it is big enough to hold 255 * 255 * 32 bits -> 260100 bytes.
#define RFB_BUF_SIZE   8192

Typedefs

typedef void(* HandleTextChatProc )(struct _rfbClient *client, int value, char *text)
 Handles a text chat message.
typedef void(* HandleXvpMsgProc )(struct _rfbClient *client, uint8_t version, uint8_t opcode)
 Handles XVP server messages.
typedef void(* HandleKeyboardLedStateProc )(struct _rfbClient *client, int value, int pad)
typedef rfbBool(* HandleCursorPosProc )(struct _rfbClient *client, int x, int y)
typedef void(* SoftCursorLockAreaProc )(struct _rfbClient *client, int x, int y, int w, int h)
typedef void(* SoftCursorUnlockScreenProc )(struct _rfbClient *client)
typedef void(* GotFrameBufferUpdateProc )(struct _rfbClient *client, int x, int y, int w, int h)
typedef void(* FinishedFrameBufferUpdateProc )(struct _rfbClient *client)
typedef char *(* GetPasswordProc )(struct _rfbClient *client)
typedef rfbCredential *(* GetCredentialProc )(struct _rfbClient *client, int credentialType)
typedef rfbBool(* MallocFrameBufferProc )(struct _rfbClient *client)
typedef void(* GotXCutTextProc )(struct _rfbClient *client, const char *text, int textlen)
typedef void(* BellProc )(struct _rfbClient *client)
typedef void(* GotCursorShapeProc )(struct _rfbClient *client, int xhot, int yhot, int width, int height, int bytesPerPixel)
typedef void(* GotCopyRectProc )(struct _rfbClient *client, int src_x, int src_y, int w, int h, int dest_x, int dest_y)
typedef void(* rfbClientLogProc )(const char *format,...)

Functions

rfbBool HandleCursorShape (rfbClient *client, int xhot, int yhot, int width, int height, uint32_t enc)
void listenForIncomingConnections (rfbClient *viewer)
int listenForIncomingConnectionsNoFork (rfbClient *viewer, int usec_timeout)
rfbBool ConnectToRFBServer (rfbClient *client, const char *hostname, int port)
rfbBool ConnectToRFBRepeater (rfbClient *client, const char *repeaterHost, int repeaterPort, const char *destHost, int destPort)
void SetClientAuthSchemes (rfbClient *client, const uint32_t *authSchemes, int size)
rfbBool InitialiseRFBConnection (rfbClient *client)
rfbBool SetFormatAndEncodings (rfbClient *client)
 Sends format and encoding parameters to the server.
rfbBool SendIncrementalFramebufferUpdateRequest (rfbClient *client)
rfbBool SendFramebufferUpdateRequest (rfbClient *client, int x, int y, int w, int h, rfbBool incremental)
 Sends a framebuffer update request to the server.
rfbBool SendScaleSetting (rfbClient *client, int scaleSetting)
rfbBool SendPointerEvent (rfbClient *client, int x, int y, int buttonMask)
 Sends a pointer event to the server.
rfbBool SendKeyEvent (rfbClient *client, uint32_t key, rfbBool down)
 Sends a key event to the server.
rfbBool SendClientCutText (rfbClient *client, char *str, int len)
 Places a string on the server's clipboard.
rfbBool HandleRFBServerMessage (rfbClient *client)
 Handles messages from the RFB server.
rfbBool TextChatSend (rfbClient *client, char *text)
 Sends a text chat message to the server.
rfbBool TextChatOpen (rfbClient *client)
 Opens a text chat window on the server.
rfbBool TextChatClose (rfbClient *client)
 Closes the text chat window on the server.
rfbBool TextChatFinish (rfbClient *client)
rfbBool PermitServerInput (rfbClient *client, int enabled)
rfbBool SendXvpMsg (rfbClient *client, uint8_t version, uint8_t code)
void PrintPixelFormat (rfbPixelFormat *format)
rfbBool SupportsClient2Server (rfbClient *client, int messageType)
rfbBool SupportsServer2Client (rfbClient *client, int messageType)
void rfbClientSetClientData (rfbClient *client, void *tag, void *data)
 Associates a client data tag with the given pointer.
void * rfbClientGetClientData (rfbClient *client, void *tag)
 Returns a pointer to the client data associated with the given tag.
void rfbClientRegisterExtension (rfbClientProtocolExtension *e)
rfbBool ReadFromRFBServer (rfbClient *client, char *out, unsigned int n)
rfbBool WriteToRFBServer (rfbClient *client, char *buf, int n)
int FindFreeTcpPort (void)
int ListenAtTcpPort (int port)
int ListenAtTcpPortAndAddress (int port, const char *address)
int ConnectClientToTcpAddr (unsigned int host, int port)
int ConnectClientToTcpAddr6 (const char *hostname, int port)
int ConnectClientToUnixSock (const char *sockFile)
int AcceptTcpConnection (int listenSock)
rfbBool SetNonBlocking (int sock)
rfbBool SetDSCP (int sock, int dscp)
rfbBool StringToIPAddr (const char *str, unsigned int *addr)
rfbBool SameMachine (int sock)
int WaitForMessage (rfbClient *client, unsigned int usecs)
 Waits for an RFB message to arrive from the server.
rfbClientrfbGetClient (int bitsPerSample, int samplesPerPixel, int bytesPerPixel)
 Allocates and returns a pointer to an rfbClient structure.
rfbBool rfbInitClient (rfbClient *client, int *argc, char **argv)
 Initializes the client.
void rfbClientCleanup (rfbClient *client)
 Cleans up the client structure and releases the memory allocated for it.

Variables

rfbBool rfbEnableClientLogging
rfbClientLogProc rfbClientLog
rfbClientLogProc rfbClientErr
rfbBool errorMessageOnReadFailure

Detailed Description

Definition in file rfbclient.h.


Define Documentation

#define RFB_BUF_SIZE   8192

Definition at line 212 of file rfbclient.h.

#define RFB_BUFFER_SIZE   (640*480)

Note that the CoRRE encoding uses this buffer and assumes it is big enough to hold 255 * 255 * 32 bits -> 260100 bytes.

640*480 = 307200 bytes. Hextile also assumes it is big enough to hold 16 * 16 * 32 bits. Tight encoding assumes BUFFER_SIZE is at least 16384 bytes.

Definition at line 199 of file rfbclient.h.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines