IT++ Logo

packet.h

Go to the documentation of this file.
00001 
00030 #ifndef PACKET_H
00031 #define PACKET_H
00032 
00033 #include <itpp/protocol/signals_slots.h>
00034 
00035 
00036 namespace itpp
00037 {
00038 
00040 
00041 
00045 class Packet
00046 {
00047 public:
00049   Packet(const int packet_size = 0) { set_bit_size(packet_size); }
00051   virtual ~Packet() {}
00052 
00054   void set_bit_size(int packet_size) { it_assert(packet_size >= 0, "Packet size must be positive"); size_bits = packet_size; }
00055 
00057   int bit_size() { return size_bits; }
00058 
00059 private:
00060   int size_bits; // size of packet in bits
00061 };
00062 
00063 
00067 class L3_Packet_Info
00068 {
00069 public:
00071   L3_Packet_Info(Packet *packet) { timestamp = 0; pkt_pointer = packet; }
00072 
00074   ~L3_Packet_Info() {}
00075 
00077   Ttype timestamp;
00078 
00080   Packet *pkt_pointer;
00081 };
00082 
00083 
00087 class Link_Packet : public Packet
00088 {
00089 public:
00091   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; }
00092 
00094   ~Link_Packet() {}
00095 
00097   unsigned long int link_packet_id;
00099   int seq_no;
00101   L3_Packet_Info *l3_pkt_info_p;
00102 };
00103 
00107 class ACK : public Packet
00108 {
00109 public:
00111   ACK(const int Seq_no = -1, const int Id = 0) { seq_no = Seq_no; id = Id; }
00112 
00114   ~ACK() {}
00115 
00117   int id;
00119   int seq_no;
00120 };
00121 
00123 
00124 } // namespace itpp
00125 
00126 #endif // #ifndef PACKET_H
00127 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
SourceForge Logo

Generated on Tue Feb 2 09:33:31 2010 for IT++ by Doxygen 1.6.2