aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/flow/flow_report.c
diff options
context:
space:
mode:
authorOle Troan <ot@cisco.com>2017-03-13 13:39:52 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2017-05-30 09:32:07 +0000
commit5c749734b14c2d3be8689b0c5b72ae8d1ddec099 (patch)
tree9aa9dd950e96668016694e3630378ebd1c09d833 /src/vnet/flow/flow_report.c
parent0e2e10b77d63196bfb93ae5be1251bbc1a1b561a (diff)
Flowprobe: Stateful flows and IPv6, L4 recording
Change-Id: I67839281623721bf42f0a918a53356143d9dc78a Signed-off-by: Ole Troan <ot@cisco.com> Signed-off-by: Pavel Kotucek <pkotucek@cisco.com> Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vnet/flow/flow_report.c')
-rw-r--r--src/vnet/flow/flow_report.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/vnet/flow/flow_report.c b/src/vnet/flow/flow_report.c
index c78a78a9..ccc84235 100644
--- a/src/vnet/flow/flow_report.c
+++ b/src/vnet/flow/flow_report.c
@@ -87,7 +87,6 @@ int send_template_packet (flow_report_main_t *frm,
if (frm->ipfix_collector.as_u32 == 0
|| frm->src_address.as_u32 == 0)
{
- clib_warning ("no collector: disabling flow collector process");
vlib_node_set_state (frm->vlib_main, flow_report_process_node.index,
VLIB_NODE_STATE_DISABLED);
return -1;
@@ -238,7 +237,8 @@ VLIB_REGISTER_NODE (flow_report_process_node) = {
};
int vnet_flow_report_add_del (flow_report_main_t *frm,
- vnet_flow_report_add_del_args_t *a)
+ vnet_flow_report_add_del_args_t *a,
+ u16 *template_id)
{
int i;
int found_index = ~0;
@@ -260,6 +260,8 @@ int vnet_flow_report_add_del (flow_report_main_t *frm,
&& fr->flow_data_callback == a->flow_data_callback)
{
found_index = i;
+ if (template_id)
+ *template_id = fr->template_id;
break;
}
}
@@ -304,7 +306,10 @@ int vnet_flow_report_add_del (flow_report_main_t *frm,
fr->opaque = a->opaque;
fr->rewrite_callback = a->rewrite_callback;
fr->flow_data_callback = a->flow_data_callback;
-
+
+ if (template_id)
+ *template_id = fr->template_id;
+
return 0;
}
@@ -415,10 +420,7 @@ set_ipfix_exporter_command_fn (vlib_main_t * vm,
break;
}
- if (collector.as_u32 == 0)
- return clib_error_return (0, "collector address required");
-
- if (src.as_u32 == 0)
+ if (collector.as_u32 != 0 && src.as_u32 == 0)
return clib_error_return (0, "src address required");
if (path_mtu > 1450 /* vpp does not support fragmentation */)
@@ -441,7 +443,8 @@ set_ipfix_exporter_command_fn (vlib_main_t * vm,
frm->template_interval = template_interval;
frm->udp_checksum = udp_checksum;
- vlib_cli_output (vm, "Collector %U, src address %U, "
+ if (collector.as_u32)
+ vlib_cli_output (vm, "Collector %U, src address %U, "
"fib index %d, path MTU %u, "
"template resend interval %us, "
"udp checksum %s",
@@ -449,6 +452,8 @@ set_ipfix_exporter_command_fn (vlib_main_t * vm,
format_ip4_address, &frm->src_address,
fib_index, path_mtu, template_interval,
udp_checksum ? "enabled" : "disabled");
+ else
+ vlib_cli_output (vm, "IPFIX Collector is disabled");
/* Turn on the flow reporting process */
vlib_process_signal_event (vm, flow_report_process_node.index,