Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Msg.h

Go to the documentation of this file.
00001 class TMsg;
00002 #ifndef MSG_H
00003 #define MSG_H
00004 
00005 #include <iostream>
00006 #include <string>
00007 #include "SmartPtr.h"
00008 #include "Container.h"
00009 #include "DHCPConst.h"
00010 #include "IPv6Addr.h"
00011 #include "Opt.h"
00012 
00013 // Hey! It's grampa of all messages
00014 class TMsg
00015 {
00016   public:
00017     // Used to create TMsg object (normal way)
00018     TMsg(int iface, SmartPtr<TIPv6Addr> addr, int msgType);
00019     TMsg(int iface, SmartPtr<TIPv6Addr> addr, int msgType, long transID);
00020 
00021     // used to create TMsg object based on received char[] data
00022     TMsg(int iface, SmartPtr<TIPv6Addr> addr, char* &buf, int &bufSize);
00023     
00024     int getSize();
00025     
00026     // trasnmit (or retransmit)
00027 
00028     virtual unsigned long getTimeout();
00029 
00030     virtual int storeSelf(char * buffer);
00031 
00032     virtual string getName() = 0;
00033 
00034     // returns requested option (or NULL, there is no such option)
00035     SmartPtr<TOpt> getOption(int type);
00036     void firstOption();
00037     int countOption();
00038 
00039     virtual SmartPtr<TOpt> getOption();
00040     
00041     long getType();
00042     long getTransID();
00043     TContainer< SmartPtr<TOpt> > getOptLst();
00044     SmartPtr<TIPv6Addr> getAddr();
00045     int getIface();
00046     virtual ~TMsg();
00047     bool isDone();
00048 
00049   protected:
00050     int MsgType;
00051 
00052     long TransID;
00053 
00054     TContainer< SmartPtr<TOpt> > Options;
00055     
00056     void setAttribs(int iface, SmartPtr<TIPv6Addr> addr, 
00057                     int msgType, long transID);
00058     
00059     bool IsDone; // Is this transaction done?
00060     char * pkt;  // buffer where this packet will be build
00061     int Iface;   // interface from/to which message was received/should be sent
00062     SmartPtr<TIPv6Addr> PeerAddr; // server/client address from/to which message was received/should be sent
00063 };
00064 
00065 #endif
00066 

Generated on Wed Mar 16 00:10:25 2005 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1