Skip to content

Commit

Permalink
Clnt managers creation unified and cleaned up.
Browse files Browse the repository at this point in the history
  • Loading branch information
tomaszmrugalski committed Dec 7, 2004
1 parent fefad2f commit 6823557
Show file tree
Hide file tree
Showing 21 changed files with 271 additions and 168 deletions.
22 changes: 14 additions & 8 deletions AddrMgr/AddrMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
*
* released under GNU GPL v2 or later licence
*
* $Id: AddrMgr.cpp,v 1.17 2004-07-05 00:53:03 thomson Exp $
* $Id: AddrMgr.cpp,v 1.18 2004-12-07 00:45:41 thomson Exp $
*
* $Log: not supported by cvs2svn $
* Revision 1.17 2004/07/05 00:53:03 thomson
* Various changes.
*
* Revision 1.16 2004/06/17 23:53:54 thomson
* Server Address Assignment rewritten.
*
Expand Down Expand Up @@ -36,10 +39,11 @@
#include "AddrClient.h"
#include "Logger.h"

TAddrMgr::TAddrMgr(string addrdb, bool loadfile)
TAddrMgr::TAddrMgr(string xmlFile, bool loadfile)
{
this->dbfile = addrdb;

this->IsDone = false;
this->XmlFile = xmlFile;

if (loadfile)
dbLoad();
}
Expand All @@ -58,12 +62,10 @@ void TAddrMgr::dbLoad()
#endif
}

void TAddrMgr::dbStore()
void TAddrMgr::dump()
{
// uncomment this line below to avoid crashes in g++-3.x
// return;
std::ofstream xmlDump;
xmlDump.open(this->dbfile.c_str(), ios::ate);
xmlDump.open(this->XmlFile.c_str(), ios::ate);
xmlDump << *this;
xmlDump.close();
}
Expand Down Expand Up @@ -353,6 +355,10 @@ void TAddrMgr::parseAddrMgr(xmlDocPtr doc,int depth)
}
#endif

bool TAddrMgr::isDone() {
return this->IsDone;
}

TAddrMgr::~TAddrMgr() {

}
Expand Down
13 changes: 9 additions & 4 deletions AddrMgr/AddrMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
*
* released under GNU GPL v2 licence
*
* $Id: AddrMgr.h,v 1.8 2004-06-17 23:53:54 thomson Exp $
* $Id: AddrMgr.h,v 1.9 2004-12-07 00:45:41 thomson Exp $
*
* $Log: not supported by cvs2svn $
* Revision 1.8 2004/06/17 23:53:54 thomson
* Server Address Assignment rewritten.
*
* Revision 1.7 2004/06/04 19:03:46 thomson
* Resolved warnings with signed/unisigned
*
Expand Down Expand Up @@ -58,7 +61,8 @@ class TAddrMgr

// --- backup/restore ---
void dbLoad();
void dbStore();
void dump();
bool isDone();

#ifdef LIBXML2
xmlDocPtr xmlLoad(const char * filename);
Expand All @@ -69,8 +73,9 @@ class TAddrMgr
#endif

protected:
TContainer< SmartPtr<TAddrClient> > ClntsLst;
string dbfile;
bool IsDone;
List(TAddrClient) ClntsLst;
string XmlFile;
};

#endif
11 changes: 6 additions & 5 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@

Dibbler changelog
-------------------
Expected changes in 0.3.0
- Linux: Fixed issue with running server and client on the same host

