MAINTENANCE
diff --git a/configure.ac b/configure.ac
index e03c84c..53975e3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,13 +13,6 @@
RELEASE=1
AC_SUBST(RELEASE)
-LIBS="-lnetconf -ljson"
-
-if test "x$webguidir" == x; then
- webguidir="/var/www"
-fi
-AC_ARG_VAR(webguidir, [Installation directory for webgui [/var/www]])
-AC_SUBST(webguidir)
AC_ARG_VAR(httpdmoduledir, [Installation directory for Apache module, leave unset to use Apache default.])
AC_SUBST(httpdmoduledir)
@@ -30,12 +23,6 @@
AC_ARG_VAR(httpdconfddir, [Directory for Apache configuration files [/etc/httpd/conf.d]])
AC_SUBST(httpdconfddir)
-if test "x$webguiname" == x; then
- webguiname="netconfwebgui"
-fi
-AC_ARG_VAR(webguiname, [Installation directory name for webgui [netconfwebgui]])
-AC_SUBST(webguiname)
-
# Checks for programs.
AC_ARG_WITH(apxs, AC_HELP_STRING([--with-apxs=NAME],[name of the apxs executable [[apxs]]]), [APXS="$with_apxs"])
if test -z "${APXS}"; then
@@ -58,18 +45,6 @@
AC_MSG_ERROR([apachectl was not found])
fi
-AC_PATH_PROGS(PHP, php, [no], [$PATH])
-if test "x$PHP" != xno; then
- for i in dom json xml pdo intl sysvsem; do
- AC_MSG_CHECKING([for php module $i])
- php -m | grep "$i" > /dev/null && AC_MSG_RESULT([yes]) || AC_MSG_ERROR([not found])
- done
-else
-AC_MSG_ERROR([php was not found])
-fi
-AC_SUBST(PHP)
-
-
# Check for rpmbuild
AC_CHECK_PROG(RPMBUILD, rpmbuild, rpmbuild, [""])
RPM_RELEASE=1
@@ -80,32 +55,18 @@
# save clean LIBS and CFLAGS
SAVEDTEMP_LIBS=$LIBS
SAVEDTEMP_CFLAGS=$CFLAGS
-#AC_CHECK_LIB([apr-1], [apr_hash_make])
-#AC_CHECK_LIB([aprutil-1], [apr_sha1_init])
-#AC_CHECK_LIB([netconf], [nc_session_connect])
-#AC_CHECK_LIB([json], [json_object_new_object])
PKG_CHECK_MODULES([json], [json])
PKG_CHECK_MODULES([websockets], [libwebsockets])
PKG_CHECK_MODULES([apr], [apr-1])
PKG_CHECK_MODULES([aprutil], [apr-util-1])
PKG_CHECK_MODULES([netconf], [libnetconf])
PKG_CHECK_MODULES([xml], [libxml-2.0])
-#$apr_CFLAGS $aprutil_CFLAGS
-#$apr_LIBS $aprutil_LIBS
CFLAGS="$json_CFLAGS $websockets_CFLAGS $netconf_CFLAGS $xml_CFLAGS"
LIBS="$json_LIBS $websockets_LIBS $netconf_LIBS $xml_LIBS"
CPPFLAGS="$xml_CPPFLAGS"
-AX_PTHREAD([LIBS="$PTHREAD_LIBS $LIBS"
- CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
- CC="$PTHREAD_CC"],
- [AC_MSG_ERROR([pthread not found])]
- )
-SAVED_LIBS=$LIBS
-SAVED_CFLAGS=$CFLAGS
-
-AC_SUBST(SAVED_LIBS)
-AC_SUBST(SAVED_CFLAGS)
+AX_PTHREAD([CC="$PTHREAD_CC"],
+ [AC_MSG_ERROR([pthread not found])])
AC_ARG_WITH([notifications],
[AC_HELP_STRING([--without-notifications], [Disable notifications])],
@@ -129,6 +90,7 @@
AC_CHECK_FUNCS([getdelim gettimeofday memset socket strdup strerror])
AC_CONFIG_FILES([Makefile
+ conf.d/Makefile
src/Makefile
])
AC_OUTPUT
diff --git a/src/Makefile.am b/src/Makefile.am
index 848f37f..6f03b35 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -19,16 +19,19 @@
mod_netconf.so: mod_netconf.c notification-server.c
$(APXS) $(LIBS) $(CFLAGS) -c -o $@ $(srcdir)/mod_netconf.c $(srcdir)/notification-server.c
-test-client$(EXEEXT): test-client.c
- gcc -std=gnu99 -Wall -g -ljson -I/usr/include/json -o $@ $<
+#test-client$(EXEEXT): test-client.c
+# gcc -std=gnu99 -Wall -g -ljson -I/usr/include/json -o $@ $<
#notification-test$(EXEEXT): notification-server.c
# gcc -std=gnu99 -Wall -g -lwebsockets -DTEST_NOTIFICATION_SERVER -o $@ $<
install-exec-local: mod_netconf.so
- [ "x$(httpdmoduledir)" == x ] && \
- $(APXS) -i -a mod_netconf.la || \
- { mkdir -p "$(httpdmoduledir)"; $(APXS) -i -S LIBEXECDIR="$(httpdmoduledir)" -a mod_netconf.la; }
+ if [ "x${httpdmoduledir}" == x ]; then \
+ $(APXS) -i -a mod_netconf.la; else \
+ { \
+ mkdir -p "${httpdmoduledir}"; \
+ $(APXS) -i -S LIBEXECDIR="${httpdmoduledir}" -a mod_netconf.la; } \
+ fi
webgui-backend$(EXEEXT): mod_netconf.c notification-server.c mod_netconf.h
gcc -Wall -g $(LIBS) $(CFLAGS) -DHTTPD_INDEPENDENT `apr-1-config --cflags --cppflags --includes --link-ld` -I/usr/include/httpd -laprutil-1 -o $@ $(srcdir)/mod_netconf.c $(srcdir)/notification-server.c
diff --git a/src/mod_netconf.c b/src/mod_netconf.c
index 7db9cfa..f307930 100644
--- a/src/mod_netconf.c
+++ b/src/mod_netconf.c
@@ -1122,21 +1122,15 @@
json_object *handle_op_getconfig(apr_pool_t *pool, json_object *request, const char *session_key)
{
NC_DATASTORE ds_type_s = -1;
- NC_DATASTORE ds_type_t = -1;
const char *filter = NULL;
char *data = NULL;
const char *source = NULL;
- const char *target = NULL;
json_object *reply = NULL;
DEBUG("Request: get-config (session %s)", session_key);
filter = json_object_get_string(json_object_object_get(request, "filter"));
- /* get parameters */
- if ((target = json_object_get_string(json_object_object_get(request, "target"))) != NULL) {
- ds_type_t = parse_datastore(target);
- }
if ((source = json_object_get_string(json_object_object_get(request, "source"))) != NULL) {
ds_type_s = parse_datastore(source);
}
@@ -1689,10 +1683,8 @@
const char *msgtext;
const char *session_key;
const char *target = NULL;
- const char *source = NULL;
const char *url = NULL;
NC_DATASTORE ds_type_t = -1;
- NC_DATASTORE ds_type_s = -1;
char *chunked_out_msg = NULL;
apr_pool_t * pool = ((struct pass_to_thread*)arg)->pool;
//server_rec * server = ((struct pass_to_thread*)arg)->server;
@@ -1796,9 +1788,6 @@
if ((target = json_object_get_string(json_object_object_get(request, "target"))) != NULL) {
ds_type_t = parse_datastore(target);
}
- if ((source = json_object_get_string(json_object_object_get(request, "source"))) != NULL) {
- ds_type_s = parse_datastore(source);
- }
if (ds_type_t == -1) {
reply = create_error("Invalid target repository type requested.");