1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2011 The Bitcoin developers
3 // Distributed under the MIT/X11 software license, see the accompanying
4 // file license.txt or http://www.opensource.org/licenses/mit-license.php.
7 # error This header can only be compiled as C++.
10 #ifndef __INCLUDED_PROTOCOL_H__
11 #define __INCLUDED_PROTOCOL_H__
13 #include "serialize.h"
23 extern unsigned char pchMessageStart[4];
29 CMessageHeader(const char* pszCommand, unsigned int nMessageSizeIn);
31 std::string GetCommand() const;
36 READWRITE(FLATDATA(pchMessageStart));
37 READWRITE(FLATDATA(pchCommand));
38 READWRITE(nMessageSize);
43 // TODO: make private (improves encapsulation)
45 enum { COMMAND_SIZE=12 };
46 char pchMessageStart[sizeof(::pchMessageStart)];
47 char pchCommand[COMMAND_SIZE];
48 unsigned int nMessageSize;
49 unsigned int nChecksum;
52 #endif // __INCLUDED_PROTOCOL_H__