Initial commit - from Precise source
[freerdp-ubuntu-pcb-backport.git] / libfreerdp-core / redirection.h
1 /**
2  * FreeRDP: A Remote Desktop Protocol Client
3  * RDP Server Redirection
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 __REDIRECTION_H
21 #define __REDIRECTION_H
22
23 #include "rdp.h"
24
25 #include <freerdp/freerdp.h>
26 #include <freerdp/utils/blob.h>
27 #include <freerdp/utils/debug.h>
28 #include <freerdp/utils/stream.h>
29 #include <freerdp/utils/string.h>
30
31 /* Redirection Flags */
32 #define LB_TARGET_NET_ADDRESS           0x00000001
33 #define LB_LOAD_BALANCE_INFO            0x00000002
34 #define LB_USERNAME                     0x00000004
35 #define LB_DOMAIN                       0x00000008
36 #define LB_PASSWORD                     0x00000010
37 #define LB_DONTSTOREUSERNAME            0x00000020
38 #define LB_SMARTCARD_LOGON              0x00000040
39 #define LB_NOREDIRECT                   0x00000080
40 #define LB_TARGET_FQDN                  0x00000100
41 #define LB_TARGET_NETBIOS_NAME          0x00000200
42 #define LB_TARGET_NET_ADDRESSES         0x00000800
43 #define LB_CLIENT_TSV_URL               0x00001000
44 #define LB_SERVER_TSV_CAPABLE           0x00002000
45
46 struct rdp_redirection
47 {
48         uint32 flags;
49         uint32 sessionID;
50         rdpString tsvUrl;
51         rdpString username;
52         rdpString domain;
53         rdpBlob password_cookie;
54         rdpString targetFQDN;
55         rdpBlob loadBalanceInfo;
56         rdpString targetNetBiosName;
57         rdpString targetNetAddress;
58         uint32 targetNetAddressesCount;
59         rdpString* targetNetAddresses;
60 };
61 typedef struct rdp_redirection rdpRedirection;
62
63 boolean rdp_recv_redirection_packet(rdpRdp* rdp, STREAM* s);
64 boolean rdp_recv_enhanced_security_redirection_packet(rdpRdp* rdp, STREAM* s);
65
66 rdpRedirection* redirection_new();
67 void redirection_free(rdpRedirection* redirection);
68
69 #ifdef WITH_DEBUG_REDIR
70 #define DEBUG_REDIR(fmt, ...) DEBUG_CLASS(REDIR, fmt, ## __VA_ARGS__)
71 #else
72 #define DEBUG_REDIR(fmt, ...) DEBUG_NULL(fmt, ## __VA_ARGS__)
73 #endif
74
75 #endif /* __REDIRECTION_H */