+
+ return 0;
+}
+
+static void drl_signal(int sig) {
+ if (sig == SIGHUP) {
+ printf("Caught SIGHUP - reopening DRL log file.\n");
+
+ fclose(logfile);
+ logfile = fopen(drl_logfile.u.string, "a");
+ printlog(LOG_CRITICAL, "Reopened logfile.\n");
+ } else {
+ printlog(LOG_WARN, "Caught unexpected signal %d in drl_signal.\n", sig);
+ }
+}
+
+static ulog_output_t drl_op = {
+ .name = "drl",
+ .output = &_output_drl,
+ .signal = &drl_signal,
+ .init = &drl_plugin_init,
+ .fini = NULL,
+};
+
+#if 0
+/* Tests the amount of time it takes to call reconfig(). */
+static void time_reconfig(int iterations) {
+ struct timeval start, end;
+ int i;
+
+ gettimeofday(&start, NULL);
+ for (i = 0; i < iterations; ++i) {
+ reconfig();
+ }
+ gettimeofday(&end, NULL);
+
+ printf("%d reconfigs() took %d seconds and %d microseconds.\n",
+ iterations, end.tv_sec - start.tv_sec, end.tv_usec - start.tv_usec);
+ exit(0);
+
+ // Seems to take about 85ms / iteration
+}
+#endif
+
+/* register output plugin with ulogd */
+static void _drl_reg_op(void)
+{
+ ulog_output_t *op = &drl_op;
+ register_output(op);