aboutsummaryrefslogtreecommitdiff
path: root/src/net.h
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-11-10 17:05:23 -0500
committerCory Fields <cory-nospam-@coryfields.com>2016-11-25 12:09:58 -0500
commit2ec935dcaab9557addcf73c33aa7f2db8cc01fee (patch)
tree3d5d7a29e05f457cee199fd273f24be8fd33550c /src/net.h
parentb7695c2275d977f20343020f2e9ba5d746928a6e (diff)
net: add CVectorWriter and CNetMsgMaker
CVectorWriter is useful for overwriting or appending an existing byte vector. CNetMsgMaker is a shortcut for creating messages on-the-fly which are suitable for pushing to CConnman.
Diffstat (limited to 'src/net.h')
-rw-r--r--src/net.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/net.h b/src/net.h
index 7a32e21f4a..9ea056c6ee 100644
--- a/src/net.h
+++ b/src/net.h
@@ -101,6 +101,20 @@ class CTransaction;
class CNodeStats;
class CClientUIInterface;
+struct CSerializedNetMsg
+{
+ CSerializedNetMsg() = default;
+ CSerializedNetMsg(CSerializedNetMsg&&) = default;
+ CSerializedNetMsg& operator=(CSerializedNetMsg&&) = default;
+ // No copying, only moves.
+ CSerializedNetMsg(const CSerializedNetMsg& msg) = delete;
+ CSerializedNetMsg& operator=(const CSerializedNetMsg&) = delete;
+
+ std::vector<unsigned char> data;
+ std::string command;
+};
+
+
class CConnman
{
public: