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-2003 Andras Varga
00014 
00015   This file is distributed WITHOUT ANY WARRANTY. See the file
00016   `license' for details on this and other legal matters.
00017 *--------------------------------------------------------------*/
00018 
00019 #ifndef __CPACKET_H
00020 #define __CPACKET_H
00021 
00022 #include "cmessage.h"
00023 
00024 //==========================================================================
00025 
00035 class SIM_API cPacket : public cMessage
00036 {
00037   protected:
00038     short _protocol;
00039     short _pdu;
00040 
00041   public:
00044 
00048     explicit cPacket(const char *name=NULL, short protocol=0, short pdu=0) :
00049        cMessage(name,MK_PACKET) {_protocol=protocol;_pdu=pdu;}
00050 
00054     cPacket(const cPacket& m);
00055 
00060     cPacket& operator=(const cPacket& m);
00062 
00065 
00070     virtual cObject *dup() const {return new cPacket(*this);}
00071 
00076     virtual void info(char *buf);
00077 
00083     virtual int netPack();
00084 
00090     virtual int netUnpack();
00092 
00095 
00099     short protocol() const     {return _protocol;}
00100 
00104     short pdu() const          {return _pdu;}
00105 
00109     void setProtocol(short p) {_protocol=p;}
00110 
00114     void setPdu(short p)      {_pdu=p;}
00116 };
00117 
00118 #endif
00119 
00120 

Generated at Mon Jun 16 23:37:31 2003 for OMNeT++ by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001