Skip to content

Commit 75773fd

Browse files
committed
Allow to set engine_id (observationDomainId).
Thanks for #57 to bc-davidb@github.
1 parent 0b96a44 commit 75773fd

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

README

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,21 @@ ipt_NETFLOW linux 2.6.x-4.x kernel module by <abc@telekom.ru> -- 2008-2016.
572572
desirable to combine it with packet processing on very highly loaded
573573
routers.
574574

575-
This option also could be changed at runtime with:
575+
This option could be changed at runtime with:
576576

577577
# echo number > /sys/module/ipt_NETFLOW/parameters/exportcpu
578578

579+
engine_id=number
580+
- Observation Domain ID (on IPFIX, Source Id on NetFlow v9, or Engine Id
581+
on NetFlow v5) value to be exported. This may help your collector to
582+
distinguish between multiple exporters. On Netflow v9 and IPFIX this
583+
value is 32-bit on NetFlow v5 only 8 low bits are significant.
584+
Default value is 0.
585+
586+
This option could be changed at runtime with:
587+
588+
# echo number > /sys/module/ipt_NETFLOW/parameters/engine_id
589+
579590

580591
====================
581592
= HOW TO READ STAT =

ipt_NETFLOW.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ MODULE_PARM_DESC(maxflows, "maximum number of flows");
209209
static int peakflows = 0;
210210
static unsigned long peakflows_at; /* jfffies */
211211

212+
static int engine_id = 0;
213+
module_param(engine_id, int, 0644);
214+
MODULE_PARM_DESC(engine_id, "Observation Domain ID");
215+
212216
#ifdef ENABLE_AGGR
213217
#define AGGR_SIZE 1024
214218
static char aggregation_buf[AGGR_SIZE] = "";
@@ -271,7 +275,6 @@ static union {
271275
struct netflow9_pdu v9;
272276
struct ipfix_pdu ipfix;
273277
} pdu;
274-
static int engine_id = 0; /* Observation Domain */
275278
static __u8 *pdu_data_used;
276279
static __u8 *pdu_high_wm; /* high watermark */
277280
static struct flowset_data *pdu_flowset = NULL; /* current data flowset */
@@ -2532,7 +2535,7 @@ static void netflow_export_pdu_v5(void)
25322535
pdu.v5.ts_unsecs = htonl(tv.tv_usec);
25332536
pdu.v5.seq = htonl(pdu_seq);
25342537
//pdu.v5.eng_type = 0;
2535-
pdu.v5.eng_id = engine_id;
2538+
pdu.v5.eng_id = (__u8)engine_id;
25362539
#ifdef ENABLE_SAMPLER
25372540
pdu.v5.sampling = htons(sampler_nf_v5());
25382541
#endif

0 commit comments

Comments
 (0)