2 * FreeRDP: A Remote Desktop Protocol Client
3 * Network Transport Layer
5 * Copyright 2011 Vic Lee
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
27 TRANSPORT_LAYER_CLOSED
30 typedef struct rdp_transport rdpTransport;
37 #include <freerdp/types.h>
38 #include <freerdp/settings.h>
39 #include <freerdp/utils/stream.h>
40 #include <freerdp/utils/wait_obj.h>
42 typedef boolean (*TransportRecv) (rdpTransport* transport, STREAM* stream, void* extra);
48 TRANSPORT_LAYER layer;
51 struct rdp_settings* settings;
52 struct rdp_credssp* credssp;
53 uint32 usleep_interval;
56 TransportRecv recv_callback;
57 struct wait_obj* recv_event;
61 STREAM* transport_recv_stream_init(rdpTransport* transport, int size);
62 STREAM* transport_send_stream_init(rdpTransport* transport, int size);
63 boolean transport_connect(rdpTransport* transport, const char* hostname, uint16 port);
64 void transport_attach(rdpTransport* transport, int sockfd);
65 boolean transport_disconnect(rdpTransport* transport);
66 boolean transport_connect_rdp(rdpTransport* transport);
67 boolean transport_connect_tls(rdpTransport* transport);
68 boolean transport_connect_nla(rdpTransport* transport);
69 boolean transport_accept_rdp(rdpTransport* transport);
70 boolean transport_accept_tls(rdpTransport* transport);
71 boolean transport_accept_nla(rdpTransport* transport);
72 int transport_read(rdpTransport* transport, STREAM* s);
73 int transport_write(rdpTransport* transport, STREAM* s);
74 void transport_get_fds(rdpTransport* transport, void** rfds, int* rcount);
75 int transport_check_fds(rdpTransport* transport);
76 boolean transport_set_blocking_mode(rdpTransport* transport, boolean blocking);
77 rdpTransport* transport_new(rdpSettings* settings);
78 void transport_free(rdpTransport* transport);