M1-nw-project/packetParser.h

28 lines
677 B
C
Raw Normal View History

2016-11-24 14:39:03 +01:00
/***************************************************************************
* By Théophile Bastian, 2017
* M1 Network course project at ENS Cachan, Juliusz Chroboczek.
* License: WTFPL v2 <http://www.wtfpl.net/>
**************************************************************************/
#pragma once
#include "neighbours.h"
#include "protocol.h"
class PacketParser {
public:
PacketParser(Neighbours* nei, Protocol* proto);
void parse(Bytes pck);
private: //meth
void readTLV(Bytes& pck, u64 nei);
void receiveNeigh(Bytes& pck, u8 length);
void receiveData(Bytes& pck, u8 length, u64 from);
private:
Neighbours* neighbours;
Protocol* protocol;
};