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

AddrIA.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: AddrIA.h,v 1.4 2004/10/27 22:07:55 thomson Exp $
00010  *
00011  * $Log: AddrIA.h,v $
00012  * Revision 1.4  2004/10/27 22:07:55  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.3  2004/09/07 22:02:32  thomson
00017  * pref/valid/IAID is not unsigned, RAPID-COMMIT now works ok.
00018  *
00019  */
00020 
00021 class TAddrIA;
00022 #ifndef ADDRIA_H
00023 #define ADDRIA_H
00024 
00025 #include <iostream>
00026 #include "DHCPConst.h"
00027 #include "SmartPtr.h"
00028 #include "Container.h"
00029 #include "AddrAddr.h"
00030 #include "DUID.h"
00031 
00032 using namespace std;
00033 
00034 class TAddrIA
00035 {
00036   public:
00037     friend ostream & operator<<(ostream & strum,TAddrIA &x);
00038     TAddrIA(int iface, SmartPtr<TIPv6Addr> addr, SmartPtr<TDUID> duid, 
00039             unsigned long T1, unsigned long T2,unsigned long ID);
00040     ~TAddrIA();
00041 
00042     //---IA state---
00043     enum EState getState();
00044     void setState(enum EState state);
00045     void setT1(unsigned long T1);
00046     void setT2(unsigned long T2);
00047     unsigned long getT1();
00048     unsigned long getT2();
00049     unsigned long getIAID();
00050 
00051     //---Iface---
00052     int getIface();
00053 
00054     //---Server's DUID---
00055     void setDUID(SmartPtr<TDUID> duid);
00056     SmartPtr<TDUID> getDUID();
00057 
00058     //---Contact with server using Unicast/Multicast---
00059     void setUnicast(SmartPtr<TIPv6Addr> addr);
00060     void setMulticast();
00061     SmartPtr<TIPv6Addr> getSrvAddr();
00062 
00063     //---list related methods---
00064     void addAddr(SmartPtr<TAddrAddr> x);
00065     void addAddr(SmartPtr<TIPv6Addr> addr, unsigned long pref, unsigned long valid);
00066     int getAddrCount();
00067 
00068     // --- address management ---
00069     void firstAddr();
00070     SmartPtr<TAddrAddr> getAddr();
00071     SmartPtr<TAddrAddr> getAddr(SmartPtr<TIPv6Addr> addr);
00072     int countAddr();
00073     int delAddr(SmartPtr<TIPv6Addr> addr);
00074     
00075     // timestamp
00076     void setTimestamp(unsigned long ts);
00077     void setTimestamp();
00078     unsigned long getT1Timeout();
00079     unsigned long getT2Timeout();
00080     unsigned long getPrefTimeout();
00081     unsigned long getValidTimeout();
00082     unsigned long getMaxValidTimeout();
00083     unsigned long getMaxValid();
00084 
00085     //---tentative---
00086     unsigned long getTentativeTimeout();
00087     enum ETentative getTentative();
00088     void setTentative();
00089 private:
00090     TContainer< SmartPtr<TAddrAddr> > AddrLst;
00091 
00092     unsigned long IAID;
00093     unsigned long T1;
00094     unsigned long T2;
00095 
00096     enum EState State; // State of this IA
00097     enum ETentative Tentative;
00098 
00099     unsigned long Timestamp; // timestamp of last IA refresh (renew/rebind/confirm etc.)
00100 
00101     SmartPtr<TDUID> DUID;
00102 
00103     // Server which maintains this IA is connected by unicast or multicast
00104     bool Unicast;
00105     SmartPtr<TIPv6Addr> SrvAddr;
00106 
00107     // Iface ID
00108     int Iface;
00109 
00110 };
00111 
00112 #endif 
00113 

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