summaryrefslogtreecommitdiffstats
path: root/input/packet
diff options
context:
space:
mode:
authorlaforge <laforge>2005-11-20 14:16:30 +0000
committerlaforge <laforge>2005-11-20 14:16:30 +0000
commitb25637a58e9ab853ac410fcd823546256ab3002b (patch)
tree5fcee055efd0b8109f0fcb2e3e3fe33bb5765b05 /input/packet
parente6459a06dbc4057ec1680c76075bc12c1774d385 (diff)
make 'num_keys' an attribute of pluginstance instead of plugin
Diffstat (limited to 'input/packet')
-rw-r--r--input/packet/ulogd_inppkt_NFLOG.c13
-rw-r--r--input/packet/ulogd_inppkt_ULOG.c2
2 files changed, 8 insertions, 7 deletions
diff --git a/input/packet/ulogd_inppkt_NFLOG.c b/input/packet/ulogd_inppkt_NFLOG.c
index 9116763..430cdd9 100644
--- a/input/packet/ulogd_inppkt_NFLOG.c
+++ b/input/packet/ulogd_inppkt_NFLOG.c
@@ -186,17 +186,18 @@ static struct ulogd_key output_keys[] = {
static inline int
interp_packet(struct ulogd_pluginstance *upi, struct nflog_data *ldata)
{
- struct ulogd_key *ret = upi->output;
+ struct ulogd_key *ret = upi->output.keys;
struct nfulnl_msg_packet_hdr *ph = nflog_get_msg_packet_hdr(ldata);
struct nfulnl_msg_packet_hw *hw = nflog_get_packet_hw(ldata);
void *payload;
int payload_len = nflog_get_payload(ldata, payload);
char *prefix = nflog_get_prefix(ldata);
- struct nfulnl_msg_packet_timestamp *ts = nflog_get_timestamp(ldata);
+ struct timeval ts;
u_int32_t mark = nflog_get_nfmark(ldata);
u_int32_t indev = nflog_get_indev(ldata);
u_int32_t outdev = nflog_get_outdev(ldata);
+
if (ph) {
/* FIXME */
@@ -231,11 +232,11 @@ interp_packet(struct ulogd_pluginstance *upi, struct nflog_data *ldata)
/* god knows why timestamp_usec contains crap if timestamp_sec
* == 0 if (pkt->timestamp_sec || pkt->timestamp_usec) { */
- if (ts && ts->sec) {
+ if (nflog_get_timestamp(ldata, &ts) == 0 && ts.tv_sec) {
/* FIXME: convert endianness */
- ret[5].u.value.ui32 = ts->sec & 0xffffffff;
+ ret[5].u.value.ui32 = ts.tv_sec & 0xffffffff;
ret[5].flags |= ULOGD_RETF_VALID;
- ret[6].u.value.ui32 = ts->usec & 0xffffffff;
+ ret[6].u.value.ui32 = ts.tv_usec & 0xffffffff;
ret[6].flags |= ULOGD_RETF_VALID;
}
@@ -273,7 +274,7 @@ static int nful_read_cb(int fd, unsigned int what, void *param)
if (len < 0)
return len;
- nflog_handle_packet(ui->nful_h, ui->nfulog_buf, len);
+ nflog_handle_packet(ui->nful_h, (char *)ui->nfulog_buf, len);
return 0;
}
diff --git a/input/packet/ulogd_inppkt_ULOG.c b/input/packet/ulogd_inppkt_ULOG.c
index 7596c8e..74ac162 100644
--- a/input/packet/ulogd_inppkt_ULOG.c
+++ b/input/packet/ulogd_inppkt_ULOG.c
@@ -128,7 +128,7 @@ static int interp_packet(struct ulogd_pluginstance *ip, ulog_packet_msg_t *pkt)
unsigned char *p;
int i;
char *buf, *oldbuf = NULL;
- struct ulogd_key *ret = ip->output;
+ struct ulogd_key *ret = ip->output.keys;
if (pkt->mac_len) {
buf = (char *) malloc(3 * pkt->mac_len + 1);