Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add srv6 #306

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions format/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func (d *JsonDriver) Format(data interface{}) ([]byte, []byte, error) {
if dataIf, ok := data.(interface{ Key() []byte }); ok {
key = dataIf.Key()
}

output, err := json.Marshal(data)
return key, output, err
}
Expand Down
494 changes: 359 additions & 135 deletions pb/flow.pb.go

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions pb/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ message FlowMessage {
NETFLOW_V9 = 3;
IPFIX = 4;
}

FlowType type = 1;

uint64 time_received_ns = 110;
Expand Down Expand Up @@ -94,4 +95,29 @@ message FlowMessage {

uint32 observation_domain_id = 70;
uint32 observation_point_id = 71;

// SRH SRv6 Header - fields decoding
uint32 srhSegmentsIPv6Left = 150;
uint32 srhLastEntryIPv6 = 151;
uint32 srhFlagsIPv6 = 152;
uint32 srhTagIPv6 = 153;
repeated bytes srhSegmentIPv6BasicList = 154;

// Tunnel IP - inner frame fields decoding
bytes innerFrame_src_addr = 160;
bytes innerFrame_dst_addr = 161;
uint32 innerFrame_proto = 162;
uint32 innerFrame_src_port = 163;
uint32 innerFrame_dst_port = 164;
uint32 innerFrame_ipv6_flow_label = 165;
uint32 innerFrame_ip_tos = 166;
uint32 innerFrame_ip_ttl = 167;
uint32 innerFrame_ip_flags = 168;
uint32 innerFrame_tcp_flags = 169;
uint32 innerFrame_fragment_id = 170;
uint32 innerFrame_fragment_offset = 171;
uint32 innerFrame_icmp_type = 172;
uint32 innerFrame_icmp_code = 173;
uint32 innerFrame_payload_len = 174;

}
11 changes: 6 additions & 5 deletions producer/proto/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,11 +232,12 @@ func mapFormat(cfg *ProducerConfig) (*FormatterConfigMapper, error) {
formatterMapped.render = make(map[string]RenderFunc)
formatterMapped.rename = make(map[string]string)
formatterMapped.isSlice = map[string]bool{
"BgpCommunities": true,
"AsPath": true,
"MplsIp": true,
"MplsLabel": true,
"MplsTtl": true,
"BgpCommunities": true,
"AsPath": true,
"MplsIp": true,
"MplsLabel": true,
"MplsTtl": true,
"SrhSegmentIPv6BasicList": true,
} // todo: improve this with defaults
for k, v := range defaultRenderers {
formatterMapped.render[k] = v
Expand Down
Loading
Loading