IT++ Logo Newcom Logo

packet.h

Go to the documentation of this file.
00001 
00033 #ifndef PACKET_H
00034 #define PACKET_H
00035 
00036 #include <itpp/protocol/signals_slots.h>
00037 
00038 
00039 namespace itpp {
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:
00067     L3_Packet_Info(Packet *packet) { timestamp = 0; pkt_pointer = packet; }
00068 
00069     ~L3_Packet_Info() {}
00070 
00071     Ttype timestamp;
00072 
00073     Packet *pkt_pointer;
00074   };
00075 
00076 
00080   class Link_Packet : public Packet {
00081   public:
00082     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; }
00083 
00084     ~Link_Packet() {}
00085 
00086     unsigned long int link_packet_id;
00087     int seq_no;
00088     L3_Packet_Info *l3_pkt_info_p;
00089   };
00090 
00094   class ACK : public Packet {
00095   public:
00096     ACK(const int Seq_no=-1, const int Id=0) { seq_no = Seq_no; id = Id; }
00097 
00098     ~ACK() {}
00099 
00100     int id;
00101     int seq_no;
00102   };
00103 
00104 
00105 } // namespace itpp
00106 
00107 #endif // #ifndef PACKET_H
00108 
SourceForge Logo

Generated on Wed Apr 18 11:45:35 2007 for IT++ by Doxygen 1.5.2