mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
VNC: Add control logic to negotiate security and framebuffer
This commit is contained in:
@@ -120,17 +120,27 @@ int vnc_server(int argc, FAR char *argv[])
|
|||||||
{
|
{
|
||||||
gvdbg("New VNC connection\n");
|
gvdbg("New VNC connection\n");
|
||||||
|
|
||||||
/* Start the VNC session. This function does not return until the
|
ret = vnc_negotiate(session);
|
||||||
* session has been terminated (or an error occurs).
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
gdbg("ERROR: Failed to negotiate security/framebuffer: %d\n",
|
||||||
|
ret);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Start the VNC session. This function does not return until
|
||||||
|
* the session has been terminated (or an error occurs).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(void)vnc_session(session);
|
ret = vnc_session(session);
|
||||||
|
gvdbg("Session terminated with %d\n", ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Re-initialize the session structure for re-use */
|
/* Re-initialize the session structure for re-use */
|
||||||
|
|
||||||
vnc_release_session(session);
|
vnc_release_session(session);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return EXIT_FAILURE; /* We won't get here */
|
return EXIT_FAILURE; /* We won't get here */
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,25 @@ FAR struct vnc_session_s *vnc_create_session(void);
|
|||||||
|
|
||||||
void vnc_release_session(FAR struct vnc_session_s *session);
|
void vnc_release_session(FAR struct vnc_session_s *session);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: vnc_negotiate
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Perform the VNC initialize sequency after a client has sucessfully
|
||||||
|
* connected to the server. Negotiate security, framebuffer and color
|
||||||
|
* properties.
|
||||||
|
*
|
||||||
|
* Input Parameters:
|
||||||
|
* session - An instance of the session structure allocated by
|
||||||
|
* vnc_create_session().
|
||||||
|
*
|
||||||
|
* Returned Value:
|
||||||
|
* Returns zero (OK) on success; a negated errno value on failure.
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
int vnc_negotiate(FAR struct vnc_session_s *session);
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: vnc_session
|
* Name: vnc_session
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user