77 static const uint8_t Df_Key[24] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, 0x89, 0xab, 0xcd, 0xef, 0x01, 0x23, 0x45, 0x67 };
80 static const uint16_t bytebit[8] = { 1, 2, 4, 8, 16, 32, 64, 128 };
83 static const uint32_t bigbyte[24] = { 0x800000, 0x400000, 0x200000, 0x100000, 0x80000, 0x40000, 0x20000, 0x10000, 0x8000, 0x4000, 0x2000, 0x1000, 0x800, 0x400, 0x200, 0x100, 0x80, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x1 };
86 static const uint8_t pc1[56] = { 56, 48, 40, 32, 24, 16, 8, 0, 57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 60, 52, 44, 36, 28, 20, 12, 4, 27, 19, 11, 3 };
89 static const uint8_t totrot[16] = { 1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28 };
92 static const uint8_t pc2[48] = { 13, 16, 10, 23, 0, 4, 2, 27, 14, 5, 20, 9, 22, 18, 11, 3, 25, 7, 15, 6, 26, 19, 12, 1, 40, 51, 30, 36, 46, 54, 29, 39, 50, 44, 32, 47, 43, 48, 38, 55, 33, 52, 45, 41, 49, 35, 28, 31 };
95 static const uint32_t SP1[64] = {
96 0x01010400, 0x00000000, 0x00010000, 0x01010404, 0x01010004, 0x00010404, 0x00000004, 0x00010000, 0x00000400, 0x01010400, 0x01010404, 0x00000400,
97 0x01000404, 0x01010004, 0x01000000, 0x00000004, 0x00000404, 0x01000400, 0x01000400, 0x00010400, 0x00010400, 0x01010000, 0x01010000, 0x01000404,
98 0x00010004, 0x01000004, 0x01000004, 0x00010004, 0x00000000, 0x00000404, 0x00010404, 0x01000000, 0x00010000, 0x01010404, 0x00000004, 0x01010000,
99 0x01010400, 0x01000000, 0x01000000, 0x00000400, 0x01010004, 0x00010000, 0x00010400, 0x01000004, 0x00000400, 0x00000004, 0x01000404, 0x00010404,
100 0x01010404, 0x00010004, 0x01010000, 0x01000404, 0x01000004, 0x00000404, 0x00010404, 0x01010400, 0x00000404, 0x01000400, 0x01000400, 0x00000000,
101 0x00010004, 0x00010400, 0x00000000, 0x01010004 };
104 static const uint32_t SP2[64] = {
105 0x80108020, 0x80008000, 0x00008000, 0x00108020, 0x00100000, 0x00000020, 0x80100020, 0x80008020, 0x80000020, 0x80108020, 0x80108000, 0x80000000,
106 0x80008000, 0x00100000, 0x00000020, 0x80100020, 0x00108000, 0x00100020, 0x80008020, 0x00000000, 0x80000000, 0x00008000, 0x00108020, 0x80100000,
107 0x00100020, 0x80000020, 0x00000000, 0x00108000, 0x00008020, 0x80108000, 0x80100000, 0x00008020, 0x00000000, 0x00108020, 0x80100020, 0x00100000,
108 0x80008020, 0x80100000, 0x80108000, 0x00008000, 0x80100000, 0x80008000, 0x00000020, 0x80108020, 0x00108020, 0x00000020, 0x00008000, 0x80000000,
109 0x00008020, 0x80108000, 0x00100000, 0x80000020, 0x00100020, 0x80008020, 0x80000020, 0x00100020, 0x00108000, 0x00000000, 0x80008000, 0x00008020,
110 0x80000000, 0x80100020, 0x80108020, 0x00108000 };
113 static const uint32_t SP3[64] = {
114 0x00000208, 0x08020200, 0x00000000, 0x08020008, 0x08000200, 0x00000000, 0x00020208, 0x08000200, 0x00020008, 0x08000008, 0x08000008, 0x00020000,
115 0x08020208, 0x00020008, 0x08020000, 0x00000208, 0x08000000, 0x00000008, 0x08020200, 0x00000200, 0x00020200, 0x08020000, 0x08020008, 0x00020208,
116 0x08000208, 0x00020200, 0x00020000, 0x08000208, 0x00000008, 0x08020208, 0x00000200, 0x08000000, 0x08020200, 0x08000000, 0x00020008, 0x00000208,
117 0x00020000, 0x08020200, 0x08000200, 0x00000000, 0x00000200, 0x00020008, 0x08020208, 0x08000200, 0x08000008, 0x00000200, 0x00000000, 0x08020008,
118 0x08000208, 0x00020000, 0x08000000, 0x08020208, 0x00000008, 0x00020208, 0x00020200, 0x08000008, 0x08020000, 0x08000208, 0x00000208, 0x08020000,
119 0x00020208, 0x00000008, 0x08020008, 0x00020200 };
122 static const uint32_t SP4[64] = {
123 0x00802001, 0x00002081, 0x00002081, 0x00000080, 0x00802080, 0x00800081, 0x00800001, 0x00002001, 0x00000000, 0x00802000, 0x00802000, 0x00802081,
124 0x00000081, 0x00000000, 0x00800080, 0x00800001, 0x00000001, 0x00002000, 0x00800000, 0x00802001, 0x00000080, 0x00800000, 0x00002001, 0x00002080,
125 0x00800081, 0x00000001, 0x00002080, 0x00800080, 0x00002000, 0x00802080, 0x00802081, 0x00000081, 0x00800080, 0x00800001, 0x00802000, 0x00802081,
126 0x00000081, 0x00000000, 0x00000000, 0x00802000, 0x00002080, 0x00800080, 0x00800081, 0x00000001, 0x00802001, 0x00002081, 0x00002081, 0x00000080,
127 0x00802081, 0x00000081, 0x00000001, 0x00002000, 0x00800001, 0x00002001, 0x00802080, 0x00800081, 0x00002001, 0x00002080, 0x00800000, 0x00802001,
128 0x00000080, 0x00800000, 0x00002000, 0x00802080 };
131 static const uint32_t SP5[64] = {
132 0x00000100, 0x02080100, 0x02080000, 0x42000100, 0x00080000, 0x00000100, 0x40000000, 0x02080000, 0x40080100, 0x00080000, 0x02000100, 0x40080100,
133 0x42000100, 0x42080000, 0x00080100, 0x40000000, 0x02000000, 0x40080000, 0x40080000, 0x00000000, 0x40000100, 0x42080100, 0x42080100, 0x02000100,
134 0x42080000, 0x40000100, 0x00000000, 0x42000000, 0x02080100, 0x02000000, 0x42000000, 0x00080100, 0x00080000, 0x42000100, 0x00000100, 0x02000000,
135 0x40000000, 0x02080000, 0x42000100, 0x40080100, 0x02000100, 0x40000000, 0x42080000, 0x02080100, 0x40080100, 0x00000100, 0x02000000, 0x42080000,
136 0x42080100, 0x00080100, 0x42000000, 0x42080100, 0x02080000, 0x00000000, 0x40080000, 0x42000000, 0x00080100, 0x02000100, 0x40000100, 0x00080000,
137 0x00000000, 0x40080000, 0x02080100, 0x40000100 };
140 static const uint32_t SP6[64] = {
141 0x20000010, 0x20400000, 0x00004000, 0x20404010, 0x20400000, 0x00000010, 0x20404010, 0x00400000, 0x20004000, 0x00404010, 0x00400000, 0x20000010,
142 0x00400010, 0x20004000, 0x20000000, 0x00004010, 0x00000000, 0x00400010, 0x20004010, 0x00004000, 0x00404000, 0x20004010, 0x00000010, 0x20400010,
143 0x20400010, 0x00000000, 0x00404010, 0x20404000, 0x00004010, 0x00404000, 0x20404000, 0x20000000, 0x20004000, 0x00000010, 0x20400010, 0x00404000,
144 0x20404010, 0x00400000, 0x00004010, 0x20000010, 0x00400000, 0x20004000, 0x20000000, 0x00004010, 0x20000010, 0x20404010, 0x00404000, 0x20400000,
145 0x00404010, 0x20404000, 0x00000000, 0x20400010, 0x00000010, 0x00004000, 0x20400000, 0x00404010, 0x00004000, 0x00400010, 0x20004010, 0x00000000,
146 0x20404000, 0x20000000, 0x00400010, 0x20004010 };
149 static const uint32_t SP7[64] = {
150 0x00200000, 0x04200002, 0x04000802, 0x00000000, 0x00000800, 0x04000802, 0x00200802, 0x04200800, 0x04200802, 0x00200000, 0x00000000, 0x04000002,
151 0x00000002, 0x04000000, 0x04200002, 0x00000802, 0x04000800, 0x00200802, 0x00200002, 0x04000800, 0x04000002, 0x04200000, 0x04200800, 0x00200002,
152 0x04200000, 0x00000800, 0x00000802, 0x04200802, 0x00200800, 0x00000002, 0x04000000, 0x00200800, 0x04000000, 0x00200800, 0x00200000, 0x04000802,
153 0x04000802, 0x04200002, 0x04200002, 0x00000002, 0x00200002, 0x04000000, 0x04000800, 0x00200000, 0x04200800, 0x00000802, 0x00200802, 0x04200800,
154 0x00000802, 0x04000002, 0x04200802, 0x04200000, 0x00200800, 0x00000000, 0x00000002, 0x04200802, 0x00000000, 0x00200802, 0x04200000, 0x00000800,
155 0x04000002, 0x04000800, 0x00000800, 0x00200002 };
158 static const uint32_t SP8[64] = {
159 0x10001040, 0x00001000, 0x00040000, 0x10041040, 0x10000000, 0x10001040, 0x00000040, 0x10000000, 0x00040040, 0x10040000, 0x10041040, 0x00041000,
160 0x10041000, 0x00041040, 0x00001000, 0x00000040, 0x10040000, 0x10000040, 0x10001000, 0x00001040, 0x00041000, 0x00040040, 0x10040040, 0x10041000,
161 0x00001040, 0x00000000, 0x00000000, 0x10040040, 0x10000040, 0x10001000, 0x00041040, 0x00040000, 0x00041040, 0x00040000, 0x10041000, 0x00001000,
162 0x00000040, 0x10040040, 0x00001000, 0x00041040, 0x10001000, 0x00000040, 0x10000040, 0x10040000, 0x10040040, 0x10000000, 0x00040000, 0x10001040,
163 0x00000000, 0x10041040, 0x00040040, 0x10000040, 0x10040000, 0x10001000, 0x10001040, 0x00000000, 0x10041040, 0x00041000, 0x00041000, 0x00001040,
164 0x00001040, 0x00040040, 0x10000000, 0x10041000 };
167 static void scrunch(uint8_t * outof, uint32_t * into)
169 *into = (*outof++ & 0xff) << 24;
170 *into |= ((*outof++ & 0xff) << 16);
171 *into |= ((*outof++ & 0xff) << 8);
172 *into++ |= (*outof++ & 0xff);
173 *into = (*outof++ & 0xff) << 24;
174 *into |= ((*outof++ & 0xff) << 16);
175 *into |= ((*outof++ & 0xff) << 8);
176 *into |= (*outof & 0xff);
180 static void unscrun(uint32_t * outof, uint8_t * into)
182 *into++ = ((*outof >> 24) & 0xff);
183 *into++ = ((*outof >> 16) & 0xff);
184 *into++ = ((*outof >> 8) & 0xff);
185 *into++ = (*outof++ & 0xff);
186 *into++ = ((*outof >> 24) & 0xff);
187 *into++ = ((*outof >> 16) & 0xff);
188 *into++ = ((*outof >> 8) & 0xff);
189 *into++ = (*outof & 0xff);
193 static void desfunc(uint32_t * block, uint32_t * keys)
195 uint32_t leftt = block[0];
196 uint32_t right = block[1];
197 uint32_t work = ((leftt >> 4) ^ right) & 0x0f0f0f0f;
199 leftt ^= (work << 4);
200 work = ((leftt >> 16) ^ right) & 0x0000ffff;
202 leftt ^= (work << 16);
203 work = ((right >> 2) ^ leftt) & 0x33333333;
205 right ^= (work << 2);
206 work = ((right >> 8) ^ leftt) & 0x00ff00ff;
208 right ^= (work << 8);
209 right = ((right << 1) | ((right >> 31) & 1)) & 0xffffffff;
210 work = (leftt ^ right) & 0xaaaaaaaa;
213 leftt = ((leftt << 1) | ((leftt >> 31) & 1)) & 0xffffffff;
215 for (
int round = 0; round < 8; ++round) {
216 work = (right << 28) | (right >> 4);
218 uint32_t fval = SP7[work & 0x3f];
219 fval |= SP5[(work >> 8) & 0x3f];
220 fval |= SP3[(work >> 16) & 0x3f];
221 fval |= SP1[(work >> 24) & 0x3f];
222 work = right ^ *keys++;
223 fval |= SP8[work & 0x3f];
224 fval |= SP6[(work >> 8) & 0x3f];
225 fval |= SP4[(work >> 16) & 0x3f];
226 fval |= SP2[(work >> 24) & 0x3f];
228 work = (leftt << 28) | (leftt >> 4);
230 fval = SP7[work & 0x3f];
231 fval |= SP5[(work >> 8) & 0x3f];
232 fval |= SP3[(work >> 16) & 0x3f];
233 fval |= SP1[(work >> 24) & 0x3f];
234 work = leftt ^ *keys++;
235 fval |= SP8[work & 0x3f];
236 fval |= SP6[(work >> 8) & 0x3f];
237 fval |= SP4[(work >> 16) & 0x3f];
238 fval |= SP2[(work >> 24) & 0x3f];
242 right = (right << 31) | (right >> 1);
243 work = (leftt ^ right) & 0xaaaaaaaa;
246 leftt = (leftt << 31) | (leftt >> 1);
247 work = ((leftt >> 8) ^ right) & 0x00ff00ff;
249 leftt ^= (work << 8);
250 work = ((leftt >> 2) ^ right) & 0x33333333;
252 leftt ^= (work << 2);
253 work = ((right >> 16) ^ leftt) & 0x0000ffff;
255 right ^= (work << 16);
256 work = ((right >> 4) ^ leftt) & 0x0f0f0f0f;
258 right ^= (work << 4);
265 void tripleDES_transform(
char const * password,
bool decode, uint8_t * inBlock, uint8_t * outBlock,
size_t length)
267 uint32_t KnL[32] = { 0 };
269 uint8_t charbuf[8] = { 0 };
270 for (
int i = 0; i < 8 && *password; ++i)
271 charbuf[i] = *password++;
273 uint8_t * key = charbuf;
279 for (
int j = 0; j < 56; ++j) {
282 pc1m[j] = (key[l >> 3] & bytebit[m]) ? 1 : 0;
284 for (
int i = 0; i < 16; ++i) {
285 int m = decode ? (15 - i) << 1 : i << 1;
288 for (
int j = 0; j < 28; ++j) {
289 int l = j + totrot[i];
290 pcr[j] = l < 28 ? pc1m[l] : pc1m[l - 28];
292 for (
int j = 28; j < 56; ++j) {
293 int l = j + totrot[i];
294 pcr[j] = l < 56 ? pc1m[l] : pc1m[l - 28];
296 for (
int j = 0; j < 24; ++j) {
298 kn[m] = kn[m] | bigbyte[j];
299 if (pcr[pc2[j + 24]])
300 kn[n] = kn[n] | bigbyte[j];
304 uint32_t * raw1 = kn;
306 uint32_t * cook = dough;
307 for (
int i = 0; i < 16; ++i, ++cook, ++raw1) {
308 uint32_t * raw0 = raw1++;
309 *cook = (*raw0 & 0x00fc0000) << 6;
310 *cook = *cook | ((*raw0 & 0x00000fc0) << 10);
311 *cook = *cook | ((*raw1 & 0x00fc0000) >> 10);
312 *cook = *cook | ((*raw1 & 0x00000fc0) >> 6);
314 *cook = (*raw0 & 0x0003f000) << 12;
315 *cook = *cook | ((*raw0 & 0x0000003f) << 16);
316 *cook = *cook | ((*raw1 & 0x0003f000) >> 4);
317 *cook = *cook | (*raw1 & 0x0000003f);
320 uint32_t * from = dough;
321 for (
int i = 0; i < 32; ++i, ++from)
324 for (
int i = 0; i < length; i += 8, inBlock += 8, outBlock += 8) {
326 scrunch(inBlock, work);
328 unscrun(work, outBlock);
339 #define MSG_SETPIXELFORMAT 0x00 340 #define MSG_SETENCODINGS 0x02 341 #define MSG_FRAMEBUFFERUPDATEREQUEST 0x03 342 #define MSG_KEYEVENT 0x04 343 #define MSG_POINTEREVENT 0x05 344 #define MSG_CLIENTCUTTEXT 0x06 347 #define MSG_FRAMEBUFFERUPDATE 0x00 348 #define MSG_SETCOLORMAPENTRIES 0x01 349 #define MSG_BELL 0x02 350 #define MSG_SERVERCUTTEXT 0x03 353 RFBClient::RFBClient()
359 RFBClient::~RFBClient()
366 RFBState RFBClient::connect(
char const * host, uint16_t port,
char const * password,
bool sharedConnection)
368 auto ip = hostToIP(host);
370 return RFBState::HostNameError;
371 if (!m_socket.connect(ip, port))
372 return RFBState::UnableToConnect;
374 m_socket.setLittleEndian(
false);
375 m_socket.setNoDelay(
true);
378 if (m_socket.read(head, 12) != 12)
379 return RFBState::CommunicationError;
381 int protVer = (head[10] -
'0') + (head[9] -
'0') * 10 + (head[8] -
'0') * 100 + (head[6] -
'0') * 1000 + (head[5] -
'0') * 10000 + (head[4] -
'0') * 100000;
386 else if (protVer >= 3003 && protVer < 3007)
388 else if (protVer != 3007)
389 return RFBState::UnsupportedProtocolVersion;
391 printf(
"protVer = %d\n", protVer);
394 m_socket.writeFmt(
"RFB 00%d.00%d\x0a", protVer / 1000, protVer - (protVer / 1000) * 1000);
396 uint8_t securityType = 0;
398 if (protVer >= 3007) {
399 int securityTypesCount = m_socket.readByte();
400 if (securityTypesCount == 0) {
402 int slen = m_socket.readDWord();
404 m_socket.read(str, slen);
406 printf(
"RFB Error: %s\n", str);
407 return RFBState::ErrorGettingSecTypes;
411 uint8_t securityTypes[securityTypesCount];
412 m_socket.read(securityTypes, securityTypesCount);
414 for (
int i = 0; i < securityTypesCount; ++i)
415 if (securityTypes[i] == 1 || securityTypes[i] == 2) {
416 securityType = securityTypes[i];
420 if (securityType == 0)
421 return RFBState::UnsupportedAuth;
424 m_socket.writeByte(securityType);
428 if (protVer == 3003) {
430 securityType = m_socket.readDWord();
433 switch (securityType) {
437 if (protVer >= 3008) {
439 if (m_socket.readDWord())
440 return RFBState::AuthFailed;
448 uint8_t challenge[16];
449 m_socket.read(challenge, 16);
450 tripleDES_transform(password,
false, challenge, challenge, 16);
451 m_socket.write(challenge, 16);
453 if (m_socket.readDWord())
454 return RFBState::AuthFailed;
455 printf(
"VNC Auth OK\n");
462 m_socket.writeByte((uint8_t)sharedConnection);
465 m_frameBufferWidth = m_socket.readWord();
466 m_frameBufferHeight = m_socket.readWord();
467 m_bitsPerPixel = m_socket.readByte();
468 m_depth = m_socket.readByte();
469 m_bigEndian = m_socket.readByte();
470 m_trueColor = m_socket.readByte();
471 m_redMax = m_socket.readWord();
472 m_greenMax = m_socket.readWord();
473 m_blueMax = m_socket.readWord();
474 m_redShift = m_socket.readByte();
475 m_greenShift = m_socket.readByte();
476 m_blueShift = m_socket.readByte();
477 m_socket.readDiscard(3);
478 int slen = m_socket.readDWord();
479 m_name = (
char*) malloc(slen + 1);
480 m_socket.read(m_name, slen);
483 printf(
"m_frameBufferWidth = %d\n", m_frameBufferWidth);
484 printf(
"m_frameBufferHeight = %d\n", m_frameBufferHeight);
485 printf(
"m_bitsPerPixel = %d\n", m_bitsPerPixel);
486 printf(
"m_depth = %d\n", m_depth);
487 printf(
"m_bigEndian = %d\n", m_bigEndian);
488 printf(
"m_trueColor = %d\n", m_trueColor);
489 printf(
"m_redMax = %d\n", m_redMax);
490 printf(
"m_greenMax = %d\n", m_greenMax);
491 printf(
"m_blueMax = %d\n", m_blueMax);
492 printf(
"m_redShift = %d\n", m_redShift);
493 printf(
"m_greenShift = %d\n", m_greenShift);
494 printf(
"m_blueShift = %d\n", m_blueShift);
495 printf(
"m_name = %s\n", m_name);
498 static const uint32_t encodings[] = { 0, };
499 sendSetEncodings(encodings,
sizeof(encodings) /
sizeof(uint32_t));
503 setPixelFormat(8, 8,
false,
true, 1, 1, 1, 2, 1, 0);
516 int bpp = m_bitsPerPixel / 8;
517 uint8_t * row = (uint8_t*) malloc(m_frameBufferWidth * bpp);
518 printf(
"row=%p\n", row);
521 uint8_t msg = m_socket.readByte();
522 printf(
"msg = %02X\n", msg);
524 uint16_t rectsCount = m_socket.readWord();
525 printf(
"rectsCount = %d\n", rectsCount);
526 for (
int i = 0; i < rectsCount; ++i) {
527 printf(
"rect #%d\n", i);
528 uint16_t xpos = m_socket.readWord();
529 uint16_t ypos = m_socket.readWord();
530 uint16_t ww = m_socket.readWord();
531 uint16_t hh = m_socket.readWord();
532 uint32_t en = m_socket.readDWord();
533 printf(
" xpos = %d ypos = %d ww = %d hh = %d en = %d\n", xpos, ypos, ww, hh, en);
535 for (
int y = 0; y < hh; ++y) {
536 m_socket.read(row, ww * bpp);
543 sendRequestUpdate(0, 0, m_frameBufferWidth, m_frameBufferHeight,
true);
546 uint8_t msg = m_socket.readByte();
547 printf(
"msg = %02X\n", msg);
549 uint16_t rectsCount = m_socket.readWord();
550 printf(
"rectsCount = %d\n", rectsCount);
551 for (
int i = 0; i < rectsCount; ++i) {
552 printf(
"rect #%d\n", i);
553 uint16_t xpos = m_socket.readWord();
554 uint16_t ypos = m_socket.readWord();
555 uint16_t ww = m_socket.readWord();
556 uint16_t hh = m_socket.readWord();
557 uint32_t en = m_socket.readDWord();
558 printf(
" xpos = %d ypos = %d ww = %d hh = %d en = %d\n", xpos, ypos, ww, hh, en);
560 for (
int y = 0; y < hh; ++y) {
561 m_socket.read(row, ww * bpp);
562 m_renderRow(m_renderRowContext, xpos, ypos + y, row, ww);
571 return RFBState::Success;
575 void RFBClient::setPixelFormat(
int bitsPerPixel,
int depth,
bool bigEndian,
bool trueColor,
int redMax,
int greenMax,
int blueMax,
int redShift,
int greenShift,
int blueShift)
577 m_bitsPerPixel = bitsPerPixel;
579 m_bigEndian = bigEndian;
580 m_trueColor = trueColor;
582 m_greenMax = greenMax;
584 m_redShift = redShift;
585 m_greenShift = greenShift;
586 m_blueShift = blueShift;
587 sendSetPixelFormat();
588 sendRequestUpdate(0, 0, m_frameBufferWidth, m_frameBufferHeight,
false);
592 void RFBClient::sendSetEncodings(uint32_t
const * encodings,
size_t encodingsCount)
594 m_socket.writeByte(MSG_SETENCODINGS);
595 m_socket.writeFillBytes(1);
596 m_socket.writeWord(encodingsCount);
597 for (
int i = 0; i < encodingsCount; ++i)
598 m_socket.writeDWord(encodings[i]);
602 void RFBClient::sendRequestUpdate(
int x,
int y,
int width,
int height,
bool incremental)
604 m_socket.writeByte(MSG_FRAMEBUFFERUPDATEREQUEST);
605 m_socket.writeByte((uint8_t)incremental);
606 m_socket.writeWord(x);
607 m_socket.writeWord(y);
608 m_socket.writeWord(
width);
609 m_socket.writeWord(
height);
613 void RFBClient::sendSetPixelFormat()
615 m_socket.writeByte(MSG_SETPIXELFORMAT);
616 m_socket.writeFillBytes(3);
617 m_socket.writeByte(m_bitsPerPixel);
618 m_socket.writeByte(m_depth);
619 m_socket.writeByte(m_bigEndian);
620 m_socket.writeByte(m_trueColor);
621 m_socket.writeWord(m_redMax);
622 m_socket.writeWord(m_greenMax);
623 m_socket.writeWord(m_blueMax);
624 m_socket.writeByte(m_redShift);
625 m_socket.writeByte(m_greenShift);
626 m_socket.writeByte(m_blueShift);
627 m_socket.writeFillBytes(3);
This file contains RFBClient class.