aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vnet/vnet/flow/flow_report.c1
-rw-r--r--vnet/vnet/flow/flow_report.h2
-rw-r--r--vnet/vnet/flow/flow_report_sample.c6
3 files changed, 8 insertions, 1 deletions
diff --git a/vnet/vnet/flow/flow_report.c b/vnet/vnet/flow/flow_report.c
index 8cfbd59a..77f92b13 100644
--- a/vnet/vnet/flow/flow_report.c
+++ b/vnet/vnet/flow/flow_report.c
@@ -203,6 +203,7 @@ int vnet_flow_report_add_del (flow_report_main_t *frm,
fr->sequence_number = 0;
fr->domain_id = a->domain_id;
+ fr->src_port = a->src_port;
fr->update_rewrite = 1;
fr->opaque = a->opaque;
fr->rewrite_callback = a->rewrite_callback;
diff --git a/vnet/vnet/flow/flow_report.h b/vnet/vnet/flow/flow_report.h
index 8b08e47e..50e15449 100644
--- a/vnet/vnet/flow/flow_report.h
+++ b/vnet/vnet/flow/flow_report.h
@@ -56,6 +56,7 @@ typedef struct flow_report {
u8 * rewrite;
u32 sequence_number;
u32 domain_id;
+ u16 src_port;
f64 last_template_sent;
int update_rewrite;
@@ -108,6 +109,7 @@ typedef struct {
void * opaque;
int is_add;
u32 domain_id;
+ u16 src_port;
} vnet_flow_report_add_del_args_t;
int vnet_flow_report_add_del (flow_report_main_t *frm,
diff --git a/vnet/vnet/flow/flow_report_sample.c b/vnet/vnet/flow/flow_report_sample.c
index 761e47ca..69f0491f 100644
--- a/vnet/vnet/flow/flow_report_sample.c
+++ b/vnet/vnet/flow/flow_report_sample.c
@@ -92,7 +92,7 @@ static u8 * template_rewrite (flow_report_main_t * frm,
ip->protocol = IP_PROTOCOL_UDP;
ip->src_address.as_u32 = src_address->as_u32;
ip->dst_address.as_u32 = collector_address->as_u32;
- udp->src_port = clib_host_to_net_u16 (4739 /* $$FIXME */);
+ udp->src_port = clib_host_to_net_u16 (fr->src_port);
udp->dst_port = clib_host_to_net_u16 (collector_port);
udp->length = clib_host_to_net_u16 (vec_len(rewrite) - sizeof (*ip));
@@ -353,6 +353,7 @@ flow_sample_command_fn (vlib_main_t * vm,
int rv;
int is_add = 1;
u32 domain_id = 0;
+ u32 src_port = UDP_DST_PORT_ipfix;
domain_id = 0;
fsm->classify_table_index = ~0;
@@ -363,6 +364,8 @@ flow_sample_command_fn (vlib_main_t * vm,
;
else if (unformat (input, "domain %d", &domain_id))
;
+ else if (unformat (input, "src-port %d", &src_port))
+ ;
else if (unformat (input, "del"))
is_add = 0;
else
@@ -378,6 +381,7 @@ flow_sample_command_fn (vlib_main_t * vm,
args.flow_data_callback = send_flows;
args.is_add = is_add;
args.domain_id = domain_id;
+ args.src_port = (u16)src_port;
rv = vnet_flow_report_add_del (frm, &args);