Backport of pre-connect Hyper-V code
[freerdp-ubuntu-pcb-backport.git] / libfreerdp-core / nego.h
index 800b3b4..cf30c94 100644 (file)
@@ -68,24 +68,40 @@ enum RDP_NEG_MSG
 
 #define EXTENDED_CLIENT_DATA_SUPPORTED 0x01
 
+#define PRECONNECTION_PDU_V1_SIZE                              16
+#define PRECONNECTION_PDU_V2_MIN_SIZE          (PRECONNECTION_PDU_V1_SIZE+2)
+
+#define PRECONNECTION_PDU_V1                                           1
+#define PRECONNECTION_PDU_V2                                           2
+
 struct rdp_nego
 {
        int port;
        uint32 flags;
        char* hostname;
        char* cookie;
-       NEGO_STATE state;
-       int tcp_connected;
        rdpBlob* routing_token;
+       boolean send_preconnection_pdu;
+       uint32 preconnection_id;
+       char* preconnection_blob;
+
+       NEGO_STATE state;
+       boolean tcp_connected;
+       boolean security_connected;
+
        uint32 selected_protocol;
        uint32 requested_protocols;
+       boolean security_layer_negotiation_enabled;
        uint8 enabled_protocols[3];
+
        rdpTransport* transport;
 };
 typedef struct rdp_nego rdpNego;
 
 boolean nego_connect(rdpNego* nego);
 
+boolean nego_send_preconnection_pdu(rdpNego* nego);
+
 void nego_attempt_nla(rdpNego* nego);
 void nego_attempt_tls(rdpNego* nego);
 void nego_attempt_rdp(rdpNego* nego);
@@ -105,11 +121,15 @@ rdpNego* nego_new(struct rdp_transport * transport);
 void nego_free(rdpNego* nego);
 void nego_init(rdpNego* nego);
 void nego_set_target(rdpNego* nego, char* hostname, int port);
+void nego_set_negotiation_enabled(rdpNego* nego, boolean security_layer_negotiation_enabled);
 void nego_enable_rdp(rdpNego* nego, boolean enable_rdp);
 void nego_enable_nla(rdpNego* nego, boolean enable_nla);
 void nego_enable_tls(rdpNego* nego, boolean enable_tls);
 void nego_set_routing_token(rdpNego* nego, rdpBlob* routing_token);
 void nego_set_cookie(rdpNego* nego, char* cookie);
+void nego_set_send_preconnection_pdu(rdpNego* nego, boolean send_pcpdu);
+void nego_set_preconnection_id(rdpNego* nego, uint32 id);
+void nego_set_preconnection_blob(rdpNego* nego, char* blob);
 
 #ifdef WITH_DEBUG_NEGO
 #define DEBUG_NEGO(fmt, ...) DEBUG_CLASS(NEGO, fmt, ## __VA_ARGS__)