diff options
author | dscho <dscho> | 2005-09-27 15:18:22 +0000 |
---|---|---|
committer | dscho <dscho> | 2005-09-27 15:18:22 +0000 |
commit | 93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2 (patch) | |
tree | 0ec66825e92a2cf60e0f32b7ab74bc5777318bd6 /rfb | |
parent | 94fcd86cc20dd2ccf7e2299a7dfbcc255c6cc771 (diff) | |
download | libtdevnc-93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2.tar.gz libtdevnc-93be927b1c1c74bc4da6f6d5978ba8e6e52f3cc2.zip |
Introduce generic protocol extension method. Deprecate
the processCustomClientMessage() method.
Diffstat (limited to 'rfb')
-rw-r--r-- | rfb/rfb.h | 31 |
1 files changed, 30 insertions, 1 deletions
@@ -145,7 +145,7 @@ typedef struct { } rfbColourMap; /* - * Security handling (RFB protocol version 3.7 + * Security handling (RFB protocol version 3.7) */ typedef struct _rfbSecurity { @@ -154,6 +154,29 @@ typedef struct _rfbSecurity { struct _rfbSecurity* next; } rfbSecurityHandler; +/* + * Protocol extension handling. + */ + +typedef struct _rfbProtocolExtension { + /* returns TRUE if extension should be activated */ + rfbBool (*init)(struct _rfbClientRec* client, void** data); + /* returns TRUE if message was handled */ + rfbBool (*handleMessage)(struct _rfbClientRec* client, + void* data, + rfbClientToServerMsg message); + void (*close)(struct _rfbClientRec* client, void* data); + void (*usage)(void); + /* processArguments returns the number of handled arguments */ + int (*processArgument)(char *argv[]); + struct _rfbProtocolExtension* next; +} rfbProtocolExtension; + +typedef struct _rfbExtensionData { + rfbProtocolExtension* extension; + void* data; + struct _rfbExtensionData* next; +} rfbExtensionData; /* * Per-screen (framebuffer) structure. There can be as many as you wish, @@ -481,6 +504,8 @@ typedef struct _rfbClientRec { /* if progressive updating is on, this variable holds the current * y coordinate of the progressive slice. */ int progressiveSliceY; + + rfbExtensionData* extensions; } rfbClientRec, *rfbClientPtr; /* @@ -760,6 +785,10 @@ void rfbMarkRectAsModified(rfbScreenInfoPtr rfbScreen,int x1,int y1,int x2,int y void rfbMarkRegionAsModified(rfbScreenInfoPtr rfbScreen,sraRegionPtr modRegion); void rfbDoNothingWithClient(rfbClientPtr cl); enum rfbNewClientAction defaultNewClientHook(rfbClientPtr cl); +void rfbRegisterProtocolExtension(rfbProtocolExtension* extension); +struct _rfbProtocolExtension* rfbGetExtensionIterator(); +void rfbReleaseExtensionIterator(); +rfbBool rfbEnableExtension(rfbClientPtr cl, rfbProtocolExtension* extension); /* to check against plain passwords */ rfbBool rfbCheckPasswordByList(rfbClientPtr cl,const char* response,int len); |