summaryrefslogtreecommitdiff
path: root/pasad.c
diff options
context:
space:
mode:
Diffstat (limited to 'pasad.c')
-rw-r--r--pasad.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/pasad.c b/pasad.c
index f75a336..537a804 100644
--- a/pasad.c
+++ b/pasad.c
@@ -1,6 +1,7 @@
#ifdef BROCCOLI
#include <broccoli.h>
#endif
+#include "includes/fifoqueue.h"
char *host_default = "127.0.0.1";
char *port_default = "47760";
@@ -14,25 +15,24 @@ bro_pasad_response(BroConn *conn, void *data, uint64* registers, uint64* uid)
data = NULL;
}
- int
-main(int argc, char **argv)
+ void
+bro_event_listener()
{
- BroConn *bc;
- char hostname[512];
- int fd = -1;
+ int fd = -1;
+ BroConn *bc = NULL;
bro_init(NULL);
-
- bro_debug_calltrace = 0;
- bro_debug_messages = 0;
+ char hostname[512];
snprintf(hostname, 512, "%s:%s", host_default, port_default);
-
if (! (bc = bro_conn_new_str(hostname, BRO_CFLAG_RECONNECT | BRO_CFLAG_ALWAYS_QUEUE)))
{
printf("Could not get Bro connection handle.\n");
exit(-1);
}
+ bro_debug_calltrace = 0;
+ bro_debug_messages = 0;
+
bro_event_registry_add(bc, "response",(BroEventFunc) bro_pasad_response, NULL);
if (! bro_conn_connect(bc))
@@ -42,11 +42,11 @@ main(int argc, char **argv)
exit(-1);
}
- fd = bro_conn_get_fd(bc);
+ fd =bro_conn_get_fd(bc);
fd_set rfds;
setbuf(stdout,NULL);
- while(1)
+ while(true)
{
FD_ZERO(&rfds);
FD_SET(fd,&rfds);
@@ -59,6 +59,13 @@ main(int argc, char **argv)
}
bro_conn_delete(bc);
+}
+
+ int
+main(int argc, char **argv)
+{
+ Fifo_q * q = init_queue(5);
+ free(q);
return 0;
}