Skip to content

Commit c65c734

Browse files
authored
Merge pull request neutrinolabs#3460 from matt335672/vnc_upgrade
Upgrade VNC module to support later RFB versions
2 parents 73bc82a + 4b2155b commit c65c734

File tree

2 files changed

+655
-320
lines changed

2 files changed

+655
-320
lines changed

vnc/rfb.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,28 @@ typedef uint32_t encoding_type;
5858
#define RFB_ENC_DESKTOP_SIZE (encoding_type)-223
5959
#define RFB_ENC_EXTENDED_DESKTOP_SIZE (encoding_type)-308
6060

61+
/* Security types defined in RFC6143 7.2 (RFB Community wiki 7.1.2) */
62+
enum sec_type
63+
{
64+
SEC_TYPE_INVALID = 0,
65+
SEC_TYPE_NONE = 1,
66+
SEC_TYPE_VNC_AUTH = 2,
67+
SEC_TYPE_MAX = SEC_TYPE_VNC_AUTH // Max supported security type
68+
};
69+
70+
#define SEC_TYPE_TO_STR(st) \
71+
(((st) == SEC_TYPE_INVALID) ? "Invalid" : \
72+
((st) == SEC_TYPE_NONE) ? "None" : \
73+
((st) == SEC_TYPE_VNC_AUTH) ? "VNC Auth" : "Unknown")
74+
75+
/* Constructs an RFB version from a major and minor version */
76+
#define MAKE_RFBPROTO_VER(maj,min) ((maj * 1000) + (min))
77+
78+
/* Convenience macros */
79+
#define RFBPROTO_VER_3_3 MAKE_RFBPROTO_VER(3,3)
80+
#define RFBPROTO_VER_3_7 MAKE_RFBPROTO_VER(3,7)
81+
#define RFBPROTO_VER_3_8 MAKE_RFBPROTO_VER(3,8)
82+
6183
/**
6284
* Returns an error string for an ExtendedDesktopSize status code
6385
*/

0 commit comments

Comments
 (0)