diff options
Diffstat (limited to 'rfb')
| -rw-r--r-- | rfb/rfb.h | 3 | ||||
| -rw-r--r-- | rfb/rfbclient.h | 5 | ||||
| -rw-r--r-- | rfb/rfbproto.h | 48 |
3 files changed, 55 insertions, 1 deletions
@@ -139,6 +139,7 @@ typedef void (*rfbDisplayHookPtr)(struct _rfbClientRec* cl); typedef void (*rfbDisplayFinishedHookPtr)(struct _rfbClientRec* cl, int result); /* support the capability to view the caps/num/scroll states of the X server */ typedef int (*rfbGetKeyboardLedStateHookPtr)(struct _rfbScreenInfo* screen); +typedef rfbBool (*rfbXvpHookPtr)(struct _rfbClientRec* cl, uint8_t, uint8_t); /* If x==1 and y==1 then set the whole display * else find the window underneath x and y and set the framebuffer to the dimensions * of that window @@ -356,6 +357,8 @@ typedef struct _rfbScreenInfo /* displayFinishedHook is called just after a frame buffer update */ rfbDisplayFinishedHookPtr displayFinishedHook; + /* xvpHook is called to handle an xvp client message */ + rfbXvpHookPtr xvpHook; } rfbScreenInfo, *rfbScreenInfoPtr; diff --git a/rfb/rfbclient.h b/rfb/rfbclient.h index 34c8737..1edd32e 100644 --- a/rfb/rfbclient.h +++ b/rfb/rfbclient.h @@ -136,6 +136,7 @@ typedef union _rfbCredential struct _rfbClient; typedef void (*HandleTextChatProc)(struct _rfbClient* client, int value, char *text); +typedef void (*HandleXvpMsgProc)(struct _rfbClient* client, uint8_t version, uint8_t opcode); 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); @@ -316,6 +317,9 @@ typedef struct _rfbClient { /* the QoS IP DSCP for this client */ int QoS_DSCP; + + /* hook to handle xvp server messages */ + HandleXvpMsgProc HandleXvpMsg; } rfbClient; /* cursor.c */ @@ -352,6 +356,7 @@ extern rfbBool TextChatOpen(rfbClient* client); extern rfbBool TextChatClose(rfbClient* client); extern rfbBool TextChatFinish(rfbClient* client); extern rfbBool PermitServerInput(rfbClient* client, int enabled); +extern rfbBool SendXvpMsg(rfbClient* client, uint8_t version, uint8_t code); extern void PrintPixelFormat(rfbPixelFormat *format); diff --git a/rfb/rfbproto.h b/rfb/rfbproto.h index c20f95c..cb62fc5 100644 --- a/rfb/rfbproto.h +++ b/rfb/rfbproto.h @@ -106,7 +106,7 @@ typedef uint32_t in_addr_t; #define INADDR_NONE ((in_addr_t) 0xffffffff) #endif -#define MAX_ENCODINGS 20 +#define MAX_ENCODINGS 21 /***************************************************************************** * @@ -405,6 +405,8 @@ typedef struct { #define rfbKeyFrameRequest 12 /* PalmVNC 1.4 & 2.0 SetScale Factor message */ #define rfbPalmVNCSetScaleFactor 0xF +/* Xvp message - bidirectional */ +#define rfbXvp 250 @@ -439,6 +441,9 @@ typedef struct { #define rfbEncodingSolMonoZip 0xFFFF0008 #define rfbEncodingUltraZip 0xFFFF0009 +/* Xvp pseudo-encoding */ +#define rfbEncodingXvp 0xFFFFFECB + /* * Special encoding numbers: * 0xFFFFFF00 .. 0xFFFFFF0F -- encoding-specific compression levels; @@ -1061,6 +1066,44 @@ typedef struct _rfbTextChatMsg { #define rfbTextChatFinished 0xFFFFFFFD +/*----------------------------------------------------------------------------- + * Xvp Message + * Bidirectional message + * A server which supports the xvp extension declares this by sending a message + * with an Xvp_INIT xvp-message-code when it receives a request from the client + * to use the xvp Pseudo-encoding. The server must specify in this message the + * highest xvp-extension-version it supports: the client may assume that the + * server supports all versions from 1 up to this value. The client is then + * free to use any supported version. Currently, only version 1 is defined. + * + * A server which subsequently receives an xvp Client Message requesting an + * operation which it is unable to perform, informs the client of this by + * sending a message with an Xvp_FAIL xvp-message-code, and the same + * xvp-extension-version as included in the client's operation request. + * + * A client supporting the xvp extension sends this to request that the server + * initiate a clean shutdown, clean reboot or abrupt reset of the system whose + * framebuffer the client is displaying. + */ + + +typedef struct { + uint8_t type; /* always rfbXvp */ + uint8_t pad; + uint8_t version; /* xvp extension version */ + uint8_t code; /* xvp message code */ +} rfbXvpMsg; + +#define sz_rfbXvpMsg (4) + +/* server message codes */ +#define rfbXvp_Fail 0 +#define rfbXvp_Init 1 +/* client message codes */ +#define rfbXvp_Shutdown 2 +#define rfbXvp_Reboot 3 +#define rfbXvp_Reset 4 + /*----------------------------------------------------------------------------- * Modif sf@2002 @@ -1115,6 +1158,7 @@ typedef union { rfbPalmVNCReSizeFrameBufferMsg prsfb; rfbFileTransferMsg ft; rfbTextChatMsg tc; + rfbXvpMsg xvp; } rfbServerToClientMsg; @@ -1350,6 +1394,7 @@ typedef struct _rfbSetSWMsg { #define sz_rfbSetSWMsg 6 + /*----------------------------------------------------------------------------- * Union of all client->server messages. */ @@ -1369,6 +1414,7 @@ typedef union { rfbFileTransferMsg ft; rfbSetSWMsg sw; rfbTextChatMsg tc; + rfbXvpMsg xvp; } rfbClientToServerMsg; /* |
