This commit is contained in:
Ren RenJuan 2014-01-14 19:58:27 +00:00
parent 023ee097b0
commit 8babf3718b
6 changed files with 42 additions and 21 deletions

View File

@ -1,7 +1,7 @@
################################################## ##################################################
# Makefile for building lib and main test routine# # Makefile for building lib and main test routine#
################################################## ##################################################
LOCATION=authoring #LOCATION=debian7
SYSTEM = $(shell uname -s) SYSTEM = $(shell uname -s)
@ -15,17 +15,23 @@ CXXFLAGS = $(PRODORDEV) -Wall -Wpointer-arith -Wcast-qual -D_REENTRANT -fPIC
CPPFLAGS = -fPIC -D_GNU_SOURCE CPPFLAGS = -fPIC -D_GNU_SOURCE
CXXFLAGS += -D_GNU_SOURCE -O0 CXXFLAGS += -D_GNU_SOURCE -O0
ifeq ($(LOCATION),authoring) ifeq ($(LOCATION),debian7)
XALAN_LIB_DIR = /usr/lib/x86_64-linux-gnu/ #XALAN_LIB_DIR = /usr/lib/x86_64-linux-gnu/
XALAN_LIB_DIR = /usr/local/lib/
XALAN_LIB = xalan-c
XALAN_INC_DIR = /usr/local/include/xalanc
XERCES_LIB_DIR = /usr/local/lib/
XERCES_LIB = xerces-c
XERCES_INC_DIR = /usr/local/include/xercesc
else else
XALAN_LIB_DIR = /usr/lib/ XALAN_LIB_DIR = /usr/lib/
endif
XALAN_LIB = xalan-c XALAN_LIB = xalan-c
XALAN_INC_DIR = /usr/include/xalanc XALAN_INC_DIR = /usr/include/xalanc
XERCES_LIB_DIR = /usr/lib/ XERCES_LIB_DIR = /usr/lib/
XERCES_LIB = xerces-c XERCES_LIB = xerces-c
XERCES_INC_DIR = /usr/include/xercesc/ XERCES_INC_DIR = /usr/include/xercesc
endif
include xml-deps.mk include xml-deps.mk

Binary file not shown.

View File

@ -117,8 +117,8 @@ int main(int const argc, const char ** const argv)
thisCliever = NULL; thisCliever = NULL;
cdHasTk = strstr(argv[0],"clips") ? true : false; cdHasTk = strstr(argv[0],"loadtk") ? true : false;
cdOrTkValue = cdHasTk ? 'd' : 'D'; // d == kb enabled, D = !d cdOrTkValue = cdHasTk ? 'd' : 'D'; // d == EPP Toolkit enabled, D = !d
//RAII constructor/destructor //RAII constructor/destructor
struct shm_remove struct shm_remove
@ -133,7 +133,7 @@ int main(int const argc, const char ** const argv)
memset(acCDglobal.get_address(), 0, acCDglobal.get_size()); memset(acCDglobal.get_address(), 0, acCDglobal.get_size());
gm = (ac_cd_global *)acCDglobal.get_address(); gm = (ac_cd_global *)acCDglobal.get_address();
strcpy(gm->id,"ausreg-cd"); strcpy(gm->id,"ausreg-cd");
strcmp(gm->id,"ausreg-cd"); // Will segfault if there is a problem so catches are are futile. strcmp(gm->id,"ausreg-cd"); // Will segfault if there is a problem so catches are futile.
// But the signal trap will catch the fault. // But the signal trap will catch the fault.
thisConfig = new clientDaemonConfig(); thisConfig = new clientDaemonConfig();
@ -236,6 +236,6 @@ void usage() {
std::cerr << "Usage: " << cdOrTk<< " <udp-port> ['*'] [device=TEST] [mdIP=" MD_DEFAULT_IP "] [logs=\\tmp]\n\n where \n\n" std::cerr << "Usage: " << cdOrTk<< " <udp-port> ['*'] [device=TEST] [mdIP=" MD_DEFAULT_IP "] [logs=\\tmp]\n\n where \n\n"
"\t <udp-port> is required, must be the first parameter, and must be 1000 or greater. \n" "\t <udp-port> 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 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"; "\t '*', if present, indicates skip the command loop (string quotes may be required). \n\n";
exit(1); exit(1);
} }

View File

