aboutsummaryrefslogtreecommitdiff
path: root/net-mgmt/netams/files
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/netams/files')
-rw-r--r--net-mgmt/netams/files/netams.sh.in37
-rw-r--r--net-mgmt/netams/files/patch-src__common.c29
-rw-r--r--net-mgmt/netams/files/patch-src__ng_netams.c25
3 files changed, 91 insertions, 0 deletions
diff --git a/net-mgmt/netams/files/netams.sh.in b/net-mgmt/netams/files/netams.sh.in
new file mode 100644
index 000000000000..8b7ea67b0d47
--- /dev/null
+++ b/net-mgmt/netams/files/netams.sh.in
@@ -0,0 +1,37 @@
+#!/bin/sh
+# $FreeBSD$
+
+# PROVIDE: netams
+# REQUIRE: NETWORKING
+# KEYWORD: shutdown
+
+# Define these netams_* variables in one of these files:
+# /etc/rc.conf
+# /etc/rc.conf.local
+# /etc/rc.conf.d/netams
+#
+# netams_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable netams.
+# netams_config (str): Custom configuration file to be passed
+# to netams.
+#
+# DO NOT CHANGE THESE DEFAULT VALUES HERE
+#
+netams_enable=${netams_enable-"NO"}
+netams_config=${netams_config-"%%PREFIX%%/etc/netams.cfg"}
+
+netams_pidfile="/var/run/netams.pid"
+
+. %%RC_SUBR%%
+
+name="netams"
+rcvar=`set_rcvar`
+command="%%PREFIX%%/libexec/netams"
+
+load_rc_config $name
+
+pidfile="${netams_pidfile}"
+
+start_cmd="echo \"Starting ${name}.\"; ${command} -ldf ${netams_config} > /dev/null"
+
+run_rc_command "$1"
diff --git a/net-mgmt/netams/files/patch-src__common.c b/net-mgmt/netams/files/patch-src__common.c
new file mode 100644
index 000000000000..949a05891b1e
--- /dev/null
+++ b/net-mgmt/netams/files/patch-src__common.c
@@ -0,0 +1,29 @@
+--- ./src/common.c Fri Apr 21 10:25:11 2006
++++ ./src/common.c Wed Jun 14 13:15:26 2006
+@@ -179,11 +179,21 @@
+
+ if (flag_syslog) { bzero(str2log2, 256); bzero(str2log1, 256+64); }
+
+- va_start(ap, fmt);
+- if (flag_nodaemon && !flag_quiet) vfprintf(stdout, fmt, ap);
+- if (flag_log) vfprintf(LOGFILE, fmt, ap);
+- if (flag_syslog) vsnprintf(str2log2,256, fmt, ap);
+- va_end(ap);
++ if (flag_nodaemon && !flag_quiet) {
++ va_start(ap, fmt);
++ vfprintf(stdout, fmt, ap);
++ va_end(ap);
++ }
++ if (flag_log) {
++ va_start(ap, fmt);
++ vfprintf(LOGFILE, fmt, ap);
++ va_end(ap);
++ }
++ if (flag_syslog) {
++ va_start(ap, fmt);
++ vsnprintf(str2log2,256, fmt, ap);
++ va_end(ap);
++ }
+
+ if (flag_syslog) {
+ snprintf(str2log1,256+64,"%s:%u %s", where, id, str2log2);
diff --git a/net-mgmt/netams/files/patch-src__ng_netams.c b/net-mgmt/netams/files/patch-src__ng_netams.c
new file mode 100644
index 000000000000..455391392ef1
--- /dev/null
+++ b/net-mgmt/netams/files/patch-src__ng_netams.c
@@ -0,0 +1,25 @@
+--- ./src/ng_netams.c Fri Mar 4 04:38:52 2005
++++ ./src/ng_netams.c Wed Jun 14 11:54:21 2006
+@@ -438,7 +438,10 @@
+ } else
+ prev=e;
+ }
+- if (data->debug) printf("callout/%u%c active %u, checked %u, queued=%u, flushed %u\n", time_second, data->daemon_node?'+':'-', data->active_flows, t_active, f_queued, f_active);
++ if (data->debug)
++ printf("callout/%lu%c active %u, checked %u, queued=%u, flushed %u\n",
++ (u_long)time_second, data->daemon_node?'+':'-',
++ data->active_flows, t_active, f_queued, f_active);
+ mtx_unlock(&data->mtx_active);
+
+ if (data->daemon_node!=0 && time_second%10==0) { // time to send info to daemon
+@@ -446,7 +449,9 @@
+ msg->header.token=data->daemon_cookie;
+ ng_netams_set_info(msg, data);
+ NG_SEND_MSG_ID(error, data->node, msg, data->daemon_node, NG_NODE_ID(data->node));
+- if (data->debug) printf("info/%u: sent to daemon [%u] with error=%u\n", time_second, data->daemon_node, error);
++ if (data->debug)
++ printf("info/%lu: sent to daemon [%u] with error=%u\n",
++ (u_long)time_second, data->daemon_node, error);
+ if (error) { data->daemon_cookie=data->daemon_node=0; } // something went wrong, reset userspace destination to prevent further loss
+ }
+