Backport of pre-connect Hyper-V code
[freerdp-ubuntu-pcb-backport.git] / libfreerdp-core / connection.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * Connection Sequence
4  *
5  * Copyright 2011 Marc-Andre Moreau <marcandre.moreau@gmail.com>
6  *
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
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  */
19
20 #ifndef __CONNECTION_H
21 #define __CONNECTION_H
22
23 #include "rdp.h"
24 #include "tpkt.h"
25 #include "tpdu.h"
26 #include "nego.h"
27 #include "mcs.h"
28 #include "activation.h"
29
30 #include <freerdp/settings.h>
31 #include <freerdp/utils/memory.h>
32
33 enum CONNECTION_STATE
34 {
35         CONNECTION_STATE_INITIAL = 0,
36         CONNECTION_STATE_NEGO,
37         CONNECTION_STATE_MCS_CONNECT,
38         CONNECTION_STATE_MCS_ERECT_DOMAIN,
39         CONNECTION_STATE_MCS_ATTACH_USER,
40         CONNECTION_STATE_MCS_CHANNEL_JOIN,
41         CONNECTION_STATE_ESTABLISH_KEYS,
42         CONNECTION_STATE_LICENSE,
43         CONNECTION_STATE_CAPABILITY,
44         CONNECTION_STATE_FINALIZATION,
45         CONNECTION_STATE_ACTIVE
46 };
47
48 boolean rdp_client_connect(rdpRdp* rdp);
49 boolean rdp_client_redirect(rdpRdp* rdp);
50 boolean rdp_client_connect_mcs_connect_response(rdpRdp* rdp, STREAM* s);
51 boolean rdp_client_connect_mcs_attach_user_confirm(rdpRdp* rdp, STREAM* s);
52 boolean rdp_client_connect_mcs_channel_join_confirm(rdpRdp* rdp, STREAM* s);
53 boolean rdp_client_connect_license(rdpRdp* rdp, STREAM* s);
54 boolean rdp_client_connect_demand_active(rdpRdp* rdp, STREAM* s);
55 boolean rdp_client_connect_finalize(rdpRdp* rdp);
56
57 boolean rdp_server_accept_nego(rdpRdp* rdp, STREAM* s);
58 boolean rdp_server_accept_mcs_connect_initial(rdpRdp* rdp, STREAM* s);
59 boolean rdp_server_accept_mcs_erect_domain_request(rdpRdp* rdp, STREAM* s);
60 boolean rdp_server_accept_mcs_attach_user_request(rdpRdp* rdp, STREAM* s);
61 boolean rdp_server_accept_mcs_channel_join_request(rdpRdp* rdp, STREAM* s);
62 boolean rdp_server_accept_client_keys(rdpRdp* rdp, STREAM* s);
63 boolean rdp_server_accept_client_info(rdpRdp* rdp, STREAM* s);
64 boolean rdp_server_accept_confirm_active(rdpRdp* rdp, STREAM* s);
65 boolean rdp_server_reactivate(rdpRdp* rdp);
66
67 #endif /* __CONNECTION_H */