summaryrefslogtreecommitdiffstats
path: root/ulogd/extensions/ulogd_PWSNIFF.c
diff options
context:
space:
mode:
authorlaforge <laforge>2000-11-20 11:43:22 +0000
committerlaforge <laforge>2000-11-20 11:43:22 +0000
commitc7d5ddfadc507d1cc9811229f938abe8c8004c0d (patch)
tree12125bd631ef4162c4e5eddce2e2c9929c6c5b9f /ulogd/extensions/ulogd_PWSNIFF.c
parent58ee76c3d9db7c2b12f8b504415917afdd6abec0 (diff)
huge reorganization for 0.9
- added hashtables everywhere - no more dynamic allocation for each packet - mysql output plugin - more keys in ulogd_BASE - moved libipulog into ulogd directory - introduced autoconf
Diffstat (limited to 'ulogd/extensions/ulogd_PWSNIFF.c')
-rw-r--r--ulogd/extensions/ulogd_PWSNIFF.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/ulogd/extensions/ulogd_PWSNIFF.c b/ulogd/extensions/ulogd_PWSNIFF.c
index cc0f19e..a1e7988 100644
--- a/ulogd/extensions/ulogd_PWSNIFF.c
+++ b/ulogd/extensions/ulogd_PWSNIFF.c
@@ -1,11 +1,11 @@
-/* ulogd_PWSNIFF.c, Version $Revision: 1.2 $
+/* ulogd_PWSNIFF.c, Version $Revision: 1.3 $
*
* ulogd logging interpreter for POP3 / FTP like plaintext passwords.
*
* (C) 2000 by Harald Welte <laforge@gnumonks.org>
* This software is released under the terms of GNU GPL
*
- * $Id: ulogd_PWSNIFF.c,v 1.2 2000/09/22 06:54:33 laforge Exp $
+ * $Id: ulogd_PWSNIFF.c,v 1.3 2000/11/16 17:20:52 laforge Exp $
*
*/
@@ -17,8 +17,8 @@
#include <linux/in.h>
#include <linux/tcp.h>
-#ifdef DEBUG
-#define DEBUGP ulogd_error
+#ifdef DEBUG_PWSNIFF
+#define DEBUGP(x) ulogd_log(ULOGD_DEBUG, x)
#else
#define DEBUGP(format, args...)
#endif
@@ -96,7 +96,7 @@ static ulog_iret_t *_interp_pwsniff(ulog_interpreter_t *ip, ulog_packet_msg_t *p
ret[0].value.ptr = (char *) malloc(len+1);
ret[0].flags |= ULOGD_RETF_VALID;
if (!ret[0].value.ptr) {
- ulogd_error("_interp_pwsniff: OOM (size=%u)\n", len);
+ ulogd_log(ULOGD_ERROR, "OOM (size=%u)\n", len);
return NULL;
}
strncpy(ret[0].value.ptr, begp, len);
@@ -106,7 +106,7 @@ static ulog_iret_t *_interp_pwsniff(ulog_interpreter_t *ip, ulog_packet_msg_t *p
ret[1].value.ptr = (char *) malloc(pw_len+1);
ret[1].flags |= ULOGD_RETF_VALID;
if (!ret[1].value.ptr){
- ulogd_error("_interp_pwsniff: OOM (size=%u)\n", pw_len);
+ ulogd_log(ULOGD_ERROR, "OOM (size=%u)\n", pw_len);
return NULL;
}
strncpy(ret[1].value.ptr, pw_begp, pw_len);
@@ -117,13 +117,15 @@ static ulog_iret_t *_interp_pwsniff(ulog_interpreter_t *ip, ulog_packet_msg_t *p
}
static ulog_iret_t pwsniff_rets[] = {
- { NULL, NULL, 0, ULOGD_RET_STRING, ULOGD_RETF_FREE, "pwsniff.user", 0 },
- { NULL, NULL, 0, ULOGD_RET_STRING, ULOGD_RETF_FREE, "pwsniff.pass", 0 },
+ { NULL, NULL, 0, ULOGD_RET_STRING, ULOGD_RETF_FREE, "pwsniff.user",
+ { ptr: NULL } },
+ { NULL, NULL, 0, ULOGD_RET_STRING, ULOGD_RETF_FREE, "pwsniff.pass",
+ { ptr: NULL } },
};
static ulog_interpreter_t base_ip[] = {
{ NULL, "pwsniff", 0, &_interp_pwsniff, 2, &pwsniff_rets },
- { NULL, "", NULL },
+ { NULL, "", 0, NULL, 0, NULL },
};
void _base_reg_ip(void)
{