diff --git a/.cproject b/.cproject index b63fa6f..4456858 100644 --- a/.cproject +++ b/.cproject @@ -131,9 +131,18 @@ true true - + make - cliever + + dirs + true + true + true + + + make + + ausreg_cd true true true diff --git a/ACTK1_0/Makefile.ausReg b/ACTK1_0/Makefile.ausReg new file mode 100644 index 0000000..a774ead --- /dev/null +++ b/ACTK1_0/Makefile.ausReg @@ -0,0 +1,127 @@ +################################################## +# Makefile for building lib and main test routine# +################################################## +LOCATION=authoring + +SYSTEM = $(shell uname -s) + +CXX = g++ +CC = gcc + +#PRODORDEV += -O2 +PRODORDEV += -ggdb3 + +CXXFLAGS = $(PRODORDEV) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC +CPPFLAGS = -fPIC -D_GNU_SOURCE +CXXFLAGS += -D_GNU_SOURCE -O0 + +ifeq ($(LOCATION),authoring) +XALAN_LIB_DIR = /usr/lib/x86_64-linux-gnu/ +endif +ifeq ($(LOCATION),production) +XALAN_LIB_DIR = /usr/lib/ +endif +XALAN_LIB = xalan-c +XALAN_INC_DIR = /usr/include/xalanc +XERCES_LIB_DIR = /usr/lib/ +XERCES_LIB = xerces-c +XERCES_INC_DIR = /usr/include/xercesc/ + +include xml-deps.mk + +##### Set this to the location of the library to be produced + +BUILD_LIB_DIR = lib +BUILD_OBJ_DIR = build + +###### Include Paths + +INCLUDE_DIR = -I . -I $(XERCES_INC_DIR) -I $(XALAN_INC_DIR) + +build_obj_dir = $(BUILD_OBJ_DIR) + +src_dirs_cpp = se se/secDNS common session xml +src_dirs_c = config +srcs_all = $(foreach dir,$(src_dirs_cpp),$(wildcard $(dir)/*.cpp)) +srcs_all += $(foreach dir,$(src_dirs_c),$(wildcard $(dir)/*.c)) + +srcs = $(filter-out %Test.cpp,$(srcs_all)) +objs = $(foreach file,$(srcs),$(build_obj_dir)/$(basename $(notdir $(file))).o) +test_srcs = $(filter %Test.cpp,$(srcs_all)) +test_objs = $(foreach file,$(test_srcs),$(build_obj_dir)/$(basename $(notdir $(file))).o) +test_execs = $(subst .o,,$(test_objs)) + +calc_deps = \ + $(CC) -MT '$(build_obj_dir)/$(basename $(notdir $@)).o $@' -MF $@ -MM $(CPPFLAGS) $(INCLUDE_DIR) $< + +all: dirs $(objs) $(BUILD_LIB_DIR)/libAusRegEPPTK.so + +%.d: %.c + $(calc_deps) +%.d: %.cpp + $(calc_deps) +include $(foreach name,$(srcs_all),$(basename $(name)).d) + +vpath %.cpp ./ \ + ./se\ + ./se/secDNS\ + ./xml\ + ./common\ + ./session\ + +vpath %.c ./config + +vpath %.o ../build + +####### Implicit rules + +.SUFFIXES: .cpp .c + +$(BUILD_OBJ_DIR)/%.o: %.cpp + $(CXX) $(CXXFLAGS) -c -o $@ $(INCLUDE_DIR) $< + +$(BUILD_OBJ_DIR)/%.o: %.c + $(CC) $(CPPFLAGS) -c -o $@ $(INCLUDE_DIR) $< + + +LDFLAGS_TESTS = -L$(BUILD_LIB_DIR) -lAusRegEPPTK \ + -L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg -licuuc -licudata \ + -L$(XERCES_LIB_DIR) -lxerces-c \ + -lssl \ + -lrt + +$(BUILD_OBJ_DIR)/%: $(BUILD_OBJ_DIR)/%.o + $(CXX) $(LDFLAGS_TESTS) -o $@ $< + +.PHONY: doc clean dclean +####### Build rules + +#libAusreg_EPP_toolkit.a: $(OBJECTS) +# $(LIB_ARCHIVER) $(LIB_FLAGS) $(BUILD_LIB_DIR)/$@ $^ + + +.PHONY: tests +tests: all $(test_execs) + + +.PHONY: dirs +dirs: + -mkdir -p $(BUILD_LIB_DIR) + -mkdir -p $(BUILD_OBJ_DIR) + +libAusRegEPPTK.so: +$(BUILD_LIB_DIR)/libAusRegEPPTK.so: $(objs) + $(CXX) $(LDFLAGS) $(PRODORDEV) -shared $^ -o $@ + +doc: + doxygen etc/Doxyfile + +clean: + $(RM) $(objs) $(BUILD_LIB_DIR)/libAusRegEPPTK.so *~ + $(RM) -r $(BUILD_OBJ_DIR) + $(RM) -r $(BUILD_LIB_DIR) + +dclean: + $(MAKE) clean + $(RM) */*.d + diff --git a/ACTK1_0/README.txt b/ACTK1_0/README.txt new file mode 100644 index 0000000..1869779 --- /dev/null +++ b/ACTK1_0/README.txt @@ -0,0 +1,146 @@ +A. Software Requirements +------------------------ + +1. GNU Make 3.80 or later +2. GCC 3.4.6 (for gcc and g++) +3. Xerces C++ 2.7.0 +4. Xalan C++ 1.0 +5. OpenSSL 0.9.7a or later +6. Doxygen 1.3.9.1 (required to produce API documentation) + +Notes +The software library may build with an earlier GCC release, but has only been +verified on GCC 3.4.6. It was developed on 64-bit Redhat Enterprise Linux ES +4 using 64-bit supporting libraries (Xerces, Xalan, OpenSSL). + + +B. Build Instructions +--------------------- + +1. Set the values of the following environment variables: +XALAN_LIB_DIR +XALAN_LIB +XALAN_INC_DIR +XERCES_LIB_DIR +XERCES_LIB +XERCES_INC_DIR +Examples: +$ XALAN_LIB_DIR=/usr/local/xalan-c/lib +$ XALAN_LIB=xalan-c +$ XALAN_INC_DIR=/usr/local/xalan-c/include +$ XERCES_LIB_DIR=/usr/lib +$ XERCES_LIB=xerces-c +$ XERCES_INC_DIR=/usr/include/xercesc +$ export XALAN_LIB_DIR XALAN_LIB XALAN_INC_DIR XERCES_LIB_DIR XERCES_LIB XERCES_INC_DIR + +2. Verify version of tools. +$ make --version$ make --version +GNU Make 3.80 +Copyright (C) 2002 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. +There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A +PARTICULAR PURPOSE. + +$ gcc --version +gcc (GCC) 3.4.6 20060404 (Red Hat 3.4.6-8) +Copyright (C) 2006 Free Software Foundation, Inc. +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +$ openssl version +OpenSSL 0.9.7a Feb 19 2003 + +$ doxygen --version +1.3.9.1 + +2. Unpack the toolkit source (one of the following): +> tar xf cpptk2_release.tar +> tar zxf cpptk2_release.tar.gz +> tar jxf cpptk2_release.tar.bz2 + +3. Build the C++ Toolkit shared library: +> make + +4. The previous command will leave object files in the bin directory and, most +importantly, the shared object file (libAusreg_EPP_toolkit.so) in the lib +directory. + + +C. Usage Information and Advice +------------------------------- + +1. When using the toolkit, the LD_LIBRARY_PATH should contain the lib +directory, or else the libAusreg_EPP_toolkit.so file shold be placed in a +system library directory, or the linker should otherwise be made aware of the +location of the libAusreg_EPP_toolkit.so file (such as by using ldconfig). +Also, the linker will need to find the Xalan and Xerces libraries (by similar +means). + +2. A configuration file (see toolkit2.conf for a sample file) must be available +to the toolkit at startup. It is recommended that this file be named +absolutely. This file directs the library to the location of other resources +required for correct operation. The user should ensure that each resource +named in the configuration file resolves to an available file on the system +(such as .xsd files). The sample configuration file is in the 'etc' directory. + +4. XML schema definition files are in the 'resources' directory. They may be +copied to another location as appropriate to the client's environment, but such +a location must be defined as described in step C.2. + + +D. Running Bundled Tests +------------------------ + +There are a set of unit tests provided with the source release of the C++ +toolkit. Follow the steps below to run these tests. In the examples, phrases +delimited by < and > should be replaced by suitable values, such as: +ORG= +to be replaced with: +ORG="AusRegistry Pty Ltd" + +1. Ensure the system requirements are met. + +2. Obtain the latest C++ toolkit source release. + +3. Obtain a valid username/password combination from the Registry server. + +4. Generate a private key and corresponding public certificate signing request, +as documented in the Registrar Help Centre (www.ausregistry.net.au). Define +the location of the private key and the certificate file returned by Registry +support staff in the toolkit configuration file. You will also receive a +CAfile from the Registry operator. The location of this must be specified by +the ssl.ca.location configuration parameter. The other parameters are +ssl.cert.location, ssl.privatekey.location and ssl.privatekey.pass for the +location of the public certificate and private key files and the passphrase of +the private key, respectively. + +5. Copy or modify the site.properties file from the 'etc' directory of the +Toolkit source release, and modify the parameters to suit your requirements. +The username and password are as obtained in (3) above. Registry support +should provide the location (hostname and port) of a suitable EPP server for +testing. +Note: the environment variable EPP_SITE_PROPERTIES defines the location of the +modified site.properties file and should be stated as an absolute filename. + +Example: +export EPP_SITE_PROPERTIES=/home/eppclient/etc/site-test.properties + +6. Run the supplied tests (will build the Toolkit library if not already built). +$ make tests + +9. Verify the results of the test run. If the test run is successful, then +there will be no output, otherwise each failed test will be reported to the +screen. Failure details are available in the target/test_reports directory. +Log messages are written by default to a file name 'log' in the working +directory. Only the messages from the last test class are available after the +test run completes. + +If the tests passed, congratulations! You have successfully configured the +dependencies of the toolkit. The next step is to consult the user manual, +which is available from the Registry Portal. Keep track of the resources +created during this procedure, especially the private key and public +certificate, as these will be required by the toolkit when integrated into your +application. + + +--- End of README.txt --- diff --git a/ACTK1_0/RELEASE_NOTES.txt b/ACTK1_0/RELEASE_NOTES.txt new file mode 100644 index 0000000..f9e11c8 --- /dev/null +++ b/ACTK1_0/RELEASE_NOTES.txt @@ -0,0 +1,20 @@ +AusRegistry's EPP Client Library for the C++ Programming Language. + +Changes in version 1.3.2 +* Change API on TLSSocket. writeInt(int i) now throws SSLException. +* Blocked SIGPIPE signal as work around fix for OpenSSL bug in version (openssl-0.9.8e-22.el5). +* Fixed exception handling mismatches in TLSSession class. + +Changes in version 1.3.1 +* Corrected sample hostname value in toolkit2.conf. + +Changes in version 1.3 +* Added classes to support DNSSEC through SecDNS-1.1 schema + +Changes in version 1.2 +* Added classes to support Key Value extensions (DomainInfoKVResponseExtension, DomainKVCommandExtension, KVExtension) +* Added classes to support generic Domain Registrant Transfer command (DomainRegistrantTransfer) + +Changes in version 1.1 +* Added classes to support Domain Expiry Synchronisation (DomainUpdateSyncCommandExtension) +* Fixed memory leaks diff --git a/ACTK1_0/build/AddRemType.o b/ACTK1_0/build/AddRemType.o new file mode 100644 index 0000000..a845016 Binary files /dev/null and b/ACTK1_0/build/AddRemType.o differ diff --git a/ACTK1_0/build/AeDomainCreateCommand.o b/ACTK1_0/build/AeDomainCreateCommand.o new file mode 100644 index 0000000..2d30a0e Binary files /dev/null and b/ACTK1_0/build/AeDomainCreateCommand.o differ diff --git a/ACTK1_0/build/AeDomainInfoResponse.o b/ACTK1_0/build/AeDomainInfoResponse.o new file mode 100644 index 0000000..02c1eb2 Binary files /dev/null and b/ACTK1_0/build/AeDomainInfoResponse.o differ diff --git a/ACTK1_0/build/AeDomainModifyRegistrantCommand.o b/ACTK1_0/build/AeDomainModifyRegistrantCommand.o new file mode 100644 index 0000000..593c56a Binary files /dev/null and b/ACTK1_0/build/AeDomainModifyRegistrantCommand.o differ diff --git a/ACTK1_0/build/AeDomainObjectType.o b/ACTK1_0/build/AeDomainObjectType.o new file mode 100644 index 0000000..f15d443 Binary files /dev/null and b/ACTK1_0/build/AeDomainObjectType.o differ diff --git a/ACTK1_0/build/AeDomainTransferRegistrantCommand.o b/ACTK1_0/build/AeDomainTransferRegistrantCommand.o new file mode 100644 index 0000000..e4dbe05 Binary files /dev/null and b/ACTK1_0/build/AeDomainTransferRegistrantCommand.o differ diff --git a/ACTK1_0/build/AeDomainTransferRegistrantResponse.o b/ACTK1_0/build/AeDomainTransferRegistrantResponse.o new file mode 100644 index 0000000..f45ccb5 Binary files /dev/null and b/ACTK1_0/build/AeDomainTransferRegistrantResponse.o differ diff --git a/ACTK1_0/build/AeExtension.o b/ACTK1_0/build/AeExtension.o new file mode 100644 index 0000000..647178a Binary files /dev/null and b/ACTK1_0/build/AeExtension.o differ diff --git a/ACTK1_0/build/ArDomainObjectType.o b/ACTK1_0/build/ArDomainObjectType.o new file mode 100644 index 0000000..3cf1347 Binary files /dev/null and b/ACTK1_0/build/ArDomainObjectType.o differ diff --git a/ACTK1_0/build/ArDomainPolicyDeleteCommand.o b/ACTK1_0/build/ArDomainPolicyDeleteCommand.o new file mode 100644 index 0000000..52d0519 Binary files /dev/null and b/ACTK1_0/build/ArDomainPolicyDeleteCommand.o differ diff --git a/ACTK1_0/build/ArDomainPolicyUndeleteCommand.o b/ACTK1_0/build/ArDomainPolicyUndeleteCommand.o new file mode 100644 index 0000000..07ec4a1 Binary files /dev/null and b/ACTK1_0/build/ArDomainPolicyUndeleteCommand.o differ diff --git a/ACTK1_0/build/ArDomainUndeleteCommand.o b/ACTK1_0/build/ArDomainUndeleteCommand.o new file mode 100644 index 0000000..d55daf8 Binary files /dev/null and b/ACTK1_0/build/ArDomainUndeleteCommand.o differ diff --git a/ACTK1_0/build/ArDomainUnrenewCommand.o b/ACTK1_0/build/ArDomainUnrenewCommand.o new file mode 100644 index 0000000..9b0deb7 Binary files /dev/null and b/ACTK1_0/build/ArDomainUnrenewCommand.o differ diff --git a/ACTK1_0/build/ArDomainUnrenewResponse.o b/ACTK1_0/build/ArDomainUnrenewResponse.o new file mode 100644 index 0000000..6d12d42 Binary files /dev/null and b/ACTK1_0/build/ArDomainUnrenewResponse.o differ diff --git a/ACTK1_0/build/ArExtension.o b/ACTK1_0/build/ArExtension.o new file mode 100644 index 0000000..a8f10ff Binary files /dev/null and b/ACTK1_0/build/ArExtension.o differ diff --git a/ACTK1_0/build/ArUnrenewCommandType.o b/ACTK1_0/build/ArUnrenewCommandType.o new file mode 100644 index 0000000..0caa525 Binary files /dev/null and b/ACTK1_0/build/ArUnrenewCommandType.o differ diff --git a/ACTK1_0/build/AuDomainCreateCommand.o b/ACTK1_0/build/AuDomainCreateCommand.o new file mode 100644 index 0000000..ded634b Binary files /dev/null and b/ACTK1_0/build/AuDomainCreateCommand.o differ diff --git a/ACTK1_0/build/AuDomainCreateCommandV1.o b/ACTK1_0/build/AuDomainCreateCommandV1.o new file mode 100644 index 0000000..013f394 Binary files /dev/null and b/ACTK1_0/build/AuDomainCreateCommandV1.o differ diff --git a/ACTK1_0/build/AuDomainInfoResponse.o b/ACTK1_0/build/AuDomainInfoResponse.o new file mode 100644 index 0000000..30063d2 Binary files /dev/null and b/ACTK1_0/build/AuDomainInfoResponse.o differ diff --git a/ACTK1_0/build/AuDomainInfoResponseV1.o b/ACTK1_0/build/AuDomainInfoResponseV1.o new file mode 100644 index 0000000..c5f60df Binary files /dev/null and b/ACTK1_0/build/AuDomainInfoResponseV1.o differ diff --git a/ACTK1_0/build/AuDomainModifyRegistrantCommand.o b/ACTK1_0/build/AuDomainModifyRegistrantCommand.o new file mode 100644 index 0000000..709adff Binary files /dev/null and b/ACTK1_0/build/AuDomainModifyRegistrantCommand.o differ diff --git a/ACTK1_0/build/AuDomainObjectType.o b/ACTK1_0/build/AuDomainObjectType.o new file mode 100644 index 0000000..03f3414 Binary files /dev/null and b/ACTK1_0/build/AuDomainObjectType.o differ diff --git a/ACTK1_0/build/AuDomainTransferRegistrantCommand.o b/ACTK1_0/build/AuDomainTransferRegistrantCommand.o new file mode 100644 index 0000000..3c24bdc Binary files /dev/null and b/ACTK1_0/build/AuDomainTransferRegistrantCommand.o differ diff --git a/ACTK1_0/build/AuDomainTransferRegistrantResponse.o b/ACTK1_0/build/AuDomainTransferRegistrantResponse.o new file mode 100644 index 0000000..4e561f2 Binary files /dev/null and b/ACTK1_0/build/AuDomainTransferRegistrantResponse.o differ diff --git a/ACTK1_0/build/AuExtension.o b/ACTK1_0/build/AuExtension.o new file mode 100644 index 0000000..2ce5813 Binary files /dev/null and b/ACTK1_0/build/AuExtension.o differ diff --git a/ACTK1_0/build/AuExtensionV1.o b/ACTK1_0/build/AuExtensionV1.o new file mode 100644 index 0000000..ff2dd3f Binary files /dev/null and b/ACTK1_0/build/AuExtensionV1.o differ diff --git a/ACTK1_0/build/CLTRID.o b/ACTK1_0/build/CLTRID.o new file mode 100644 index 0000000..1fee468 Binary files /dev/null and b/ACTK1_0/build/CLTRID.o differ diff --git a/ACTK1_0/build/CertificateUserMismatchException.o b/ACTK1_0/build/CertificateUserMismatchException.o new file mode 100644 index 0000000..08e4304 Binary files /dev/null and b/ACTK1_0/build/CertificateUserMismatchException.o differ diff --git a/ACTK1_0/build/CheckResponse.o b/ACTK1_0/build/CheckResponse.o new file mode 100644 index 0000000..906cdb7 Binary files /dev/null and b/ACTK1_0/build/CheckResponse.o differ diff --git a/ACTK1_0/build/Command.o b/ACTK1_0/build/Command.o new file mode 100644 index 0000000..a1bce15 Binary files /dev/null and b/ACTK1_0/build/Command.o differ diff --git a/ACTK1_0/build/CommandCounter.o b/ACTK1_0/build/CommandCounter.o new file mode 100644 index 0000000..53e9660 Binary files /dev/null and b/ACTK1_0/build/CommandCounter.o differ diff --git a/ACTK1_0/build/Constants.o b/ACTK1_0/build/Constants.o new file mode 100644 index 0000000..b96dd35 Binary files /dev/null and b/ACTK1_0/build/Constants.o differ diff --git a/ACTK1_0/build/ContactCheckResponse.o b/ACTK1_0/build/ContactCheckResponse.o new file mode 100644 index 0000000..6c71dc4 Binary files /dev/null and b/ACTK1_0/build/ContactCheckResponse.o differ diff --git a/ACTK1_0/build/ContactCreateCommand.o b/ACTK1_0/build/ContactCreateCommand.o new file mode 100644 index 0000000..9c3593a Binary files /dev/null and b/ACTK1_0/build/ContactCreateCommand.o differ diff --git a/ACTK1_0/build/ContactCreateResponse.o b/ACTK1_0/build/ContactCreateResponse.o new file mode 100644 index 0000000..4d8e68e Binary files /dev/null and b/ACTK1_0/build/ContactCreateResponse.o differ diff --git a/ACTK1_0/build/ContactInfoResponse.o b/ACTK1_0/build/ContactInfoResponse.o new file mode 100644 index 0000000..5c2130b Binary files /dev/null and b/ACTK1_0/build/ContactInfoResponse.o differ diff --git a/ACTK1_0/build/ContactNotificationResponse.o b/ACTK1_0/build/ContactNotificationResponse.o new file mode 100644 index 0000000..b6f047a Binary files /dev/null and b/ACTK1_0/build/ContactNotificationResponse.o differ diff --git a/ACTK1_0/build/ContactTransferResponse.o b/ACTK1_0/build/ContactTransferResponse.o new file mode 100644 index 0000000..7038239 Binary files /dev/null and b/ACTK1_0/build/ContactTransferResponse.o differ diff --git a/ACTK1_0/build/ContactUpdateCommand.o b/ACTK1_0/build/ContactUpdateCommand.o new file mode 100644 index 0000000..8ddd412 Binary files /dev/null and b/ACTK1_0/build/ContactUpdateCommand.o differ diff --git a/ACTK1_0/build/CreateResponse.o b/ACTK1_0/build/CreateResponse.o new file mode 100644 index 0000000..2fe0be3 Binary files /dev/null and b/ACTK1_0/build/CreateResponse.o differ diff --git a/ACTK1_0/build/DataResponse.o b/ACTK1_0/build/DataResponse.o new file mode 100644 index 0000000..6ba20ec Binary files /dev/null and b/ACTK1_0/build/DataResponse.o differ diff --git a/ACTK1_0/build/Disclose.o b/ACTK1_0/build/Disclose.o new file mode 100644 index 0000000..3c87271 Binary files /dev/null and b/ACTK1_0/build/Disclose.o differ diff --git a/ACTK1_0/build/DomainAddRem.o b/ACTK1_0/build/DomainAddRem.o new file mode 100644 index 0000000..a475a20 Binary files /dev/null and b/ACTK1_0/build/DomainAddRem.o differ diff --git a/ACTK1_0/build/DomainCheckResponse.o b/ACTK1_0/build/DomainCheckResponse.o new file mode 100644 index 0000000..01abe41 Binary files /dev/null and b/ACTK1_0/build/DomainCheckResponse.o differ diff --git a/ACTK1_0/build/DomainCreateCommand.o b/ACTK1_0/build/DomainCreateCommand.o new file mode 100644 index 0000000..e11db9c Binary files /dev/null and b/ACTK1_0/build/DomainCreateCommand.o differ diff --git a/ACTK1_0/build/DomainCreateResponse.o b/ACTK1_0/build/DomainCreateResponse.o new file mode 100644 index 0000000..09b2ee5 Binary files /dev/null and b/ACTK1_0/build/DomainCreateResponse.o differ diff --git a/ACTK1_0/build/DomainInfoKVResponseExtension.o b/ACTK1_0/build/DomainInfoKVResponseExtension.o new file mode 100644 index 0000000..89437ae Binary files /dev/null and b/ACTK1_0/build/DomainInfoKVResponseExtension.o differ diff --git a/ACTK1_0/build/DomainInfoResponse.o b/ACTK1_0/build/DomainInfoResponse.o new file mode 100644 index 0000000..23758aa Binary files /dev/null and b/ACTK1_0/build/DomainInfoResponse.o differ diff --git a/ACTK1_0/build/DomainKVCommandExtension.o b/ACTK1_0/build/DomainKVCommandExtension.o new file mode 100644 index 0000000..763fd5b Binary files /dev/null and b/ACTK1_0/build/DomainKVCommandExtension.o differ diff --git a/ACTK1_0/build/DomainNotificationResponse.o b/ACTK1_0/build/DomainNotificationResponse.o new file mode 100644 index 0000000..119676a Binary files /dev/null and b/ACTK1_0/build/DomainNotificationResponse.o differ diff --git a/ACTK1_0/build/DomainRegistrantTransferCommand.o b/ACTK1_0/build/DomainRegistrantTransferCommand.o new file mode 100644 index 0000000..8fd84ab Binary files /dev/null and b/ACTK1_0/build/DomainRegistrantTransferCommand.o differ diff --git a/ACTK1_0/build/DomainRegistrantTransferResponse.o b/ACTK1_0/build/DomainRegistrantTransferResponse.o new file mode 100644 index 0000000..55df468 Binary files /dev/null and b/ACTK1_0/build/DomainRegistrantTransferResponse.o differ diff --git a/ACTK1_0/build/DomainRenewCommand.o b/ACTK1_0/build/DomainRenewCommand.o new file mode 100644 index 0000000..6a1b425 Binary files /dev/null and b/ACTK1_0/build/DomainRenewCommand.o differ diff --git a/ACTK1_0/build/DomainRenewResponse.o b/ACTK1_0/build/DomainRenewResponse.o new file mode 100644 index 0000000..dfe9b59 Binary files /dev/null and b/ACTK1_0/build/DomainRenewResponse.o differ diff --git a/ACTK1_0/build/DomainSecDNSCreateCommandExtension.o b/ACTK1_0/build/DomainSecDNSCreateCommandExtension.o new file mode 100644 index 0000000..6a14063 Binary files /dev/null and b/ACTK1_0/build/DomainSecDNSCreateCommandExtension.o differ diff --git a/ACTK1_0/build/DomainSecDNSInfoResponseExtension.o b/ACTK1_0/build/DomainSecDNSInfoResponseExtension.o new file mode 100644 index 0000000..9cd65a0 Binary files /dev/null and b/ACTK1_0/build/DomainSecDNSInfoResponseExtension.o differ diff --git a/ACTK1_0/build/DomainSecDNSUpdateCommandExtension.o b/ACTK1_0/build/DomainSecDNSUpdateCommandExtension.o new file mode 100644 index 0000000..56493a3 Binary files /dev/null and b/ACTK1_0/build/DomainSecDNSUpdateCommandExtension.o differ diff --git a/ACTK1_0/build/DomainTransferResponse.o b/ACTK1_0/build/DomainTransferResponse.o new file mode 100644 index 0000000..e33ae21 Binary files /dev/null and b/ACTK1_0/build/DomainTransferResponse.o differ diff --git a/ACTK1_0/build/DomainUpdateCommand.o b/ACTK1_0/build/DomainUpdateCommand.o new file mode 100644 index 0000000..ca1607a Binary files /dev/null and b/ACTK1_0/build/DomainUpdateCommand.o differ diff --git a/ACTK1_0/build/DomainUpdateSyncCommandExtension.o b/ACTK1_0/build/DomainUpdateSyncCommandExtension.o new file mode 100644 index 0000000..9413c8c Binary files /dev/null and b/ACTK1_0/build/DomainUpdateSyncCommandExtension.o differ diff --git a/ACTK1_0/build/E164Extension.o b/ACTK1_0/build/E164Extension.o new file mode 100644 index 0000000..9e4dec2 Binary files /dev/null and b/ACTK1_0/build/E164Extension.o differ diff --git a/ACTK1_0/build/EPPDateFormatter.o b/ACTK1_0/build/EPPDateFormatter.o new file mode 100644 index 0000000..e212992 Binary files /dev/null and b/ACTK1_0/build/EPPDateFormatter.o differ diff --git a/ACTK1_0/build/EPPWriter.o b/ACTK1_0/build/EPPWriter.o new file mode 100644 index 0000000..fb208ce Binary files /dev/null and b/ACTK1_0/build/EPPWriter.o differ diff --git a/ACTK1_0/build/EnumDomainCreateCommand.o b/ACTK1_0/build/EnumDomainCreateCommand.o new file mode 100644 index 0000000..4a12e19 Binary files /dev/null and b/ACTK1_0/build/EnumDomainCreateCommand.o differ diff --git a/ACTK1_0/build/EnumDomainInfoResponse.o b/ACTK1_0/build/EnumDomainInfoResponse.o new file mode 100644 index 0000000..2a7edfe Binary files /dev/null and b/ACTK1_0/build/EnumDomainInfoResponse.o differ diff --git a/ACTK1_0/build/EnumDomainUpdateCommand.o b/ACTK1_0/build/EnumDomainUpdateCommand.o new file mode 100644 index 0000000..4793fbe Binary files /dev/null and b/ACTK1_0/build/EnumDomainUpdateCommand.o differ diff --git a/ACTK1_0/build/EnumType.o b/ACTK1_0/build/EnumType.o new file mode 100644 index 0000000..7156dc2 Binary files /dev/null and b/ACTK1_0/build/EnumType.o differ diff --git a/ACTK1_0/build/ErrorPkg.o b/ACTK1_0/build/ErrorPkg.o new file mode 100644 index 0000000..f44cf39 Binary files /dev/null and b/ACTK1_0/build/ErrorPkg.o differ diff --git a/ACTK1_0/build/Greeting.o b/ACTK1_0/build/Greeting.o new file mode 100644 index 0000000..a271acc Binary files /dev/null and b/ACTK1_0/build/Greeting.o differ diff --git a/ACTK1_0/build/HostAddRem.o b/ACTK1_0/build/HostAddRem.o new file mode 100644 index 0000000..1d8e98f Binary files /dev/null and b/ACTK1_0/build/HostAddRem.o differ diff --git a/ACTK1_0/build/HostCheckResponse.o b/ACTK1_0/build/HostCheckResponse.o new file mode 100644 index 0000000..3ec43d7 Binary files /dev/null and b/ACTK1_0/build/HostCheckResponse.o differ diff --git a/ACTK1_0/build/HostCreateCommand.o b/ACTK1_0/build/HostCreateCommand.o new file mode 100644 index 0000000..4300d60 Binary files /dev/null and b/ACTK1_0/build/HostCreateCommand.o differ diff --git a/ACTK1_0/build/HostCreateResponse.o b/ACTK1_0/build/HostCreateResponse.o new file mode 100644 index 0000000..a895a63 Binary files /dev/null and b/ACTK1_0/build/HostCreateResponse.o differ diff --git a/ACTK1_0/build/HostInfoResponse.o b/ACTK1_0/build/HostInfoResponse.o new file mode 100644 index 0000000..efec2ec Binary files /dev/null and b/ACTK1_0/build/HostInfoResponse.o differ diff --git a/ACTK1_0/build/HostUpdateCommand.o b/ACTK1_0/build/HostUpdateCommand.o new file mode 100644 index 0000000..ccf05ec Binary files /dev/null and b/ACTK1_0/build/HostUpdateCommand.o differ diff --git a/ACTK1_0/build/IPVersion.o b/ACTK1_0/build/IPVersion.o new file mode 100644 index 0000000..bccc6bc Binary files /dev/null and b/ACTK1_0/build/IPVersion.o differ diff --git a/ACTK1_0/build/InetAddress.o b/ACTK1_0/build/InetAddress.o new file mode 100644 index 0000000..19d824b Binary files /dev/null and b/ACTK1_0/build/InetAddress.o differ diff --git a/ACTK1_0/build/InfoResponse.o b/ACTK1_0/build/InfoResponse.o new file mode 100644 index 0000000..b9beea8 Binary files /dev/null and b/ACTK1_0/build/InfoResponse.o differ diff --git a/ACTK1_0/build/KVExtension.o b/ACTK1_0/build/KVExtension.o new file mode 100644 index 0000000..7b541c1 Binary files /dev/null and b/ACTK1_0/build/KVExtension.o differ diff --git a/ACTK1_0/build/Logger.o b/ACTK1_0/build/Logger.o new file mode 100644 index 0000000..c5c655d Binary files /dev/null and b/ACTK1_0/build/Logger.o differ diff --git a/ACTK1_0/build/LoginCommand.o b/ACTK1_0/build/LoginCommand.o new file mode 100644 index 0000000..c35eeaf Binary files /dev/null and b/ACTK1_0/build/LoginCommand.o differ diff --git a/ACTK1_0/build/NAPTR.o b/ACTK1_0/build/NAPTR.o new file mode 100644 index 0000000..f4d0a0e Binary files /dev/null and b/ACTK1_0/build/NAPTR.o differ diff --git a/ACTK1_0/build/NamespaceResolver.o b/ACTK1_0/build/NamespaceResolver.o new file mode 100644 index 0000000..fbd02dc Binary files /dev/null and b/ACTK1_0/build/NamespaceResolver.o differ diff --git a/ACTK1_0/build/NotificationResponse.o b/ACTK1_0/build/NotificationResponse.o new file mode 100644 index 0000000..346bfb2 Binary files /dev/null and b/ACTK1_0/build/NotificationResponse.o differ diff --git a/ACTK1_0/build/ObjectCommand.o b/ACTK1_0/build/ObjectCommand.o new file mode 100644 index 0000000..ef6d3c9 Binary files /dev/null and b/ACTK1_0/build/ObjectCommand.o differ diff --git a/ACTK1_0/build/Period.o b/ACTK1_0/build/Period.o new file mode 100644 index 0000000..5e33938 Binary files /dev/null and b/ACTK1_0/build/Period.o differ diff --git a/ACTK1_0/build/PeriodUnit.o b/ACTK1_0/build/PeriodUnit.o new file mode 100644 index 0000000..14c1f9d Binary files /dev/null and b/ACTK1_0/build/PeriodUnit.o differ diff --git a/ACTK1_0/build/PollOperation.o b/ACTK1_0/build/PollOperation.o new file mode 100644 index 0000000..064cb5d Binary files /dev/null and b/ACTK1_0/build/PollOperation.o differ diff --git a/ACTK1_0/build/PollResponse.o b/ACTK1_0/build/PollResponse.o new file mode 100644 index 0000000..05e4698 Binary files /dev/null and b/ACTK1_0/build/PollResponse.o differ diff --git a/ACTK1_0/build/PostalInfo.o b/ACTK1_0/build/PostalInfo.o new file mode 100644 index 0000000..4717601 Binary files /dev/null and b/ACTK1_0/build/PostalInfo.o differ diff --git a/ACTK1_0/build/PostalInfoType.o b/ACTK1_0/build/PostalInfoType.o new file mode 100644 index 0000000..5b602e7 Binary files /dev/null and b/ACTK1_0/build/PostalInfoType.o differ diff --git a/ACTK1_0/build/Properties.o b/ACTK1_0/build/Properties.o new file mode 100644 index 0000000..93d9a80 Binary files /dev/null and b/ACTK1_0/build/Properties.o differ diff --git a/ACTK1_0/build/ProtocolExtensionCommand.o b/ACTK1_0/build/ProtocolExtensionCommand.o new file mode 100644 index 0000000..c353c1d Binary files /dev/null and b/ACTK1_0/build/ProtocolExtensionCommand.o differ diff --git a/ACTK1_0/build/ReceiveSE.o b/ACTK1_0/build/ReceiveSE.o new file mode 100644 index 0000000..474ddf0 Binary files /dev/null and b/ACTK1_0/build/ReceiveSE.o differ diff --git a/ACTK1_0/build/RegistrantObjectType.o b/ACTK1_0/build/RegistrantObjectType.o new file mode 100644 index 0000000..d2727dd Binary files /dev/null and b/ACTK1_0/build/RegistrantObjectType.o differ diff --git a/ACTK1_0/build/RegistrantTransferCommandType.o b/ACTK1_0/build/RegistrantTransferCommandType.o new file mode 100644 index 0000000..82ab209 Binary files /dev/null and b/ACTK1_0/build/RegistrantTransferCommandType.o differ diff --git a/ACTK1_0/build/Response.o b/ACTK1_0/build/Response.o new file mode 100644 index 0000000..f91911d Binary files /dev/null and b/ACTK1_0/build/Response.o differ diff --git a/ACTK1_0/build/ResponseExtension.o b/ACTK1_0/build/ResponseExtension.o new file mode 100644 index 0000000..141eb4c Binary files /dev/null and b/ACTK1_0/build/ResponseExtension.o differ diff --git a/ACTK1_0/build/Result.o b/ACTK1_0/build/Result.o new file mode 100644 index 0000000..64099b2 Binary files /dev/null and b/ACTK1_0/build/Result.o differ diff --git a/ACTK1_0/build/ResultCounter.o b/ACTK1_0/build/ResultCounter.o new file mode 100644 index 0000000..982dc86 Binary files /dev/null and b/ACTK1_0/build/ResultCounter.o differ diff --git a/ACTK1_0/build/SSLException.o b/ACTK1_0/build/SSLException.o new file mode 100644 index 0000000..6edb679 Binary files /dev/null and b/ACTK1_0/build/SSLException.o differ diff --git a/ACTK1_0/build/SecDNSChgType.o b/ACTK1_0/build/SecDNSChgType.o new file mode 100644 index 0000000..932ff10 Binary files /dev/null and b/ACTK1_0/build/SecDNSChgType.o differ diff --git a/ACTK1_0/build/SecDNSDSData.o b/ACTK1_0/build/SecDNSDSData.o new file mode 100644 index 0000000..bc514f0 Binary files /dev/null and b/ACTK1_0/build/SecDNSDSData.o differ diff --git a/ACTK1_0/build/SecDNSDSOrKeyType.o b/ACTK1_0/build/SecDNSDSOrKeyType.o new file mode 100644 index 0000000..16c76e6 Binary files /dev/null and b/ACTK1_0/build/SecDNSDSOrKeyType.o differ diff --git a/ACTK1_0/build/SecDNSExtension.o b/ACTK1_0/build/SecDNSExtension.o new file mode 100644 index 0000000..a3625c1 Binary files /dev/null and b/ACTK1_0/build/SecDNSExtension.o differ diff --git a/ACTK1_0/build/SecDNSKeyData.o b/ACTK1_0/build/SecDNSKeyData.o new file mode 100644 index 0000000..b52ba6b Binary files /dev/null and b/ACTK1_0/build/SecDNSKeyData.o differ diff --git a/ACTK1_0/build/SecDNSRemType.o b/ACTK1_0/build/SecDNSRemType.o new file mode 100644 index 0000000..84e9350 Binary files /dev/null and b/ACTK1_0/build/SecDNSRemType.o differ diff --git a/ACTK1_0/build/SendSE.o b/ACTK1_0/build/SendSE.o new file mode 100644 index 0000000..4aa7eee Binary files /dev/null and b/ACTK1_0/build/SendSE.o differ diff --git a/ACTK1_0/build/SessionFactory.o b/ACTK1_0/build/SessionFactory.o new file mode 100644 index 0000000..dfde379 Binary files /dev/null and b/ACTK1_0/build/SessionFactory.o differ diff --git a/ACTK1_0/build/SessionManagerFactory.o b/ACTK1_0/build/SessionManagerFactory.o new file mode 100644 index 0000000..d126c63 Binary files /dev/null and b/ACTK1_0/build/SessionManagerFactory.o differ diff --git a/ACTK1_0/build/SessionManagerImpl.o b/ACTK1_0/build/SessionManagerImpl.o new file mode 100644 index 0000000..6e39b9b Binary files /dev/null and b/ACTK1_0/build/SessionManagerImpl.o differ diff --git a/ACTK1_0/build/SessionManagerPropertiesImpl.o b/ACTK1_0/build/SessionManagerPropertiesImpl.o new file mode 100644 index 0000000..b3a69a3 Binary files /dev/null and b/ACTK1_0/build/SessionManagerPropertiesImpl.o differ diff --git a/ACTK1_0/build/SessionPoolImpl.o b/ACTK1_0/build/SessionPoolImpl.o new file mode 100644 index 0000000..c90055e Binary files /dev/null and b/ACTK1_0/build/SessionPoolImpl.o differ diff --git a/ACTK1_0/build/StandardCommandType.o b/ACTK1_0/build/StandardCommandType.o new file mode 100644 index 0000000..a29e948 Binary files /dev/null and b/ACTK1_0/build/StandardCommandType.o differ diff --git a/ACTK1_0/build/StandardObjectType.o b/ACTK1_0/build/StandardObjectType.o new file mode 100644 index 0000000..636a477 Binary files /dev/null and b/ACTK1_0/build/StandardObjectType.o differ diff --git a/ACTK1_0/build/StringUtils.o b/ACTK1_0/build/StringUtils.o new file mode 100644 index 0000000..f3b760f Binary files /dev/null and b/ACTK1_0/build/StringUtils.o differ diff --git a/ACTK1_0/build/SyncExtension.o b/ACTK1_0/build/SyncExtension.o new file mode 100644 index 0000000..b210b99 Binary files /dev/null and b/ACTK1_0/build/SyncExtension.o differ diff --git a/ACTK1_0/build/SystemProperties.o b/ACTK1_0/build/SystemProperties.o new file mode 100644 index 0000000..10faf64 Binary files /dev/null and b/ACTK1_0/build/SystemProperties.o differ diff --git a/ACTK1_0/build/TLSContext.o b/ACTK1_0/build/TLSContext.o new file mode 100644 index 0000000..af2d506 Binary files /dev/null and b/ACTK1_0/build/TLSContext.o differ diff --git a/ACTK1_0/build/TLSSession.o b/ACTK1_0/build/TLSSession.o new file mode 100644 index 0000000..8268bec Binary files /dev/null and b/ACTK1_0/build/TLSSession.o differ diff --git a/ACTK1_0/build/TLSSocket.o b/ACTK1_0/build/TLSSocket.o new file mode 100644 index 0000000..55955cc Binary files /dev/null and b/ACTK1_0/build/TLSSocket.o differ diff --git a/ACTK1_0/build/Timer.o b/ACTK1_0/build/Timer.o new file mode 100644 index 0000000..34f1d1f Binary files /dev/null and b/ACTK1_0/build/Timer.o differ diff --git a/ACTK1_0/build/TransferCommand.o b/ACTK1_0/build/TransferCommand.o new file mode 100644 index 0000000..095eebf Binary files /dev/null and b/ACTK1_0/build/TransferCommand.o differ diff --git a/ACTK1_0/build/TransferOp.o b/ACTK1_0/build/TransferOp.o new file mode 100644 index 0000000..98b598e Binary files /dev/null and b/ACTK1_0/build/TransferOp.o differ diff --git a/ACTK1_0/build/TransferResponse.o b/ACTK1_0/build/TransferResponse.o new file mode 100644 index 0000000..5192f65 Binary files /dev/null and b/ACTK1_0/build/TransferResponse.o differ diff --git a/ACTK1_0/build/UserPassMismatchException.o b/ACTK1_0/build/UserPassMismatchException.o new file mode 100644 index 0000000..8c4b43c Binary files /dev/null and b/ACTK1_0/build/UserPassMismatchException.o differ diff --git a/ACTK1_0/build/XMLDocument.o b/ACTK1_0/build/XMLDocument.o new file mode 100644 index 0000000..6f56391 Binary files /dev/null and b/ACTK1_0/build/XMLDocument.o differ diff --git a/ACTK1_0/build/XMLGregorianCalendar.o b/ACTK1_0/build/XMLGregorianCalendar.o new file mode 100644 index 0000000..63ee600 Binary files /dev/null and b/ACTK1_0/build/XMLGregorianCalendar.o differ diff --git a/ACTK1_0/build/XMLParser.o b/ACTK1_0/build/XMLParser.o new file mode 100644 index 0000000..1c9f02f Binary files /dev/null and b/ACTK1_0/build/XMLParser.o differ diff --git a/ACTK1_0/build/XMLWriter.o b/ACTK1_0/build/XMLWriter.o new file mode 100644 index 0000000..d1be8b8 Binary files /dev/null and b/ACTK1_0/build/XMLWriter.o differ diff --git a/ACTK1_0/build/boolean.o b/ACTK1_0/build/boolean.o new file mode 100644 index 0000000..296d2bc Binary files /dev/null and b/ACTK1_0/build/boolean.o differ diff --git a/ACTK1_0/build/config.o b/ACTK1_0/build/config.o new file mode 100644 index 0000000..c3bd4c5 Binary files /dev/null and b/ACTK1_0/build/config.o differ diff --git a/ACTK1_0/build/init.o b/ACTK1_0/build/init.o new file mode 100644 index 0000000..27a0b01 Binary files /dev/null and b/ACTK1_0/build/init.o differ diff --git a/ACTK1_0/build/log.o b/ACTK1_0/build/log.o new file mode 100644 index 0000000..1fe4278 Binary files /dev/null and b/ACTK1_0/build/log.o differ diff --git a/ACTK1_0/lib/libACTK1_0.so b/ACTK1_0/lib/libACTK1_0.so new file mode 100755 index 0000000..70e8dc3 Binary files /dev/null and b/ACTK1_0/lib/libACTK1_0.so differ diff --git a/ACTK1_0/log b/ACTK1_0/log new file mode 100644 index 0000000..a16b7fe --- /dev/null +++ b/ACTK1_0/log @@ -0,0 +1,2 @@ +20140107 18:53:11.479 | com.ausregistry.cpptoolkit.debug | FINE: Using message file: resources/messages.properties +20140107 18:53:11.479 | com.ausregistry.cpptoolkit.debug | FINE: Loading messages file: resources/messages.properties diff --git a/APIG/Makefile b/APIG/Makefile index e09be09..0f76e7c 100644 --- a/APIG/Makefile +++ b/APIG/Makefile @@ -5,14 +5,19 @@ LOCATION=authoring CC=g++ Cc=gcc - BOSTLIB=-L/usr/lib/boost - BOSINCL=-L/usr/include/boost - LOG4LIB=-L/usr/lib +##### Set this to the location of the executables/objects to be produced + +BUILD_OBJ_DIR = build + +BOSTLIB=-L/usr/lib/boost +BOSINCL=-L/usr/include/boost +LOG4LIB=-L/usr/lib +CLIENT=drde SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) -l boost_system -l boost_thread -l log4cpp ifeq ($(LOCATION),authoring) -SINCL= -I include -I /usr/include/log4cpp $(BOSINCL) +SINCL= -I include -I ../AusRegCliever/include -I /usr/include/log4cpp $(BOSINCL) CFLAGS= -DCURRENT_DEBUG=1000 endif @@ -23,7 +28,8 @@ CLFLAGS= -Wall -Wundef -Wpointer-arith -Wshadow \ -Wmissing-prototypes -Wnested-externs \ -Wstrict-prototypes -Waggregate-return -Wno-implicit -ACOBJS= build/cliever.o build/cdLogger.o build/clientDaemonConfig.o build/clientDaemon.o +ACOBJS= build/cliever.o build/cdLogger.o build/clientDaemonConfig.o \ + build/clientDaemon.o build/commander.o build/mdBehavior.o # --- targets # @@ -32,7 +38,7 @@ ifeq ($(LOCATION),authoring) all: cliever endif -cliever: build/cliever +cliever: build/$(CLIENT)-cd .c.o: $(Cc) -c $(CLFLAGS) -o $< @@ -46,29 +52,43 @@ build/cliever.o: client/ausreg-cd.cpp include/*.h build/clientDaemonConfig.o: client/clientDaemonConfig.cpp include/*.h $(CC) $(CFLAGS) client/clientDaemonConfig.cpp -c -o build/clientDaemonConfig.o $(SINCL) -build/masterDaemon.o: client/clientDaemon.cpp include/*.h +build/clientDaemon.o: client/clientDaemon.cpp include/*.h $(CC) $(CFLAGS) client/clientDaemon.cpp -c -o build/clientDaemon.o $(SINCL) -build/ausreg-cd: $(ACOBJS) - $(CC) $(CFLAGS) -o build/ausreg-cd $(SINCL) $(LIBS) $(ACOBJS) $(SLIBS) +build/mdBehavior.o: client/mdBehavior.cpp include/mdBehavior.h + $(CC) $(CFLAGS) client/mdBehavior.cpp $(SINCL) -c -o build/mdBehavior.o + +build/commander.o: client/commander.cpp include/mdCommander.h + $(CC) $(CFLAGS) client/commander.cpp $(SINCL) -c -o build/commander.o + +build/$(CLIENT)-cd: $(ACOBJS) + $(CC) $(CFLAGS) -o build/$(CLIENT)-cd $(SINCL) $(LIBS) $(ACOBJS) $(SLIBS) doxygen/index.html: etc/doxygen.config doxygen etc/doxygen.config # --- rebuild on copy to a new host -distclean: - clrbak - rm -rf build - rm -rf doxygen - mkdir doxygen - mkdir build - touch etc/doxygen.config +#distclean: +# clrbak +# rm -rf build +# rm -rf doxygen +# mkdir doxygen +# mkdir build +# touch etc/doxygen.config + +.PHONY: ausreg_cd +ausreg_cd: build/$(CLIENT)-cd + +.PHONY: dirs +dirs: + -mkdir -p $(BUILD_LIB_DIR) + clean: clrbak find ./build -name "*.o" -print | perl -ne "print;chop;unlink" find ./build -name "*.rpo" -print | perl -ne "print;chop;unlink" - rm build/drde-cliever + rm build/$(CLIENT)-cd diff --git a/APIG/build/cdLogger.o b/APIG/build/cdLogger.o new file mode 100644 index 0000000..11d3599 Binary files /dev/null and b/APIG/build/cdLogger.o differ diff --git a/APIG/build/clientDaemon.o b/APIG/build/clientDaemon.o new file mode 100644 index 0000000..bfd02c1 Binary files /dev/null and b/APIG/build/clientDaemon.o differ diff --git a/APIG/build/clientDaemonConfig.o b/APIG/build/clientDaemonConfig.o new file mode 100644 index 0000000..5642e4d Binary files /dev/null and b/APIG/build/clientDaemonConfig.o differ diff --git a/APIG/build/cliever.o b/APIG/build/cliever.o new file mode 100644 index 0000000..eea2c16 Binary files /dev/null and b/APIG/build/cliever.o differ diff --git a/APIG/build/commander.o b/APIG/build/commander.o new file mode 100644 index 0000000..fe73674 Binary files /dev/null and b/APIG/build/commander.o differ diff --git a/APIG/build/drde-cd b/APIG/build/drde-cd new file mode 100755 index 0000000..e40326f Binary files /dev/null and b/APIG/build/drde-cd differ diff --git a/APIG/build/mdBehavior.o b/APIG/build/mdBehavior.o new file mode 100644 index 0000000..bcf4324 Binary files /dev/null and b/APIG/build/mdBehavior.o differ diff --git a/APIG/client/apig-cli.cpp b/APIG/client/apig-cli.cpp index 120f061..21882f6 100644 --- a/APIG/client/apig-cli.cpp +++ b/APIG/client/apig-cli.cpp @@ -25,7 +25,7 @@ main(int argc, char **argv) { char debug[10]; int rc; - cout << "mdclient compiled " __DATE__ " " __TIME__ " \n"; + cout << "apig-cli compiled " __DATE__ " " __TIME__ " \n"; if (argc < 3 ) { @@ -34,13 +34,13 @@ main(int argc, char **argv) { " = . defaults to '" DEFAULT_DEVICE "'\n" " = 'n' or 'N'\n\n" - "The master daemon must be running at the specified .\n" + "The XMLRPC at is presumed a master daemon varint .\n" " = n causes non-repeatable testbucket(s) to be skipped.\n" "Any other 3rd ooption causes a simple connectivity test and exit.\n" - "Otherwise performs the full MD core API test suite.\n\n"; + "Otherwise performs the full AC core APIG test suite.\n\n"; - // "If XMLRPC_TRACE_XML is defined will pause " << - // PAUSE_SECS << " at selected points in the tests.\n\n"; + "If XMLRPC_TRACE_XML is defined will pause " << + PAUSE_SECS << " at selected points in the tests.\n\n"; exit(1); } diff --git a/APIG/client/ausreg-cd.cpp b/APIG/client/ausreg-cd.cpp index fcdcdae..9907eee 100644 --- a/APIG/client/ausreg-cd.cpp +++ b/APIG/client/ausreg-cd.cpp @@ -6,9 +6,9 @@ #include #include - bool cdHasKb; - char cdOrKbValue; -const char *cdOrKb=&cdOrKbValue; + bool cdHasTk; + char cdOrTkValue; +const char *cdOrTk=&cdOrTkValue; using namespace std; @@ -51,37 +51,37 @@ void acClientServer() { // AKA "Cliever" if (lfp<0) {puts("Can't open lockfile!"); exit(1);} if (lockf(lfp,F_TLOCK,0)<0) {puts("Can't lock lockfile!"); exit(0);} - shared_memory_object shm(open_only, "ac-cd-global", read_write); + shared_memory_object shm(open_only, "ausreg-cd-global", read_write); mapped_region acCDglobal(shm, read_write); gm = (ac_cd_global *)acCDglobal.get_address(); - if (strcmp(gm->id,"ac-cd")) // Same deal + if (strcmp(gm->id,"ausreg-cd")) // Same deal {theseLogs.logN(0,"Daemon couldn't identify global memory. Bye."); exit(1);} gm->daemon_pid = getpid(); sprintf(str,"%d",getpid()); - theseLogs.logN(1,"ac-cd running (%s)",str); + theseLogs.logN(1,"ausreg-cd running (%s)",str); strcat(str,"\n"); write(lfp,str,strlen(str)); /* record pid to lockfile */ setSignals(); - theseLogs.init("ac-cd"); + theseLogs.init("ausreg-cd"); theseLogs.logN(0,CD_NAME " " CD_VERSION " compiled on " __DATE__ " @ " __TIME__); theseLogs.logN(3,"Cliever processing(%d) begins for devices on port %s to MD at %s.",getpid(),thisConfig->telemetryPortStr.c_str(),thisConfig->mdAddress.c_str()); try { boost::thread cliever(runCliever); - boost::thread dataLayer(runDataLayer); + boost::thread apiLayer(runAPILayer); - if (!dataLayer.joinable() || !cliever.joinable()) { - if (!dataLayer.joinable()) - theseLogs.logN(0,"Failed to start data layer, ac-cd process will terminate."); + if (!apiLayer.joinable() || !cliever.joinable()) { + if (!apiLayer.joinable()) + theseLogs.logN(0,"Failed to start API layer, ausred-cd process will terminate."); if (!cliever.joinable()) - theseLogs.logN(0,"Failed to start client-server, ac-cd process will terminate."); + theseLogs.logN(0,"Failed to start client-server, ausureg-cd process will terminate."); } else { theseLogs.logN(0,"Cliever started OK."); - dataLayer.join(); - theseLogs.logN(0,"ac-cd EOJ."); + apiLayer.join(); + theseLogs.logN(0,"ausreg-cd EOJ."); } } @@ -103,23 +103,23 @@ int main(int const argc, const char ** const argv) thisCliever = NULL; - cdHasKb = strstr(argv[0],"clips") ? true : false; - cdOrKbValue = cdHasKb ? 'd' : 'D'; // d == kb enabled, D = !d + cdHasTk = strstr(argv[0],"clips") ? true : false; + cdOrTkValue = cdHasTk ? 'd' : 'D'; // d == kb enabled, D = !d //RAII constructor/destructor struct shm_remove { - shm_remove() { shared_memory_object::remove("ac-cd-global"); } - ~shm_remove() { shared_memory_object::remove("ac-cd-global"); } + shm_remove() { shared_memory_object::remove("ausreg-cd-global"); } + ~shm_remove() { shared_memory_object::remove("ausreg-cd-global"); } } remover; - shared_memory_object shm(create_only, "ac-cd-global", read_write); + shared_memory_object shm(create_only, "ausreg-cd-global", read_write); shm.truncate(CD_GLOBAL_SIZE); mapped_region acCDglobal(shm, read_write); memset(acCDglobal.get_address(), 0, acCDglobal.get_size()); gm = (ac_cd_global *)acCDglobal.get_address(); - strcpy(gm->id,"ac-cd"); - strcmp(gm->id,"ac-cd"); // Will segfault if there is a problem so catches are are futile. + strcpy(gm->id,"ausreg-cd"); + strcmp(gm->id,"ausreg-cd"); // Will segfault if there is a problem so catches are are futile. // But the signal trap will catch the fault. thisConfig = new clientDaemonConfig(); @@ -165,16 +165,16 @@ void runCommander() { int i; mdCommander commander; - theseLogs.init("ac-cd-ui"); + theseLogs.init("ausreg-cd-ui"); theseLogs.logN(0,"Interactive command processor started."); commander.driver(); if (thisConfig->terminateRequest) { theseLogs.logN(0,"Interactive shutdown requested."); - puts("ac-cd operator issued terminate command."); + puts("ausreg-cd operator issued terminate command."); kill(gm->daemon_pid,SIGTERM); } else { theseLogs.logN(0,"Interactive command processor ended."); - sprintf(msg,"Commander terminated, ac-cd continues (%d).",gm->daemon_pid); + sprintf(msg,"Commander terminated, ausreg-cd continues (%d).",gm->daemon_pid); puts(msg); } @@ -204,10 +204,10 @@ void signal_handler(int sig) case SIGUSR1: break; case SIGHUP: - theseLogs.logN(0,"hangup signal caught, currently ac-cd ignores this."); + theseLogs.logN(0,"hangup signal caught, currently ausreg-cd ignores this."); break; case SIGTERM: - theseLogs.logN(0,"terminate signal caught, ac-cd will shutdown."); + theseLogs.logN(0,"terminate signal caught, ausreg-cd will shutdown."); cdShutdown termEvent; termEvent.send(); break; @@ -216,7 +216,7 @@ void signal_handler(int sig) } void usage() { - std::cerr << "Usage: " << cdOrKb << " ['*'] [device=TEST] [mdIP=" MD_DEFAULT_IP "] [logs=\\tmp]\n\n where \n\n" + std::cerr << "Usage: " << cdOrTk<< " ['*'] [device=TEST] [mdIP=" MD_DEFAULT_IP "] [logs=\\tmp]\n\n where \n\n" "\t is required, must be the first parameter, and must be 1000 or greater. \n" "\t The other parameters are optional and non-positional and take the shown defaults. \n" "\t '*', if present, indicates skip the command loop (string quotes may be required). \n"; diff --git a/APIG/client/cdLogger.cpp b/APIG/client/cdLogger.cpp index c9a35a1..f4e4cab 100644 --- a/APIG/client/cdLogger.cpp +++ b/APIG/client/cdLogger.cpp @@ -1,4 +1,4 @@ -#include "ac-cd.h" +#include "ausreg-cd.h" #include "log4cpp/Category.hh" #include "log4cpp/Appender.hh" @@ -19,7 +19,7 @@ using namespace log4cpp; void cdLogger::init(const char *baseName) { - const char *defaultBasename = "ac-cd-99"; + const char *defaultBasename = "ausreg-cd-99"; char mainLogFileName[128]; if (!strlen(baseName)) strcpy(mainLogFileName,defaultBasename); diff --git a/APIG/client/clientDaemon.cpp b/APIG/client/clientDaemon.cpp index 06141e8..10be4cd 100644 --- a/APIG/client/clientDaemon.cpp +++ b/APIG/client/clientDaemon.cpp @@ -1,4 +1,4 @@ -#include "ac-cd.h" +#include "ausreg-cd.h" #include "../server/Listener.cpp" #include "../server/EventSender.cpp" #include @@ -11,12 +11,13 @@ void stream(); void trCallback(const boost::system::error_code& error); void mdCliever::processEvent( const cdIncoming &dgEvent ) -{ +{ int dummy; assert(EventSender::isSending()); switch(dgEvent.dg.hdr.msgType) { case MDDG_NEWBORN: - switch(dgEvent.dg.hdr.clientType) { +// switch(dgEvent.dg.hdr.clientType) { + switch(dummy) { case MDDEV_MD: if (dgEvent.dg.hdr.sinkHandle) { myHandle = dgEvent.dg.hdr.sinkHandle; @@ -27,7 +28,7 @@ void mdCliever::processEvent( const cdIncoming &dgEvent ) break; case MACHINE: break; - case MDDEV_INSTRUMENT: + case MDDEV_PEER: break; } break; @@ -156,11 +157,11 @@ void runCliever() { theseLogs.logNdebug(0,0,"runCliever asio ended"); } -void runDataLayer() { +void runAPILayer() { int assertCliever; - theseLogs.logN(1,"Spin to attach MD datalayer background on port %d ...",thisConfig->telemetryPort); + theseLogs.logN(1,"Spin to attach MDapiLayer background on port %d ...",thisConfig->telemetryPort); for(assertCliever=0;!thisCliever && assertCliever < MAX_DEBUG;assertCliever++); for(assertCliever=0;!thisCliever->alive && assertCliever < MAX_DEBUG;assertCliever++); @@ -186,7 +187,7 @@ void runDataLayer() { } catch (...) { - theseLogs.logN(0,"Unknown failure in datalayer bg."); + theseLogs.logN(0,"Unknown failure inapiLayer bg."); } theseLogs.logNdebug(1,0,"asio background io service ended."); diff --git a/APIG/client/clientDaemonConfig.cpp b/APIG/client/clientDaemonConfig.cpp index 0e30c55..bbd1fea 100644 --- a/APIG/client/clientDaemonConfig.cpp +++ b/APIG/client/clientDaemonConfig.cpp @@ -1,5 +1,5 @@ -#include "ac-cd.h" +#include "ausreg-cd.h" int clientDaemonConfig::loadMachineConfiguration() { diff --git a/APIG/client/commander.cpp b/APIG/client/commander.cpp index a7cd536..e2c8db5 100644 --- a/APIG/client/commander.cpp +++ b/APIG/client/commander.cpp @@ -1,4 +1,4 @@ -#include "ac-cd.h" +#include "ausreg-cd.h" int is_numeric(const char *p) { int i = strlen(p),j=0; if (*p) { @@ -16,7 +16,7 @@ int is_numeric(const char *p) { int i = strlen(p),j=0; void mdCommander::driver() { bool rc; - char instrinsic[16],next,rawString[256],work[256]; + char instrinsic[16],next,rawString[4096],work[4096]; const char *mdErrCode = ""; int i,commandLength; @@ -35,9 +35,42 @@ void mdCommander::driver() { } } if (!strlen(rawString)) continue; - if (rawString[0] == '?') { - help(); - continue; + if (strlen(rawString) == 2) { + switch(rawString[0]) { + case '?': help(); + break; + case 'e': eppMainMenu(); + break; + case '!': sendCommand(); + break; + case 'X': flushCommand(); + break; + case 'a': acMainMenu(); + break; + case 'c': check(); + break; + case 'i': info(); + break; + case 't': transferCheck(); + break; + case 'C': create(); + break; + case 'R': renew(); + break; + case 'U': update(); + break; + case 'D': trash(); + break; + case 'T': transfer(); + break; + } + continue; + } + if (strlen(rawString) == 3) { + if (!strcmp(rawString,"??")) { + showCommand(); + continue; + } } if (is_numeric(rawString) == 2) { rawString[strlen(rawString)] = 0; @@ -46,18 +79,7 @@ void mdCommander::driver() { } if (strlen(rawString) >= 4 && strlen(rawString) <= 6 ) {if (!strcmp(rawString,"log\n")) { - system("less /tmp/ac-cd.log"); - continue; - } - if (!strcmp(rawString,"rlog\n")) { - system(PULL_MD_LOG); - system("less ac-md.log"); - continue; - } - if (!strcmp(rawString,"clips\n")) { -#ifdef MD_MAND - -#endif + system("less /tmp/ausreg-cd.log"); continue; } if (!strcmp(rawString,"done\n")) { @@ -78,56 +100,76 @@ void mdCommander::driver() { puts("That SCPI command is too short!"); continue; } - rc = scpi(rawString); + rc = epp(rawString); if (!rc) puts("Command transmitted: OK."); else printf("Command result: %s.",mdErrCode); continue; } - } + } } + void mdCommander::greet() { - puts("ac-cd command processor"); - puts("Enter ? for help or a cliever low level command"); + puts(" AC Commander "); + puts("Enter ? for help or an AC command"); acceptingInput = true; - SCPImode = true; + EPPmode = true; currentDevice = std::string("ALX"); } void mdCommander::help() { - const char *banner = "\n" CD_NAME " " CD_VERSION " compiled on " __DATE__ " @ " __TIME__ " (%d)\n"; + const char *banner = "\n" CD_NAME " " CD_VERSION " compiled on " __DATE__ " @ " __TIME__ " (%d)\n\n"; system("clear"); printf(banner,thisConfig->shellProcess); - printf("Target mdStdDevIdx: %d (0: Master Daemon(MD), 1: Cliever(CD))\n",mdStdDevIdx); - puts("LL (low level) Cliever commands: \n"); + printf(" target acEPPDevIdx-> %d this acEPPDevIdx: %d \n\n",0,mdStdDevIdx); puts(" ? - display this screen"); - puts(" - make (an integer) the target mdStdDevIdx"); - puts(" done - terminate the command loop but not ausreg-cd"); - puts(" log - display this cliever log"); - puts(" rlog - pull and display the MD log"); - puts(" mdapi - run mdclient here (xmlrpc-c must be installed)"); - printf(" quit - terminate %s (if in md shell CTL-C if finished)\n\n",thisConfig->origCmd); - puts("Anything else is a EPP cmd for the selected EPP Server."); - puts("If the device responds it should show in the log if debug level high enough.\n"); - if (*cdOrKb == 'd') { - puts("In the character mode UI:"); - puts(" Enter (help) in the rules system for more help."); - puts(" Enter (exit) in the rules system to return here.\n"); - } - puts("If in md shell, 'RST' and 'quit' resets the servers for this Cliever group"); - puts("(i.e. if the mdStdDevIdx is 0;used to get a fresh epoch with MD"); - puts(" and CD initialized and connected for device and data client testing).\n"); - puts("NB: USE LL SCPI COMMANDS FOR DEVICE DEV ONLY -\n"); - puts("Sending device commands at this level is potentially dangerous and is "); - puts("only for device development. Other users should issue commands using the"); - puts("data client XMLRPC API, e.g. thru mdclient which uses the current best"); - puts("proven rulebase (when MD is running as daclips-md)."); + puts(" ! - send the pending command"); + puts(" ?? - display the pending command"); + puts(" X - discard the pending command"); + puts(" - make (an integer) the target acEPPDevIdx"); + puts(" done - terminate this command loop but not ausreg-cd"); + puts(" e - standard EPP command menu"); + puts(" a - AC system control menu"); + puts(" log - display this cliever's log"); + puts(" rlog - pull and display the master daemon log"); + puts(" quit - terminate this process tree\n\n"); + puts("Any command valid outside command data loop(>>)."); } -bool mdCommander::scpi(char *cmd) { +void mdCommander::eppMainMenu() { + + const char *banner = "\n" CD_NAME " " CD_VERSION " compiled on " __DATE__ " @ " __TIME__ " (%d)\n\n"; + + system("clear"); + printf(banner,thisConfig->shellProcess); + printf(" target acEPPDevIdx-> %d this acEPPDevIdx: %d \n\n",0,mdStdDevIdx); + puts(" Queries \n"); + puts(" c - check"); + puts(" i - info"); + puts(" t - transfer\n"); + puts(" Commands \n"); + puts(" C - create"); + puts(" R - renew"); + puts(" U - update\n"); + puts(" D - delete"); + puts(" T - transfer"); + + } +void mdCommander::acMainMenu() { + + const char *banner = "\n" CD_NAME " " CD_VERSION " compiled on " __DATE__ " @ " __TIME__ " (%d)\n\n"; + + system("clear"); + printf(banner,thisConfig->shellProcess); + printf(" target acEPPDevIdx-> %d this acEPPDevIdx: %d \n\n",0,mdStdDevIdx); + puts(" Directives \n\n"); + puts(" RST - followed by quit resets entire AC system"); + + } +bool mdCommander::epp(char *cmd) { char *command,work[256]; bool isDirect=false,rc=true; @@ -146,4 +188,15 @@ bool mdCommander::scpi(char *cmd) { return rc; } +void mdCommander::check(){}; +void mdCommander::create(){}; +void mdCommander::flushCommand(){}; +void mdCommander::info(){}; +void mdCommander::renew(){}; +void mdCommander::sendCommand(){}; +void mdCommander::showCommand(){}; +void mdCommander::trash(){}; +void mdCommander::transfer(){}; +void mdCommander::transferCheck(){}; +void mdCommander::update(){}; diff --git a/APIG/client/mdBehavior.cpp b/APIG/client/mdBehavior.cpp new file mode 100644 index 0000000..11f75d4 --- /dev/null +++ b/APIG/client/mdBehavior.cpp @@ -0,0 +1,29 @@ +#include "ausreg-cd.h" +using namespace std; + + +std::string mdCommand::dO(void *targeT,std::string *text) { + + return std::string("OK"); + +} +mdEPP *mdEPP::setHandler(cdResponse *cdr) { + + mdEPP *value = this; + mdCmdPOD *flat = (mdCmdPOD *)(&cdr->reply->payLoad[0]); + + memcpy(flat,&this->parms,sizeof(mdCmdPOD)); + strcpy(&flat->sVal,this->signature.c_str()); + flat->nArgs = this->signature.length(); + + cdr->reply->hdr.primeOffset = cdr->reply->hdr.payloadSize = sizeof(mdCmdPOD) + flat->nArgs; + + done: return value; + +} +bool mdMandSpace::setFullName() { + + bool value=true; + + return value; +} diff --git a/APIG/include/ausreg-cd.h b/APIG/include/ausreg-cd.h index 4ff37bc..90d536a 100644 --- a/APIG/include/ausreg-cd.h +++ b/APIG/include/ausreg-cd.h @@ -30,27 +30,28 @@ #include #include -#define CLIEVER +#define CLIEVER + +#define CLIEVER_APP " ausreg-cd " +#define MD_COMPONENT "Client Daemon" // Cliever Component +#define MD_NAME CLIEVER_APP " " MD_COMPONENT +#define MD_VERSION " 1.0 " // Version +#define MD_DEFAULT_IP "188.138.106.163" #include "mdcommon.h" -#ifdef MD_MAND -#include -#endif - #include "cdEvents.h" #include "mdCommander.h" #include "mdBehavior.h" -#include "mdObservable.h" #include "mdState.h" #define CD_EPOCH date() #define CD_GLOBAL_SIZE 4096 -#define CD_LOCK_FILE "ac-cd.lock" -#define CD_NAME DACLIPS_APP " Cliever" -#define CD_VERSION "1.1" +#define CD_LOCK_FILE "ausreg-cd.lock" +#define CD_NAME CLIEVER_APP " ausreg-cd" +#define CD_VERSION "1.0" #define CD_REFRESH MD_HEARTBEAT // default milliseconds between telemetry frame updates #define CD_MAX_DEVICE 4 // including ourselves @@ -61,7 +62,7 @@ typedef std::map ODEsOfInterest; #include "cdLogger.h" -class cdDataLayer; +class cdapiLayer; class mdCliever; @@ -74,15 +75,15 @@ class mdCliever; mdCliever *thisCliever; - extern void runDataLayer(); + extern void runAPILayer(); extern void runCliever(); extern void shutdown(); #else - extern ac_cd_global *gm; + extern ac_cd_global *gm; extern boost::asio::io_service io_bg,io_fg; - extern const char *cdOrKb; + extern const char *cdOrTk; extern cdLogger theseLogs; extern clientDaemonConfig *thisConfig; extern mdCliever *thisCliever; diff --git a/APIG/include/clientDaemon.h b/APIG/include/clientDaemon.h index 06ac7d0..97ecfa0 100644 --- a/APIG/include/clientDaemon.h +++ b/APIG/include/clientDaemon.h @@ -51,7 +51,7 @@ class mdCliever: public mdProcess, bool alive,connected,shuttingDown,shutDown; - int instrumentHandle[MAX_INSTRUMENTS], + int eppPeerHandle[MAX_PEER], myHandle,machineHandle, rc, sentMsgCount[N_MDDG_TYPES][CD_MAX_DEVICE]; @@ -67,7 +67,7 @@ class mdCliever: public mdProcess, pulse = NULL; shuttingDown = shutDown = false; memset(sentMsgCount,0,sizeof(sentMsgCount)); - memset(instrumentHandle,0,sizeof(instrumentHandle)); + memset(eppPeerHandle,0,sizeof(eppPeerHandle)); myHandle = machineHandle = 0; } mdCliever(clientDaemonConfig *cmdCfg) diff --git a/APIG/include/clientDaemonConfig.h b/APIG/include/clientDaemonConfig.h index 312db94..22fd0cc 100644 --- a/APIG/include/clientDaemonConfig.h +++ b/APIG/include/clientDaemonConfig.h @@ -29,7 +29,7 @@ public: std::string telemetryPortStr; int cluster, debugThreshold, - instruments[MAX_INSTRUMENTS]; + eppServers[MAX_PEER]; int telemetryPort; // talks to central server with this date epoch(CD_EPOCH); localSourcesByClaimedName localDevices; @@ -41,7 +41,7 @@ public: debugThreshold = MAX_DEBUG; strcpy(logPath,"/tmp"); runCommander = true; - memset(instruments,0,sizeof(instruments)); + memset(eppServers,0,sizeof(eppServers)); } int loadMachineConfiguration(); diff --git a/APIG/include/coreapi.h b/APIG/include/coreapi.h new file mode 100644 index 0000000..f50fa3a --- /dev/null +++ b/APIG/include/coreapi.h @@ -0,0 +1,232 @@ +/*! \brief registerDevice + * core API. + * + * Singleton: All Devices must begin their interation with the MD + * with this and use the supplied handle sin subsequent + * API. + */ +class registerDevice : public xmlrpc_c::method { +private: + masterDaemonConfig *_cfg; +public: + registerDevice(masterDaemonConfig *cfg) { + _cfg = cfg; + _signature = "i:is"; + _help = "Register an XMLRPS APIG client. The first parameter is a device type value. " + "The string, specifies a signature identifying client. Normally the first call " + "in use of the MD XMLRPC i/f after connecting. The response if positive definite " + "is a handle to use in further interaction. This provides the XML genericity in" + " APIG. Signature 'release' releases a handle already obtain via this API."; + } + void + execute(xmlrpc_c::paramList const& paramList, + xmlrpc_c::value * const retvalP) { + + int const handleOrType(paramList.getInt(0)); + std::string stringField(paramList.getString(1)); + + paramList.verifyEnd(2); + + if (stringField == "release") + *retvalP = xmlrpc_c::value_int(thisService->releaseDevice(handleOrType)); + else + *retvalP = xmlrpc_c::value_int(thisService->getDeviceHandle(handleOrType,stringField)); + + } + +}; +/*! \brief getter + * core API. + * + * Common getter. + */ +class getter : public xmlrpc_c::method, mdState { +public: + getter() { + _signature = "S:is"; + _help = "Send handle, dataname, get structure answer. The the first " + "character of the dataname determines its type: ODEs " + "(Operational Data Elements) start with an underscore, otherwise " + "the dataname is that of an expermental Observable. The first " + "entry in the structure is always the state of the call which " + "will either the supplied dataname indicating success or error text. " + "The remainder of the structure is specific to the datatype."; + } + + void + execute(xmlrpc_c::paramList const& paramList, + xmlrpc_c::value * const retvalP) { + + int const deviceHandle(paramList.getInt(0)); + std::string dataName(paramList.getString(1)); + paramList.verifyEnd(2); + + *retvalP = *mdState::get(deviceHandle,dataName); + } + +}; +/*! \brief setter + * core API. + * + * Common setter. + */ +class setter : public xmlrpc_c::method, mdState { +public: + setter() { + + _signature = "s:iS"; + _help = "Process a gotten structure with changes. " + "Answers 'OK' or error text"; + } + + void + execute(xmlrpc_c::paramList const& paramList, + xmlrpc_c::value * const retvalP) { + + int const deviceHandle(paramList.getInt(0)); + xmlrpc_c::cstruct returnee(paramList.getStruct(1)); + paramList.verifyEnd(2); + + *retvalP = xmlrpc_c::value_string(mdState::set(deviceHandle,returnee)); + } +}; +/*! \brief create + * create a ndw data element. + * + * Dynamically create a MD data item. + */ +class create : public xmlrpc_c::method, mdState { +public: + create() { + + _signature = "s:iss"; + _help = "Given a device handle, focus type, and dataname create the element. " + "The type string uses the standard xmplrpc-c single character " + "type signatures and the name is an MD dataname whose first character " + "determines whether an Observable or and ODEe. Any text " + "following the type signature is preserved as a comment. " + "Answers 'OK' or error text"; + } + + void + execute(xmlrpc_c::paramList const& paramList, + xmlrpc_c::value * const retvalP) { + + int const deviceHandle(paramList.getInt(0)); + std::string typeSpec(paramList.getString(1)); + std::string newName(paramList.getString(2)); + paramList.verifyEnd(3); + + *retvalP = xmlrpc_c::value_string(mdState::create(deviceHandle,typeSpec,newName)); + } + +}; +/*! \brief cmdListFetch + * core API. + * + * Fetch currently defined Mands for device. + */ + + +class cmdListFetch : public xmlrpc_c::method, mdCommand { +public: + cmdListFetch() { + + _signature = "A:is"; + _help = "Send handle, md_dev type, and the mand layer. " + "Use empty string to get the full subsystem list. Reply will be " + "an array of the available commands."; + } + + void + execute(xmlrpc_c::paramList const& paramList, + xmlrpc_c::value * const retvalP) { + + int const deviceHandle(paramList.getInt(0)); + int const deviceType(paramList.getInt(0)); + std::string commandSetSpecified(paramList.getString(2)); + paramList.verifyEnd(3); + + if (deviceType != MACHINE && deviceType != MDDEV_INSTRUMENT) + *retvalP = xmlrpc_c::value_string(std::string("Invalid MD client type.")); + else + {if (thisService->validateHandleForCmds(deviceHandle)) + *retvalP = *thisService->fetchCommands(commandSetSpecified); + else *retvalP = xmlrpc_c::value_string(std::string("Error: Device not in state where this API can execute.")); + + } + } +}; +/*! \brief cmd + * core API. + * + * Common commander. + */ +class cmd : public xmlrpc_c::method, mdCommand { +public: + cmd() { + + _signature = "s:iS"; + _help = "Given, a handle, device type, the full text of a mand " + "sends the command to the MD and if accepted to the target. " + "If the mand is valid for the configured MD, MD answers OK " + "and sends it, otherwise answers error text. Whether " + "or not the OK indicates anything other than a valid command " + "depends on the configured behavior of the device."; + } + + std::string head(std::string in) { return in; } + std::string tail(std::string in) { return in; } + void + execute(xmlrpc_c::paramList const& paramList, + xmlrpc_c::value * const retvalP) { + + mdCommand *thisCommand; + mdCommand local; + + int deviceHandle(paramList.getInt(0)); + std::string commandText(paramList.getString(1)); + paramList.verifyEnd(2); + std::string tails=tail(commandText); + +// if (thisService->validateHandleForCmds(deviceHandle)) { +// if (thisCommand = thisDevice->commands[head(commandText)]) +// *retvalP = xmlrpc_c::value_string(thisCommand->dO(thisDevice,&tails)) ; +// else { +// *retvalP = xmlrpc_c::value_string(std::string("Error: Can't construct SCPI Command '" + commandText + "'")); +// } +// } +// else { +// *retvalP = xmlrpc_c::value_string(std::string("Error: Unknown Device")); +// } + } +}; + +/*! \brief getMDversion + * core API. + * + * Report the configuration of the MD. This API can be called at + * any time and does not require a device handle. + */ +class getMDversion : public xmlrpc_c::method { +public: + getMDversion() { + + _signature = "i:s"; + _help = "Accepts a device handle and returns the version identification " + "of the MD. "; + + } + + void + execute(xmlrpc_c::paramList const& paramList, + xmlrpc_c::value * const retvalP) { + + int const addend(paramList.getInt(0)); + + paramList.verifyEnd(1); + *retvalP = xmlrpc_c::value_string("OpenAUC v 0.5"); + } + +}; + diff --git a/APIG/include/mdBehavior.h b/APIG/include/mdBehavior.h new file mode 100644 index 0000000..213c946 --- /dev/null +++ b/APIG/include/mdBehavior.h @@ -0,0 +1,92 @@ +#ifndef MD_BEHAVIOR +#define MD_BEHAVIOR + +#include "Listener.h" +#include "EventSender.h" +#include "PolymorphEvent.h" + +/*! \brief mdMand + * The former mdBehavior + * + * The overall object category and files are still using the original name. + * Wanted to make d0 pure virtual but too many problems with current gcc template instantiation + * ( http://gcc.gnu.org/onlinedocs/gcc/Template-Instantiation.html ) + * + * The CLIPS integration with the low level system in mostly restricted to this interface. + */ + +class mdMand; + +typedef std::map MandLayer; + +class mdMand { +public: + + md_mand kind; + std::string fullname; + MandLayer subsystem; // children + MandLayer parent; + void *handler; + + // Subtypes must implement these. + std::string *dO(std::string *text); + +}; + +class mdMandSpace { + MandLayer catalog; + + bool add(std::string name,md_mand typ) + {if (catalog.find(name) == catalog.end()) { + mdMand *newMand = new mdMand(); + catalog[name] = *newMand; + newMand->fullname = name; + newMand->kind = typ; + newMand->handler = NULL; + } + + } + mdMand *find(std::string fn); + mdMand *parseAndCreatePath(std::string fn); + bool setFullName(void); +}; + +typedef struct { + bool requiresResponse; + bool hasArguments; + unsigned short nArgs; + char sVal; +} + mdCmdPOD; + +class mdCommand : mdMand { +public: + mdCmdPOD parms; + std::string signature; + + mdCommand(md_mand typ=MD_USER_MAND,std::string name=std::string("")) + {mdMand::handler = NULL; + mdMand::fullname = name; + mdMand::kind = typ; + } + ~mdCommand() {} + + mdCommand *mand(int deviceHandle, std::string& text); + std::string dO(void *target,std::string *text); + void *getHandler() {return mdMand::handler;} + void setHandler(void *to) {mdMand::handler = to;} + +}; +class mdResponse; +class mdEPP : mdCommand { +public: + + mdEPP(std::string name) : mdCommand(MD_EPP, name) {} + mdEPP *setHandler(cdResponse *cdr); + std::string dO(void *target,std::string *text); + +}; + +typedef std::map InstructionSet; // The EPP commands by cannonical name. + +#endif diff --git a/APIG/include/mdCommander.h b/APIG/include/mdCommander.h index cacfc5d..61753e1 100644 --- a/APIG/include/mdCommander.h +++ b/APIG/include/mdCommander.h @@ -4,7 +4,7 @@ class mdCommander { bool acceptingInput; - bool SCPImode; // false implies CLIPS mode + bool EPPmode; // RFC 8 int mdStdDevIdx; std::string currentDevice; @@ -13,10 +13,24 @@ class mdCommander { mdCommander() {mdStdDevIdx=0;} ~mdCommander() {} + void acMainMenu(); + void check(); + void create(); void driver(); + void eppMainMenu(); + void flushCommand(); void greet(); void help(); - bool scpi(char *command); + void info(); + void renew(); + void sendCommand(); + void showCommand(); + void trash(); + void transfer(); + void transferCheck(); + void update(); + + bool epp(char *command); }; diff --git a/APIG/include/mdclient.h b/APIG/include/mdclient.h index 27540f4..e74e6e4 100644 --- a/APIG/include/mdclient.h +++ b/APIG/include/mdclient.h @@ -91,12 +91,12 @@ public: sprintf(testContext,"Get handle for device: %s to test against: %s\n",defaultDevice,serverURL); if (!mdServerHandle) bucket00(testContext); - bucket01("Check predefined observables access.\n"); - bucket02("Check for required SCPI subsystems for the selected device.\n"); + bucket01("Check predefined ODEs access.\n"); + bucket02("Check for required EPP mand.\n"); if (!repeatableOnly) bucket03("Check dynamic definition of remaining specified observables.\n"); bucket04("Check event/rule mechanism.\n"); - bucket05("Check SCPI execution.\n"); + bucket05("Check EPP execution.\n"); bucket06("Check datagram layer operations.\n"); } diff --git a/APIG/include/mdcommon.h b/APIG/include/mdcommon.h deleted file mode 100644 index 9a87db3..0000000 --- a/APIG/include/mdcommon.h +++ /dev/null @@ -1,537 +0,0 @@ - /** - * \mainpage AusReg Cliever - * - *

