Skip to content

Commit ba9257e

Browse files
committed
sFlow: display input/output interfaces for expanded flows
These were already present for regular flows.
1 parent a84cdb8 commit ba9257e

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

print-sflow.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,13 +795,17 @@ sflow_print_expanded_flow_sample(netdissect_options *ndo,
795795

796796
nrecords = GET_BE_U_4(sflow_expanded_flow_sample->records);
797797

798-
ND_PRINT(" seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, records %u",
798+
ND_PRINT(" seqnum %u, type %u, idx %u, rate %u, pool %u, drops %u, input %u (%u), output %u (%u), records %u",
799799
GET_BE_U_4(sflow_expanded_flow_sample->seqnum),
800800
GET_BE_U_4(sflow_expanded_flow_sample->type),
801801
GET_BE_U_4(sflow_expanded_flow_sample->index),
802802
GET_BE_U_4(sflow_expanded_flow_sample->rate),
803803
GET_BE_U_4(sflow_expanded_flow_sample->pool),
804804
GET_BE_U_4(sflow_expanded_flow_sample->drops),
805+
GET_BE_U_4(sflow_expanded_flow_sample->in_interface_value),
806+
GET_BE_U_4(sflow_expanded_flow_sample->in_interface_format),
807+
GET_BE_U_4(sflow_expanded_flow_sample->out_interface_value),
808+
GET_BE_U_4(sflow_expanded_flow_sample->out_interface_format),
805809
nrecords);
806810

807811
return sflow_print_flow_records(ndo, pointer + sizeof(struct sflow_expanded_flow_sample_t),

tests/TESTLIST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ qinqv QinQpacket.pcap QinQpacketv.out -e -v
195195
# now SFLOW tests
196196
sflow1 sflow_multiple_counter_30_pdus.pcap sflow_multiple_counter_30_pdus.out -v
197197
sflow2 sflow_multiple_counter_30_pdus.pcap sflow_multiple_counter_30_pdus-nv.out
198+
sflow-expanded sflow_expanded.pcap sflow_expanded.out -v
198199
# ipv6 sflow support
199200
sflow-v6 sflow-print-v6.pcap sflow-print-v6.out -vvv
200201

tests/sflow_expanded.out

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
1 2022-12-29 15:03:48.557763 IP (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto UDP (17), length 356)
2+
192.0.2.100.47873 > 192.0.2.101.6343: sFlowv5, IPv4 agent 49.49.49.49, agent-id 0, seqnum 115694180, uptime 3465002224, samples 1, length 328
3+
expanded flow sample (3), length 292, seqnum 2170480284, type 0, idx 11001, rate 1000, pool 1521799520, drops 0, input 29001 (0), output 1285816721 (0), records 3
4+
enterprise 0 Raw packet (1) length 140
5+
protocol Ethernet (1), length 126, stripped bytes 4, header_size 122
6+
enterprise 0 Extended Gateway data (1003) length 68
7+
enterprise 0 Extended Router data (1002) length 16

tests/sflow_expanded.pcap

410 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)