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 
00039 
00040 
00044   class Packet {
00045   public:
00047     Packet(const int packet_size=0) { set_bit_size(packet_size); }
00049     virtual ~Packet() {}
00050 
00052     void set_bit_size(int packet_size) { it_assert(packet_size >= 0, "Packet size must be positive"); size_bits = packet_size; }
00053 
00055     int bit_size() { return size_bits; }
00056 
00057   private:
00058     int size_bits; // size of packet in bits
00059   };
00060 
00061 
00065   class L3_Packet_Info{
00066   public:
00068     L3_Packet_Info(Packet *packet) { timestamp = 0; pkt_pointer = packet; }
00069 
00071     ~L3_Packet_Info() {}
00072 
00074     Ttype timestamp;
00075 
00077     Packet *pkt_pointer;
00078   };
00079 
00080 
00084   class Link_Packet : public Packet {
00085   public:
00087     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; }
00088 
00090     ~Link_Packet() {}
00091 
00093     unsigned long int link_packet_id;
00095     int seq_no;
00097     L3_Packet_Info *l3_pkt_info_p;
00098   };
00099 
00103   class ACK : public Packet {
00104   public:
00106     ACK(const int Seq_no=-1, const int Id=0) { seq_no = Seq_no; id = Id; }
00107 
00109     ~ACK() {}
00110 
00112     int id;
00114     int seq_no;
00115   };
00116 
00118 
00119 } // namespace itpp
00120 
00121 #endif // #ifndef PACKET_H
00122 
SourceForge Logo

Generated on Sat Apr 19 10:41:57 2008 for IT++ by Doxygen 1.5.5