IT++ Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
packet.h
Go to the documentation of this file.
1 
29 #ifndef PACKET_H
30 #define PACKET_H
31 
33 
34 
35 namespace itpp
36 {
37 
39 
40 
44 class Packet
45 {
46 public:
48  Packet(const int packet_size = 0) { set_bit_size(packet_size); }
50  virtual ~Packet() {}
51 
53  void set_bit_size(int packet_size) { it_assert(packet_size >= 0, "Packet size must be positive"); size_bits = packet_size; }
54 
56  int bit_size() { return size_bits; }
57 
58 private:
59  int size_bits; // size of packet in bits
60 };
61 
62 
67 {
68 public:
70  L3_Packet_Info(Packet *packet) { timestamp = 0; pkt_pointer = packet; }
71 
74 
77 
80 };
81 
82 
86 class Link_Packet : public Packet
87 {
88 public:
90  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; }
91 
94 
96  unsigned long int link_packet_id;
98  int seq_no;
101 };
102 
106 class ACK : public Packet
107 {
108 public:
110  ACK(const int Seq_no = -1, const int Id = 0) { seq_no = Seq_no; id = Id; }
111 
113  ~ACK() {}
114 
116  int id;
118  int seq_no;
119 };
120 
122 
123 } // namespace itpp
124 
125 #endif // #ifndef PACKET_H
126 
SourceForge Logo

Generated on Fri Mar 21 2014 17:14:13 for IT++ by Doxygen 1.8.1.2