Fabcoin Core  0.16.2
P2P Digital Currency
RLPXFrameReader.h
Go to the documentation of this file.
1 /*
2  This file is part of cpp-ethereum.
3 
4  cpp-ethereum is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  cpp-ethereum is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with cpp-ethereum. If not, see <http://www.gnu.org/licenses/>.
16  */
23 #pragma once
24 
25 #include <libdevcore/Guards.h>
26 #include "RLPXFrameCoder.h"
27 #include "RLPXPacket.h"
28 namespace ba = boost::asio;
29 namespace bi = boost::asio::ip;
30 
31 namespace dev
32 {
33 namespace p2p
34 {
35 
42 {
43 public:
44  RLPXFrameReader(uint16_t _protocolType): m_protocolType(_protocolType) {}
45 
47  std::vector<RLPXPacket> demux(RLPXFrameCoder& _coder, RLPXFrameInfo const& _info, bytesRef _frame);
48 
49 protected:
50  uint16_t m_protocolType;
51  std::map<uint16_t, std::pair<RLPXPacket, uint32_t>> m_incomplete;
52 };
53 
54 }
55 }
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
Definition: Arith256.cpp:15
A modifiable reference to an existing object or vector in memory.
Definition: vector_ref.h:20
RLPXFrameReader(uint16_t _protocolType)
std::vector< RLPXPacket > demux(RLPXFrameCoder &_coder, RLPXFrameInfo const &_info, bytesRef _frame)
Processes a single frame returning complete packets.
Encapsulation of Frame.
std::map< uint16_t, std::pair< RLPXPacket, uint32_t > > m_incomplete
Sequence: Incomplete packet and bytes remaining.
RLPFrameReader Reads and assembles RLPX frame byte buffers into RLPX packets.
Encoder/decoder transport for RLPx connection established by RLPXHandshake.