Main Page   Modules   Class Hierarchy   Compound List   File List   Compound Members  

cpacket.h

00001 //==========================================================================
00002 //   CPACKET.H  -  header for
00003 //                             OMNeT++
00004 //            Discrete System Simulation in C++
00005 //
00006 //
00007 //  Declaration of the following classes:
00008 //    cPacket : network packet class
00009 //
00010 //==========================================================================
00011 
00012 /*--------------------------------------------------------------*
00013   Copyright (C) 1992-2001 Andras Varga
00014   Technical University of Budapest, Dept. of Telecommunications,
00015   Stoczek u.2, H-1111 Budapest, Hungary.
00016 
00017   This file is distributed WITHOUT ANY WARRANTY. See the file
00018   `license' for details on this and other legal matters.
00019 *--------------------------------------------------------------*/
00020 
00021 #ifndef __CPACKET_H
00022 #define __CPACKET_H
00023 
00024 #include "cmessage.h"
00025 
00026 //==========================================================================
00027 
00034 class SIM_API cPacket : public cMessage
00035 {
00036   protected:
00037     short _protocol;
00038     short _pdu;
00039 
00040   public:
00043 
00047     explicit cPacket(const char *name=NULL, short protocol=0, short pdu=0) :
00048        cMessage(name,MK_PACKET) {_protocol=protocol;_pdu=pdu;}
00049 
00053     cPacket(const cPacket& m);
00054 
00059     cPacket& operator=(const cPacket& m);
00061 
00064 
00069     virtual cObject *dup() const {return new cPacket(*this);}
00070 
00074     virtual const char *className() const {return "cPacket";}
00075 
00080     virtual const char *inspectorFactoryName() const {return "cPacketIFC";}
00081 
00086     virtual void info(char *buf);
00087 
00093     virtual int netPack();
00094 
00100     virtual int netUnpack();
00102 
00105 
00109     short protocol() const     {return _protocol;}
00110 
00114     short pdu() const          {return _pdu;}
00115 
00119     void setProtocol(short p) {_protocol=p;}
00120 
00124     void setPdu(short p)      {_pdu=p;}
00126 };
00127 
00128 #endif
00129 
00130 

Generated at Sat May 4 15:45:48 2002 for OMNeT++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001