From 6d5843ebbedce772e72c7a655abefd2b64993c03 Mon Sep 17 00:00:00 2001 From: Julien Pinsonneau Date: Tue, 12 Mar 2024 10:23:51 +0100 Subject: [PATCH] update ebpf dependency --- go.mod | 2 +- go.sum | 4 ++-- .../pkg/decode/decode_protobuf.go | 20 +++++++++++-------- vendor/modules.txt | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/go.mod b/go.mod index ff852a379..925906463 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/netobserv/gopipes v0.3.0 github.com/netobserv/loki-client-go v0.0.0-20220927092034-f37122a54500 - github.com/netobserv/netobserv-ebpf-agent v0.3.3 + github.com/netobserv/netobserv-ebpf-agent v0.3.4-0.20240312085757-e9bf0d0d5a09 github.com/netsampler/goflow2 v1.3.7 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.19.0 diff --git a/go.sum b/go.sum index 4176ed430..ff7292492 100644 --- a/go.sum +++ b/go.sum @@ -631,8 +631,8 @@ github.com/netobserv/gopipes v0.3.0 h1:IYmPnnAVCdSK7VmHmpFhrVBOEm45qpgbZmJz1sSW+ github.com/netobserv/gopipes v0.3.0/go.mod h1:N7/Gz05EOF0CQQSKWsv3eof22Cj2PB08Pbttw98YFYU= github.com/netobserv/loki-client-go v0.0.0-20220927092034-f37122a54500 h1:RmnoJe/ci5q+QdM7upFdxiU+D8F3L3qTd5wXCwwHefw= github.com/netobserv/loki-client-go v0.0.0-20220927092034-f37122a54500/go.mod h1:LHXpc5tjKvsfZn0pwLKrvlgEhZcCaw3Di9mUEZGAI4E= -github.com/netobserv/netobserv-ebpf-agent v0.3.3 h1:4e/mDVhSTd8JzaqKapaQ78BFLJP/GYpYWQ/LHPArJeI= -github.com/netobserv/netobserv-ebpf-agent v0.3.3/go.mod h1:R3zRIhu5faj91s9pCU735oULLC+oBDPzA/xVwiUJ9PY= +github.com/netobserv/netobserv-ebpf-agent v0.3.4-0.20240312085757-e9bf0d0d5a09 h1:9Y7nPXhMc8PToNX4aQltGNcpSDBehWoTHlg/LWToils= +github.com/netobserv/netobserv-ebpf-agent v0.3.4-0.20240312085757-e9bf0d0d5a09/go.mod h1:W26Mf03LriOdylI/3T0yKgmU3bR4gy/ihzRd0SzJb3w= github.com/netsampler/goflow2 v1.3.7 h1:XZaTy8kkMnGXpJ9hS3KbO1McyrFTpVNhVFEx9rNhMmc= github.com/netsampler/goflow2 v1.3.7/go.mod h1:4UZsVGVAs//iMCptUHn3WNScztJeUhZH7kDW2+/vDdQ= github.com/oklog/oklog v0.3.2/go.mod h1:FCV+B7mhrz4o+ueLpx+KqkyXRGMWOYEvfiXtdGtbWGs= diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/decode/decode_protobuf.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/decode/decode_protobuf.go index 4d0ea2bbb..0bd286c61 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/decode/decode_protobuf.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/decode/decode_protobuf.go @@ -46,18 +46,19 @@ func PBFlowToMap(flow *pbflow.Record) config.GenericMap { return config.GenericMap{} } out := config.GenericMap{ - "FlowDirection": int(flow.Direction.Number()), "SrcMac": macToStr(flow.DataLink.GetSrcMac()), "DstMac": macToStr(flow.DataLink.GetDstMac()), "Etype": flow.EthProtocol, - "Duplicate": flow.Duplicate, "TimeFlowStartMs": flow.TimeFlowStart.AsTime().UnixMilli(), "TimeFlowEndMs": flow.TimeFlowEnd.AsTime().UnixMilli(), "TimeReceived": time.Now().Unix(), - "Interface": flow.Interface, "AgentIP": ipToStr(flow.AgentIp), } + if flow.Duplicate { + out["Duplicate"] = true + } + if flow.Bytes != 0 { out["Bytes"] = flow.Bytes } @@ -65,17 +66,20 @@ func PBFlowToMap(flow *pbflow.Record) config.GenericMap { if flow.Packets != 0 { out["Packets"] = flow.Packets } - var interfaces []interface{} - var flowDirections []interface{} + var interfaces []string + var directions []int if len(flow.GetDupList()) != 0 { for _, entry := range flow.GetDupList() { interfaces = append(interfaces, entry.Interface) - flowDirections = append(flowDirections, entry.Direction) + directions = append(directions, int(entry.Direction)) } - out["Interfaces"] = interfaces - out["FlowDirections"] = flowDirections + } else { + interfaces = append(interfaces, flow.Interface) + directions = append(directions, int(flow.Direction)) } + out["Interfaces"] = interfaces + out["IfDirections"] = directions ethType := ethernet.EtherType(flow.EthProtocol) if ethType == ethernet.EtherTypeIPv4 || ethType == ethernet.EtherTypeIPv6 { diff --git a/vendor/modules.txt b/vendor/modules.txt index 9eb96574c..7a99cbdfe 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -250,7 +250,7 @@ github.com/netobserv/loki-client-go/pkg/labelutil github.com/netobserv/loki-client-go/pkg/logproto github.com/netobserv/loki-client-go/pkg/metric github.com/netobserv/loki-client-go/pkg/urlutil -# github.com/netobserv/netobserv-ebpf-agent v0.3.3 +# github.com/netobserv/netobserv-ebpf-agent v0.3.4-0.20240312085757-e9bf0d0d5a09 ## explicit; go 1.20 github.com/netobserv/netobserv-ebpf-agent/pkg/decode github.com/netobserv/netobserv-ebpf-agent/pkg/grpc