0.3.0-RC3
Soon to be released 0.3.0
- Server no longer supports link local addresses (bug #38)
- Linux: Fixed issue with running server and client on the same host (bug #56)
- Server now supports stateless mode (bug #71)
- Developer's guide (bugs #42, #43)
- Log files are now created, even when run in the console (bugs #34, #36)
- DAD timeout was decreased to 1 second
Expand All @@ -15,7 +16,7 @@
- Client requests for Lifetime option only if explicitly told to do so (bug #75)
- Server now properly retransmits messages.
- Client no longer sends RapidCommit unless told to do so (bug #55)
- Client no longer retrasmits indefinetly INF-REQUEST message
- Client no longer retrasmits indefinetly INF-REQUEST message.

0.3.0-RC2
- Fixed bug found by PCSS team regarding improper socket initialization in ClntTransMgr.
Expand Down Expand Up @@ -73,5 +74,5 @@
0.1.0
- First release

For details, see http://klub.com.pl/bugzilla/
For details regarding bugs and requested features, see http://klub.com.pl/bugzilla/

12 changes: 10 additions & 2 deletions CfgMgr/StationRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#endif
#include "StationRange.h"
#include "DHCPConst.h"
#include "Logger.h"

TStationRange::TStationRange(void)
{
Expand Down Expand Up @@ -114,8 +115,15 @@ unsigned long TStationRange::rangeCount()
return 0;
}

TStationRange::~TStationRange(void)
{
TStationRange::~TStationRange(void) {
}

SmartPtr<TIPv6Addr> TStationRange::getAddrL() {
return this->AddrL;
}

SmartPtr<TIPv6Addr> TStationRange::getAddrR() {
return this->AddrR;
}

ostream& operator<<(ostream& out,TStationRange& range)
Expand Down
7 changes: 6 additions & 1 deletion CfgMgr/StationRange.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
*
* released under GNU GPL v2 or later licence
*
* $Id: StationRange.h,v 1.3 2004-07-05 00:12:29 thomson Exp $
* $Id: StationRange.h,v 1.4 2004-12-07 00:45:41 thomson Exp $
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2004/07/05 00:12:29 thomson
* Lots of minor changes.
*
*
*/

Expand Down Expand Up @@ -40,6 +43,8 @@ class TStationRange
bool in(SmartPtr<TDUID> duid);
SmartPtr<TIPv6Addr> getRandomAddr();
unsigned long rangeCount();
SmartPtr<TIPv6Addr> getAddrL();
SmartPtr<TIPv6Addr> getAddrR();
private:
bool isAddrRange;
SmartPtr<TDUID> DUIDL;
Expand Down
31 changes: 13 additions & 18 deletions ClntAddrMgr/ClntAddrMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
*
* released under GNU GPL v2 or later licence
*
* $Id: ClntAddrMgr.cpp,v 1.7 2004-12-03 20:51:42 thomson Exp $
* $Id: ClntAddrMgr.cpp,v 1.8 2004-12-07 00:45:41 thomson Exp $
*
* $Log: not supported by cvs2svn $
* Revision 1.7 2004/12/03 20:51:42 thomson
* Logging issues fixed.
*
* Revision 1.6 2004/10/27 22:07:55 thomson
* Signed/unsigned issues fixed, Lifetime option implemented, INFORMATION-REQUEST
* message is now sent properly. Valid lifetime granted by server fixed.
Expand All @@ -30,8 +33,8 @@
#include "Logger.h"


TClntAddrMgr::TClntAddrMgr(SmartPtr<TClntCfgMgr> ClntCfgMgr, string addrdb, bool loadDB)
:TAddrMgr(addrdb, loadDB)
TClntAddrMgr::TClntAddrMgr(SmartPtr<TClntCfgMgr> ClntCfgMgr, string xmlFile, bool loadDB)
:TAddrMgr(xmlFile, loadDB)
{

// add this client (with proper duid)
Expand Down Expand Up @@ -115,36 +118,28 @@ void TClntAddrMgr::doDuties()

}

void TClntAddrMgr::firstIA()
{
void TClntAddrMgr::firstIA() {
Client->firstIA();
}

SmartPtr<TAddrIA> TClntAddrMgr::getIA()
{
SmartPtr<TAddrIA> TClntAddrMgr::getIA() {
return Client->getIA();
}

bool TClntAddrMgr::delIA(long IAID)
{
bool TClntAddrMgr::delIA(long IAID) {
return Client->delIA(IAID);
}

void TClntAddrMgr::addIA(SmartPtr<TAddrIA> ptr)
{
void TClntAddrMgr::addIA(SmartPtr<TAddrIA> ptr) {
Client->addIA(ptr);
}

int TClntAddrMgr::countIA()
{
int TClntAddrMgr::countIA() {
return Client->countIA();
}




TClntAddrMgr::~TClntAddrMgr()
{
TClntAddrMgr::~TClntAddrMgr() {
Log(Debug) << "ClntAddrMgr cleanup." << LogEnd;
}

bool TClntAddrMgr::isIAAssigned(unsigned long IAID)
Expand Down
8 changes: 6 additions & 2 deletions ClntAddrMgr/ClntAddrMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
*
* released under GNU GPL v2 or later licence
*
* $Id: ClntAddrMgr.h,v 1.4 2004-10-27 22:07:55 thomson Exp $
* $Id: ClntAddrMgr.h,v 1.5 2004-12-07 00:45:41 thomson Exp $
*
* $Log: not supported by cvs2svn $
* Revision 1.4 2004/10/27 22:07:55 thomson
* Signed/unsigned issues fixed, Lifetime option implemented, INFORMATION-REQUEST
* message is now sent properly. Valid lifetime granted by server fixed.
*
* Revision 1.3 2004/09/08 21:22:45 thomson
* Parser improvements, signed/unsigned issues addressed.
*
Expand All @@ -31,7 +35,7 @@ class TClntCfgMgr;
class TClntAddrMgr : public TAddrMgr
{
public:
TClntAddrMgr(SmartPtr<TClntCfgMgr> ClntConfMgr, string addrdb, bool loadDB);
TClntAddrMgr(SmartPtr<TClntCfgMgr> ClntConfMgr, string xmlFile, bool loadDB);

unsigned long getT1Timeout();
unsigned long getT2Timeout();
Expand Down
Loading

0 comments on commit 6823557

Please sign in to comment.