#include <TpPacket.h>
Inheritance diagram for TpPacket::
Public Methods | |
TpPacket (unsigned char *message, unsigned int length, bool endBit, unsigned char sequenceNum) | |
For data packets. More... | |
TpPacket (unsigned short credits, unsigned short ack, bool isRetransmission) | |
For creating ACK packets. More... | |
TpPacket (unsigned char *tpdata, unsigned int length) | |
Decode the header of the TP packet. More... | |
TpPacket (const TpPacket &) | |
Copy constructor. More... | |
virtual | ~TpPacket () |
delete the rawData. More... | |
unsigned char * | getTpData () |
Used right before sending over network. More... | |
unsigned short | getTpLength () |
Return the length of the data plus the length of the TP header. More... | |
bool | isEnd () |
Return true if the end bit is set. More... | |
bool | isRetrans () |
Return true if the retransmission bit is set. More... | |
void | makeRetrans () |
Set the retransmission bit to true. More... | |
unsigned char * | getData () |
Return a pointer to the data portion of the packet. More... | |
unsigned short | getDataLength () |
Return the length of the data in this packet. More... | |
unsigned short | getSeqNum () |
Return the sequence number of the packet. More... | |
bool | isAck () |
Return true if the ACK bit is set. More... | |
unsigned short | getAckNum () |
Return the ACK number. More... | |
unsigned short | getCredits () |
Return the number of credits. More... | |
virtual void | toStream (std::ostream &out) |
void | dumpHeader (std::ostream &out) |
Private Attributes | |
unsigned short | m_seqNum |
unsigned short | m_credits |
unsigned short | m_ack |
bool | m_ackBit |
unsigned int | m_length |
bool | m_endBit |
bool | m_retransBit |
unsigned char * | m_data |
unsigned char * | m_rawData |
Definition at line 13 of file TpPacket.h.
|
For data packets.
Definition at line 20 of file TpPacket.cpp. |
|
For creating ACK packets.
Definition at line 45 of file TpPacket.cpp. |
|
Decode the header of the TP packet.
Definition at line 67 of file TpPacket.cpp. |
|
Copy constructor. Creates a copy of the TpPacket. Definition at line 84 of file TpPacket.cpp. |
|
delete the rawData.
Definition at line 112 of file TpPacket.cpp. |
|
Definition at line 268 of file TpPacket.cpp. |
|
Return the ACK number.
Definition at line 226 of file TpPacket.cpp. Referenced by SAR::receivePacket().
|
|
Return the number of credits.
Definition at line 236 of file TpPacket.cpp. Referenced by SAR::receivePacket().
|
|
Return a pointer to the data portion of the packet.
Definition at line 156 of file TpPacket.cpp. Referenced by ReceiveWindow::reassemble().
|
|
Return the length of the data in this packet.
Definition at line 166 of file TpPacket.cpp. Referenced by ReceiveWindow::addReceive(), ReceiveWindow::reassemble(), and SendWindow::reliableSend().
|
|
Return the sequence number of the packet.
Definition at line 176 of file TpPacket.cpp. Referenced by SendWindow::addPacket(), ReceiveWindow::addPacket(), ReceiveWindow::addReceive(), ReceiveWindow::canAdd(), and SendWindow::reliableSend().
|
|
Used right before sending over network. This automatically puts the data in a byte array, offset by the size of the Network Protocol header. Therefore, when the network layer goes to insert its info, it does not need to shift this array. Definition at line 129 of file TpPacket.cpp. Referenced by NpPacket::NpPacket(), and dumpHeader().
|
|
Return the length of the data plus the length of the TP header.
Definition at line 146 of file TpPacket.cpp. Referenced by NpPacket::NpPacket().
|
|
Return true if the ACK bit is set.
Definition at line 216 of file TpPacket.cpp. Referenced by SAR::receivePacket().
|
|
Return true if the end bit is set.
Definition at line 186 of file TpPacket.cpp. |
|
Return true if the retransmission bit is set.
Definition at line 196 of file TpPacket.cpp. Referenced by SAR::receivePacket().
|
|
Set the retransmission bit to true.
Definition at line 206 of file TpPacket.cpp. Referenced by SendWindow::sentPacketTimeoutImpl().
|
|
Reimplemented from BasicObject. Definition at line 243 of file TpPacket.cpp. |
|
Definition at line 51 of file TpPacket.h. |
|
Definition at line 52 of file TpPacket.h. |
|
Definition at line 50 of file TpPacket.h. |
|
Definition at line 56 of file TpPacket.h. |
|
Definition at line 54 of file TpPacket.h. |
|
Definition at line 53 of file TpPacket.h. |
|
Definition at line 57 of file TpPacket.h. |
|
Definition at line 55 of file TpPacket.h. |
|
Definition at line 49 of file TpPacket.h. |