diff --git a/.cproject b/.cproject index eea8ca3..3e2d645 100644 --- a/.cproject +++ b/.cproject @@ -55,60 +55,8 @@ - - make - libACTK1_0.so - true - true - true - - - make - - clean - true - true - true - - - make - tests - true - true - true - - - make - dirs - true - true - true - - - make - dclean - true - true - true - - - make - - all - false - true - true - - - make - xsd2xml - true - true - true - make - clean true true @@ -116,7 +64,6 @@ make - all true true @@ -124,14 +71,68 @@ make + tests true true true - + make + libACTK1_0.so + true + true + true + + + make + clean + true + true + true + + + make + + tests + true + true + true + + + make + + dirs + true + true + true + + + make + + dclean + true + true + true + + + make + all + false + true + true + + + make + + build/LPCommands.o + true + true + false + + + make clean true true @@ -139,6 +140,7 @@ make + dirs true true @@ -146,6 +148,7 @@ make + apig-cli true true @@ -153,7 +156,6 @@ make - build/commander.o true true @@ -161,7 +163,6 @@ make - build/ausreg-cd true true @@ -169,7 +170,6 @@ make - cliever true true @@ -177,36 +177,13 @@ make - all true true true - - make - all - true - true - true - - - make - tests - true - true - true - - - make - clean - true - true - true - make - cliever true true @@ -214,6 +191,7 @@ make + clean false true @@ -221,6 +199,7 @@ make + distclean true true @@ -228,11 +207,36 @@ make + build/ausreg-md true true true + + make + + all + true + true + true + + + make + + tests + true + true + true + + + make + + clean + true + true + true + diff --git a/.gitignore b/.gitignore index 4fcadfe..21759f2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.cproject .settings .project *.o *.so *.d \ No newline at end of file +.cproject .settings .project **/*.o **/*.so **/*.d **/libACTK1_o.so **/drde-cliever **/drde-cd \ No newline at end of file diff --git a/ACTK1_0/Makefile b/ACTK1_0/Makefile index 03ea5af..6e736f6 100644 --- a/ACTK1_0/Makefile +++ b/ACTK1_0/Makefile @@ -114,29 +114,29 @@ $(BUILD_OBJ_DIR)/%: $(BUILD_OBJ_DIR)/%.o # # The toolkit raises the c++ "static initialization fiasco" situation. Use this as needed -# -#ARTKOBJS= build/XMLGregorianCalendar.o build/XMLParser.o build/XMLWriter.o build/ACSession.o build/DomainAddRem.o build/EnumDomainInfoResponse.o build/log.o build/PostalInfoType.o build/SessionManagerPropertiesImpl.o \ -#build/RegistrantObjectType.o build/mdLogger.o \ -#build/AddRemType.o build/DomainCheckResponse.o build/EnumDomainUpdateCommand.o build/LPECheckResponse.o build/Properties.o build/SessionPoolImpl.o \#build/boolean.o build/DomainCreateCommand.o build/EnumType.o build/LPECreateCommand.o build/ProtocolExtensionCommand.o build/SSLException.o \ -#build/CertificateUserMismatchException.o build/DomainCreateResponse.o build/EPPDateFormatter.o build/LPECreateResponse.o build/ReceiveSE.o build/StandardCommandType.o \ -#build/CheckResponse.o build/DomainInfoKVResponseExtension.o build/EPPWriter.o build/NamespaceResolver.o build/StandardObjectType.o \ -#build/CLTRID.o build/DomainInfoResponse.o build/ErrorPkg.o build/NAPTR.o build/RegistrantTransferCommandType.o build/StringUtils.o \ -#build/CommandCounter.o build/DomainKVCommandExtension.o build/Greeting.o build/NotificationResponse.o build/ResponseExtension.o build/SyncExtension.o \ -#build/Command.o build/DomainNotificationResponse.o build/HostAddRem.o build/ObjectCommand.o build/Response.o build/SystemProperties.o \ -#build/config.o build/DomainRegistrantTransferCommand.o build/HostCheckResponse.o build/ResultCounter.o build/Timer.o \ -#build/Constants.o build/DomainRegistrantTransferResponse.o build/HostCreateCommand.o build/Result.o build/TLSContext.o \ -#build/ContactCheckResponse.o build/DomainRenewCommand.o build/HostCreateResponse.o build/LPEDomainObjectType.o build/SecDNSChgType.o build/TLSSession.o \ -#build/ContactCreateCommand.o build/DomainRenewResponse.o build/HostInfoResponse.o build/SecDNSDSData.o build/TLSSocket.o \ -#build/ContactCreateResponse.o build/DomainSecDNSCreateCommandExtension.o build/HostUpdateCommand.o build/SecDNSDSOrKeyType.o build/TransferCommand.o \ -#build/ContactInfoResponse.o build/DomainSecDNSInfoResponseExtension.o build/InetAddress.o build/LPEExtension.o build/SecDNSExtension.o build/TransferOp.o \ -#build/ContactNotificationResponse.o build/DomainSecDNSUpdateCommandExtension.o build/InfoResponse.o build/LPELPECreateCommand.o build/SecDNSKeyData.o build/TransferResponse.o \ -#build/ContactTransferResponse.o build/DomainTransferResponse.o build/init.o build/Period.o build/SecDNSRemType.o build/UserPassMismatchException.o \ -#build/ContactUpdateCommand.o build/DomainUpdateCommand.o build/IPVersion.o build/PeriodUnit.o build/SendSE.o build/XMLDocument.o \ -#build/CreateResponse.o build/DomainUpdateSyncCommandExtension.o build/KVExtension.o build/PollOperation.o build/SessionFactory.o \ -#build/DataResponse.o build/E164Extension.o build/Logger.o build/PollResponse.o build/SessionManagerFactory.o \ -#build/Disclose.o build/EnumDomainCreateCommand.o build/LoginCommand.o build/PostalInfo.o build/SessionManagerImpl.o - - +# +ARTKOBJS= build/XMLGregorianCalendar.o build/XMLParser.o build/XMLWriter.o build/ACSession.o build/DomainAddRem.o build/EnumDomainInfoResponse.o build/log.o build/PostalInfoType.o build/SessionManagerPropertiesImpl.o \ +build/RegistrantObjectType.o \ +build/AddRemType.o build/DomainCheckResponse.o build/EnumDomainUpdateCommand.o build/Properties.o build/SessionPoolImpl.o \ +build/boolean.o build/DomainCreateCommand.o build/EnumType.o build/ProtocolExtensionCommand.o build/SSLException.o \ +build/CertificateUserMismatchException.o build/DomainCreateResponse.o build/EPPDateFormatter.o build/ReceiveSE.o build/StandardCommandType.o \ +build/CheckResponse.o build/DomainInfoKVResponseExtension.o build/EPPWriter.o build/NamespaceResolver.o build/StandardObjectType.o \ +build/CLTRID.o build/DomainInfoResponse.o build/ErrorPkg.o build/NAPTR.o build/RegistrantTransferCommandType.o build/StringUtils.o \ +build/CommandCounter.o build/DomainKVCommandExtension.o build/Greeting.o build/NotificationResponse.o build/ResponseExtension.o build/SyncExtension.o \ +build/Command.o build/DomainNotificationResponse.o build/HostAddRem.o build/ObjectCommand.o build/Response.o build/SystemProperties.o \ +build/config.o build/DomainRegistrantTransferCommand.o build/HostCheckResponse.o build/LPRespExtender.o build/ResultCounter.o build/Timer.o \ +build/Constants.o build/DomainRegistrantTransferResponse.o build/HostCreateCommand.o build/LPCmdExtender.o build/Result.o build/TLSContext.o \ +build/ContactCheckResponse.o build/DomainRenewCommand.o build/HostCreateResponse.o build/LPLaunch.o build/SecDNSChgType.o build/TLSSession.o \ +build/ContactCreateCommand.o build/DomainRenewResponse.o build/HostInfoResponse.o build/LPExtension.o build/SecDNSDSData.o build/TLSSocket.o \ +build/ContactCreateResponse.o build/DomainSecDNSCreateCommandExtension.o build/HostUpdateCommand.o build/SecDNSDSOrKeyType.o build/TransferCommand.o \ +build/ContactInfoResponse.o build/DomainSecDNSInfoResponseExtension.o build/InetAddress.o build/SecDNSExtension.o build/TransferOp.o \ +build/ContactNotificationResponse.o build/DomainSecDNSUpdateCommandExtension.o build/InfoResponse.o build/SecDNSKeyData.o build/TransferResponse.o \ +build/ContactTransferResponse.o build/DomainTransferResponse.o build/init.o build/Period.o build/SecDNSRemType.o build/UserPassMismatchException.o \ +build/ContactUpdateCommand.o build/DomainUpdateCommand.o build/IPVersion.o build/PeriodUnit.o build/SendSE.o build/XMLDocument.o \ +build/CreateResponse.o build/DomainUpdateSyncCommandExtension.o build/KVExtension.o build/PollOperation.o build/SessionFactory.o \ +build/DataResponse.o build/E164Extension.o build/Logger.o build/PollResponse.o build/SessionManagerFactory.o \ +build/Disclose.o build/EnumDomainCreateCommand.o build/LoginCommand.o build/PostalInfo.o build/SessionManagerImpl.o + .PHONY: tests tests: all $(test_execs) @@ -148,7 +148,7 @@ dirs: libACTK1_0.so: $(BUILD_LIB_DIR)/libACTK1_0.so: $(objs) - $(CXX) $(LDFLAGS) $(PRODORDEV) -shared $(objs) -o $@ + $(CXX) $(LDFLAGS) $(PRODORDEV) -shared $(ARTKOBJS) -o $@ xsd2xml: $(BUILD_OBJ_DIR)/xsd2xml: build/parser.o diff --git a/ACTK1_0/se/LPE/LPExtension.cpp b/ACTK1_0/se/LPE/LPExtension.cpp new file mode 100644 index 0000000..5adcde7 --- /dev/null +++ b/ACTK1_0/se/LPE/LPExtension.cpp @@ -0,0 +1,14 @@ +#include "se/LPE/LPExtension.hpp" + +std::string& LPExtension::getURI() const +{ + static std::string uri = "urn:ietf:params:xml:ns:launch-1.0"; + return uri; +} + +std::string& LPExtension::getSchemaLocation() const +{ + static std::string loc = "urn:ietf:params:xml:ns:launch-1.0 launch-1.0.xsd"; + return loc; +} + diff --git a/ACTK1_0/se/LPE/LPExtension.hpp b/ACTK1_0/se/LPE/LPExtension.hpp new file mode 100644 index 0000000..bb6a443 --- /dev/null +++ b/ACTK1_0/se/LPE/LPExtension.hpp @@ -0,0 +1,29 @@ +#ifndef __LPEXTENSION_HPP +#define __LPEXTENSION_HPP + +#include "se/Extension.hpp" + +/** + * A bundled set of constants representing the .ae EPP extension + * schema. The namespace URI uniquely identifies the extension. + */ +class LPExtension : public Extension +{ +public: + + virtual ~LPExtension(void) { } + + /** + * Get the globally unique namespace URI which identifies this extension. + */ + virtual std::string& getURI() const; + + /** + * Get the location hint for the XML schema used to validate EPP service + * element instances using this extension. + */ + virtual std::string& getSchemaLocation() const; +}; + +#endif // __LPEXTENSION_HPP + diff --git a/ACTK1_0/se/LPE/LPLaunch.cpp b/ACTK1_0/se/LPE/LPLaunch.cpp new file mode 100644 index 0000000..f37fe8a --- /dev/null +++ b/ACTK1_0/se/LPE/LPLaunch.cpp @@ -0,0 +1,16 @@ +#include "xml/XMLHelper.hpp" +#include "LPLaunch.hpp" + +void LPLaunch::appendData(XMLWriter* xmlWriter, DOMElement* addElement) +{ + DOMElement* lpDataElement = xmlWriter->appendChild(addElement, "launch"); + XMLHelper::setTextContent(xmlWriter->appendChild(lpDataElement, "phase"), phase); + XMLHelper::setTextContent(xmlWriter->appendChild(lpDataElement, "status"), status); + + +} +void LPLaunch::createXMLElement(XMLWriter* xmlWriter, DOMElement* addElement) +{ + + +} diff --git a/ACTK1_0/se/LPE/LPLaunch.hpp b/ACTK1_0/se/LPE/LPLaunch.hpp new file mode 100644 index 0000000..b2bb087 --- /dev/null +++ b/ACTK1_0/se/LPE/LPLaunch.hpp @@ -0,0 +1,40 @@ +#ifndef LPDATA_HPP_ +#define LPDATA_HPP_ + +#include + +#include "xercesc/dom/DOMElement.hpp" +#include "xml/XMLWriter.hpp" + +using namespace std; + +class LPLaunch +{ + public: + LPLaunch() : + phase(""), + status(")") + {} + + virtual ~LPLaunch() {} + + const string getPhase() const; + const string getStatus() const; + + void appendData(XMLWriter* xmlWriter, DOMElement* addElement); + void createXMLElement(XMLWriter* xmlWriter, DOMElement* addElement); + private: + string phase; + string status; +}; + +inline const string LPLaunch::getPhase() const +{ + return phase; +} +inline const string LPLaunch::getStatus() const +{ + return status; +} + +#endif /* LPDATA_HPP_ */ diff --git a/AusRegCliever/Makefile b/AusRegCliever/Makefile index cdad37b..3bbf17c 100644 --- a/AusRegCliever/Makefile +++ b/AusRegCliever/Makefile @@ -127,7 +127,7 @@ build/mdAusReg.o: server/mdAusReg.cpp include/*.h build/ausreg-md: $(MDOBJS) $(CC) $(CFLAGS) -o build/ausreg-md $(SINCL) $(LIBS) $(MDOBJS) $(DLIBS) -build/drde-cliever: $(ACOBJS) +build/drde-cliever: $(ACOBJS) $(CC) $(CFLAGS) -o build/drde-cliever $(SINCL) $(LIBS) $(ACOBJS) $(SLIBS) $(ARTKDEPS) doxygen/index.html: etc/doxygen.config diff --git a/AusRegCliever/build/drde-cliever b/AusRegCliever/build/drde-cliever deleted file mode 100755 index d01a13a..0000000 Binary files a/AusRegCliever/build/drde-cliever and /dev/null differ diff --git a/AusRegCliever/server/mdAusReg.cpp b/AusRegCliever/server/mdAusReg.cpp index 7b784db..91fdb77 100644 --- a/AusRegCliever/server/mdAusReg.cpp +++ b/AusRegCliever/server/mdAusReg.cpp @@ -8,8 +8,7 @@ #include "session/StatsManager.hpp" #include "se/DomainCheckCommand.hpp" #include "se/DomainCheckResponse.hpp" -#include "OTE/LPECheckCommand.hpp" -#include "OTE/LPECheckResponse.hpp" +#include "se/LPE/LPCmdExtender.hpp" #include "se/TransferOp.hpp" #include "se/IntPostalInfo.hpp" #include "se/ContactCreateCommand.hpp" @@ -18,8 +17,6 @@ #include "se/DomainCreateResponse.hpp" #include "se/DomainTransferCommand.hpp" #include "se/DomainTransferResponse.hpp" -#include "OTE/LPECreateCommand.hpp" -#include "OTE/LPECreateResponse.hpp" using namespace std; @@ -150,11 +147,13 @@ void ausRegEPPTK::doOTEB() const IntPostalInfo rrjPO(rrjName,rrjOrg, rrjCrib,rrjCity,rrjProv,rrjPC,rrjGuo); - ContactCreateCommand baCommand_0(rrj,rrjPW,&rrjPO,rrjEmail); - ContactCreateResponse baResponse_0; + ContactCreateCommand oteCommand_0(rrj,rrjPW,&rrjPO,rrjEmail); + ContactCreateResponse oteResponse_0; + + theseLogs->logN(1,"(skip) Create Contact(s)."); if (!contactCreated) try { - thisTest = Transaction(&baCommand_0, &baResponse_0); + thisTest = Transaction(&oteCommand_0, &oteResponse_0); manager->execute(thisTest); } catch(const std::exception e) @@ -166,15 +165,15 @@ void ausRegEPPTK::doOTEB() theseLogs->logN(1,"Case %d Failed, harness catch.",cmd++); } - theseLogs->logN(1,"Continue Basic Access OTE Transactions."); + theseLogs->logN(1,"Continue OTE Transactions."); sleep(2); theseLogs->logN(1,"(%d) Conventional check of yoda.guru",cmd++); - DomainCheckCommand baCommand_1(name2); - DomainCheckResponse baResponse_1; + DomainCheckCommand oteCommand_1(name2); + DomainCheckResponse oteResponse_1; try { - thisTest = Transaction(&baCommand_1, &baResponse_1); + thisTest = Transaction(&oteCommand_1, &oteResponse_1); manager->execute(thisTest); } catch(...) @@ -182,13 +181,29 @@ void ausRegEPPTK::doOTEB() theseLogs->logN(0,"Case %d Failed, harness catch.",cmd++); } - theseLogs->logN(1,"(%d) LPE Check of unicycles.bike",cmd++); + theseLogs->logN(1,"(%d) LPE Check of unicycles.bike",cmd++); - LPECheckCommand baCommand_2("unicycles.bike"); - LPECheckResponse baResponse_2; + DomainCheckCommand oteCommand_2("unicycles.bike"); + LPCmdExtender oteCX; oteCX.addToCommand(oteCommand_2); - thisTest = Transaction(&baCommand_2, &baResponse_2); - manager->execute(thisTest); + DomainCheckResponse oteResponse_2; + + try { + thisTest = Transaction(&oteCommand_2, &oteResponse_2); + manager->execute(thisTest); + } + catch (EPPException& e) + { const char *eMsg = e.getMessage().c_str(); + const char *opNow = op.c_str(); + theseLogs->logN(2,"EPP Exception during OTE B (%s): %s .",opNow,eMsg); + throw e; + } + catch (...) + { + theseLogs->logN(2,"General Exception OTE B (%s).",op.c_str()); + } + + // Used in all of below const std::string pw("Ab9dW@rd"); const std::string RID("renjuan"); @@ -197,52 +212,54 @@ void ausRegEPPTK::doOTEB() std::vector billing(1,std::string("renjuan") ); std::vector ns(1,std::string("ns1.google.com") );; -// admin.push_back(std::string("Administration")); -// tech.push_back(std::string("Technical")); -// billing.push_back(std::string("Billing")); -// ns.push_back(std::string("ns1.google.com")); - try { theseLogs->logN(2,"skip: (%d) LPE create more using OTE %s.",cmd++, - thisAccount); + theseLogs->logN(2,"skip: (%d) create more domains in OTE %s.",cmd++, thisAccount); - if (addDomains) { + if (addDomains) { + + try { DomainCreateCommand - baCommand_3(name3,pw,&RID, &tech, &ns, &admin, &billing); - DomainCreateResponse baResponse_3; + oteCommand_3(name3,pw,&RID, &tech, &ns, &admin, &billing); + DomainCreateResponse oteResponse_3; - thisTest = Transaction(&baCommand_3, &baResponse_3); + thisTest = Transaction(&oteCommand_3, &oteResponse_3); manager->execute(thisTest); DomainCreateCommand - baCommand_3a(name2,pw,&RID, &tech, &ns, &admin, &billing); - DomainCreateResponse baResponse_3a; + oteCommand_3a(name2,pw,&RID, &tech, &ns, &admin, &billing); + DomainCreateResponse oteResponse_3a; - thisTest = Transaction(&baCommand_3a, &baResponse_3a); + thisTest = Transaction(&oteCommand_3a, &oteResponse_3a); manager->execute(thisTest); DomainCreateCommand - baCommand_3b(name5,pw,&RID, &tech, &ns, &admin, &billing); - DomainCreateResponse baResponse_3b; + oteCommand_3b(name5,pw,&RID, &tech, &ns, &admin, &billing); + DomainCreateResponse oteResponse_3b; - thisTest = Transaction(&baCommand_3b, &baResponse_3b); + thisTest = Transaction(&oteCommand_3b, &oteResponse_3b); manager->execute(thisTest); DomainCreateCommand - baCommand_3c(name4,pw,&RID, &tech, &ns, &admin, &billing); - DomainCreateResponse baResponse_3c; + oteCommand_3c(name4,pw,&RID, &tech, &ns, &admin, &billing); + DomainCreateResponse oteResponse_3c; - thisTest = Transaction(&baCommand_3c, &baResponse_3c); + thisTest = Transaction(&oteCommand_3c, &oteResponse_3c); manager->execute(thisTest); - - } + } + catch (EPPException& e) + { const char *eMsg = e.getMessage().c_str(); + const char *opNow = op.c_str(); + theseLogs->logN(2,"EPP Exception during OTE B (%s): %s .",opNow,eMsg); + throw e; } - catch(...) + catch (...) { - theseLogs->logN(0,"Case %d Failed, harness catch.",cmd++); + theseLogs->logN(2,"General Exception OTE B (%s).",op.c_str()); } + } - theseLogs->logN(2,"%s (%d) %s -> %s.", + theseLogs->logN(2,"skip %s (%d) %s -> %s.", (transferGainer ? "Request" : "Approve"),cmd++, name1,thatAccount); @@ -252,12 +269,12 @@ void ausRegEPPTK::doOTEB() transferGainer ? new TransferOp("request") : new TransferOp("approve") ; DomainTransferCommand - baCommand_4(thisTransfer,name1); - DomainTransferResponse baResponse_4; + oteCommand_4(thisTransfer,name1); + DomainTransferResponse oteResponse_4; try { - thisTest = Transaction(&baCommand_4, &baResponse_4); + thisTest = Transaction(&oteCommand_4, &oteResponse_4); manager->execute(thisTest); } @@ -266,25 +283,27 @@ void ausRegEPPTK::doOTEB() theseLogs->logN(0,"Case %d Failed, harness catch.",cmd++); } - } + } - theseLogs->logN(1,"(%d) Sunrise create %s with ICANN SMD test files.",cmd++,name5); + theseLogs->logN(1,"(%d) Sunrise create %s with ICANN SMD test files.",cmd++,name5); - LPECreateCommand baCommand_5(name5,pw,&RID, &tech, &ns, &admin, &billing); - LPECreateResponse baResponse_5; + DomainCreateCommand oteCommand_5(name5,pw,&RID, &tech, &ns, &admin, &billing); + LPCmdExtender oteC5X; oteC5X.addToCommand(oteCommand_5); + DomainCreateResponse oteResponse_5; - thisTest = Transaction(&baCommand_5, &baResponse_5); + thisTest = Transaction(&oteCommand_5, &oteResponse_5); manager->execute(thisTest); theseLogs->logN(1,"(%d) Create test-validate.claimsgasix (TCN).",cmd++); - LPECreateCommand baCommand_6("test-validate.claimsgasix",pw,&RID, &tech, &ns, &admin, &billing); - LPECreateResponse baResponse_6; + DomainCreateCommand oteCommand_6("test-validate.claimsgasix",pw,&RID, &tech, &ns, &admin, &billing); + LPCmdExtender oteC6X; oteC6X.addToCommand(oteCommand_6); + DomainCreateResponse oteResponse_6; - thisTest = Transaction(&baCommand_6, &baResponse_6); + thisTest = Transaction(&oteCommand_6, &oteResponse_6); manager->execute(thisTest); - theseLogs->logN(1,"End OTE Basic Access Tests.",cmd++); + theseLogs->logN(0,"End OTE Session."); sess->close(); manager->shutdown(); @@ -293,12 +312,12 @@ void ausRegEPPTK::doOTEB() catch (EPPException& e) { const char *eMsg = e.getMessage().c_str(); const char *opNow = op.c_str(); - theseLogs->logN(2,"EPP Exception during OTE B (%s): %s .",opNow,eMsg); + theseLogs->logN(2,"Outer EPP Exception during OTE (%s): %s .",opNow,eMsg); throw e; } catch (...) { - theseLogs->logN(2,"General Exception during OTE B (%s).",op.c_str()); + theseLogs->logN(2,"Outer General Exception in OTE (%s).",op.c_str()); } }// debug while