| 6 |
| * Copyright Nikolai Kudashov, 2015-2018. |
| 7 | */ |
| 8 |
| 9 | #ifndef MTPROTOSCHEME_H |
| 10 | #define MTPROTOSCHEME_H |
| 11 |
| 12 | #include <vector> |
| 13 | #include <memory> |
| 14 | #include <map> |
| 15 | #include <bits/unique_ptr.h> |
| 16 | #include "TLObject.h" |
| 17 |
| 18 | class ByteArray; |
| 19 | class NativeByteBuffer; |
| 20 |
| 21 | class TLClassStore { |
| 22 |
| 23 | public: |
| 24 | static TLObject *TLdeserialize(NativeByteBuffer *stream, uint32_t bytes, uint32_t constructor, int32_t instanceNum, bool &error); |
| 25 |
| 26 | }; |
| 27 |
| 28 | class TL_api_request : public TLObject { |
| 29 |
| 30 | public: |
| 31 | NativeByteBuffer *request = nullptr; |
| 32 |
| 33 | ~TL_api_request(); |
| 34 | bool isNeedLayer(); |
| 35 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t bytes, bool &error); |
| 36 | void serializeToStream(NativeByteBuffer *stream); |
| 37 | }; |
| 38 |
| 39 | class TL_api_response : public TLObject { |
| 40 |
| 41 | public: |
| 42 | std::unique_ptr<NativeByteBuffer> response; |
| 43 |
| 44 | void readParamsEx(NativeByteBuffer *stream, uint32_t bytes, bool &error); |
| 45 | }; |
| 46 |
| 47 | class TL_future_salt : public TLObject { |
| 48 |
| 49 | public: |
| 50 | static const uint32_t constructor = 0x0949d9dc; |
| 51 |
| 52 | int32_t valid_since; |
| 53 | int32_t valid_until; |
| 54 | int64_t salt; |
| 55 |
| 56 | static TL_future_salt *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 57 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 58 | }; |
| 59 |
| 60 | class TL_msgs_state_info : public TLObject { |
| 61 |
| 62 | public: |
| 63 | static const uint32_t constructor = 0x04deb57d; |
| 64 |
| 65 | int64_t req_msg_id; |
| 66 | std::unique_ptr<ByteArray> info; |
| 67 |
| 68 | static TL_msgs_state_info *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 69 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 70 | void serializeToStream(NativeByteBuffer *stream); |
| 71 | }; |
| 72 |
| 73 | class Server_DH_Params : public TLObject { |
| 74 |
| 75 | public: |
| 76 | std::unique_ptr<ByteArray> nonce; |
| 77 | std::unique_ptr<ByteArray> server_nonce; |
| 78 | std::unique_ptr<ByteArray> new_nonce_hash; |
| 79 | std::unique_ptr<ByteArray> encrypted_answer; |
| 80 |
| 81 | static Server_DH_Params *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 82 | }; |
| 83 |
| 84 | class TL_server_DH_params_fail : public Server_DH_Params { |
| 85 |
| 86 | public: |
| 87 | static const uint32_t constructor = 0x79cb045d; |
| 88 |
| 89 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 90 | }; |
| 91 |
| 92 | class TL_server_DH_params_ok : public Server_DH_Params { |
| 93 |
| 94 | public: |
| 95 | static const uint32_t constructor = 0xd0e8075c; |
| 96 |
| 97 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 98 | }; |
| 99 |
| 100 | class TL_resPQ : public TLObject { |
| 101 |
| 102 | public: |
| 103 | static const uint32_t constructor = 0x05162463; |
| 104 |
| 105 | std::unique_ptr<ByteArray> nonce; |
| 106 | std::unique_ptr<ByteArray> server_nonce; |
| 107 | std::unique_ptr<ByteArray> pq; |
| 108 | std::vector<int64_t> server_public_key_fingerprints; |
| 109 |
| 110 | static TL_resPQ *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 111 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 112 | }; |
| 113 |
| 114 | /* |
| 115 | p_q_inner_data#83c95aec pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 = P_Q_inner_data; |
| 116 |
| 117 | p_q_inner_data_temp#3c6a84d4 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 expires_in:int = P_Q_inner_data; |
| 118 |
| 119 |
| 120 |
| 121 | */ |
| 122 |
| 123 | class TL_p_q_inner_data : public TLObject { |
| 124 |
| 125 | public: |
| 126 | static const uint32_t constructor = 0x83c95aec; |
| 127 |
| 128 | std::unique_ptr<ByteArray> pq; |
| 129 | std::unique_ptr<ByteArray> p; |
| 130 | std::unique_ptr<ByteArray> q; |
| 131 | std::unique_ptr<ByteArray> nonce; |
| 132 | std::unique_ptr<ByteArray> server_nonce; |
| 133 | std::unique_ptr<ByteArray> new_nonce; |
| 134 |
| 135 | void serializeToStream(NativeByteBuffer *stream); |
| 136 | }; |
| 137 |
| 138 | class TL_p_q_inner_data_dc : public TLObject { |
| 139 |
| 140 | public: |
| 141 | static const uint32_t constructor = 0xa9f55f95; |
| 142 |
| 143 | std::unique_ptr<ByteArray> pq; |
| 144 | std::unique_ptr<ByteArray> p; |
| 145 | std::unique_ptr<ByteArray> q; |
| 146 | std::unique_ptr<ByteArray> nonce; |
| 147 | std::unique_ptr<ByteArray> server_nonce; |
| 148 | std::unique_ptr<ByteArray> new_nonce; |
| 149 | int32_t dc; |
| 150 |
| 151 | void serializeToStream(NativeByteBuffer *stream); |
| 152 | }; |
| 153 |
| 154 | class TL_p_q_inner_data_temp : public TLObject { |
| 155 |
| 156 | public: |
| 157 | static const uint32_t constructor = 0x3c6a84d4; |
| 158 |
| 159 | std::unique_ptr<ByteArray> pq; |
| 160 | std::unique_ptr<ByteArray> p; |
| 161 | std::unique_ptr<ByteArray> q; |
| 162 | std::unique_ptr<ByteArray> nonce; |
| 163 | std::unique_ptr<ByteArray> server_nonce; |
| 164 | std::unique_ptr<ByteArray> new_nonce; |
| 165 | int32_t expires_in; |
| 166 |
| 167 | void serializeToStream(NativeByteBuffer *stream); |
| 168 | }; |
| 169 |
| 170 | class TL_p_q_inner_data_temp_dc : public TLObject { |
| 171 |
| 172 | public: |
| 173 | static const uint32_t constructor = 0x56fddf88; |
| 174 |
| 175 | std::unique_ptr<ByteArray> pq; |
| 176 | std::unique_ptr<ByteArray> p; |
| 177 | std::unique_ptr<ByteArray> q; |
| 178 | std::unique_ptr<ByteArray> nonce; |
| 179 | std::unique_ptr<ByteArray> server_nonce; |
| 180 | std::unique_ptr<ByteArray> new_nonce; |
| 181 | int32_t dc; |
| 182 | int32_t expires_in; |
| 183 |
| 184 | void serializeToStream(NativeByteBuffer *stream); |
| 185 | }; |
| 186 |
| 187 | class TL_bind_auth_key_inner : public TLObject { |
| 188 |
| 189 | public: |
| 190 | static const uint32_t constructor = 0x75a3f765; |
| 191 |
| 192 | int64_t nonce; |
| 193 | int64_t temp_auth_key_id; |
| 194 | int64_t perm_auth_key_id; |
| 195 | int64_t temp_session_id; |
| 196 | int32_t expires_at; |
| 197 |
| 198 | void serializeToStream(NativeByteBuffer *stream); |
| 199 | }; |
| 200 |
| 201 |
| 202 | class TL_auth_bindTempAuthKey : public TLObject { |
| 203 |
| 204 | public: |
| 205 | static const uint32_t constructor = 0xcdd42a05; |
| 206 |
| 207 | int64_t perm_auth_key_id; |
| 208 | int64_t nonce; |
| 209 | int32_t expires_at; |
| 210 | NativeByteBuffer *encrypted_message = nullptr; |
| 211 |
| 212 | ~TL_auth_bindTempAuthKey(); |
| 213 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 214 | void serializeToStream(NativeByteBuffer *stream); |
| 215 | }; |
| 216 |
| 217 | class TL_auth_dropTempAuthKeys : public TLObject { |
| 218 |
| 219 | public: |
| 220 | static const uint32_t constructor = 0x8e48a188; |
| 221 |
| 222 | std::vector<int64_t> except_auth_keys; |
| 223 |
| 224 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 225 | void serializeToStream(NativeByteBuffer *stream); |
| 226 | }; |
| 227 |
| 228 | class TL_pong : public TLObject { |
| 229 |
| 230 | public: |
| 231 | static const uint32_t constructor = 0x347773c5; |
| 232 |
| 233 | int64_t msg_id; |
| 234 | int64_t ping_id; |
| 235 |
| 236 | static TL_pong *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 237 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 238 | }; |
| 239 |
| 240 | class TL_future_salts : public TLObject { |
| 241 |
| 242 | public: |
| 243 | static const uint32_t constructor = 0xae500895; |
| 244 |
| 245 | int64_t req_msg_id; |
| 246 | int32_t now; |
| 247 | std::vector<std::unique_ptr<TL_future_salt>> salts; |
| 248 |
| 249 | static TL_future_salts *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 250 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 251 | }; |
| 252 |
| 253 | class RpcDropAnswer : public TLObject { |
| 254 |
| 255 | public: |
| 256 | int64_t msg_id; |
| 257 | int32_t seq_no; |
| 258 | int32_t bytes; |
| 259 |
| 260 | static RpcDropAnswer *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 261 | }; |
| 262 |
| 263 | class TL_rpc_answer_unknown : public RpcDropAnswer { |
| 264 |
| 265 | public: |
| 266 | static const uint32_t constructor = 0x5e2ad36e; |
| 267 |
| 268 | void serializeToStream(NativeByteBuffer *stream); |
| 269 | }; |
| 270 |
| 271 | class TL_rpc_answer_dropped : public RpcDropAnswer { |
| 272 |
| 273 | public: |
| 274 | static const uint32_t constructor = 0xa43ad8b7; |
| 275 |
| 276 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 277 | }; |
| 278 |
| 279 | class TL_rpc_answer_dropped_running : public RpcDropAnswer { |
| 280 |
| 281 | public: |
| 282 | static const uint32_t constructor = 0xcd78e586; |
| 283 |
| 284 | void serializeToStream(NativeByteBuffer *stream); |
| 285 | }; |
| 286 |
| 287 | class Set_client_DH_params_answer : public TLObject { |
| 288 |
| 289 | public: |
| 290 | std::unique_ptr<ByteArray> nonce; |
| 291 | std::unique_ptr<ByteArray> server_nonce; |
| 292 | std::unique_ptr<ByteArray> new_nonce_hash2; |
| 293 | std::unique_ptr<ByteArray> new_nonce_hash3; |
| 294 | std::unique_ptr<ByteArray> new_nonce_hash1; |
| 295 |
| 296 | static Set_client_DH_params_answer *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 297 | }; |
| 298 |
| 299 | class TL_message : public TLObject { |
| 300 |
| 301 | public: |
| 302 | static const uint32_t constructor = 0x5bb8e511; |
| 303 |
| 304 | int64_t msg_id; |
| 305 | int32_t seqno; |
| 306 | int32_t bytes; |
| 307 | std::unique_ptr<TLObject> body; |
| 308 | TLObject *outgoingBody = nullptr; |
| 309 | std::unique_ptr<NativeByteBuffer> unparsedBody; |
| 310 |
| 311 | static TL_message *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 312 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 313 | void serializeToStream(NativeByteBuffer *stream); |
| 314 | }; |
| 315 |
| 316 | class TL_dh_gen_retry : public Set_client_DH_params_answer { |
| 317 |
| 318 | public: |
| 319 | static const uint32_t constructor = 0x46dc1fb9; |
| 320 |
| 321 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 322 | }; |
| 323 |
| 324 | class TL_dh_gen_fail : public Set_client_DH_params_answer { |
| 325 |
| 326 | public: |
| 327 | static const uint32_t constructor = 0xa69dae02; |
| 328 |
| 329 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 330 | }; |
| 331 |
| 332 | class TL_dh_gen_ok : public Set_client_DH_params_answer { |
| 333 |
| 334 | public: |
| 335 | static const uint32_t constructor = 0x3bcbf734; |
| 336 |
| 337 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 338 | }; |
| 339 |
| 340 | class BadMsgNotification : public TLObject { |
| 341 |
| 342 | public: |
| 343 | int64_t bad_msg_id; |
| 344 | int32_t bad_msg_seqno; |
| 345 | int32_t error_code; |
| 346 | int64_t new_server_salt; |
| 347 |
| 348 | static BadMsgNotification *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 349 | }; |
| 350 |
| 351 | class TL_bad_msg_notification : public BadMsgNotification { |
| 352 |
| 353 | public: |
| 354 | static const uint32_t constructor = 0xa7eff811; |
| 355 |
| 356 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 357 | }; |
| 358 |
| 359 | class TL_bad_server_salt : public BadMsgNotification { |
| 360 |
| 361 | public: |
| 362 | static const uint32_t constructor = 0xedab447b; |
| 363 |
| 364 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 365 | }; |
| 366 |
| 367 | class TL_msgs_state_req : public TLObject { |
| 368 |
| 369 | public: |
| 370 | static const uint32_t constructor = 0xda69fb52; |
| 371 |
| 372 | std::vector<int64_t> msg_ids; |
| 373 |
| 374 | static TL_msgs_state_req *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 375 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 376 | void serializeToStream(NativeByteBuffer *stream); |
| 377 | }; |
| 378 |
| 379 | class MsgDetailedInfo : public TLObject { |
| 380 |
| 381 | public: |
| 382 | int64_t answer_msg_id; |
| 383 | int32_t bytes; |
| 384 | int32_t status; |
| 385 | int64_t msg_id; |
| 386 |
| 387 | static MsgDetailedInfo *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 388 | }; |
| 389 |
| 390 | class TL_msg_new_detailed_info : public MsgDetailedInfo { |
| 391 |
| 392 | public: |
| 393 | static const uint32_t constructor = 0x809db6df; |
| 394 |
| 395 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 396 | }; |
| 397 |
| 398 | class TL_msg_detailed_info : public MsgDetailedInfo { |
| 399 |
| 400 | public: |
| 401 | static const uint32_t constructor = 0x276d3ec6; |
| 402 |
| 403 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 404 | }; |
| 405 |
| 406 | class TL_msg_copy : public TLObject { |
| 407 |
| 408 | public: |
| 409 | static const uint32_t constructor = 0xe06046b2; |
| 410 |
| 411 | std::unique_ptr<TL_message> orig_message; |
| 412 |
| 413 | static TL_msg_copy *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 414 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 415 | void serializeToStream(NativeByteBuffer *stream); |
| 416 | }; |
| 417 |
| 418 | class TL_msgs_all_info : public TLObject { |
| 419 |
| 420 | public: |
| 421 | static const uint32_t constructor = 0x8cc0d131; |
| 422 |
| 423 | std::vector<int64_t> msg_ids; |
| 424 | std::unique_ptr<ByteArray> info; |
| 425 |
| 426 | static TL_msgs_all_info *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 427 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 428 | }; |
| 429 |
| 430 | class TL_rpc_result : public TLObject { |
| 431 |
| 432 | public: |
| 433 | static const uint32_t constructor = 0xf35c6d01; |
| 434 |
| 435 | int64_t req_msg_id; |
| 436 | std::unique_ptr<TLObject> result; |
| 437 |
| 438 | void readParamsEx(NativeByteBuffer *stream, uint32_t bytes, int32_t instanceNum, bool &error); |
| 439 | }; |
| 440 |
| 441 | class TL_new_session_created : public TLObject { |
| 442 |
| 443 | public: |
| 444 | static const uint32_t constructor = 0x9ec20908; |
| 445 |
| 446 | int64_t first_msg_id; |
| 447 | int64_t unique_id; |
| 448 | int64_t server_salt; |
| 449 |
| 450 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 451 | }; |
| 452 |
| 453 | class DestroySessionRes : public TLObject { |
| 454 |
| 455 | public: |
| 456 | int64_t session_id; |
| 457 |
| 458 | static DestroySessionRes *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 459 | }; |
| 460 |
| 461 | class TL_destroy_session_ok : public DestroySessionRes { |
| 462 |
| 463 | public: |
| 464 | static const uint32_t constructor = 0xe22045fc; |
| 465 |
| 466 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 467 | }; |
| 468 |
| 469 | class TL_destroy_session_none : public DestroySessionRes { |
| 470 |
| 471 | public: |
| 472 | static const uint32_t constructor = 0x62d350c9; |
| 473 |
| 474 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 475 | }; |
| 476 |
| 477 | class TL_msgs_ack : public TLObject { |
| 478 |
| 479 | public: |
| 480 | static const uint32_t constructor = 0x62d6b459; |
| 481 |
| 482 | std::vector<int64_t> msg_ids; |
| 483 |
| 484 | static TL_msgs_ack *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 485 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 486 | void serializeToStream(NativeByteBuffer *stream); |
| 487 | }; |
| 488 |
| 489 | class TL_msg_container : public TLObject { |
| 490 |
| 491 | public: |
| 492 | static const uint32_t constructor = 0x73f1f8dc; |
| 493 |
| 494 | std::vector<std::unique_ptr<TL_message>> messages; |
| 495 |
| 496 | static TL_msg_container *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 497 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 498 | void serializeToStream(NativeByteBuffer *stream); |
| 499 | }; |
| 500 |
| 501 | class TL_msg_resend_req : public TLObject { |
| 502 |
| 503 | public: |
| 504 | static const uint32_t constructor = 0x7d861a08; |
| 505 |
| 506 | std::vector<int64_t> msg_ids; |
| 507 |
| 508 | static TL_msg_resend_req *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 509 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 510 | void serializeToStream(NativeByteBuffer *stream); |
| 511 | }; |
| 512 |
| 513 | class MsgsStateInfo : public TLObject { |
| 514 |
| 515 | public: |
| 516 | static const uint32_t constructor = 0x04deb57d; |
| 517 |
| 518 | int64_t req_msg_id; |
| 519 | std::string info; |
| 520 |
| 521 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 522 | }; |
| 523 |
| 524 | class RpcError : public TLObject { |
| 525 |
| 526 | public: |
| 527 | int32_t error_code; |
| 528 | std::string error_message; |
| 529 | int64_t query_id; |
| 530 | }; |
| 531 |
| 532 | class TL_rpc_error : public RpcError { |
| 533 |
| 534 | public: |
| 535 | static const uint32_t constructor = 0x2144ca19; |
| 536 |
| 537 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 538 | }; |
| 539 |
| 540 | class TL_rpc_req_error : public RpcError { |
| 541 |
| 542 | public: |
| 543 | static const uint32_t constructor = 0x7ae432f5; |
| 544 |
| 545 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 546 | }; |
| 547 |
| 548 | class TL_client_DH_inner_data : public TLObject { |
| 549 |
| 550 | public: |
| 551 | static const uint32_t constructor = 0x6643b654; |
| 552 |
| 553 | std::unique_ptr<ByteArray> nonce; |
| 554 | std::unique_ptr<ByteArray> server_nonce; |
| 555 | int64_t retry_id; |
| 556 | std::unique_ptr<ByteArray> g_b; |
| 557 |
| 558 | void serializeToStream(NativeByteBuffer *stream); |
| 559 | }; |
| 560 |
| 561 | class TL_server_DH_inner_data : public TLObject { |
| 562 |
| 563 | public: |
| 564 | static const uint32_t constructor = 0xb5890dba; |
| 565 |
| 566 | std::unique_ptr<ByteArray> nonce; |
| 567 | std::unique_ptr<ByteArray> server_nonce; |
| 568 | uint32_t g; |
| 569 | std::unique_ptr<ByteArray> dh_prime; |
| 570 | std::unique_ptr<ByteArray> g_a; |
| 571 | int32_t server_time; |
| 572 |
| 573 | static TL_server_DH_inner_data *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 574 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 575 | void serializeToStream(NativeByteBuffer *stream); |
| 576 | }; |
| 577 |
| 578 | class TL_req_pq : public TLObject { |
| 579 |
| 580 | public: |
| 581 | static const uint32_t constructor = 0x60469778; |
| 582 |
| 583 | std::unique_ptr<ByteArray> nonce; |
| 584 |
| 585 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 586 | void serializeToStream(NativeByteBuffer *stream); |
| 587 | }; |
| 588 |
| 589 | class TL_req_pq_multi : public TLObject { |
| 590 |
| 591 | public: |
| 592 | static const uint32_t constructor = 0xbe7e8ef1; |
| 593 |
| 594 | std::unique_ptr<ByteArray> nonce; |
| 595 |
| 596 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 597 | void serializeToStream(NativeByteBuffer *stream); |
| 598 | }; |
| 599 |
| 600 | class TL_req_DH_params : public TLObject { |
| 601 |
| 602 | public: |
| 603 | static const uint32_t constructor = 0xd712e4be; |
| 604 |
| 605 | std::unique_ptr<ByteArray> nonce; |
| 606 | std::unique_ptr<ByteArray> server_nonce; |
| 607 | std::unique_ptr<ByteArray> p; |
| 608 | std::unique_ptr<ByteArray> q; |
| 609 | int64_t public_key_fingerprint; |
| 610 | std::unique_ptr<ByteArray> encrypted_data; |
| 611 |
| 612 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 613 | void serializeToStream(NativeByteBuffer *stream); |
| 614 | }; |
| 615 |
| 616 | class TL_set_client_DH_params : public TLObject { |
| 617 |
| 618 | public: |
| 619 | static const uint32_t constructor = 0xf5045f1f; |
| 620 |
| 621 | std::unique_ptr<ByteArray> nonce; |
| 622 | std::unique_ptr<ByteArray> server_nonce; |
| 623 | std::unique_ptr<ByteArray> encrypted_data; |
| 624 |
| 625 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 626 | void serializeToStream(NativeByteBuffer *stream); |
| 627 | }; |
| 628 |
| 629 | class TL_rpc_drop_answer : public TLObject { |
| 630 |
| 631 | public: |
| 632 | static const uint32_t constructor = 0x58e4a740; |
| 633 |
| 634 | int64_t req_msg_id; |
| 635 |
| 636 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 637 | void serializeToStream(NativeByteBuffer *stream); |
| 638 | }; |
| 639 |
| 640 | class TL_get_future_salts : public TLObject { |
| 641 |
| 642 | public: |
| 643 | static const uint32_t constructor = 0xb921bd04; |
| 644 |
| 645 | int32_t num; |
| 646 |
| 647 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 648 | void serializeToStream(NativeByteBuffer *stream); |
| 649 | }; |
| 650 |
| 651 | class TL_ping : public TLObject { |
| 652 |
| 653 | public: |
| 654 | static const uint32_t constructor = 0x7abe77ec; |
| 655 |
| 656 | int64_t ping_id; |
| 657 |
| 658 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 659 | void serializeToStream(NativeByteBuffer *stream); |
| 660 | }; |
| 661 |
| 662 | class TL_ping_delay_disconnect : public TLObject { |
| 663 |
| 664 | public: |
| 665 | static const uint32_t constructor = 0xf3427b8c; |
| 666 |
| 667 | int64_t ping_id; |
| 668 | int32_t disconnect_delay; |
| 669 |
| 670 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 671 | void serializeToStream(NativeByteBuffer *stream); |
| 672 | }; |
| 673 |
| 674 | class TL_destroy_session : public TLObject { |
| 675 |
| 676 | public: |
| 677 | static const uint32_t constructor = 0xe7512126; |
| 678 |
| 679 | int64_t session_id; |
| 680 |
| 681 | TLObject *deserializeResponse(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 682 | void serializeToStream(NativeByteBuffer *stream); |
| 683 | }; |
| 684 |
| 685 | class TL_gzip_packed : public TLObject { |
| 686 |
| 687 | public: |
| 688 | static const uint32_t constructor = 0x3072cfa1; |
| 689 |
| 690 | NativeByteBuffer *packed_data_to_send = nullptr; |
| 691 | std::unique_ptr<NativeByteBuffer> packed_data; |
| 692 | std::unique_ptr<TLObject> originalRequest; |
| 693 |
| 694 | ~TL_gzip_packed(); |
| 695 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 696 | void serializeToStream(NativeByteBuffer *stream); |
| 697 | }; |
| 698 |
| 699 | class TL_error : public TLObject { |
| 700 |
| 701 | public: |
| 702 | static const uint32_t constructor = 0xc4b9f9bb; |
| 703 |
| 704 | int32_t code; |
| 705 | std::string text; |
| 706 |
| 707 | static TL_error *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 708 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 709 | void serializeToStream(NativeByteBuffer *stream); |
| 710 | }; |
| 711 |
| 712 | class TL_invokeAfterMsg : public TLObject { |
| 713 |
| 714 | public: |
| 715 | static const uint32_t constructor = 0xcb9f372d; |
| 716 |
| 717 | int64_t msg_id; |
| 718 | TLObject *outgoingQuery = nullptr; |
| 719 | std::unique_ptr<TLObject> query; |
| 720 |
| 721 | void serializeToStream(NativeByteBuffer *stream); |
| 722 | }; |
| 723 |
| 724 | class invokeWithLayer : public TLObject { |
| 725 |
| 726 | public: |
| 727 | static const uint32_t constructor = 0xda9b0d0d; |
| 728 |
| 729 | int32_t layer; |
| 730 | std::unique_ptr<TLObject> query; |
| 731 |
| 732 | void serializeToStream(NativeByteBuffer *stream); |
| 733 | }; |
| 734 |
| 735 | class TL_inputClientProxy : public TLObject { |
| 736 |
| 737 | public: |
| 738 | static const uint32_t constructor = 0x75588b3f; |
| 739 |
| 740 | std::string address; |
| 741 | int32_t port; |
| 742 |
| 743 | void serializeToStream(NativeByteBuffer *stream); |
| 744 | }; |
| 745 |
| 746 | class initConnection : public TLObject { |
| 747 |
| 748 | public: |
| 749 | static const uint32_t constructor = 0x785188b8; |
| 750 |
| 751 | int32_t flags; |
| 752 | int32_t api_id; |
| 753 | std::string device_model; |
| 754 | std::string system_version; |
| 755 | std::string app_version; |
| 756 | std::string system_lang_code; |
| 757 | std::string lang_pack; |
| 758 | std::string lang_code; |
| 759 | std::unique_ptr<TL_inputClientProxy> proxy; |
| 760 | std::unique_ptr<TLObject> query; |
| 761 |
| 762 | void serializeToStream(NativeByteBuffer *stream); |
| 763 | }; |
| 764 |
| 765 | class IpPort : public TLObject { |
| 766 |
| 767 | public: |
| 768 | static IpPort *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 769 | }; |
| 770 |
| 771 | class TL_ipPort : public IpPort { |
| 772 |
| 773 | public: |
| 774 | static const int32_t constructor = 0xd433ad73; |
| 775 |
| 776 | std::string ipv4; |
| 777 | uint32_t port; |
| 778 |
| 779 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 780 | }; |
| 781 |
| 782 | class TL_ipPortSecret : public IpPort { |
| 783 |
| 784 | public: |
| 785 | static const int32_t constructor = 0x37982646; |
| 786 |
| 787 | std::string ipv4; |
| 788 | uint32_t port; |
| 789 | std::unique_ptr<ByteArray> secret; |
| 790 |
| 791 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 792 | }; |
| 793 |
| 794 | class TL_accessPointRule : public TLObject { |
| 795 |
| 796 | public: |
| 797 | static const int32_t constructor = 0x4679b65f; |
| 798 |
| 799 | std::string phone_prefix_rules; |
| 800 | uint32_t dc_id; |
| 801 | std::vector<std::unique_ptr<IpPort>> ips; |
| 802 |
| 803 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 804 | }; |
| 805 |
| 806 | class TL_help_configSimple : public TLObject { |
| 807 |
| 808 | public: |
| 809 | static const uint32_t constructor = 0x5a592a6c; |
| 810 |
| 811 | int32_t date; |
| 812 | int32_t expires; |
| 813 | std::vector<std::unique_ptr<TL_accessPointRule>> rules; |
| 814 |
| 815 | static TL_help_configSimple *TLdeserialize(NativeByteBuffer *stream, uint32_t constructor, int32_t instanceNum, bool &error); |
| 816 | void readParams(NativeByteBuffer *stream, int32_t instanceNum, bool &error); |
| 817 | }; |
| 818 |
| 819 | #endif |
| 820 |