.type = ULOGD_RET_IPADDR,
.flags = ULOGD_RETF_NONE,
.name = "orig.ip.saddr",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_sourceIPv4Address,
},
.type = ULOGD_RET_UINT8,
.flags = ULOGD_RETF_NONE,
.name = "orig.ip.protocol",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_protocolIdentifier,
},
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "orig.raw.pktlen",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_octetTotalCount,
/* FIXME: this could also be octetDeltaCount */
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "orig.raw.pktcount",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_packetTotalCount,
/* FIXME: this could also be packetDeltaCount */
.type = ULOGD_RET_IPADDR,
.flags = ULOGD_RETF_NONE,
.name = "reply.ip.saddr",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_sourceIPv4Address,
},
.type = ULOGD_RET_UINT8,
.flags = ULOGD_RETF_NONE,
.name = "reply.ip.protocol",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_protocolIdentifier,
},
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "reply.raw.pktlen",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_octetTotalCount,
/* FIXME: this could also be octetDeltaCount */
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "reply.raw.pktcount",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_packetTotalCount,
/* FIXME: this could also be packetDeltaCount */
struct ct_timestamp *ts)
{
struct ulogd_key *ret = upi->output.keys;
-
+
ret[NFCT_CT_EVENT].u.value.ui32 = type;
ret[NFCT_CT_EVENT].flags |= ULOGD_RETF_VALID;
if (ts) {
if (ts->time[START].tv_sec) {
- ret[NFCT_FLOW_START_SEC].u.value.ui32 =
+ ret[NFCT_FLOW_START_SEC].u.value.ui32 =
ts->time[START].tv_sec;
ret[NFCT_FLOW_START_SEC].flags |= ULOGD_RETF_VALID;
void *data)
{
struct ulogd_pluginstance *upi = data;
- struct nfct_pluginstance *cpi =
+ struct nfct_pluginstance *cpi =
(struct nfct_pluginstance *) upi->private;
struct ct_timestamp *ts = NULL;
struct ct_timestamp tmp = {
"`netlink_socket_buffer_size' and "
"`netlink_socket_buffer_maxsize'\n");
}
-
+
/* internal hash can deal with refresh */
if (usehash_ce(upi->config_kset).u.value != 0) {
nfct_send(cpi->ovh, NFCT_Q_DUMP, &family);
static int get_ctr_zero(struct ulogd_pluginstance *upi)
{
int family = 0; /* any */
- struct nfct_pluginstance *cpi =
+ struct nfct_pluginstance *cpi =
(struct nfct_pluginstance *)upi->private;
return nfct_query(cpi->cth, NFCT_Q_DUMP_RESET, &family);
static void getctr_timer_cb(struct ulogd_timer *t, void *data)
{
struct ulogd_pluginstance *upi = data;
- struct nfct_pluginstance *cpi =
+ struct nfct_pluginstance *cpi =
(struct nfct_pluginstance *)upi->private;
get_ctr_zero(upi);
static int configure_nfct(struct ulogd_pluginstance *upi,
struct ulogd_pluginstance_stack *stack)
{
- struct nfct_pluginstance *cpi =
+ struct nfct_pluginstance *cpi =
(struct nfct_pluginstance *)upi->private;
int ret;
-
+
ret = config_parse_file(upi->id, upi->config_kset);
if (ret < 0)
return ret;
static int constructor_nfct(struct ulogd_pluginstance *upi)
{
- struct nfct_pluginstance *cpi =
+ struct nfct_pluginstance *cpi =
(struct nfct_pluginstance *)upi->private;
cpi->cth = nfct_open(NFNL_SUBSYS_CTNETLINK,
return -1;
}
}
-
+
return 0;
}
{
struct nfct_pluginstance *cpi = (void *) pi;
int rc;
-
+
hashtable_destroy(cpi->ct_active);
rc = nfct_close(cpi->cth);
};
static struct ulogd_key output_keys[] = {
- {
- .type = ULOGD_RET_RAW,
+ {
+ .type = ULOGD_RET_RAW,
.flags = ULOGD_RETF_NONE,
- .name = "raw.mac",
+ .name = "raw.mac",
.ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_sourceMacAddress,
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "raw.pktlen",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_NETFILTER,
.field_id = IPFIX_NF_rawpacket_length,
},
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "raw.pktcount",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_packetDeltaCount,
},
},
{
.type = ULOGD_RET_STRING,
- .flags = ULOGD_RETF_NONE,
- .name = "oob.prefix",
+ .flags = ULOGD_RETF_NONE,
+ .name = "oob.prefix",
.ipfix = {
.vendor = IPFIX_VENDOR_NETFILTER,
- .field_id = IPFIX_NF_prefix,
+ .field_id = IPFIX_NF_prefix,
},
},
- { .type = ULOGD_RET_UINT32,
- .flags = ULOGD_RETF_NONE,
- .name = "oob.time.sec",
- .ipfix = {
- .vendor = IPFIX_VENDOR_IETF,
- .field_id = IPFIX_flowStartSeconds,
+ { .type = ULOGD_RET_UINT32,
+ .flags = ULOGD_RETF_NONE,
+ .name = "oob.time.sec",
+ .ipfix = {
+ .vendor = IPFIX_VENDOR_IETF,
+ .field_id = IPFIX_flowStartSeconds,
},
},
{
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
- .name = "oob.time.usec",
+ .name = "oob.time.usec",
.ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_flowStartMicroSeconds,
{
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
- .name = "oob.mark",
+ .name = "oob.mark",
.ipfix = {
.vendor = IPFIX_VENDOR_NETFILTER,
.field_id = IPFIX_NF_mark,
{
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
- .name = "oob.ifindex_in",
+ .name = "oob.ifindex_in",
.ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_ingressInterface,
{
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
- .name = "oob.ifindex_out",
+ .name = "oob.ifindex_out",
.ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_egressInterface,
.field_id = IPFIX_NF_hook,
},
},
- {
- .type = ULOGD_RET_UINT16,
- .flags = ULOGD_RETF_NONE,
- .name = "raw.mac_len",
+ {
+ .type = ULOGD_RET_UINT16,
+ .flags = ULOGD_RETF_NONE,
+ .name = "raw.mac_len",
},
{
.type = ULOGD_RET_UINT32,
};
-static inline int
+static inline int
interp_packet(struct ulogd_pluginstance *upi, struct nflog_data *ldata)
{
struct ulogd_key *ret = upi->output.keys;
if (unbind_ce(upi->config_kset).u.value > 0) {
ulogd_log(ULOGD_NOTICE, "forcing unbind of existing log "
- "handler for protocol %d\n",
+ "handler for protocol %d\n",
af_ce(upi->config_kset).u.value);
- if (nflog_unbind_pf(ui->nful_h,
+ if (nflog_unbind_pf(ui->nful_h,
af_ce(upi->config_kset).u.value) < 0) {
ulogd_log(ULOGD_ERROR, "unable to force-unbind "
"existing log handler for protocol %d\n",
ulogd_log(ULOGD_ERROR, "unable to set flags 0x%x\n",
flags);
}
-
+
nflog_callback_register(ui->nful_gh, &msg_cb, upi);
ui->nful_fd.fd = nflog_fd(ui->nful_h);
};
static struct ulogd_key output_keys[] = {
- {
- .type = ULOGD_RET_RAW,
- .flags = ULOGD_RETF_NONE,
- .name = "raw.mac",
+ {
+ .type = ULOGD_RET_RAW,
+ .flags = ULOGD_RETF_NONE,
+ .name = "raw.mac",
.ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = IPFIX_sourceMacAddress,
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "raw.pktlen",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = 1
},
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
.name = "raw.pktcount",
- .ipfix = {
+ .ipfix = {
.vendor = IPFIX_VENDOR_IETF,
.field_id = 2
},
},
{
.type = ULOGD_RET_STRING,
- .flags = ULOGD_RETF_NONE,
- .name = "oob.prefix",
+ .flags = ULOGD_RETF_NONE,
+ .name = "oob.prefix",
},
- { .type = ULOGD_RET_UINT32,
- .flags = ULOGD_RETF_NONE,
- .name = "oob.time.sec",
- .ipfix = {
- .vendor = IPFIX_VENDOR_IETF,
- .field_id = 22
+ { .type = ULOGD_RET_UINT32,
+ .flags = ULOGD_RETF_NONE,
+ .name = "oob.time.sec",
+ .ipfix = {
+ .vendor = IPFIX_VENDOR_IETF,
+ .field_id = 22
},
},
{
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
- .name = "oob.time.usec",
+ .name = "oob.time.usec",
},
{
.type = ULOGD_RET_UINT32,
.flags = ULOGD_RETF_NONE,
- .name = "oob.mark",
+ .name = "oob.mark",
},
{
.type = ULOGD_RET_STRING,
.flags = ULOGD_RETF_NONE,
- .name = "oob.in",
+ .name = "oob.in",
},
{
.type = ULOGD_RET_STRING,
.flags = ULOGD_RETF_NONE,
- .name = "oob.out",
+ .name = "oob.out",
},
{
.type = ULOGD_RET_UINT8,
.field_id = IPFIX_NF_hook,
},
},
- {
- .type = ULOGD_RET_UINT16,
- .flags = ULOGD_RETF_NONE,
- .name = "raw.mac_len",
+ {
+ .type = ULOGD_RET_UINT16,
+ .flags = ULOGD_RETF_NONE,
+ .name = "raw.mac_len",
},
{
.type = ULOGD_RET_UINT8,