Skip to content

Commit 4b2155b

Browse files
committed
Restructure VNC lib_mod_connect()
1) Restructure lib_mod_connect() along the lines of the PDUs documented in RFC 6143. 2) Logging in lib_mod_connect() has been revised and improved. 3) Wrinkles around version 3.7 and 3.8 of the RFB protocol are now addressed. 4) Some new definitions are added to rfb.h to replace the use of magic numbers.
1 parent 527d21b commit 4b2155b

File tree

2 files changed

+638
-377
lines changed

2 files changed

+638
-377
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)