Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

TpPacket.h

Go to the documentation of this file.
00001 #ifndef __TPPACKET_H
00002 #define __TPPACKET_H
00003 
00004 #include <stdio.h>
00005 #include <iostream>
00006 #include <sys/types.h>
00007 #include "GlobalConstants.h"
00008 #include "Packet.h"
00009 #include "os_spec.h"
00010 
00011 using namespace std;
00012 
00013 class TpPacket : public Packet
00014 {
00015 public:
00016     OS_SPEC_ENUM Offset {
00017         SeqNumOffset     = 0,
00018         AckOffset        = 1,
00019         CreditsOffset    = 2,
00020         AckBitOffset     = 2,
00021         RetransBitOffset = 2,
00022         EndBitOffset     = 2,
00023         DataOffset       = 3
00024     };
00025 
00026         TpPacket(unsigned char* message, unsigned int length, bool endBit, unsigned char sequenceNum);
00027         TpPacket(unsigned short credits, unsigned short ack, bool isRetransmission);
00028         TpPacket(unsigned char* tpdata, unsigned int length);
00029         TpPacket(const TpPacket&);
00030         virtual ~TpPacket();
00031         
00032         unsigned char* getTpData();
00033         unsigned short getTpLength();
00034         bool isEnd();
00035         bool isRetrans();
00036         void makeRetrans();
00037                   
00038         unsigned char* getData();
00039         unsigned short getDataLength();
00040         unsigned short getSeqNum();
00041         bool isAck();
00042         unsigned short getAckNum();
00043         unsigned short getCredits();
00044         
00045     virtual void toStream(std::ostream& out);
00046     void dumpHeader(std::ostream& out);
00047 
00048 private:
00049         unsigned short m_seqNum;
00050         unsigned short m_credits;
00051         unsigned short m_ack;
00052         bool m_ackBit;
00053         unsigned int m_length;
00054         bool m_endBit;
00055         bool m_retransBit;
00056         unsigned char *m_data;
00057         unsigned char *m_rawData;
00058 };
00059 
00060 #endif

Generated at Thu Jul 11 13:31:52 2002 for Peekabooty by doxygen1.2.9 written by Dimitri van Heesch, © 1997-2001