22 #ifndef FREERDP_LIB_CORE_GATEWAY_TSG_H
23 #define FREERDP_LIB_CORE_GATEWAY_TSG_H
25 typedef struct rdp_tsg rdpTsg;
29 #include "../transport.h"
31 #include <winpr/rpc.h>
32 #include <winpr/winpr.h>
33 #include <winpr/wtypes.h>
35 #include <freerdp/types.h>
36 #include <freerdp/api.h>
43 TSG_STATE_CHANNEL_CREATED,
44 TSG_STATE_PIPE_CREATED,
45 TSG_STATE_TUNNEL_CLOSE_PENDING,
46 TSG_STATE_CHANNEL_CLOSE_PENDING,
50 #define TsProxyCreateTunnelOpnum 1
51 #define TsProxyAuthorizeTunnelOpnum 2
52 #define TsProxyMakeTunnelCallOpnum 3
53 #define TsProxyCreateChannelOpnum 4
54 #define TsProxyUnused5Opnum 5
55 #define TsProxyCloseChannelOpnum 6
56 #define TsProxyCloseTunnelOpnum 7
57 #define TsProxySetupReceivePipeOpnum 8
58 #define TsProxySendToServerOpnum 9
60 #define MAX_RESOURCE_NAMES 50
62 #define TS_GATEWAY_TRANSPORT 0x5452
64 #define TSG_ASYNC_MESSAGE_CONSENT_MESSAGE 0x00000001
65 #define TSG_ASYNC_MESSAGE_SERVICE_MESSAGE 0x00000002
66 #define TSG_ASYNC_MESSAGE_REAUTH 0x00000003
68 #define TSG_TUNNEL_CALL_ASYNC_MSG_REQUEST 0x00000001
69 #define TSG_TUNNEL_CANCEL_ASYNC_MSG_REQUEST 0x00000002
71 #define TSG_NAP_CAPABILITY_QUAR_SOH 0x00000001
72 #define TSG_NAP_CAPABILITY_IDLE_TIMEOUT 0x00000002
73 #define TSG_MESSAGING_CAP_CONSENT_SIGN 0x00000004
74 #define TSG_MESSAGING_CAP_SERVICE_MSG 0x00000008
75 #define TSG_MESSAGING_CAP_REAUTH 0x00000010
76 #define TSG_MESSAGING_MAX_MESSAGE_LENGTH 65536
80 #define E_PROXY_INTERNALERROR 0x800759D8
81 #define E_PROXY_RAP_ACCESSDENIED 0x800759DA
82 #define E_PROXY_NAP_ACCESSDENIED 0x800759DB
83 #define E_PROXY_TS_CONNECTFAILED 0x800759DD
84 #define E_PROXY_ALREADYDISCONNECTED 0x800759DF
85 #define E_PROXY_QUARANTINE_ACCESSDENIED 0x800759ED
86 #define E_PROXY_NOCERTAVAILABLE 0x800759EE
87 #define E_PROXY_COOKIE_BADPACKET 0x800759F7
88 #define E_PROXY_COOKIE_AUTHENTICATION_ACCESS_DENIED 0x800759F8
89 #define E_PROXY_UNSUPPORTED_AUTHENTICATION_METHOD 0x800759F9
90 #define E_PROXY_CAPABILITYMISMATCH 0x800759E9
92 #define E_PROXY_NOTSUPPORTED 0x000059E8
93 #define E_PROXY_MAXCONNECTIONSREACHED 0x000059E6
94 #define E_PROXY_SESSIONTIMEOUT 0x000059F6
95 #define E_PROXY_REAUTH_AUTHN_FAILED 0x000059FA
96 #define E_PROXY_REAUTH_CAP_FAILED 0x000059FB
97 #define E_PROXY_REAUTH_RAP_FAILED 0x000059FC
98 #define E_PROXY_SDR_NOT_SUPPORTED_BY_TS 0x000059FD
99 #define E_PROXY_REAUTH_NAP_FAILED 0x00005A00
100 #define E_PROXY_CONNECTIONABORTED 0x000004D4
102 FREERDP_LOCAL
void tsg_free(rdpTsg* tsg);
104 WINPR_ATTR_MALLOC(tsg_free, 1)
105 FREERDP_LOCAL rdpTsg* tsg_new(rdpTransport* transport);
107 FREERDP_LOCAL BOOL tsg_proxy_begin(rdpTsg* tsg);
109 FREERDP_LOCAL BOOL tsg_connect(rdpTsg* tsg, const
char* hostname, UINT16 port, DWORD timeout);
110 FREERDP_LOCAL BOOL tsg_disconnect(rdpTsg* tsg);
112 FREERDP_LOCAL BOOL tsg_recv_pdu(rdpTsg* tsg, const
RPC_PDU* pdu);
114 FREERDP_LOCAL BOOL tsg_check_event_handles(rdpTsg* tsg);
115 FREERDP_LOCAL DWORD tsg_get_event_handles(rdpTsg* tsg, HANDLE* events, DWORD count);
117 FREERDP_LOCAL TSG_STATE tsg_get_state(rdpTsg* tsg);
118 FREERDP_LOCAL BOOL tsg_set_state(rdpTsg* tsg, TSG_STATE state);
120 FREERDP_LOCAL BIO* tsg_get_bio(rdpTsg* tsg);