IT++ Logo
packet.h
Go to the documentation of this file.
00001 
00029 #ifndef PACKET_H
00030 #define PACKET_H
00031 
00032 #include <itpp/protocol/signals_slots.h>
00033 
00034 
00035 namespace itpp
00036 {
00037 
00039 
00040 
00044 class Packet
00045 {
00046 public:
00048   Packet(const int packet_size = 0) { set_bit_size(packet_size); }
00050   virtual ~Packet() {}
00051 
00053   void set_bit_size(int packet_size) { it_assert(packet_size >= 0, "Packet size must be positive"); size_bits = packet_size; }
00054 
00056   int bit_size() { return size_bits; }
00057 
00058 private:
00059   int size_bits; // size of packet in bits
00060 };
00061 
00062 
00066 class L3_Packet_Info
00067 {
00068 public:
00070   L3_Packet_Info(Packet *packet) { timestamp = 0; pkt_pointer = packet; }
00071 
00073   ~L3_Packet_Info() {}
00074 
00076   Ttype timestamp;
00077 
00079   Packet *pkt_pointer;
00080 };
00081 
00082 
00086 class Link_Packet : public Packet
00087 {
00088 public:
00090   Link_Packet(const int Seq_no, const unsigned long int Link_packet_id, L3_Packet_Info *Cp) { seq_no = Seq_no; link_packet_id = Link_packet_id; l3_pkt_info_p = Cp; }
00091 
00093   ~Link_Packet() {}
00094 
00096   unsigned long int link_packet_id;
00098   int seq_no;
00100   L3_Packet_Info *l3_pkt_info_p;
00101 };
00102 
00106 class ACK : public Packet
00107 {
00108 public:
00110   ACK(const int Seq_no = -1, const int Id = 0) { seq_no = Seq_no; id = Id; }
00111 
00113   ~ACK() {}
00114 
00116   int id;
00118   int seq_no;
00119 };
00120 
00122 
00123 } // namespace itpp
00124 
00125 #endif // #ifndef PACKET_H
00126 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SourceForge Logo

Generated on Sat Jul 9 2011 15:21:32 for IT++ by Doxygen 1.7.4