ITS
BroadcastForwardingPacketEntry.cpp
Go to the documentation of this file.
2 
4 {
5  m_bh = BasicHeader();
6  m_ch = CommonHeader();
7  m_payload = QByteArray();
8  m_sender = QByteArray();
9 }
10 
11 BroadcastForwardingPacketEntry::BroadcastForwardingPacketEntry(BasicHeader bh, CommonHeader ch, GACPacket packet, QByteArray payload, QByteArray sender, uchar* destination, uchar* forwarder)
12 {
13  m_bh = bh;
14  m_ch = ch;
16  m_gac = packet;
17  m_sender = sender;
18  for(int i=0; i<6; i++)
19  {
20  m_destination[i] = destination[i];
21  m_forwarder[i] = forwarder[i];
22  }
23 }
24 
25 BroadcastForwardingPacketEntry::BroadcastForwardingPacketEntry(BasicHeader bh, CommonHeader ch, GBCPacket packet, QByteArray payload, QByteArray sender, uchar* destination, uchar* forwarder)
26 {
27  m_bh = bh;
28  m_ch = ch;
30  m_gbc = packet;
31  m_sender = sender;
32  for(int i=0; i<6; i++)
33  {
34  m_destination[i] = destination[i];
35  m_forwarder[i] = forwarder[i];
36  }
37 }
38 
40 {
41  m_bh = bh;
42  m_ch = ch;
44  m_tsb = packet;
45  m_sender = sender;
46 }
47 
49 {
50  m_bh = bh;
51  m_ch = ch;
53  m_shb = packet;
54  m_sender = sender;
55 }
56 
58 {
59  if(other.commonHeader().headerType() != m_ch.headerType())
60  return false;
61 
62  switch(other.commonHeader().headerType())
63  {
66  break;
69  break;
71  switch(other.commonHeader().headerType())
72  {
75  break;
78  break;
79  }
80  }
81  return false;
82 }
83 
85 {
86  m_gac = other.m_gac;
87  m_gbc = other.m_gbc;
88  m_shb = other.m_shb;
89  m_tsb = other.m_tsb;
90  m_payload = other.m_payload;
91  m_sender = other.m_sender;
92  for(int i=0; i<6; i++)
93  {
94  m_destination[i] = other.m_destination[i];
95  m_forwarder[i] = other.m_forwarder[i];
96  }
97 }
98 
100 {
101  switch(m_ch.headerType())
102  {
104  if(m_gac.soPv().gnAddr() == lpv.gnAddr())
105  m_gac.setSoPv(lpv);
106  break;
108  if(m_gbc.soPv().gnAddr() == lpv.gnAddr())
109  m_gbc.setSoPv(lpv);
110  break;
112  switch (m_ch.headerSubType())
113  {
115  if(m_shb.soPv().gnAddr() == lpv.gnAddr())
116  m_shb.setSoPv(lpv);
117  break;
119  if(m_tsb.soPv().gnAddr() == lpv.gnAddr())
120  m_tsb.setSoPv(lpv);
121  break;
122  }
123  break;
124  }
125 }
QByteArray m_sender
QByteArray sender() const
sender Entry sender getter.
uchar m_forwarder[6]
QByteArray m_payload
uchar * forwarder()
forwarder Entry forwarder getter.
uchar * destination()
destination Entry destination getter.
BroadcastForwardingPacketEntry()
BroadcastForwardingPacketEntry BroadcastForwardingPacketEntry constructor.
void setSoPv(LongPositionVector lpv)
setSoPv SHB SO PV setter.
Definition: SHBPacket.h:71
CommonHeader commonHeader() const
basicHeader Entry Common Header getter.
LongPositionVector soPv() const
soPv TSB SO PV getter.
Definition: TSBPacket.h:73
LongPositionVector soPv() const
soPv SO PV getter.
Definition: GBCPacket.h:95
quint32 timestamp() const
timestamp Timestamp field getter
quint16 sequenceNumber() const
sequenceNumber Sequence number getter.
Definition: GBCPacket.h:90
bool operator==(const BroadcastForwardingPacketEntry &other)
operator== Comparison operator.
void setSoPv(LongPositionVector lpv)
setSoPv TSB SO PV setter.
Definition: TSBPacket.h:78
BasicHeader m_bh
GBCPacket m_gbc
void setSoPv(LongPositionVector lpv)
setSoPv SO PV setter.
Definition: GBCPacket.h:106
GnAddr gnAddr() const
gnAddr GnAddr field getter
bool isDuplicatePacketDetectionTimestampSN(quint32 lastReceivedTimestamp, quint32 nowReceivedTimestamp, quint16 lastReceivedSN, quint16 nowReceivedSN)
isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp and th...
Definition: apiNetwork.cpp:104
QByteArray payload() const
basicHeader Entry payload getter.
void updateSourcePacketSoPv(LongPositionVector lpv)
updateSourcePacketSoPv Update the entry SO PV.
quint8 headerType() const
headerType Header field getter.
Definition: CommonHeader.h:193
Entry of the BroadcastForwardingPacketBuffer.
GACPacket m_gac
quint16 sequenceNumber() const
sequenceNumber TSB sequence number getter.
Definition: TSBPacket.h:68
CommonHeader m_ch
quint8 headerSubType() const
headerSubType Header sub-type field getter.
Definition: CommonHeader.h:198
uchar m_destination[6]
SHBPacket m_shb
bool isDuplicatePacketDetectionTimestamp(quint32 lastReceivedTimestamp, quint32 nowReceivedTimestamp)
isDuplicatePacketDetectionTimestamp Calculate if the packet is a duplicate using the timestamp of the...
Definition: apiNetwork.cpp:95
TSBPacket m_tsb
LongPositionVector soPv() const
soPv SHB SO PV getter.
Definition: SHBPacket.h:66