|
FreeRDP
|
Internal library implementation of include/freerdp/server/udp.h and the server UDP API, including the listener, flows, relays, and peer flow hooks. More...

Data Fields | |
| CRITICAL_SECTION | lock |
| udpListenerSocket | sockets [UDPLISTENER_MAX_SOCKETS] |
| size_t | socketCount |
| udpListenerSocket | retired [UDPLISTENER_MAX_SOCKETS] |
| size_t | retiredCount |
| wHashTable * | entriesByHash |
| wHashTable * | entriesByAddress |
| udpListenerRelay * | relays |
| size_t | relayCount |
| HANDLE | relayThread |
| LONG | relayStop |
| LONG | relayFailed |
| SOCKET | relayWake [2] |
| HANDLE | thread |
| HANDLE | wake |
| LONG | stop |
| BOOL | shared |
| BOOL | freed |
| BYTE | buffer [0x10000] |
Internal library implementation of include/freerdp/server/udp.h and the server UDP API, including the listener, flows, relays, and peer flow hooks.
FreeRDP: A Remote Desktop Protocol Implementation Server UDP listener for multitransport tunnels
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Following [MS-RDPEMT] 1.3, clients send RDP-UDP SYN packets to the TCP connection's address and port. The listener demultiplexes incoming datagrams by routing them to the corresponding flow, where a per-flow tunnel thread processes them. The listener thread performs no protocol work to prevent slow clients from blocking others.
Servers that fork per connection or delegate to per-user processes serve clients outside the process owning the port. Such servers keep the listener in the port-owning process and use a socket pair per connection via freerdp_udp_socket_pair(). One end of the pair is passed to the child process:
The connection process never accesses the shared socket, preventing it from reading other users' datagrams. Listener and socket-pair sockets are close-on-exec; a child that forks without exec must call freerdp_udp_listener_close_after_fork() instead of freerdp_udp_listener_free(). The relay ends when either socket in the pair closes.
Datagrams are identified by source address; only the client's SYN ties a datagram to a connection via a cleartext hash. A UDP connection is unproven until the security cookie arrives within the TLS session (see FreeRDP_UdpLinkState). A source address remains bound to its connection until termination; new connections from the same address/port (e.g., via NAT) remain on TCP until then. The flow binds to the address of the first SYN and its cookie hash; if the client's NAT assigns a new port, the tunnel ends.
A tunnel allows at most 4096 datagrams in flight (~5 MB per round trip, e.g., 50 MB/s at 100 ms), though the congestion window may be smaller.
Definition at line 165 of file udplistener_internal.h.
| BYTE freerdp_udp_listener::buffer[0x10000] |
Definition at line 196 of file udplistener_internal.h.
| wHashTable* freerdp_udp_listener::entriesByAddress |
Definition at line 178 of file udplistener_internal.h.
| wHashTable* freerdp_udp_listener::entriesByHash |
Definition at line 177 of file udplistener_internal.h.
| BOOL freerdp_udp_listener::freed |
Definition at line 194 of file udplistener_internal.h.
| CRITICAL_SECTION freerdp_udp_listener::lock |
Definition at line 167 of file udplistener_internal.h.
| size_t freerdp_udp_listener::relayCount |
Definition at line 182 of file udplistener_internal.h.
| LONG freerdp_udp_listener::relayFailed |
Definition at line 186 of file udplistener_internal.h.
| udpListenerRelay* freerdp_udp_listener::relays |
Definition at line 181 of file udplistener_internal.h.
| LONG freerdp_udp_listener::relayStop |
Definition at line 184 of file udplistener_internal.h.
| HANDLE freerdp_udp_listener::relayThread |
Definition at line 183 of file udplistener_internal.h.
| SOCKET freerdp_udp_listener::relayWake[2] |
Definition at line 187 of file udplistener_internal.h.
| udpListenerSocket freerdp_udp_listener::retired[UDPLISTENER_MAX_SOCKETS] |
Definition at line 173 of file udplistener_internal.h.
| size_t freerdp_udp_listener::retiredCount |
Definition at line 174 of file udplistener_internal.h.
| BOOL freerdp_udp_listener::shared |
Definition at line 193 of file udplistener_internal.h.
| size_t freerdp_udp_listener::socketCount |
Definition at line 170 of file udplistener_internal.h.
| udpListenerSocket freerdp_udp_listener::sockets[UDPLISTENER_MAX_SOCKETS] |
Definition at line 169 of file udplistener_internal.h.
| LONG freerdp_udp_listener::stop |
Definition at line 191 of file udplistener_internal.h.
| HANDLE freerdp_udp_listener::thread |
Definition at line 189 of file udplistener_internal.h.
| HANDLE freerdp_udp_listener::wake |
Definition at line 190 of file udplistener_internal.h.