- * - * \par About - * \par - * The Delivery Document Subsite - * - * \htmlonly - * \endhtmlonly - * - *

- * - * \par AusReg Cliever requirements - * - * This program suite was originally developed on Debian Wheezy 64 but - * should compile on any Unix where all of the requirements are present. - * - *

- * - * \par Access source code - * - * Developers Repository - * - * - To pull from my git repo: - * - \verbatim git clone drde@git.meansofproduction.biz:/git/DRDE \endverbatim - * - * - *

- * - * \par Top Level External Dependencies... and version currently used - *
- * \b boost: 1.49
- * \b log4cpp: 1.0
- * \b sigc++: 2.0
- *
- * The above is a covering set of dependencies, everything else required for unix builds should be in the git repo or with AusReg EPP TK. - * - *

- * - * accommon.h - Core Daemon Level definitions. - * - * \par Authors Support Site - * - * \htmlonly DNS EPP Upgrade Service \endhtmlonly - * - * \par License - * See the licenses section of the Latex2HTML document - * - */ - -#ifndef MD_COMMON -#define MD_COMMON - -#include - -using namespace std; -using boost::asio::ip::udp; - -#define MAX_CLIENTS 1000 -#define MAX_CLIEVER 10 -#define MAX_DATACLIENTS 200 -#define MAX_EPP_SERVERS 3 . -#define MAX_DEBUG 1000 // Set the config parm higher than this to inhibit logNdebug(m...) where m < this -#define MAX_HOST (((MAX_CLIEVER + 1) * MAX_EPP_SERVERS) + MAX_CLIENTS) -#ifndef MD_STAGE -#define CD_DEFAULT_IP "192.168.0.9" -#define MD_DEFAULT_IP "192.168.0.5" -#define PULL_MD_LOG "cp /somejuan/tmp/-md.log ." -#else -#define CD_DEFAULT_IP "184.168.64.86" -#define MD_DEFAULT_IP "178.79.142.228" -#define PULL_MD_LOG ("scp drde@" MD_DEFAULT_IP "/tmp/-md.log .") -#endif -#define MD_EPOCH date() -#define MD_HEARTBEAT 1 // Network peer heartbeat in seconds. -#define MD_MAX_DATAGRAM (32*1024) // half of the IPV4 max -#define AC_APP "Generic" -#define AC_COMPONENT "Master Daemon" // AC Component -#define AC_NAME AC_APP " " AC_COMPONENT -#define MD_VERSION " 1.1 " // DACLIPS Version -#define MD_REFRESH 10 // default milliseconds between APIG frame updates -#define MD_TYPE "EPPREGISTRAR" -#define NORMAL_DEBUG 10 -#ifndef CURRENT_DEBUG -#define CURRENT_DEBUG NORMAL_DEBUG -#endif -#define NOT_OK -1 -#define OK 0 -#define RUNNING_DIR "/tmp" - -#define theMachine thisConfig->machine[thisConfig->thisMachineContext] - -enum md_mand { - MD_NAM, // Not a Mand. - MD_USER_MAND, // User defined mand type - MD_SCPI, - MD_RULE_ACTION, - MD_CLIEVER_CMD, // From CD command loop or other UI - MD_CLIENT_CMD, // From XMLRPC - MD_NMANDS -}; - -enum mdErrorCode { // In ac-md/kb index to masterDaemonConfig.err - MDERR_OK, - MDERR_MISSING, - MDERR_EXISTS, - MDERR_CONFLICT, - MDERR_NOTREADY, - MDERR_SYNTAX, - N_MDSTDERR -}; - -enum md_dispatch_category { - MD_NEWBORN = 0, // inbound this isn't dispatched - CD_FRAME, - MD_FRAME, - CD_MDQUERY, - MD_SHUTDOWN -}; - -enum md_host { - MDDEV_MD = 0, - MDDEV_CD, - MDDEV_PEER, - MACHINE, - N_MDDEV_TYPES -}; - -enum md_reserved { - MD_RESERVED_UNDEFINED = 0, - N_MD_RESERVED -}; - -enum mdDGtype { - MDDG_HEARTBEAT = 0, - MDDG_DEVICEHB, - MDDG_NEWBORN, - MDDG_MDQUERY, - MDDG_REGSCPI, - MDDG_REGOBS, - MDDG_REGODE, - MDDG_TELEMETRY, - MDDG_CDRESET, - N_MDDG_TYPES -}; - -typedef -struct MD_DG_TYPE { -unsigned inBandOnly : 1; -unsigned requiresAck : 1; -unsigned isAckNak : 1; -unsigned value : 1; // i.e. boolean for ack/nak etc. where true = ack. -unsigned reserved : 4; -unsigned clieverGroup : 8; // masterDaemonConfig.thisMachineContext -unsigned reserved2 : 16; -} - mdDGflags; - -typedef -struct MD_DG_HEADER { -mdDGtype msgType; -mdDGflags dgType; -mdDGtype dgSubType; -int msgSN; // Ordinal in a dialog -md_device clientType; -int sourceHandle; -int sinkHandle; -int handle; // for example if query about a device other than source or sink. -mdErrorCode ec; -int payloadSize; -int primeOffset; // for example to the name associated with the data -} - mdDGHeader; - -typedef -struct MD_DATAGRAM { - mdDGHeader hdr; - char payLoad[MD_MAX_DATAGRAM - (sizeof(mdDGHeader))]; -} - mdDatagram; - -typedef -struct MD_REPLY { - mdDGHeader hdr; - char payLoad[512 - sizeof(mdDGHeader)]; -} - mdDGReply; - -class mdReply { -public: - - mdDGReply dg; - - mdReply() {memset((void *)&dg,0,sizeof(mdDGReply)); - dg.hdr.dgType.isAckNak = true; - } -}; - -#if (defined(MD_MAIN) || defined(CD_MAIN) ) -const char *hostTypes[N_MDDEV_TYPES ] = { "Master Daemon", "Cliever", "Machine" }; -#else -extern const char *clientTypes[N_MDDEV_TYPES]; -#endif - -/* \brief mdProcess - * Abstract base class of various subprocesses - * - * AC is a distributed system with various subprocesses - * spanning the central server, the 'Cliever' middleware components and clients. - * Root class for these. - * - */ - -class mdWQitem { -public: - md_dispatch_category kind; - const void *what; - int user; // User defined - mdWQitem (const void *work,md_dispatch_category priority,int x) - : what(work), kind(priority), user(x) {} - - bool operator< (const mdWQitem & right) const { - return kind < right.kind; - } - -}; - -typedef std::priority_queue < mdWQitem* > MDWQ; - -class mdProcess { -public: MDWQ q; - mdProcess() {} - ~mdProcess() {} - - void queue(mdWQitem *w) {q.push(w);} -virtual void dispatch(mdWQitem *w)=0; -virtual void run() = 0; - -}; -#define MD_DEFAULT_DEVICE_PROTOCOL 0 -#define MD_DEFAULT_RULE 0 - -typedef -struct { - unsigned open:1; - unsigned looped:1; // back channel established from passive connection. - unsigned reserved:30; - } mdCnctBool; - -typedef -struct MD_CONTROL_BLOCK -{int handle; // debug mark - mdCnctBool connection; - boost::asio::ip::udp::endpoint ep; - boost::asio::ip::udp::resolver::iterator it; - boost::asio::ip::udp::socket *udp; - MD_CONTROL_BLOCK() { - handle = 0; - memset((void *)&connection,0,sizeof(connection)); - udp = NULL; - } -} - mdCB; - -typedef std::map mdStdDevicePODMap; // MD Standard Device Map - -/* - *\brief stdDev: collection with MD at: 0, CDs in: 1 - MAX_CLIEVER, - * eppPeers in: MAX_CLIEVER+2 - MAX_CLIEVER+2+MAX_EPPSERVER - * - * The mdStdDevIdx of a host is its index above. - * Within intervals clients are assigned compactly in the same order as thier handles are created and assigned. - */ - -#if (defined(MD_MAIN) || defined(CD_MAIN) || defined(TK_DLL_MAIN)) - mdStdDevicePODMap cb; - int myStdDevIdx=MAX_CLIENTS+1; // global default to localhost -#else - extern mdStdDevicePODMap cb; - extern int myStdDevIdx; -#endif - -class mdDGChannel -{public: - - boost::asio::io_service& io_service_; - boost::asio::ip::udp::endpoint p_endpoint_; - boost::asio::ip::udp::endpoint a_endpoint_; - boost::asio::ip::udp::endpoint *ep_; - boost::asio::ip::udp::resolver *r; - boost::asio::ip::udp::resolver::query *q; - boost::asio::ip::udp::socket passive_; - boost::asio::ip::udp::socket *active_; - boost::asio::ip::udp::socket *s_; - - char ack_[sizeof(mdDGReply)]; - char data_[MD_MAX_DATAGRAM]; - - int mdStdDevIdx; - - mdDatagram *inProcess; - mdReply *reply; - - short port; - - mdDGChannel(boost::asio::io_service& io_service, - short inport, int stdDevIdx=myStdDevIdx) - : io_service_(io_service), mdStdDevIdx(stdDevIdx), - passive_(io_service, udp::endpoint(udp::v4(), inport)) - { - inProcess = (mdDatagram *)data_; - ep_ = &p_endpoint_; - port = inport; - reply = (mdReply *)ack_; - q = NULL; - r = NULL; - s_ = &passive_; - - passive_.async_receive_from( - boost::asio::buffer(data_, MD_MAX_DATAGRAM), p_endpoint_, - boost::bind(&mdDGChannel::handle_receive_from, this, - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); - } - - void async_send(mdDatagram &dg) { - - size_t dgSize = sizeof(mdDGHeader) + dg.hdr.payloadSize; - - *inProcess = dg; - //std::memcpy(this->data_,(char *)&dg,dgSize); - - active_->async_send_to( - boost::asio::buffer(data_, dgSize), *ep_, - boost::bind(&mdDGChannel::handle_send_to, this, - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); - } - - bool connect_to (std::string &host, std::string &port, int stdDevIdx=-1) { - - bool value = false; - int rport = atoi(port.c_str()); - boost::system::error_code ec; - boost::asio::ip::udp::endpoint remote ( boost::asio::ip::address::from_string(host.c_str()), rport); - - stdDevIdx = (stdDevIdx == -1) ? mdStdDevIdx : stdDevIdx; - map::iterator iter = cb.find(stdDevIdx); - if( iter == cb.end() ) cb[stdDevIdx] = new mdCB(); - - try { - if (!r) r = new udp::resolver(io_service_); - if ( q) delete q; - q = new udp::resolver::query(udp::v4(), host.c_str(), port.c_str()); - cb[stdDevIdx]->it = r->resolve(*q); - if (!cb[mdStdDevIdx]->udp) - cb[mdStdDevIdx]->udp = new udp::socket(io_service_, udp::endpoint(udp::v4(), 0)); - active_ = cb[mdStdDevIdx]->udp; - if (active_->is_open()) - active_->connect(remote,ec); - - if (!ec) value = true; - - } - catch(...) {} - - return (cb[stdDevIdx]->connection.open=value); - - } - - bool connect_to (boost::asio::ip::udp::endpoint &ep,boost::system::error_code &ec,int &step,int stdDevIdx=-1) - { - - bool value = false; - - stdDevIdx = stdDevIdx == -1 ? mdStdDevIdx : stdDevIdx; - map::iterator iter = cb.find(stdDevIdx); - if( iter == cb.end() ) cb[stdDevIdx] = new mdCB(); - - try { if (cb[stdDevIdx]->udp) {if (cb[stdDevIdx]->udp->is_open()) - cb[stdDevIdx]->udp->close(); - delete cb[stdDevIdx]->udp;} - - cb[stdDevIdx]->ep = ep; - active_ = cb[stdDevIdx]->udp = new boost::asio::ip::udp::socket( io_service_ , udp::endpoint(udp::v4(), 0) ); - ec.clear(); - active_->connect( cb[stdDevIdx]->ep, ec ); - if (active_->is_open()) { value = true; cb[stdDevIdx]->connection.open=1; } - else { - step++; - active_->open( udp::v4(), ec ); - if (active_->is_open()) {value = true; cb[stdDevIdx]->connection.open=1; } - } - - } - catch(boost::system::system_error &be) {boost::system::system_error warning = be;} - catch(...) {} - - return (value); - - } - - void handle_receive_from(const boost::system::error_code& error, size_t bytes_recvd); - - void handle_send_to(const boost::system::error_code& asioEC, size_t sentByes) - { - size_t dgSize = inProcess->hdr.dgType.requiresAck - ? sizeof(mdReply) : sizeof(mdDatagram); - - // std::string debugMsg = asioEC.message(); - - if (inProcess->hdr.dgType.requiresAck) - active_->async_receive_from( - boost::asio::buffer(ack_, dgSize), *ep_, - boost::bind(&mdDGChannel::handle_receive_from, this, - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); - else - active_->async_receive_from( - boost::asio::buffer(data_, dgSize), *ep_, - boost::bind(&mdDGChannel::handle_receive_from, this, - boost::asio::placeholders::error, - boost::asio::placeholders::bytes_transferred)); - } - - bool send(mdDatagram &dg) { - - size_t dgSize = sizeof(mdDGHeader) + dg.hdr.payloadSize; - - return (dgSize == - active_->send(boost::asio::buffer((void *)&dg, dgSize))); - - } - - bool send_to(mdDatagram &dg, int mdStdDevIdx) { - - size_t dgSize = sizeof(mdDGHeader) + dg.hdr.payloadSize; - - return (dgSize == - active_->send_to(boost::asio::buffer((void *)&dg, dgSize), *cb[mdStdDevIdx]->it)); - - } - - size_t send(mdReply &dg, boost::system::error_code &ec) { - - size_t dgSize = sizeof(mdDGReply); - boost::asio::socket_base::message_flags flags=0; - - return (active_->send(boost::asio::buffer((void *)&dg, dgSize), flags, ec)); - - } - - size_t send_back(mdReply &dg, boost::system::error_code &ec, int &step) { - - size_t dgSize = sizeof(mdDGReply); - boost::asio::socket_base::message_flags flags=0; - step = 1; - - a_endpoint_ = passive_.remote_endpoint(ec); - - if (ec) return 0; - - return (passive_.send_to(boost::asio::buffer((void *)&dg, dgSize), a_endpoint_, flags, ec)); - - } - - bool send_to(mdReply &dg,int mdStdDevIdx) { - - size_t dgSize = sizeof(mdDGReply); - - return (dgSize == - active_->send_to(boost::asio::buffer((void *)&dg, dgSize), *cb[mdStdDevIdx]->it)); - - } - -}; - - -#if defined(_WIN32_WINNT) && !defined(DllExport) && defined(DV_DLL) -#pragma warning( disable: 4251 ) -#define DllExport __declspec(dllexport) -#else -#define DllExport -#endif - -typedef std::map mdErrMsgMap; - -class DllExport mdError { - - int instance; - mdErrMsgMap text; - -public: - mdError() { text[0] = std::string("OK"); - instance = 0; - } - - ~mdError() {} - - // The below populate the additional messages; - // Instances below 1000 are reserved for system errors, negative - // integers not used. - // Users derive from this class and implement additionalUsrMsgs. - - void additionalUserMsg(int instCode,const char *msgText) - {if (instCode >= 1000) text[instCode] = std::string(msgText);} - void additionalSystemMsg(int instCode,const char *msgText) - {if (instCode < 1000 && instCode >0) text[instCode] = std::string(msgText);} - - int get() {return instance;} - void get(mdError **parentPtr) - {*parentPtr = this;} - void set(int i) {instance = i;} - - const char *what(char *buffer=NULL) { - if (text.find(get()) == text.end()) { - {if (!buffer) return NULL; - sprintf(buffer,"Unknown error code: %d",get()); - return buffer; - } - return text[get()].c_str(); - } - return "unknown"; - } - -}; - -class mdDG { -public: - mdDatagram dg; - - mdDG() {memset(&dg,0,sizeof(mdDatagram));} - -}; - -#endif diff --git a/AusRegCliever/Makefile b/AusRegCliever/Makefile index bb61218..71fe1b0 100644 --- a/AusRegCliever/Makefile +++ b/AusRegCliever/Makefile @@ -1,7 +1,7 @@ LOCATION=authoring # -# -# Add other locations and move target differences into the macros as needed +# Add other locations and move target differences into the macros as needed, +# setup for my primary development and testing hosts. # CC=g++ Cc=gcc @@ -9,6 +9,7 @@ Cc=gcc BOSTLIB=-L/usr/lib/boost BOSINCL=-I/usr/include/boost LOG4LIB=-L/usr/lib + CLIENT=drde ifeq ($(LOCATION),authoring) ARTKLIB=-L/home/jdaugherty/clients/reg.de/git/ACTK1_0/lib @@ -35,6 +36,9 @@ XERCES_LIB_DIR = /usr/lib/ XERCES_LIB = xerces-c XERCES_INC_DIR = /usr/include/xercesc/ +# +# ---------- Should not need to change below +# CLIBS= -L$(USRLIB) CLFLAGS= -Wall -Wundef -Wpointer-arith -Wshadow \ @@ -57,7 +61,7 @@ ARTKDEPS = -L$(ARTK_LIB_DIR) -lACTK1_0 \ all: cliever -cliever: build/drde-cliever +cliever: build/$(CLIENT)-cliever .c.o: $(Cc) -c $(CLFLAGS) -o $< @@ -89,20 +93,19 @@ build/drde-cliever: $(ACOBJS) doxygen/index.html: etc/doxygen.config doxygen etc/doxygen.config -# --- rebuild on copy to a new host -distclean: - clrbak - rm -rf build - rm -rf doxygen - mkdir doxygen - mkdir build - touch etc/doxygen.config +#distclean: +# clrbak +# rm -rf build +# rm -rf doxygen +# mkdir doxygen +# mkdir build +# touch etc/doxygen.config clean: clrbak find ./build -name "*.o" -print | perl -ne "print;chop;unlink" find ./build -name "*.rpo" -print | perl -ne "print;chop;unlink" - rm build/drde-cliever + rm build/$(CLIENT)-cliever diff --git a/AusRegCliever/build/cliever.o b/AusRegCliever/build/cliever.o new file mode 100644 index 0000000..3fbe710 Binary files /dev/null and b/AusRegCliever/build/cliever.o differ diff --git a/AusRegCliever/build/drde-cliever b/AusRegCliever/build/drde-cliever new file mode 100755 index 0000000..5838fac Binary files /dev/null and b/AusRegCliever/build/drde-cliever differ diff --git a/AusRegCliever/build/masterDaemon.o b/AusRegCliever/build/masterDaemon.o new file mode 100644 index 0000000..09d7f6f Binary files /dev/null and b/AusRegCliever/build/masterDaemon.o differ diff --git a/AusRegCliever/build/masterDaemonConfig.o b/AusRegCliever/build/masterDaemonConfig.o new file mode 100644 index 0000000..d1a8c5d Binary files /dev/null and b/AusRegCliever/build/masterDaemonConfig.o differ diff --git a/AusRegCliever/build/mdAusReg.o b/AusRegCliever/build/mdAusReg.o new file mode 100644 index 0000000..51f9936 Binary files /dev/null and b/AusRegCliever/build/mdAusReg.o differ diff --git a/AusRegCliever/build/mdHost.o b/AusRegCliever/build/mdHost.o new file mode 100644 index 0000000..335dd49 Binary files /dev/null and b/AusRegCliever/build/mdHost.o differ diff --git a/AusRegCliever/build/mdLogger.o b/AusRegCliever/build/mdLogger.o new file mode 100644 index 0000000..46c760e Binary files /dev/null and b/AusRegCliever/build/mdLogger.o differ diff --git a/AusRegCliever/build/mdState.o b/AusRegCliever/build/mdState.o new file mode 100644 index 0000000..390d84a Binary files /dev/null and b/AusRegCliever/build/mdState.o differ diff --git a/AusRegCliever/include/cliever-md.h b/AusRegCliever/include/cliever-md.h index e78d123..fd7251f 100644 --- a/AusRegCliever/include/cliever-md.h +++ b/AusRegCliever/include/cliever-md.h @@ -26,6 +26,11 @@ namespace fsm = boost::statechart; +#define CLIEVER_APP "AusReg Cliever" +#define MD_COMPONENT "Master Daemon" // Cliever Component +#define MD_NAME CLIEVER_APP " " MD_COMPONENT +#define MD_VERSION " 1.0 " // Version + #include "mdcommon.h" #include "mdevents.h" #include "mdLogger.h" diff --git a/AusRegCliever/include/mdState.h b/AusRegCliever/include/mdState.h index ebd0cff..2e8b7e2 100644 --- a/AusRegCliever/include/mdState.h +++ b/AusRegCliever/include/mdState.h @@ -64,7 +64,11 @@ public: void * get(int deviceHandle,std::string &dataName); std::string set(int deviceHandle,std::string &inbound); +#ifdef CLIEVER + void registerData(const char *dataName,const cdIncoming &thisOne); +#else void registerData(const char *dataName,const mdIncoming &thisOne); +#endif ODEsByName localODEs; diff --git a/AusRegCliever/include/mdcommon.h b/AusRegCliever/include/mdcommon.h index d815558..deb6ee9 100644 --- a/AusRegCliever/include/mdcommon.h +++ b/AusRegCliever/include/mdcommon.h @@ -70,10 +70,7 @@ using boost::asio::ip::udp; #define MD_EPOCH date() #define MD_HEARTBEAT 1 // Network peer heartbeat in seconds. #define MD_MAX_DATAGRAM (32*1024) // half of the IPV4 max -#define CLIEVER_APP "AusReg Cliever" -#define MD_COMPONENT "Master Daemon" // Cliever Component -#define MD_NAME CLIEVER_APP " " MD_COMPONENT -#define MD_VERSION " 1.0 " // Version + #define MD_REFRESH 10 // default milliseconds between API frame updates #define MD_TYPE "EPPPEER" #define NORMAL_DEBUG 10 @@ -200,7 +197,7 @@ public: } }; -#if (defined(MD_MAIN) ) +#if (defined(MD_MAIN) || defined(CD_MAIN) ) const char *clientTypes[N_MDDEV_TYPES ] = { "Master Daemon", "Cliever", "MD Client" }; #else extern const char *clientTypes[N_MDDEV_TYPES];