gem5  v22.1.0.0
vncserver.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010, 2015 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
42 #include <sys/ioctl.h>
43 #include <sys/stat.h>
44 
45 #if defined(__FreeBSD__)
46 #include <termios.h>
47 
48 #else
49 #include <sys/termios.h>
50 
51 #endif
52 #include "base/vnc/vncserver.hh"
53 
54 #include <fcntl.h>
55 #include <poll.h>
56 #include <sys/types.h>
57 #include <unistd.h>
58 
59 #include <cerrno>
60 #include <cstddef>
61 #include <cstdio>
62 
63 #include "base/atomicio.hh"
64 #include "base/logging.hh"
65 #include "base/output.hh"
66 #include "base/socket.hh"
67 #include "base/trace.hh"
68 #include "debug/VNC.hh"
69 #include "sim/byteswap.hh"
70 
71 namespace gem5
72 {
73 
74 const PixelConverter VncServer::pixelConverter(
75  4, // 4 bytes / pixel
76  16, 8, 0, // R in [23, 16], G in [15, 8], B in [7, 0]
77  8, 8, 8, // 8 bits / channel
78  ByteOrder::little);
79 
88  : PollEvent(fd, e), vncserver(vs)
89 {
90 }
91 
92 void
94 {
95  vncserver->accept();
96 }
97 
102  : PollEvent(fd, e), vncserver(vs)
103 {
104 }
105 
106 void
108 {
109  if (revent & POLLIN)
110  vncserver->data();
111  else if (revent & POLLNVAL)
112  vncserver->detach();
113 }
114 
119  : VncInput(p), listenEvent(NULL), dataEvent(NULL), number(p.number),
120  dataFd(-1), sendUpdate(false),
121  supportsRawEnc(false), supportsResizeEnc(false)
122 {
123  if (p.port)
124  listen(p.port);
125 
127 
128  // We currently only support one pixel format. Extract the pixel
129  // representation from our PixelConverter instance and keep it
130  // around for telling the client and making sure it cooperates
133  pixelFormat.bigendian = pixelConverter.byte_order == ByteOrder::big;
141 
142  DPRINTF(VNC, "Vnc server created at port %d\n", p.port);
143 }
144 
146 {
147  if (dataFd != -1)
148  ::close(dataFd);
149 
150  if (listenEvent)
151  delete listenEvent;
152 
153  if (dataEvent)
154  delete dataEvent;
155 }
156 
157 
158 //socket creation and vnc client attach
159 void
161 {
163  warn_once("Sockets disabled, not accepting vnc client connections");
164  return;
165  }
166 
167  while (!listener.listen(port, true)) {
168  DPRINTF(VNC,
169  "can't bind address vnc server port %d in use PID %d\n",
170  port, getpid());
171  port++;
172  }
173 
174  ccprintf(std::cerr, "%s: Listening for connections on port %d\n",
175  name(), port);
176 
177  listenEvent = new ListenEvent(this, listener.getfd(), POLLIN);
179 }
180 
181 // attach a vnc client
182 void
184 {
185  // As a consequence of being called from the PollQueue, we might
186  // have been called from a different thread. Migrate to "our"
187  // thread.
189 
190  if (!listener.islistening())
191  panic("%s: cannot accept a connection if not listening!", name());
192 
193  int fd = listener.accept(true);
194  if (fd < 0) {
195  warn("%s: failed to accept VNC connection!", name());
196  return;
197  }
198 
199  if (dataFd != -1) {
200  char message[] = "vnc server already attached!\n";
201  atomic_write(fd, message, sizeof(message));
202  ::close(fd);
203  return;
204  }
205 
206  dataFd = fd;
207 
208  // Send our version number to the client
209  write((uint8_t *)vncVersion(), strlen(vncVersion()));
210 
211  // read the client response
212  dataEvent = new DataEvent(this, dataFd, POLLIN);
214 
215  inform("VNC client attached\n");
216 }
217 
218 // data called by data event
219 void
221 {
222  // We have new data, see if we can handle it
223  DPRINTF(VNC, "Vnc client message recieved\n");
224 
225  switch (curState) {
228  break;
230  checkSecurity();
231  break;
232  case WaitForClientInit:
233  // Don't care about shared, just need to read it out of the socket
234  uint8_t shared;
235  if (!read(&shared))
236  return;
237 
238  // Send our idea of the frame buffer
239  sendServerInit();
240 
241  break;
242  case NormalPhase:
243  uint8_t message_type;
244  if (!read(&message_type))
245  return;
246 
247  switch (message_type) {
249  setPixelFormat();
250  break;
251  case ClientSetEncodings:
252  setEncodings();
253  break;
255  requestFbUpdate();
256  break;
257  case ClientKeyEvent:
259  break;
260  case ClientPointerEvent:
262  break;
263  case ClientCutText:
264  recvCutText();
265  break;
266  default:
267  warn("Unimplemented message type recv from client: %d\n",
268  message_type);
269  detach();
270  break;
271  }
272  break;
273  default:
274  panic("Unknown vnc server state\n");
275  }
276 }
277 
278 
279 // read from socket
280 bool
281 VncServer::read(uint8_t *buf, size_t len)
282 {
283  if (dataFd < 0)
284  panic("vnc not properly attached.\n");
285 
286  size_t ret;
287  do {
288  ret = ::read(dataFd, buf, len);
289  } while (ret == -1 && errno == EINTR);
290 
291 
292  if (ret != len) {
293  DPRINTF(VNC, "Read failed %d.\n", ret);
294  detach();
295  return false;
296  }
297 
298  return true;
299 }
300 
301 bool
302 VncServer::read1(uint8_t *buf, size_t len)
303 {
304  return read(buf + 1, len - 1);
305 }
306 
307 
308 template<typename T>
309 bool
311 {
312  return read((uint8_t *)val, sizeof(T));
313 }
314 
315 // write to socket
316 bool
317 VncServer::write(const uint8_t *buf, size_t len)
318 {
319  if (dataFd < 0)
320  panic("Vnc client not properly attached.\n");
321 
322  ssize_t ret = atomic_write(dataFd, buf, len);
323 
324  if (ret != len) {
325  DPRINTF(VNC, "Write failed.\n");
326  detach();
327  return false;
328  }
329 
330  return true;
331 }
332 
333 template<typename T>
334 bool
336 {
337  return write((uint8_t *)val, sizeof(T));
338 }
339 
340 bool
341 VncServer::write(const char* str)
342 {
343  return write((uint8_t *)str, strlen(str));
344 }
345 
346 // detach a vnc client
347 void
349 {
350  if (dataFd != -1) {
351  ::close(dataFd);
352  dataFd = -1;
353  }
354 
355  if (!dataEvent || !dataEvent->queued())
356  return;
357 
359  delete dataEvent;
360  dataEvent = NULL;
362 
363  inform("VNC client detached\n");
364  DPRINTF(VNC, "detach vnc client %d\n", number);
365 }
366 
367 void
368 VncServer::sendError(const char* error_msg)
369 {
370  uint32_t len = strlen(error_msg);
371  if (!write(&len))
372  return;
373  write(error_msg);
374 }
375 
376 void
378 {
379  assert(curState == WaitForProtocolVersion);
380 
381  [[maybe_unused]] size_t len;
382  char version_string[13];
383 
384  // Null terminate the message so it's easier to work with
385  version_string[12] = 0;
386 
387  if (!read((uint8_t *)version_string, sizeof(version_string) - 1)) {
388  warn("Failed to read protocol version.");
389  return;
390  }
391 
392  uint32_t major_version, minor_version;
393 
394  // Figure out the major/minor numbers
395  if (sscanf(version_string, "RFB %03d.%03d\n", &major_version,
396  &minor_version) != 2) {
397  warn(" Malformed protocol version %s\n", version_string);
398  sendError("Malformed protocol version\n");
399  detach();
400  return;
401  }
402 
403  DPRINTF(VNC, "Client request protocol version %d.%d\n", major_version,
404  minor_version);
405 
406  // If it's not 3.X we don't support it
407  if (major_version != 3 || minor_version < 2) {
408  warn("Unsupported VNC client version... disconnecting\n");
409  uint8_t err = AuthInvalid;
410  write(&err);
411  detach();
412  return;
413  }
414  // Auth is different based on version number
415  if (minor_version < 7) {
416  uint32_t sec_type = htobe((uint32_t)AuthNone);
417  if (!write(&sec_type))
418  return;
419  } else {
420  uint8_t sec_cnt = 1;
421  uint8_t sec_type = htobe((uint8_t)AuthNone);
422  if (!write(&sec_cnt) || !write(&sec_type))
423  return;
424  }
425 
426  // Wait for client to respond
428 }
429 
430 void
432 {
434 
435  uint8_t security_type;
436  if (!read(&security_type))
437  return;
438 
439  if (security_type != AuthNone) {
440  warn("Unknown VNC security type\n");
441  sendError("Unknown security type\n");
442  }
443 
444  DPRINTF(VNC, "Sending security auth OK\n");
445 
446  uint32_t success = htobe(VncOK);
447  if (!write(&success))
448  return;
450 }
451 
452 void
454 {
455  ServerInitMsg msg;
456 
457  DPRINTF(VNC, "Sending server init message to client\n");
458 
459  msg.fbWidth = htobe(videoWidth());
460  msg.fbHeight = htobe(videoHeight());
461 
462  msg.px.bpp = htobe(pixelFormat.bpp);
463  msg.px.depth = htobe(pixelFormat.depth);
472  memset(msg.px.padding, 0, 3);
473  msg.namelen = 2;
474  msg.namelen = htobe(msg.namelen);
475  std::memcpy(msg.name, "M5", 2);
476 
477  if (!write(&msg))
478  return;
480 }
481 
482 void
484 {
485  DPRINTF(VNC, "Received pixel format from client message\n");
486 
487  PixelFormatMessage pfm;
488  if (!read1((uint8_t *)&pfm, sizeof(PixelFormatMessage)))
489  return;
490 
491  DPRINTF(VNC, " -- bpp = %d; depth = %d; be = %d\n", pfm.px.bpp,
492  pfm.px.depth, pfm.px.bigendian);
493  DPRINTF(VNC, " -- true color = %d red,green,blue max = %d,%d,%d\n",
494  pfm.px.truecolor, betoh(pfm.px.redmax), betoh(pfm.px.greenmax),
495  betoh(pfm.px.bluemax));
496  DPRINTF(VNC, " -- red,green,blue shift = %d,%d,%d\n", pfm.px.redshift,
497  pfm.px.greenshift, pfm.px.blueshift);
498 
499  if (betoh(pfm.px.bpp) != pixelFormat.bpp ||
500  betoh(pfm.px.depth) != pixelFormat.depth ||
503  betoh(pfm.px.redmax) != pixelFormat.redmax ||
505  betoh(pfm.px.bluemax) != pixelFormat.bluemax ||
509  warn("VNC client doesn't support true color raw encoding\n");
510  detach();
511  }
512 }
513 
514 void
516 {
517  DPRINTF(VNC, "Received supported encodings from client\n");
518 
520  if (!read1((uint8_t *)&pem, sizeof(PixelEncodingsMessage)))
521  return;
522 
523  pem.num_encodings = betoh(pem.num_encodings);
524 
525  DPRINTF(VNC, " -- %d encoding present\n", pem.num_encodings);
527 
528  for (int x = 0; x < pem.num_encodings; x++) {
529  int32_t encoding;
530  if (!read(&encoding))
531  return;
532  DPRINTF(VNC, " -- supports %d\n", betoh(encoding));
533 
534  switch (betoh(encoding)) {
535  case EncodingRaw:
536  supportsRawEnc = true;
537  break;
538  case EncodingDesktopSize:
539  supportsResizeEnc = true;
540  break;
541  }
542  }
543 
544  if (!supportsRawEnc) {
545  warn("VNC clients must always support raw encoding\n");
546  detach();
547  }
548 }
549 
550 void
552 {
553  DPRINTF(VNC, "Received frame buffer update request from client\n");
554 
556  if (!read1((uint8_t *)&fbr, sizeof(FrameBufferUpdateReq)))
557  return;
558 
559  fbr.x = betoh(fbr.x);
560  fbr.y = betoh(fbr.y);
561  fbr.width = betoh(fbr.width);
562  fbr.height = betoh(fbr.height);
563 
564  DPRINTF(VNC, " -- x = %d y = %d w = %d h = %d\n", fbr.x, fbr.y, fbr.width,
565  fbr.height);
566 
568 }
569 
570 void
572 {
573  DPRINTF(VNC, "Received keyboard input from client\n");
574  KeyEventMessage kem;
575  if (!read1((uint8_t *)&kem, sizeof(KeyEventMessage)))
576  return;
577 
578  kem.key = betoh(kem.key);
579  DPRINTF(VNC, " -- received key code %d (%s)\n", kem.key, kem.down_flag ?
580  "down" : "up");
581 
582  if (keyboard)
583  keyboard->keyPress(kem.key, kem.down_flag);
584 }
585 
586 void
588 {
589  DPRINTF(VNC, "Received pointer input from client\n");
591 
592  if (!read1((uint8_t *)&pem, sizeof(PointerEventMessage)))
593  return;
594 
595  pem.x = betoh(pem.x);
596  pem.y = betoh(pem.y);
597  DPRINTF(VNC, " -- pointer at x = %d y = %d buttons = %#x\n", pem.x, pem.y,
598  pem.button_mask);
599 
600  if (mouse)
601  mouse->mouseAt(pem.x, pem.y, pem.button_mask);
602 }
603 
604 void
606 {
607  DPRINTF(VNC, "Received client copy buffer message\n");
608 
610  if (!read1((uint8_t *)&cct, sizeof(ClientCutTextMessage)))
611  return;
612 
613  char str[1025];
614  size_t data_len = betoh(cct.length);
615  DPRINTF(VNC, "String length %d\n", data_len);
616  while (data_len > 0) {
617  size_t bytes_to_read = data_len > 1024 ? 1024 : data_len;
618  if (!read((uint8_t *)&str, bytes_to_read))
619  return;
620  str[bytes_to_read] = 0;
621  data_len -= bytes_to_read;
622  DPRINTF(VNC, "Buffer: %s\n", str);
623  }
624 
625 }
626 
627 
628 void
630 {
631 
632  if (dataFd <= 0 || curState != NormalPhase || !sendUpdate) {
633  DPRINTF(VNC, "NOT sending framebuffer update\n");
634  return;
635  }
636 
637  // The client will request data constantly, unless we throttle it
638  sendUpdate = false;
639 
640  DPRINTF(VNC, "Sending framebuffer update\n");
641 
642  FrameBufferUpdate fbu;
643  FrameBufferRect fbr;
644 
646  fbu.num_rects = 1;
647  fbr.x = 0;
648  fbr.y = 0;
649  fbr.width = videoWidth();
650  fbr.height = videoHeight();
651  fbr.encoding = EncodingRaw;
652 
653  // fix up endian
654  fbu.num_rects = htobe(fbu.num_rects);
655  fbr.x = htobe(fbr.x);
656  fbr.y = htobe(fbr.y);
657  fbr.width = htobe(fbr.width);
658  fbr.height = htobe(fbr.height);
659  fbr.encoding = htobe(fbr.encoding);
660 
661  // send headers to client
662  if (!write(&fbu) || !write(&fbr))
663  return;
664 
665  assert(fb);
666 
668  for (int y = 0; y < fb->height(); ++y) {
669  // Convert and send a line at a time
670  uint8_t *raw_pixel(line_buffer.data());
671  for (unsigned x = 0; x < fb->width(); ++x) {
672  pixelConverter.fromPixel(raw_pixel, fb->pixel(x, y));
673  raw_pixel += pixelConverter.length;
674  }
675 
676  if (!write(line_buffer.data(), line_buffer.size()))
677  return;
678  }
679 }
680 
681 void
683 {
684  assert(fb && dataFd > 0 && curState == NormalPhase);
685  DPRINTF(VNC, "Sending framebuffer resize\n");
686 
687  FrameBufferUpdate fbu;
688  FrameBufferRect fbr;
689 
691  fbu.num_rects = 1;
692  fbr.x = 0;
693  fbr.y = 0;
694  fbr.width = videoWidth();
695  fbr.height = videoHeight();
697 
698  // fix up endian
699  fbu.num_rects = htobe(fbu.num_rects);
700  fbr.x = htobe(fbr.x);
701  fbr.y = htobe(fbr.y);
702  fbr.width = htobe(fbr.width);
703  fbr.height = htobe(fbr.height);
704  fbr.encoding = htobe(fbr.encoding);
705 
706  // send headers to client
707  if (!write(&fbu))
708  return;
709  write(&fbr);
710 
711  // No actual data is sent in this message
712 }
713 
714 void
716 {
718 
719  sendUpdate = true;
721 }
722 
723 void
725 {
726  if (dataFd > 0 && curState == NormalPhase) {
727  if (supportsResizeEnc)
729  else
730  // The frame buffer changed size and we can't update the client
731  detach();
732  }
733 }
734 
735 } // namespace gem5
#define DPRINTF(x,...)
Definition: trace.hh:186
unsigned height() const
Frame buffer height in pixels.
Definition: framebuffer.hh:101
const Pixel & pixel(unsigned x, unsigned y) const
Get a pixel from an (x, y) coordinate.
Definition: framebuffer.hh:160
unsigned width() const
Frame buffer width in pixels.
Definition: framebuffer.hh:99
virtual bool listen(int port, bool reuse=true)
Definition: socket.cc:122
virtual int accept(bool nodelay=false)
Definition: socket.cc:176
static bool allDisabled()
Definition: socket.cc:71
bool islistening() const
Definition: socket.hh:78
int getfd() const
Definition: socket.hh:77
virtual std::string name() const
Definition: named.hh:47
ByteOrder byte_order
Byte order when stored to memory.
Definition: pixel.hh:192
Channel ch_b
Blue channel conversion helper.
Definition: pixel.hh:199
unsigned depth
Number of bits used to represent one pixel value (excluding padding).
Definition: pixel.hh:190
unsigned length
Bytes per pixel when stored in memory (including padding)
Definition: pixel.hh:184
Channel ch_r
Red channel conversion helper.
Definition: pixel.hh:195
uint32_t fromPixel(const Pixel &pixel) const
Convert a Pixel into a color word.
Definition: pixel.hh:150
Channel ch_g
Green channel conversion helper.
Definition: pixel.hh:197
const FrameBuffer * fb
pointer to the actual data that is stored in the frame buffer device
Definition: vncinput.hh:218
virtual void setDirty()
The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a...
Definition: vncinput.cc:93
VncInputParams Params
Definition: vncinput.hh:166
uint16_t videoHeight() const
What is the height of the screen we're displaying.
Definition: vncinput.hh:200
uint16_t videoWidth() const
What is the width of the screen we're displaying.
Definition: vncinput.hh:193
VncKeyboard * keyboard
The device to notify when we get key events.
Definition: vncinput.hh:209
VncMouse * mouse
The device to notify when we get mouse events.
Definition: vncinput.hh:215
@ ClientSetEncodings
Definition: vncinput.hh:97
@ ClientSetPixelFormat
Definition: vncinput.hh:96
@ ClientFrameBufferUpdate
Definition: vncinput.hh:98
virtual void keyPress(uint32_t key, bool down)=0
Called when the vnc server receives a key press event from the client.
virtual void mouseAt(uint16_t x, uint16_t y, uint8_t buttons)=0
called whenever the mouse moves or it's button state changes buttons is a simple mask with each butto...
void process(int revent)
Definition: vncserver.cc:107
DataEvent(VncServer *vs, int fd, int e)
Poll event for the data socket.
Definition: vncserver.cc:101
void process(int revent)
Definition: vncserver.cc:93
ListenEvent(VncServer *vs, int fd, int e)
Poll event for the listen socket.
Definition: vncserver.cc:87
void recvKeyboardInput()
Receive message from client providing new keyboard input.
Definition: vncserver.cc:571
ListenSocket listener
Definition: vncserver.hh:183
bool read1(uint8_t *buf, size_t len)
Read len -1 bytes from the client into the buffer provided + 1 assert that we read enough bytes.
Definition: vncserver.cc:302
void sendServerInit()
Send client our idea about what the frame buffer looks like.
Definition: vncserver.cc:453
void setEncodings()
Receive encodings message from client and process it.
Definition: vncserver.cc:515
ListenEvent * listenEvent
Definition: vncserver.hh:164
bool write(const uint8_t *buf, size_t len)
Write a buffer to the client.
Definition: vncserver.cc:317
bool supportsResizeEnc
If the vnc client supports the desktop resize command.
Definition: vncserver.hh:212
void frameBufferResized() override
Definition: vncserver.cc:724
void sendFrameBufferResized()
Tell the client that the frame buffer resized.
Definition: vncserver.cc:682
void setPixelFormat()
Receive pixel foramt message from client and process it.
Definition: vncserver.cc:483
DataEvent * dataEvent
Definition: vncserver.hh:178
void checkSecurity()
Check that the security exchange was successful.
Definition: vncserver.cc:431
friend class DataEvent
Definition: vncserver.hh:177
void requestFbUpdate()
Receive message from client asking for updated frame buffer.
Definition: vncserver.cc:551
friend class ListenEvent
Definition: vncserver.hh:163
void listen(int port)
Definition: vncserver.cc:160
void sendFrameBufferUpdate()
Send a updated frame buffer to the client.
Definition: vncserver.cc:629
void recvPointerInput()
Recv message from client providing new mouse movement or button click.
Definition: vncserver.cc:587
void recvCutText()
Receive message from client that there is text in it's paste buffer.
Definition: vncserver.cc:605
bool supportsRawEnc
If the vnc client supports receiving raw data.
Definition: vncserver.hh:209
void setDirty() override
The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a...
Definition: vncserver.cc:715
static const PixelConverter pixelConverter
Definition: vncserver.hh:315
void sendError(const char *error_msg)
vnc client Interface
Definition: vncserver.cc:368
void checkProtocolVersion()
Check the client's protocol verion for compatibility and send the security types we support.
Definition: vncserver.cc:377
bool read(uint8_t *buf, size_t len)
Read some data from the client.
Definition: vncserver.cc:281
PixelFormat pixelFormat
The one and only pixel format we support.
Definition: vncserver.hh:206
VncServer(const Params &p)
VncServer.
Definition: vncserver.cc:118
ConnectionState curState
The rfb prototol state the connection is in.
Definition: vncserver.hh:199
bool sendUpdate
An update needs to be sent to the client.
Definition: vncserver.hh:203
const char * vncVersion() const
Definition: vncserver.hh:103
static const uint32_t VncOK
Error conditions.
Definition: vncserver.hh:75
static const uint32_t AuthInvalid
Authentication modes.
Definition: vncserver.hh:71
static const uint32_t AuthNone
Definition: vncserver.hh:72
@ ServerFrameBufferUpdate
Definition: vncserver.hh:80
EventQueue * eventQueue() const
Definition: eventq.hh:1010
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:178
void remove(PollEvent *event)
Definition: pollevent.cc:139
PollQueue pollQueue
Definition: pollevent.cc:55
void schedule(PollEvent *event)
Definition: pollevent.cc:159
uint16_t len
Definition: helpers.cc:62
#define warn(...)
Definition: logging.hh:246
#define warn_once(...)
Definition: logging.hh:250
#define inform(...)
Definition: logging.hh:247
Bitfield< 14, 12 > fd
Definition: types.hh:150
Bitfield< 6 > err
Definition: misc_types.hh:809
Bitfield< 9 > e
Definition: misc_types.hh:65
Bitfield< 27, 25 > encoding
Definition: types.hh:90
Bitfield< 19 > vs
Definition: misc_types.hh:576
Bitfield< 4 > x
Definition: pagetable.hh:61
Bitfield< 54 > p
Definition: pagetable.hh:70
Bitfield< 63 > val
Definition: misc.hh:776
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
T betoh(T value)
Definition: byteswap.hh:175
T htobe(T value)
Definition: byteswap.hh:174
ssize_t atomic_write(int fd, const void *s, size_t n)
Definition: atomicio.cc:67
void ccprintf(cp::Print &print)
Definition: cprintf.hh:130
unsigned offset
Offset in bits.
Definition: pixel.hh:122
unsigned mask
Bit mask (after shifting)
Definition: pixel.hh:124
Declaration of a VNC server.

Generated on Wed Dec 21 2022 10:22:29 for gem5 by doxygen 1.9.1