From 50bd624cc49d7409f6f73b65aeae4cabdec3e7ee Mon Sep 17 00:00:00 2001 From: "Justin Terry (VM)" Date: Thu, 21 Sep 2017 16:13:05 -0700 Subject: Implements XRDP over vsock 1. Implements the ability to use AV_VSOCK for the transport rather than TCP. 2. Updates the ini file to be able to conditionally turn this feature on. --- common/trans.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'common/trans.c') diff --git a/common/trans.c b/common/trans.c index d73764de..8a271722 100644 --- a/common/trans.c +++ b/common/trans.c @@ -831,6 +831,26 @@ trans_listen_address(struct trans *self, char *port, const char *address) } } } +#if defined(XRDP_ENABLE_VSOCK) + else if (self->mode == TRANS_MODE_VSOCK) /* vsock socket */ + { + self->sck = g_vsock_socket(); + if (self->sck < 0) + return 1; + + g_tcp_set_non_blocking(self->sck); + + if (g_vsock_bind(self->sck, port) == 0) + { + if (g_tcp_listen(self->sck) == 0) + { + self->status = TRANS_STATUS_UP; /* ok */ + self->type1 = TRANS_TYPE_LISTENER; /* listener */ + return 0; + } + } + } +#endif return 1; } -- cgit v1.2.3