IT++ Logo
packet.h
Go to the documentation of this file.
1 
29 #ifndef PACKET_H
30 #define PACKET_H
31 
32 #include <itpp/itexports.h>
33 
34 #if (defined(_MSC_VER) && defined(ITPP_SHARED_LIB) && !(defined(itpp_EXPORTS) || defined(itpp_debug_EXPORTS)))
35 
36 #ifndef ITPP_PROTOCOL_EXCLUDED
37 #define ITPP_PROTOCOL_EXCLUDED
38 #pragma message( "PROTOCOL definitions are not available for MSVC shared builds" )
39 #endif
40 
41 #else
42 
44 
45 
46 namespace itpp
47 {
48 
50 
51 
55 class Packet
56 {
57 public:
59  Packet(const int packet_size = 0) { set_bit_size(packet_size); }
61  virtual ~Packet() {}
62 
64  void set_bit_size(int packet_size) { it_assert(packet_size >= 0, "Packet size must be positive"); size_bits = packet_size; }
65 
67  int bit_size() { return size_bits; }
68 
69 private:
70  int size_bits; // size of packet in bits
71 };
72 
73 
78 {
79 public:
81  L3_Packet_Info(Packet *packet) { timestamp = 0; pkt_pointer = packet; }
82 
85 
88 
91 };
92 
93 
97 class Link_Packet : public Packet
98 {
99 public:
101  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; }
102 
105 
107  unsigned long int link_packet_id;
109  int seq_no;
112 };
113 
117 class ACK : public Packet
118 {
119 public:
121  ACK(const int Seq_no = -1, const int Id = 0) { seq_no = Seq_no; id = Id; }
122 
124  ~ACK() {}
125 
127  int id;
129  int seq_no;
130 };
131 
133 
134 } // namespace itpp
135 
136 #endif
137 
138 #endif // #ifndef PACKET_H
139 
SourceForge Logo

Generated on Sat May 25 2013 16:32:23 for IT++ by Doxygen 1.8.2