mod_netconf: set tcp port of notification server
add configure option to set tcp port of websockets server
- refs #643
diff --git a/src/configure b/src/configure
index 9df5666..ff8497e 100755
--- a/src/configure
+++ b/src/configure
@@ -702,6 +702,7 @@
enable_option_checking
with_libnetconf
with_notifications
+with_notifport
'
ac_precious_vars='build_alias
host_alias
@@ -1338,6 +1339,7 @@
--with-libnetconf=PATH Set the path to libnetconf (usually local GIT
repository)
--without-notifications Disable notifications
+ --with-notifport=PORT Set TCP port of websocket notification server.
Some influential environment variables:
PKG_CONFIG path to pkg-config utility
@@ -4035,6 +4037,16 @@
fi
+
+# Check whether --with-notifport was given.
+if test "${with_notifport+set}" = set; then
+ withval=$with_notifport; CFLAGS="$CFLAGS -DNOTIFICATION_SERVER_PORT=$with_notifport"
+else
+ CFLAGS="$CFLAGS"
+
+fi
+
+
CFLAGS="$CFLAGS -I/usr/include/json"
diff --git a/src/configure.in b/src/configure.in
index 6b91bf3..4e56d69 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -72,6 +72,12 @@
]
)
+AC_ARG_WITH([notifport],
+ [AC_HELP_STRING([--with-notifport=PORT], [Set TCP port of websocket notification server.])],
+ [CFLAGS="$CFLAGS -DNOTIFICATION_SERVER_PORT=$with_notifport"],
+ [CFLAGS="$CFLAGS"]
+)
+
CFLAGS="$CFLAGS -I/usr/include/json"
AC_SUBST(REQS)
AC_SUBST(BUILDREQS)
diff --git a/src/notification_module.h b/src/notification_module.h
index a005dc5..49a96cc 100644
--- a/src/notification_module.h
+++ b/src/notification_module.h
@@ -53,7 +53,9 @@
typedef struct s {} server_rec;
#endif
+#ifndef NOTIFICATION_SERVER_PORT
#define NOTIFICATION_SERVER_PORT 8080
+#endif
/**
* \brief Notification module initialization