CatapultServer  v0.5.0.1 (Elephant)
ChainPackets.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "catapult/ionet/Packet.h"
23 #include "catapult/types.h"
24 
25 namespace catapult { namespace api {
26 
27 #pragma pack(push, 1)
28 
30  struct ChainInfoResponse : public ionet::Packet {
31  static constexpr ionet::PacketType Packet_Type = ionet::PacketType::Chain_Info;
32 
35 
37  uint64_t ScoreHigh;
38 
40  uint64_t ScoreLow;
41  };
42 
44  template<ionet::PacketType PacketType>
45  struct HeightPacket : public ionet::Packet {
47 
50  };
51 
54 
56  struct BlockHashesRequest : public HeightPacket<ionet::PacketType::Block_Hashes> {
58  uint32_t NumHashes;
59  };
60 
62  struct PullBlocksRequest : public HeightPacket<ionet::PacketType::Pull_Blocks> {
64  uint32_t NumBlocks;
65 
67  uint32_t NumResponseBytes;
68  };
69 
70 #pragma pack(pop)
71 }}
catapult::api::ChainInfoResponse::Packet_Type
static constexpr ionet::PacketType Packet_Type
Definition: ChainPackets.h:31
catapult::api::HeightPacket::Packet_Type
static constexpr ionet::PacketType Packet_Type
Definition: ChainPackets.h:46
catapult::ionet::Packet
A packet header with a data payload.
Definition: Packet.h:32
catapult::api::ChainInfoResponse::ScoreLow
uint64_t ScoreLow
Low part of the score.
Definition: ChainPackets.h:40
catapult::api::BlockHashesRequest::NumHashes
uint32_t NumHashes
Requested number of hashes.
Definition: ChainPackets.h:58
Packet.h
catapult::utils::BaseValue< uint64_t, Height_tag >
catapult::ionet::PacketType
PacketType
An enumeration of known packet types.
Definition: PacketType.h:171
catapult::api::HeightPacket::Height
catapult::Height Height
Requested block height.
Definition: ChainPackets.h:49
catapult::api::BlockHashesRequest
A block hashes request.
Definition: ChainPackets.h:56
catapult::api::PullBlocksRequest::NumBlocks
uint32_t NumBlocks
Requested number of blocks.
Definition: ChainPackets.h:64
catapult::api::ChainInfoResponse
A chain info response.
Definition: ChainPackets.h:30
catapult::api::ChainInfoResponse::Height
catapult::Height Height
Chain height.
Definition: ChainPackets.h:34
types.h
catapult::api::PullBlocksRequest::NumResponseBytes
uint32_t NumResponseBytes
Requested response size (in bytes).
Definition: ChainPackets.h:67
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::api::ChainInfoResponse::ScoreHigh
uint64_t ScoreHigh
High part of the score.
Definition: ChainPackets.h:37
catapult::api::HeightPacket
A packet containing header information and a height.
Definition: ChainPackets.h:45
catapult::api::PullBlocksRequest
A pull blocks request.
Definition: ChainPackets.h:62