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

ClntTransMgr.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: ClntTransMgr.h,v 1.8 2005/01/12 00:10:05 thomson Exp $
00010  *
00011  * $Log: ClntTransMgr.h,v $
00012  * Revision 1.8  2005/01/12 00:10:05  thomson
00013  * Compilation fixes.
00014  *
00015  * Revision 1.7  2005/01/08 16:52:03  thomson
00016  * Relay support implemented.
00017  *
00018  * Revision 1.6  2004/12/07 00:45:41  thomson
00019  * Clnt managers creation unified and cleaned up.
00020  *
00021  * Revision 1.5  2004/12/04 23:45:40  thomson
00022  * Problem with client and server on the same Linux host fixed (bug #56)
00023  *
00024  * Revision 1.4  2004/09/07 15:37:44  thomson
00025  * Socket handling changes.
00026  *
00027  */
00028 class TClntTransMgr;
00029 class TDHCPMsg;
00030 class TClntAddrMgr;
00031 class TMsg;
00032 class TClntMsg;
00033 class TClntConfMgr;
00034 
00035 #ifndef CLNTTRANSMGR_H
00036 #define CLNTTRANSMGR_H
00037 #include <string>
00038 #include "ClntIfaceMgr.h"
00039 #include "ClntCfgIface.h"
00040 #include "Opt.h"
00041 #include "IPv6Addr.h"
00042 
00043 class TClntTransMgr
00044 {
00045   public:
00046     TClntTransMgr(SmartPtr<TClntIfaceMgr> ifaceMgr, 
00047                   SmartPtr<TClntAddrMgr> addrMgr,
00048                   SmartPtr<TClntCfgMgr> cfgMgr,
00049                   string config);
00050     ~TClntTransMgr();
00051     void doDuties();
00052     void relayMsg(SmartPtr<TClntMsg> msg);
00053     unsigned long getTimeout();
00054     void stop();
00055     void sendRequest(TContainer< SmartPtr<TOpt> > requestOptions, 
00056                      TContainer< SmartPtr<TMsg> > srvlist,int iface);
00057     void sendInfRequest(TContainer< SmartPtr<TOpt> > requestOptions, int iface);
00058     void sendRebind( TContainer<SmartPtr<TOpt> > ptrIA, int iface);
00059     void sendRelease(TContainer< SmartPtr<TAddrIA> > ptrIA);
00060     void shutdown();
00061     bool isDone();
00062     void setThat(SmartPtr<TClntTransMgr> that);
00063 
00064     char * getCtrlAddr();
00065     int    getCtrlIface();
00066     
00067  protected:
00068     void removeExpired();
00069     void checkDecline();
00070     void checkConfirm();
00071     void checkDB();
00072     void checkRenew();
00073     void checkRequest();
00074     void checkSolicit();
00075     void checkInfRequest();
00076 
00077   private:
00078     bool openLoopbackSocket();
00079     bool openSocket(SmartPtr<TClntCfgIface> iface);
00080 
00081     // managers
00082     SmartPtr<TClntCfgMgr>   CfgMgr;
00083     SmartPtr<TClntIfaceMgr> IfaceMgr;
00084     SmartPtr<TClntAddrMgr>  AddrMgr;
00085     SmartPtr<TClntTransMgr> That;
00086 
00087     TContainer< SmartPtr<TClntMsg> > Transactions;
00088     bool IsDone;
00089     bool Shutdown;
00090     bool ConfirmEnabled;  // should we send CONFIRM message?
00091 
00092     bool BindReuse; // Bug #56. Shall we allow running client and server on the same machine?
00093 
00094     int ctrlIface;
00095     char ctrlAddr[48];
00096 };
00097 #endif
00098 
00099 

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