@ -6,7 +6,7 @@
if (!(expr)) { \ if (!(expr)) { \
std::cerr << __FILE__ << ":" << __LINE__ << ":" << #expr << std::endl;} std::cerr << __FILE__ << ":" << __LINE__ << ":" << #expr << std::endl;}
const char *banner = CD_NAME " " CD_VERSION " compiled on " __DATE__ " @ " __TIME__ " (%d)"; const char *banner = CD_NAME " " CD_VERSION " compiled on " __DATE__ " @ " __TIME__ " (%d/%d)";
char theBanner[256]; char theBanner[256];
int targetHost = 0; int targetHost = 0;
@ -232,8 +232,10 @@ void mdCommander::driver() {
if (!strcmp(rawString,"done")) { if (!strcmp(rawString,"done")) {
goto done; goto done;
} }
if (!strcmp(rawString,"quit")) { if (!strcmp(rawString,"quit")) { work[128];
thisConfig->terminateRequest = true; thisConfig->terminateRequest = true;
sprintf(work,"kill -9 %d",thisConfig->daemonProcess);
system(work);
goto done; goto done;
} }
continue; continue;
@ -254,7 +256,7 @@ void mdCommander::greet() {
const char *title="AusReg Cliever Commander", const char *title="AusReg Cliever Commander",
*prompt="Enter ? or command"; *prompt="Enter ? or command";
sprintf(theBanner,banner,thisConfig->shellProcess); sprintf(theBanner,banner,thisConfig->shellProcess,thisConfig->daemonProcess);
getmaxyx(stdscr,row,col); getmaxyx(stdscr,row,col);
mvprintw(0,(col-strlen(banner))/2,"%s",theBanner); mvprintw(0,(col-strlen(banner))/2,"%s",theBanner);
mvprintw(row/2,(col-strlen(title))/2,"%s",title); mvprintw(row/2,(col-strlen(title))/2,"%s",title);
@ -492,6 +494,9 @@ const char *befehlJetzt = cmdNames[commandsNow[cmdNow]];
return true; return true;
}; };
//
// Wrappers for specific EPP commands.
//
void mdCommander::check(bool run) { void mdCommander::check(bool run) {
if (!commandsNow[cmdNow]) commandsNow[cmdNow] = 0; if (!commandsNow[cmdNow]) commandsNow[cmdNow] = 0;

View File

@ -1,4 +1,4 @@
LOCATION=authoring LOCATION=debian7
# #
# 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. # setup for my primary development and testing hosts.
@ -11,7 +11,7 @@ Cc=gcc
LOG4LIB=-L/usr/lib LOG4LIB=-L/usr/lib
CLIENT=drde CLIENT=drde
ifeq ($(LOCATION),authoring) ifeq ($(LOCATION),debian7)
ARTKLIB=-L/home/jdaugherty/clients/reg.de/git/ACTK1_0/lib ARTKLIB=-L/home/jdaugherty/clients/reg.de/git/ACTK1_0/lib
ARTKINCL=-I/home/jdaugherty/clients/reg.de/git/ACTK1_0 ARTKINCL=-I/home/jdaugherty/clients/reg.de/git/ACTK1_0
else else
@ -24,17 +24,22 @@ SLIBS= -L/usr/lib $(BOSTLIB) $(LOG4LIB) $(ARTKLIB) -l boost_system -l boost_thre
SINCL= -I include -I /usr/include/log4cpp $(BOSINCL) SINCL= -I include -I /usr/include/log4cpp $(BOSINCL)
CFLAGS= -DCURRENT_DEBUG=1000 -ggdb3 CFLAGS= -DCURRENT_DEBUG=1000 -ggdb3
ifeq ($(LOCATION),authoring) ifeq ($(LOCATION),debian7)
XALAN_LIB_DIR = /usr/lib/x86_64-linux-gnu/ #XALAN_LIB_DIR = /usr/lib/x86_64-linux-gnu/
XALAN_LIB_DIR = /usr/local/lib
XALAN_LIB = xalan-c
XALAN_INC_DIR = /usr/local/include/xalanc
XERCES_LIB_DIR = /usr/local/lib/
XERCES_LIB = xerces-c
XERCES_INC_DIR = /usr/local/include/xercesc/
else else
XALAN_LIB_DIR = /usr/lib/ XALAN_LIB_DIR = /usr/lib/
endif
XALAN_LIB = xalan-c XALAN_LIB = xalan-c
XALAN_INC_DIR = /usr/include/xalanc XALAN_INC_DIR = /usr/include/xalanc/
XERCES_LIB_DIR = /usr/lib/ XERCES_LIB_DIR = /usr/lib/
XERCES_LIB = xerces-c XERCES_LIB = xerces-c
XERCES_INC_DIR = /usr/include/xercesc/ XERCES_INC_DIR = /usr/include/xercesc/
endif
# #
# ---------- Should not need to change below # ---------- Should not need to change below
@ -50,6 +55,7 @@ ACOBJS= build/cliever.o build/mdLogger.o build/masterDaemonConfig.o build/maste
build/mdHost.o build/mdState.o build/mdAusReg.o build/mdHost.o build/mdState.o build/mdAusReg.o
ARTKDEPS = -L$(ARTK_LIB_DIR) -lACTK1_0 \ ARTKDEPS = -L$(ARTK_LIB_DIR) -lACTK1_0 \
-L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\ -L$(XALAN_LIB_DIR) -lxalan-c -lxalanMsg\
-L$(XERCES_LIB_DIR) -lxerces-c \ -L$(XERCES_LIB_DIR) -lxerces-c \

View File

@ -123,6 +123,7 @@ void masterDaemon::dispatch(const mdIncoming &what) {
} }
} }
int masterDaemon::initAusRegTK(void) { int masterDaemon::initAusRegTK(void) {
int rc=OK; int rc=OK;
@ -153,6 +154,7 @@ int masterDaemon::initAusRegTK(void) {
return rc; return rc;
} }
void masterDaemon::listen() { void masterDaemon::listen() {
EventSender<mdAttention>::add(*this); EventSender<mdAttention>::add(*this);
@ -250,6 +252,7 @@ void masterDaemon::run() {
fg = new mdDGChannel( thisService->io_, 0 ); fg = new mdDGChannel( thisService->io_, 0 );
if (initAusRegTK()) return; if (initAusRegTK()) return;
if (artk->tkScenario == ACTK_OTEA) { if (artk->tkScenario == ACTK_OTEA) {
boost::thread oteArun(oteA); boost::thread oteArun(oteA);
assert(oteArun.joinable()); assert(oteArun.joinable());
@ -262,6 +265,7 @@ void masterDaemon::run() {
oteBrun.join(); oteBrun.join();
theseLogs->logNdebug(MAX_DEBUG,0,"Pre-production Ops / OTEB EOJ."); theseLogs->logNdebug(MAX_DEBUG,0,"Pre-production Ops / OTEB EOJ.");
} }
listen(); listen();
boost::thread work(mdWQ); boost::thread work(mdWQ);
assert(work.joinable()); assert(work.joinable());