21 #ifndef FREERDP_AUTODETECT_H
22 #define FREERDP_AUTODETECT_H
24 #include <freerdp/api.h>
25 #include <freerdp/types.h>
34 FREERDP_AUTODETECT_STATE_INITIAL,
35 FREERDP_AUTODETECT_STATE_REQUEST,
36 FREERDP_AUTODETECT_STATE_RESPONSE,
37 FREERDP_AUTODETECT_STATE_COMPLETE,
38 FREERDP_AUTODETECT_STATE_FAIL
39 } FREERDP_AUTODETECT_STATE;
43 RDP_NETCHAR_RESERVED = 0x0000U,
45 RDP_NETCHAR_RESULT_TYPE_BASE_RTT_AVG_RTT = 0x0840U,
47 RDP_NETCHAR_RESULT_TYPE_BW_AVG_RTT = 0x0880U,
49 RDP_NETCHAR_RESULT_TYPE_BASE_RTT_BW_AVG_RTT = 0x08C0U
50 } RDP_NETCHAR_RESULT_TYPE;
54 RDP_BW_RESULTS_RESPONSE_TYPE_CONNECTTIME = 0x0003,
55 RDP_BW_RESULTS_RESPONSE_TYPE_CONTINUOUS = 0x000B
56 } RDP_BW_RESULTS_RESPONSE_TYPE;
61 typedef BOOL (*pRTTMeasureRequest)(rdpAutoDetect* autodetect, RDP_TRANSPORT_TYPE transport,
62 UINT16 sequenceNumber);
63 typedef BOOL (*pRTTMeasureResponse)(rdpAutoDetect* autodetect, RDP_TRANSPORT_TYPE transport,
64 UINT16 sequenceNumber);
65 typedef BOOL (*pBandwidthMeasureStart)(rdpAutoDetect* autodetect, RDP_TRANSPORT_TYPE transport,
66 UINT16 sequenceNumber);
67 typedef BOOL (*pBandwidthMeasurePayload)(rdpAutoDetect* autodetect,
68 RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber,
69 UINT16 payloadLength);
70 typedef BOOL (*pBandwidthMeasureStop)(rdpAutoDetect* autodetect, RDP_TRANSPORT_TYPE transport,
71 UINT16 sequenceNumber, UINT16 payloadLength);
72 typedef BOOL (*pBandwidthMeasureResults)(rdpAutoDetect* autodetect,
73 RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber,
74 UINT16 responseType, UINT32 timeDelta,
76 typedef BOOL (*pNetworkCharacteristicsResult)(rdpAutoDetect* autodetect,
77 RDP_TRANSPORT_TYPE transport,
78 UINT16 sequenceNumber,
79 const rdpNetworkCharacteristicsResult* result);
80 typedef BOOL (*pClientBandwidthMeasureResult)(rdpAutoDetect* autodetect,
81 RDP_TRANSPORT_TYPE transport, UINT16 responseType,
82 UINT16 sequenceNumber, UINT32 timeDelta,
84 typedef BOOL (*pNetworkCharacteristicsSync)(rdpAutoDetect* autodetect,
85 RDP_TRANSPORT_TYPE transport, UINT16 sequenceNumber,
86 UINT32 bandwidth, UINT32 rtt);
87 typedef BOOL (*pRxTxReceived)(rdpAutoDetect* autodetect, RDP_TRANSPORT_TYPE transport,
88 UINT16 requestType, UINT16 sequenceNumber);
89 typedef FREERDP_AUTODETECT_STATE (*pOnConnectTimeAutoDetect)(rdpAutoDetect* autodetect);
94 RDP_NETCHAR_RESULT_TYPE type;
106 ALIGN64 rdpContext* context;
108 ALIGN64 UINT64 rttMeasureStartTime;
110 ALIGN64 UINT64 bandwidthMeasureStartTime;
111 ALIGN64 UINT64 bandwidthMeasureTimeDelta;
112 ALIGN64 UINT32 bandwidthMeasureByteCount;
114 ALIGN64 UINT32 netCharBandwidth;
115 ALIGN64 UINT32 netCharBaseRTT;
116 ALIGN64 UINT32 netCharAverageRTT;
117 ALIGN64 BOOL bandwidthMeasureStarted;
118 ALIGN64 FREERDP_AUTODETECT_STATE state;
119 ALIGN64
void* custom;
121 UINT64 paddingA[16 - 12];
123 ALIGN64 pRTTMeasureRequest RTTMeasureRequest;
124 ALIGN64 pRTTMeasureResponse RTTMeasureResponse;
125 ALIGN64 pBandwidthMeasureStart BandwidthMeasureStart;
126 ALIGN64 pBandwidthMeasurePayload BandwidthMeasurePayload;
127 ALIGN64 pBandwidthMeasureStop BandwidthMeasureStop;
128 ALIGN64 pBandwidthMeasureResults BandwidthMeasureResults;
129 ALIGN64 pNetworkCharacteristicsResult NetworkCharacteristicsResult;
130 ALIGN64 pClientBandwidthMeasureResult ClientBandwidthMeasureResult;
131 ALIGN64 pNetworkCharacteristicsSync NetworkCharacteristicsSync;
132 ALIGN64 pRxTxReceived RequestReceived;
133 ALIGN64 pRxTxReceived ResponseReceived;
134 ALIGN64 pOnConnectTimeAutoDetect OnConnectTimeAutoDetectBegin;
135 ALIGN64 pOnConnectTimeAutoDetect OnConnectTimeAutoDetectProgress;
136 UINT64 paddingB[32 - 29];
138 FREERDP_API rdpAutoDetect* autodetect_get(rdpContext* context);