Commit d313bc3d authored by mr-ti's avatar mr-ti
Browse files

No commit message

No commit message
parent a51fe742
......@@ -31,5 +31,4 @@ ENDIF(NOT DEFINED project_WC_REVISION)
SET(global_unicomctrl_DEFS ${global_unicomctrl_DEFS} -D_UNI_REVISION="\\"${project_WC_REVISION}\\"" -D_UNI_VERSION="\\"0.7.0a0\\"")
MESSAGE("DDnsSync Project revision ${project_WC_REVISION}")
SUBDIRS(ddnssbase ddnssync)
#SUBDIRS(ddnssbase ddnssync ddnssplugins)
SUBDIRS(ddnssbase ddnssync ddnssplugins)
SUBDIRS(dyndns zoneedit)
# ### HEAD ###
PROJECT(dyndns)
# ### COMMUN ###
SET(dyndns_SRCS dyndns.cpp)
SET(dyndns_LIBS ddnssbase)
SET(dyndns_DEFS ${global_unicomctrl_DEFS})
SET(dyndns_LDFS )
# add " -D_UNI_INTENSIVE_VERBOSE" for more debub message
# ### BODY ###
IF (FREEBSD)
SET(dyndns_DEFS ${dyndns_DEFS} -I/usr/local/include)
SET(dyndns_LDFS ${dyndns_LDFS} -L/usr/local/lib)
ENDIF(FREEBSD)
# ### BUILD ###
ADD_DEFINITIONS(${dyndns_DEFS})
ADD_LIBRARY(dyndns SHARED ${dyndns_SRCS})
SET_TARGET_PROPERTIES(dyndns PROPERTIES LINK_FLAGS "${dyndns_LDFS}")
SET_TARGET_PROPERTIES(dyndns PROPERTIES OUTPUT_NAME dyndns)
TARGET_LINK_LIBRARIES(dyndns ${dyndns_LIBS})
# ### INSTALL ###
INSTALL(TARGETS dyndns DESTINATION lib/ddnssync PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
#include "../../ddnssbase/ddnsshttpcl.h"
#include "../../ddnssbase/cregex.h"
extern "C"
{
void exec(const string& request){
CRegex regex("('([^']+)')|(([^[:space:]]+))");
regex.setBuffer(&request);
list<string> elts=regex.getMatchs();
for(list<string>::iterator it=elts.begin();it!=elts.end();it++){
CUniObj::printd("",*it+"\n");
}
}
}
# ### HEAD ###
PROJECT(zoneedit)
# ### COMMUN ###
SET(zoneedit_SRCS zoneedit.cpp)
SET(zoneedit_LIBS ddnssbase)
SET(zoneedit_DEFS ${global_unicomctrl_DEFS})
SET(zoneedit_LDFS )
# add " -D_UNI_INTENSIVE_VERBOSE" for more debub message
# ### BODY ###
IF (FREEBSD)
SET(zoneedit_DEFS ${zoneedit_DEFS} -I/usr/local/include)
SET(zoneedit_LDFS ${zoneedit_LDFS} -L/usr/local/lib)
ENDIF(FREEBSD)
# ### BUILD ###
ADD_DEFINITIONS(${zoneedit_DEFS})
ADD_LIBRARY(zoneedit SHARED ${zoneedit_SRCS})
SET_TARGET_PROPERTIES(zoneedit PROPERTIES LINK_FLAGS "${zoneedit_LDFS}")
SET_TARGET_PROPERTIES(zoneedit PROPERTIES OUTPUT_NAME zoneedit)
TARGET_LINK_LIBRARIES(zoneedit ${zoneedit_LIBS})
# ### INSTALL ###
INSTALL(TARGETS zoneedit DESTINATION lib/ddnssync PERMISSIONS OWNER_READ GROUP_READ WORLD_READ)
#include "../../ddnssbase/ddnsshttpcl.h"
#include "../../ddnssbase/cregex.h"
extern "C"
{
void exec(const string& request){
}
}
......@@ -28,7 +28,7 @@ DDnsSPlList::DDnsSPlList(CUniConf &config):CUniObj() {
ExecFct exec;
char *tmp;
for(StringList::iterator it=list.begin();it!=list.end();it++){
plugPath=dirPath+"lib"+*it+".so";
plugPath=dirPath+"/lib"+*it+".so";
handle = dlopen (plugPath.c_str(), RTLD_LAZY|RTLD_GLOBAL);
if (!handle) {
printc("dlopen() >> "+string(dlerror())+"\n");
......@@ -64,9 +64,10 @@ DDnsSPlList::~DDnsSPlList() {
void DDnsSPlList::exec(const string &request){
CRegex regex("([^[:space:]]+)");
regex.setBuffer(&request);
map<string,Plugin *>::iterator it=plugList.find(regex.getFirstMatch());
string cmd=regex.getFirstMatch();
map<string,Plugin *>::iterator it=plugList.find(cmd);
if(it==plugList.end()){
throw string("Unknow command \""+it->first+"\"");
throw string("Unknow command \""+cmd+"\"");
}else{
string::size_type newBeg=request.find_first_not_of("\t ",regex.end()+1);
if(newBeg==string::npos)
......
......@@ -3,6 +3,7 @@
#include <unicomctrl/cunicomcl.h>
#include <unicomctrl/cunithreadmanager.h>
#include "ddnssreqanalyzer.h"
#include "ddnsspluginlist.h"
#include <string>
#include <signal.h>
......@@ -58,6 +59,8 @@ int main(int argc, char **argv) {
"Possible values are :\n\t* verbose\n\t* short\n\t* quiet\n"
"You must correct this error in the configuration file.\n");
DDnsSPlList::pList=new DDnsSPlList(config);
string server=config.getValue("server");
string user=config.getValue("user");
string passwd=config.getValue("passwd");
......@@ -84,6 +87,7 @@ int main(int argc, char **argv) {
thList.waitJoin();
thList.killall();
delete DDnsSPlList::pList;
return 0;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment