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

Opt.h

Go to the documentation of this file.
00001 /*                                                                           
00002  * Dibbler - a portable DHCPv6                                               
00003  *                                                                           
00004  * authors: Tomasz Mrugalski <thomson@klub.com.pl>                           
00005  *          Marek Senderski <msend@o2.pl>                                    
00006  *                                                                           
00007  * released under GNU GPL v2 or later licence                                
00008  *                                                                           
00009  * $Id: Opt.h,v 1.5 2004/10/27 22:07:56 thomson Exp $
00010  *
00011  * $Log: Opt.h,v $
00012  * Revision 1.5  2004/10/27 22:07:56  thomson
00013  * Signed/unsigned issues fixed, Lifetime option implemented, INFORMATION-REQUEST
00014  * message is now sent properly. Valid lifetime granted by server fixed.
00015  *
00016  * Revision 1.4  2004/05/23 16:40:12  thomson
00017  * *** empty log message ***
00018  *
00019  *                                                                           
00020  */
00021 
00022 #ifndef OPT_H
00023 #define OPT_H
00024 
00025 #include "SmartPtr.h"
00026 #include "Container.h"
00027 #include "DUID.h"
00028 
00029 class TMsg;
00030 
00031 class TOpt
00032 {
00033   public:
00034     TOpt(int optType, TMsg* parent);
00035     virtual ~TOpt();
00036 
00037     virtual int getSize() = 0;
00038     virtual char * storeSelf(char* buf) = 0;
00039     virtual bool doDuties() = 0;
00040     virtual bool isValid();
00041     int getOptType();
00042     int getSubOptSize();
00043     
00044     char* TOpt::storeSubOpt(char* buf);
00045     SmartPtr<TOpt> getOption(int optType);
00046 
00047     // suboptions management
00048     void firstOption();
00049     SmartPtr<TOpt> getOption();
00050     void addOption(SmartPtr<TOpt> opt);
00051     int countOption();
00052     void setParent(TMsg* Parent);
00053 
00054     SmartPtr<TDUID> getDUID();
00055     void setDUID(SmartPtr<TDUID> duid);
00056 
00057  protected:
00058     TContainer< SmartPtr<TOpt> > SubOptions;
00059     int OptType;
00060     TMsg* Parent;
00061     SmartPtr<TDUID> DUID;
00062 };
00063 
00064 #endif
00065 

Generated on Mon Dec 27 21:55:22 2004 for Dibbler - a portable DHCPv6 by  doxygen 1.3.9.1