Add PacketInfo.h.

GitOrigin-RevId: 76db525e427aaa8afc0f64473743dffaffdd89be
This commit is contained in:
levlam 2019-01-31 05:23:40 +03:00
parent b9fc33b7d1
commit 534eab1912
9 changed files with 41 additions and 19 deletions

View File

@ -447,6 +447,7 @@ set(TDLIB_SOURCE
td/mtproto/HttpTransport.h
td/mtproto/IStreamTransport.h
td/mtproto/NoCryptoStorer.h
td/mtproto/PacketInfo.h
td/mtproto/PacketStorer.h
td/mtproto/PingConnection.h
td/mtproto/RawConnection.h

View File

@ -9,6 +9,7 @@
#include "td/mtproto/AuthKey.h"
#include "td/mtproto/Handshake.h"
#include "td/mtproto/NoCryptoStorer.h"
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/PacketStorer.h"
#include "td/mtproto/RawConnection.h"
#include "td/mtproto/Transport.h"

33
td/mtproto/PacketInfo.h Normal file
View File

@ -0,0 +1,33 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2019
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/utils/common.h"
#include "td/utils/UInt.h"
namespace td {
namespace mtproto {
struct PacketInfo {
enum { Common, EndToEnd } type = Common;
uint64 auth_key_id;
uint32 message_ack;
UInt128 message_key;
uint64 salt;
uint64 session_id;
uint64 message_id;
int32 seq_no;
int32 version{1};
bool no_crypto_flag;
bool is_creator{false};
bool check_mod4{true};
};
} // namespace mtproto
} // namespace td

View File

@ -8,6 +8,7 @@
#include "td/mtproto/AuthKey.h"
#include "td/mtproto/NoCryptoStorer.h"
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/PacketStorer.h"
#include "td/mtproto/RawConnection.h"
#include "td/mtproto/utils.h"

View File

@ -7,6 +7,7 @@
#pragma once
#include "td/mtproto/IStreamTransport.h"
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/TransportType.h"
#include "td/utils/buffer.h"
@ -24,7 +25,6 @@ namespace td {
class Storer;
namespace mtproto {
class AuthKey;
struct PacketInfo;
} // namespace mtproto
} // namespace td

View File

@ -7,6 +7,7 @@
#pragma once
#include "td/mtproto/RawConnection.h"
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/utils.h"
#include "td/utils/buffer.h"
@ -45,7 +46,6 @@ class destroy_auth_key_none;
namespace mtproto {
class AuthData;
struct PacketInfo;
struct MsgInfo {
uint64 session_id;

View File

@ -6,6 +6,7 @@
//
#pragma once
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/utils.h"
#include "td/utils/common.h"
@ -122,23 +123,6 @@ struct NoCryptoHeader {
#endif
#pragma pack(pop)
struct PacketInfo {
enum { Common, EndToEnd } type = Common;
uint64 auth_key_id;
uint32 message_ack;
UInt128 message_key;
uint64 salt;
uint64 session_id;
uint64 message_id;
int32 seq_no;
int32 version{1};
bool no_crypto_flag;
bool is_creator{false};
bool check_mod4{true};
};
class Transport {
public:
class ReadResult {

View File

@ -17,6 +17,7 @@
#include "td/telegram/TdDb.h"
#include "td/mtproto/AuthKey.h"
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/Transport.h"
#include "td/utils/as.h"

View File

@ -13,6 +13,7 @@
#include "td/telegram/secret_api.hpp"
#include "td/telegram/telegram_api.hpp"
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/PacketStorer.h"
#include "td/mtproto/Transport.h"
#include "td/mtproto/utils.h"