From d0ea6f9920d30f46d1f5d44e8823a8d932f9f29d Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sun, 17 Jun 2012 02:40:36 +0300 Subject: Properly and efficiently use split utility headers --- src/connection.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/connection.cpp') diff --git a/src/connection.cpp b/src/connection.cpp index 6cb655f2f..4f5d095e5 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -22,10 +22,22 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "serialization.h" #include "log.h" #include "porting.h" +#include "util/serialize.h" +#include "util/numeric.h" +#include "util/string.h" namespace con { +static u16 readPeerId(u8 *packetdata) +{ + return readU16(&packetdata[4]); +} +static u8 readChannel(u8 *packetdata) +{ + return readU8(&packetdata[6]); +} + BufferedPacket makePacket(Address &address, u8 *data, u32 datasize, u32 protocol_id, u16 sender_peer_id, u8 channel) { -- cgit v1.2.3