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 0449acb9..94d57239 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 @@ -143,6 +143,14 @@ func RecordToMap(fr *model.Record) config.GenericMap { } out["NetworkEvents"] = metadata } + + if fr.Metrics.TranslatedFlow.ZoneId != 0 { + out["ZoneId"] = fr.Metrics.TranslatedFlow.ZoneId + out["XlatSrcPort"] = fr.Metrics.TranslatedFlow.Sport + out["XlatDstPort"] = fr.Metrics.TranslatedFlow.Dport + out["XlatSrcAddr"] = model.IP(fr.Metrics.TranslatedFlow.Saddr).String() + out["XlatDstAddr"] = model.IP(fr.Metrics.TranslatedFlow.Daddr).String() + } return out } diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.go index 243f49dd..a1367e55 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.go @@ -104,6 +104,7 @@ type BpfFlowMetricsT struct { FlowRtt uint64 NetworkEventsIdx uint8 NetworkEvents [4][8]uint8 + TranslatedFlow BpfTranslatedFlowT } type BpfFlowRecordT struct { @@ -149,6 +150,14 @@ const ( BpfTcpFlagsTRST_ACK_FLAG BpfTcpFlagsT = 1024 ) +type BpfTranslatedFlowT struct { + Saddr [16]uint8 + Daddr [16]uint8 + Sport uint16 + Dport uint16 + ZoneId uint16 +} + // LoadBpf returns the embedded CollectionSpec for Bpf. func LoadBpf() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_BpfBytes) @@ -202,6 +211,7 @@ type BpfProgramSpecs struct { TcxEgressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.ProgramSpec `ebpf:"track_nat_manip_pkt"` } // BpfMapSpecs contains maps before they are loaded into the kernel. @@ -270,6 +280,7 @@ type BpfPrograms struct { TcxEgressPcaParse *ebpf.Program `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.Program `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.Program `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.Program `ebpf:"track_nat_manip_pkt"` } func (p *BpfPrograms) Close() error { @@ -286,6 +297,7 @@ func (p *BpfPrograms) Close() error { p.TcxEgressPcaParse, p.TcxIngressFlowParse, p.TcxIngressPcaParse, + p.TrackNatManipPkt, ) } diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.o b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.o index 426e1f76..f39e0733 100644 Binary files a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.o and b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_arm64_bpfel.o differ diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.go index 5be29d7b..6887f2b6 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.go @@ -104,6 +104,7 @@ type BpfFlowMetricsT struct { FlowRtt uint64 NetworkEventsIdx uint8 NetworkEvents [4][8]uint8 + TranslatedFlow BpfTranslatedFlowT } type BpfFlowRecordT struct { @@ -149,6 +150,14 @@ const ( BpfTcpFlagsTRST_ACK_FLAG BpfTcpFlagsT = 1024 ) +type BpfTranslatedFlowT struct { + Saddr [16]uint8 + Daddr [16]uint8 + Sport uint16 + Dport uint16 + ZoneId uint16 +} + // LoadBpf returns the embedded CollectionSpec for Bpf. func LoadBpf() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_BpfBytes) @@ -202,6 +211,7 @@ type BpfProgramSpecs struct { TcxEgressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.ProgramSpec `ebpf:"track_nat_manip_pkt"` } // BpfMapSpecs contains maps before they are loaded into the kernel. @@ -270,6 +280,7 @@ type BpfPrograms struct { TcxEgressPcaParse *ebpf.Program `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.Program `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.Program `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.Program `ebpf:"track_nat_manip_pkt"` } func (p *BpfPrograms) Close() error { @@ -286,6 +297,7 @@ func (p *BpfPrograms) Close() error { p.TcxEgressPcaParse, p.TcxIngressFlowParse, p.TcxIngressPcaParse, + p.TrackNatManipPkt, ) } diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.o b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.o index 3e9760cd..ca6d91db 100644 Binary files a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.o and b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_powerpc_bpfel.o differ diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.go index 47501856..de15efd8 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.go @@ -104,6 +104,7 @@ type BpfFlowMetricsT struct { FlowRtt uint64 NetworkEventsIdx uint8 NetworkEvents [4][8]uint8 + TranslatedFlow BpfTranslatedFlowT } type BpfFlowRecordT struct { @@ -149,6 +150,14 @@ const ( BpfTcpFlagsTRST_ACK_FLAG BpfTcpFlagsT = 1024 ) +type BpfTranslatedFlowT struct { + Saddr [16]uint8 + Daddr [16]uint8 + Sport uint16 + Dport uint16 + ZoneId uint16 +} + // LoadBpf returns the embedded CollectionSpec for Bpf. func LoadBpf() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_BpfBytes) @@ -202,6 +211,7 @@ type BpfProgramSpecs struct { TcxEgressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.ProgramSpec `ebpf:"track_nat_manip_pkt"` } // BpfMapSpecs contains maps before they are loaded into the kernel. @@ -270,6 +280,7 @@ type BpfPrograms struct { TcxEgressPcaParse *ebpf.Program `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.Program `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.Program `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.Program `ebpf:"track_nat_manip_pkt"` } func (p *BpfPrograms) Close() error { @@ -286,6 +297,7 @@ func (p *BpfPrograms) Close() error { p.TcxEgressPcaParse, p.TcxIngressFlowParse, p.TcxIngressPcaParse, + p.TrackNatManipPkt, ) } diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.o b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.o index 875a2ccc..710c534d 100644 Binary files a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.o and b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_s390_bpfeb.o differ diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.go index 02a04e87..1a130a6e 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.go @@ -104,6 +104,7 @@ type BpfFlowMetricsT struct { FlowRtt uint64 NetworkEventsIdx uint8 NetworkEvents [4][8]uint8 + TranslatedFlow BpfTranslatedFlowT } type BpfFlowRecordT struct { @@ -149,6 +150,14 @@ const ( BpfTcpFlagsTRST_ACK_FLAG BpfTcpFlagsT = 1024 ) +type BpfTranslatedFlowT struct { + Saddr [16]uint8 + Daddr [16]uint8 + Sport uint16 + Dport uint16 + ZoneId uint16 +} + // LoadBpf returns the embedded CollectionSpec for Bpf. func LoadBpf() (*ebpf.CollectionSpec, error) { reader := bytes.NewReader(_BpfBytes) @@ -202,6 +211,7 @@ type BpfProgramSpecs struct { TcxEgressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.ProgramSpec `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.ProgramSpec `ebpf:"track_nat_manip_pkt"` } // BpfMapSpecs contains maps before they are loaded into the kernel. @@ -270,6 +280,7 @@ type BpfPrograms struct { TcxEgressPcaParse *ebpf.Program `ebpf:"tcx_egress_pca_parse"` TcxIngressFlowParse *ebpf.Program `ebpf:"tcx_ingress_flow_parse"` TcxIngressPcaParse *ebpf.Program `ebpf:"tcx_ingress_pca_parse"` + TrackNatManipPkt *ebpf.Program `ebpf:"track_nat_manip_pkt"` } func (p *BpfPrograms) Close() error { @@ -286,6 +297,7 @@ func (p *BpfPrograms) Close() error { p.TcxEgressPcaParse, p.TcxIngressFlowParse, p.TcxIngressPcaParse, + p.TrackNatManipPkt, ) } diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.o b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.o index ee2e4c29..24cee921 100644 Binary files a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.o and b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/bpf_x86_bpfel.o differ diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/gen.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/gen.go index a21e44a8..3ec45b49 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/gen.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/ebpf/gen.go @@ -1,4 +1,4 @@ package ebpf // $BPF_CLANG and $BPF_CFLAGS are set by the Makefile. -//go:generate bpf2go -cc $BPF_CLANG -cflags $BPF_CFLAGS -target amd64,arm64,ppc64le,s390x -type flow_metrics_t -type flow_id_t -type flow_record_t -type pkt_drops_t -type dns_record_t -type global_counters_key_t -type direction_t -type filter_action_t -type tcp_flags_t Bpf ../../bpf/flows.c -- -I../../bpf/headers +//go:generate bpf2go -cc $BPF_CLANG -cflags $BPF_CFLAGS -target amd64,arm64,ppc64le,s390x -type flow_metrics_t -type flow_id_t -type flow_record_t -type pkt_drops_t -type dns_record_t -type global_counters_key_t -type direction_t -type filter_action_t -type tcp_flags_t -type translated_flow_t Bpf ../../bpf/flows.c -- -I../../bpf/headers diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/model/record.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/model/record.go index 8d4c6c70..26557d4f 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/model/record.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/model/record.go @@ -134,6 +134,8 @@ func Accumulate(r *ebpf.BpfFlowMetrics, src *ebpf.BpfFlowMetrics) { r.NetworkEventsIdx = (r.NetworkEventsIdx + 1) % maxNetworkEvents } } + + r.TranslatedFlow = src.TranslatedFlow } func networkEventsMDExist(events [maxNetworkEvents][networkEventsMaxEventsMD]uint8, md [networkEventsMaxEventsMD]uint8) bool { diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/flow.pb.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/flow.pb.go index 6a5c4320..84b7fef1 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/flow.pb.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/flow.pb.go @@ -1,6 +1,6 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.34.2 +// protoc-gen-go v1.35.1 // protoc v3.19.4 // source: proto/flow.proto @@ -79,11 +79,9 @@ type CollectorReply struct { func (x *CollectorReply) Reset() { *x = CollectorReply{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *CollectorReply) String() string { @@ -94,7 +92,7 @@ func (*CollectorReply) ProtoMessage() {} func (x *CollectorReply) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -119,11 +117,9 @@ type Records struct { func (x *Records) Reset() { *x = Records{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Records) String() string { @@ -134,7 +130,7 @@ func (*Records) ProtoMessage() {} func (x *Records) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -167,11 +163,9 @@ type DupMapEntry struct { func (x *DupMapEntry) Reset() { *x = DupMapEntry{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DupMapEntry) String() string { @@ -182,7 +176,7 @@ func (*DupMapEntry) ProtoMessage() {} func (x *DupMapEntry) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -249,15 +243,14 @@ type Record struct { DnsErrno uint32 `protobuf:"varint,25,opt,name=dns_errno,json=dnsErrno,proto3" json:"dns_errno,omitempty"` DupList []*DupMapEntry `protobuf:"bytes,26,rep,name=dup_list,json=dupList,proto3" json:"dup_list,omitempty"` NetworkEventsMetadata []string `protobuf:"bytes,27,rep,name=network_events_metadata,json=networkEventsMetadata,proto3" json:"network_events_metadata,omitempty"` + Xlat *Xlat `protobuf:"bytes,28,opt,name=xlat,proto3" json:"xlat,omitempty"` } func (x *Record) Reset() { *x = Record{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Record) String() string { @@ -268,7 +261,7 @@ func (*Record) ProtoMessage() {} func (x *Record) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -472,6 +465,13 @@ func (x *Record) GetNetworkEventsMetadata() []string { return nil } +func (x *Record) GetXlat() *Xlat { + if x != nil { + return x.Xlat + } + return nil +} + type DataLink struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -483,11 +483,9 @@ type DataLink struct { func (x *DataLink) Reset() { *x = DataLink{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DataLink) String() string { @@ -498,7 +496,7 @@ func (*DataLink) ProtoMessage() {} func (x *DataLink) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -539,11 +537,9 @@ type Network struct { func (x *Network) Reset() { *x = Network{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Network) String() string { @@ -554,7 +550,7 @@ func (*Network) ProtoMessage() {} func (x *Network) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -604,11 +600,9 @@ type IP struct { func (x *IP) Reset() { *x = IP{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *IP) String() string { @@ -619,7 +613,7 @@ func (*IP) ProtoMessage() {} func (x *IP) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -685,11 +679,9 @@ type Transport struct { func (x *Transport) Reset() { *x = Transport{} - if protoimpl.UnsafeEnabled { - mi := &file_proto_flow_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_proto_flow_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Transport) String() string { @@ -700,7 +692,7 @@ func (*Transport) ProtoMessage() {} func (x *Transport) ProtoReflect() protoreflect.Message { mi := &file_proto_flow_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -736,6 +728,83 @@ func (x *Transport) GetProtocol() uint32 { return 0 } +type Xlat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + SrcAddr *IP `protobuf:"bytes,1,opt,name=src_addr,json=srcAddr,proto3" json:"src_addr,omitempty"` + DstAddr *IP `protobuf:"bytes,2,opt,name=dst_addr,json=dstAddr,proto3" json:"dst_addr,omitempty"` + SrcPort uint32 `protobuf:"varint,3,opt,name=src_port,json=srcPort,proto3" json:"src_port,omitempty"` + DstPort uint32 `protobuf:"varint,4,opt,name=dst_port,json=dstPort,proto3" json:"dst_port,omitempty"` + ZoneId uint32 `protobuf:"varint,5,opt,name=zone_id,json=zoneId,proto3" json:"zone_id,omitempty"` +} + +func (x *Xlat) Reset() { + *x = Xlat{} + mi := &file_proto_flow_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *Xlat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Xlat) ProtoMessage() {} + +func (x *Xlat) ProtoReflect() protoreflect.Message { + mi := &file_proto_flow_proto_msgTypes[8] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Xlat.ProtoReflect.Descriptor instead. +func (*Xlat) Descriptor() ([]byte, []int) { + return file_proto_flow_proto_rawDescGZIP(), []int{8} +} + +func (x *Xlat) GetSrcAddr() *IP { + if x != nil { + return x.SrcAddr + } + return nil +} + +func (x *Xlat) GetDstAddr() *IP { + if x != nil { + return x.DstAddr + } + return nil +} + +func (x *Xlat) GetSrcPort() uint32 { + if x != nil { + return x.SrcPort + } + return 0 +} + +func (x *Xlat) GetDstPort() uint32 { + if x != nil { + return x.DstPort + } + return 0 +} + +func (x *Xlat) GetZoneId() uint32 { + if x != nil { + return x.ZoneId + } + return 0 +} + var File_proto_flow_proto protoreflect.FileDescriptor var file_proto_flow_proto_rawDesc = []byte{ @@ -755,7 +824,7 @@ var file_proto_flow_proto_rawDesc = []byte{ 0x2f, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0xf4, 0x08, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, + 0x22, 0x96, 0x09, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x65, 0x74, 0x68, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x65, 0x74, 0x68, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x12, 0x2f, 0x0a, 0x09, 0x64, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, @@ -826,35 +895,48 @@ var file_proto_flow_proto_rawDesc = []byte{ 0x36, 0x0a, 0x17, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x5f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x1b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x15, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x22, 0x3c, 0x0a, 0x08, 0x44, 0x61, 0x74, 0x61, 0x4c, - 0x69, 0x6e, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x6d, 0x61, 0x63, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, 0x72, 0x63, 0x4d, 0x61, 0x63, 0x12, 0x17, 0x0a, 0x07, - 0x64, 0x73, 0x74, 0x5f, 0x6d, 0x61, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x64, - 0x73, 0x74, 0x4d, 0x61, 0x63, 0x22, 0x6b, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, - 0x12, 0x25, 0x0a, 0x08, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x49, 0x50, 0x52, 0x07, - 0x73, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x12, 0x25, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x66, 0x6c, - 0x6f, 0x77, 0x2e, 0x49, 0x50, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x12, - 0x0a, 0x04, 0x64, 0x73, 0x63, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x64, 0x73, - 0x63, 0x70, 0x22, 0x3d, 0x0a, 0x02, 0x49, 0x50, 0x12, 0x14, 0x0a, 0x04, 0x69, 0x70, 0x76, 0x34, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x04, 0x69, 0x70, 0x76, 0x34, 0x12, 0x14, - 0x0a, 0x04, 0x69, 0x70, 0x76, 0x36, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, 0x52, 0x04, - 0x69, 0x70, 0x76, 0x36, 0x42, 0x0b, 0x0a, 0x09, 0x69, 0x70, 0x5f, 0x66, 0x61, 0x6d, 0x69, 0x6c, - 0x79, 0x22, 0x5d, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x19, - 0x0a, 0x08, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x73, 0x72, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, - 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, 0x73, 0x74, - 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x2a, 0x24, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, - 0x07, 0x49, 0x4e, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x47, - 0x52, 0x45, 0x53, 0x53, 0x10, 0x01, 0x32, 0x3e, 0x0a, 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, - 0x74, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x0f, 0x2e, 0x70, 0x62, - 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x16, 0x2e, 0x70, - 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, - 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x0a, 0x5a, 0x08, 0x2e, 0x2f, 0x70, 0x62, 0x66, 0x6c, - 0x6f, 0x77, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x20, 0x0a, 0x04, 0x78, 0x6c, 0x61, 0x74, 0x18, + 0x1c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x58, + 0x6c, 0x61, 0x74, 0x52, 0x04, 0x78, 0x6c, 0x61, 0x74, 0x22, 0x3c, 0x0a, 0x08, 0x44, 0x61, 0x74, + 0x61, 0x4c, 0x69, 0x6e, 0x6b, 0x12, 0x17, 0x0a, 0x07, 0x73, 0x72, 0x63, 0x5f, 0x6d, 0x61, 0x63, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x73, 0x72, 0x63, 0x4d, 0x61, 0x63, 0x12, 0x17, + 0x0a, 0x07, 0x64, 0x73, 0x74, 0x5f, 0x6d, 0x61, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x06, 0x64, 0x73, 0x74, 0x4d, 0x61, 0x63, 0x22, 0x6b, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, + 0x72, 0x6b, 0x12, 0x25, 0x0a, 0x08, 0x73, 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x49, 0x50, + 0x52, 0x07, 0x73, 0x72, 0x63, 0x41, 0x64, 0x64, 0x72, 0x12, 0x25, 0x0a, 0x08, 0x64, 0x73, 0x74, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, + 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x49, 0x50, 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, + 0x12, 0x12, 0x0a, 0x04, 0x64, 0x73, 0x63, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, + 0x64, 0x73, 0x63, 0x70, 0x22, 0x3d, 0x0a, 0x02, 0x49, 0x50, 0x12, 0x14, 0x0a, 0x04, 0x69, 0x70, + 0x76, 0x34, 0x18, 0x01, 0x20, 0x01, 0x28, 0x07, 0x48, 0x00, 0x52, 0x04, 0x69, 0x70, 0x76, 0x34, + 0x12, 0x14, 0x0a, 0x04, 0x69, 0x70, 0x76, 0x36, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x48, 0x00, + 0x52, 0x04, 0x69, 0x70, 0x76, 0x36, 0x42, 0x0b, 0x0a, 0x09, 0x69, 0x70, 0x5f, 0x66, 0x61, 0x6d, + 0x69, 0x6c, 0x79, 0x22, 0x5d, 0x0a, 0x09, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x70, 0x6f, 0x72, 0x74, + 0x12, 0x19, 0x0a, 0x08, 0x73, 0x72, 0x63, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x07, 0x73, 0x72, 0x63, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, + 0x73, 0x74, 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, + 0x73, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, + 0x6f, 0x6c, 0x22, 0xa3, 0x01, 0x0a, 0x04, 0x58, 0x6c, 0x61, 0x74, 0x12, 0x25, 0x0a, 0x08, 0x73, + 0x72, 0x63, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, + 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x49, 0x50, 0x52, 0x07, 0x73, 0x72, 0x63, 0x41, 0x64, + 0x64, 0x72, 0x12, 0x25, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0a, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x49, 0x50, + 0x52, 0x07, 0x64, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x12, 0x19, 0x0a, 0x08, 0x73, 0x72, 0x63, + 0x5f, 0x70, 0x6f, 0x72, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x73, 0x72, 0x63, + 0x50, 0x6f, 0x72, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x64, 0x73, 0x74, 0x5f, 0x70, 0x6f, 0x72, 0x74, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x07, 0x64, 0x73, 0x74, 0x50, 0x6f, 0x72, 0x74, 0x12, + 0x17, 0x0a, 0x07, 0x7a, 0x6f, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, + 0x52, 0x06, 0x7a, 0x6f, 0x6e, 0x65, 0x49, 0x64, 0x2a, 0x24, 0x0a, 0x09, 0x44, 0x69, 0x72, 0x65, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0b, 0x0a, 0x07, 0x49, 0x4e, 0x47, 0x52, 0x45, 0x53, 0x53, + 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x47, 0x52, 0x45, 0x53, 0x53, 0x10, 0x01, 0x32, 0x3e, + 0x0a, 0x09, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x31, 0x0a, 0x04, 0x53, + 0x65, 0x6e, 0x64, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x52, 0x65, 0x63, + 0x6f, 0x72, 0x64, 0x73, 0x1a, 0x16, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x43, 0x6f, + 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x6f, 0x72, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x42, 0x0a, + 0x5a, 0x08, 0x2e, 0x2f, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -870,7 +952,7 @@ func file_proto_flow_proto_rawDescGZIP() []byte { } var file_proto_flow_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_proto_flow_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_proto_flow_proto_msgTypes = make([]protoimpl.MessageInfo, 9) var file_proto_flow_proto_goTypes = []any{ (Direction)(0), // 0: pbflow.Direction (*CollectorReply)(nil), // 1: pbflow.CollectorReply @@ -881,31 +963,35 @@ var file_proto_flow_proto_goTypes = []any{ (*Network)(nil), // 6: pbflow.Network (*IP)(nil), // 7: pbflow.IP (*Transport)(nil), // 8: pbflow.Transport - (*timestamppb.Timestamp)(nil), // 9: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 10: google.protobuf.Duration + (*Xlat)(nil), // 9: pbflow.Xlat + (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 11: google.protobuf.Duration } var file_proto_flow_proto_depIdxs = []int32{ 4, // 0: pbflow.Records.entries:type_name -> pbflow.Record 0, // 1: pbflow.DupMapEntry.direction:type_name -> pbflow.Direction 0, // 2: pbflow.Record.direction:type_name -> pbflow.Direction - 9, // 3: pbflow.Record.time_flow_start:type_name -> google.protobuf.Timestamp - 9, // 4: pbflow.Record.time_flow_end:type_name -> google.protobuf.Timestamp + 10, // 3: pbflow.Record.time_flow_start:type_name -> google.protobuf.Timestamp + 10, // 4: pbflow.Record.time_flow_end:type_name -> google.protobuf.Timestamp 5, // 5: pbflow.Record.data_link:type_name -> pbflow.DataLink 6, // 6: pbflow.Record.network:type_name -> pbflow.Network 8, // 7: pbflow.Record.transport:type_name -> pbflow.Transport 7, // 8: pbflow.Record.agent_ip:type_name -> pbflow.IP - 10, // 9: pbflow.Record.dns_latency:type_name -> google.protobuf.Duration - 10, // 10: pbflow.Record.time_flow_rtt:type_name -> google.protobuf.Duration + 11, // 9: pbflow.Record.dns_latency:type_name -> google.protobuf.Duration + 11, // 10: pbflow.Record.time_flow_rtt:type_name -> google.protobuf.Duration 3, // 11: pbflow.Record.dup_list:type_name -> pbflow.DupMapEntry - 7, // 12: pbflow.Network.src_addr:type_name -> pbflow.IP - 7, // 13: pbflow.Network.dst_addr:type_name -> pbflow.IP - 2, // 14: pbflow.Collector.Send:input_type -> pbflow.Records - 1, // 15: pbflow.Collector.Send:output_type -> pbflow.CollectorReply - 15, // [15:16] is the sub-list for method output_type - 14, // [14:15] is the sub-list for method input_type - 14, // [14:14] is the sub-list for extension type_name - 14, // [14:14] is the sub-list for extension extendee - 0, // [0:14] is the sub-list for field type_name + 9, // 12: pbflow.Record.xlat:type_name -> pbflow.Xlat + 7, // 13: pbflow.Network.src_addr:type_name -> pbflow.IP + 7, // 14: pbflow.Network.dst_addr:type_name -> pbflow.IP + 7, // 15: pbflow.Xlat.src_addr:type_name -> pbflow.IP + 7, // 16: pbflow.Xlat.dst_addr:type_name -> pbflow.IP + 2, // 17: pbflow.Collector.Send:input_type -> pbflow.Records + 1, // 18: pbflow.Collector.Send:output_type -> pbflow.CollectorReply + 18, // [18:19] is the sub-list for method output_type + 17, // [17:18] is the sub-list for method input_type + 17, // [17:17] is the sub-list for extension type_name + 17, // [17:17] is the sub-list for extension extendee + 0, // [0:17] is the sub-list for field type_name } func init() { file_proto_flow_proto_init() } @@ -913,104 +999,6 @@ func file_proto_flow_proto_init() { if File_proto_flow_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_proto_flow_proto_msgTypes[0].Exporter = func(v any, i int) any { - switch v := v.(*CollectorReply); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_flow_proto_msgTypes[1].Exporter = func(v any, i int) any { - switch v := v.(*Records); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_flow_proto_msgTypes[2].Exporter = func(v any, i int) any { - switch v := v.(*DupMapEntry); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_flow_proto_msgTypes[3].Exporter = func(v any, i int) any { - switch v := v.(*Record); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_flow_proto_msgTypes[4].Exporter = func(v any, i int) any { - switch v := v.(*DataLink); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_flow_proto_msgTypes[5].Exporter = func(v any, i int) any { - switch v := v.(*Network); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_flow_proto_msgTypes[6].Exporter = func(v any, i int) any { - switch v := v.(*IP); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_proto_flow_proto_msgTypes[7].Exporter = func(v any, i int) any { - switch v := v.(*Transport); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } file_proto_flow_proto_msgTypes[6].OneofWrappers = []any{ (*IP_Ipv4)(nil), (*IP_Ipv6)(nil), @@ -1021,7 +1009,7 @@ func file_proto_flow_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_proto_flow_proto_rawDesc, NumEnums: 1, - NumMessages: 8, + NumMessages: 9, NumExtensions: 0, NumServices: 1, }, diff --git a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/proto.go b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/proto.go index 8341a4d7..16ffa568 100644 --- a/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/proto.go +++ b/vendor/github.com/netobserv/netobserv-ebpf-agent/pkg/pbflow/proto.go @@ -76,6 +76,11 @@ func FlowToPB(fr *model.Record, s *ovnobserv.SampleDecoder) *Record { DnsFlags: uint32(fr.Metrics.DnsRecord.Flags), DnsErrno: uint32(fr.Metrics.DnsRecord.Errno), TimeFlowRtt: durationpb.New(fr.TimeFlowRtt), + Xlat: &Xlat{ + SrcPort: uint32(fr.Metrics.TranslatedFlow.Sport), + DstPort: uint32(fr.Metrics.TranslatedFlow.Dport), + ZoneId: uint32(fr.Metrics.TranslatedFlow.ZoneId), + }, } if fr.Metrics.DnsRecord.Latency != 0 { pbflowRecord.DnsLatency = durationpb.New(fr.DNSLatency) @@ -94,9 +99,13 @@ func FlowToPB(fr *model.Record, s *ovnobserv.SampleDecoder) *Record { if fr.Id.EthProtocol == model.IPv6Type { pbflowRecord.Network.SrcAddr = &IP{IpFamily: &IP_Ipv6{Ipv6: fr.Id.SrcIp[:]}} pbflowRecord.Network.DstAddr = &IP{IpFamily: &IP_Ipv6{Ipv6: fr.Id.DstIp[:]}} + pbflowRecord.Xlat.SrcAddr = &IP{IpFamily: &IP_Ipv6{Ipv6: fr.Metrics.TranslatedFlow.Saddr[:]}} + pbflowRecord.Xlat.DstAddr = &IP{IpFamily: &IP_Ipv6{Ipv6: fr.Metrics.TranslatedFlow.Daddr[:]}} } else { pbflowRecord.Network.SrcAddr = &IP{IpFamily: &IP_Ipv4{Ipv4: model.IntEncodeV4(fr.Id.SrcIp)}} pbflowRecord.Network.DstAddr = &IP{IpFamily: &IP_Ipv4{Ipv4: model.IntEncodeV4(fr.Id.DstIp)}} + pbflowRecord.Xlat.SrcAddr = &IP{IpFamily: &IP_Ipv4{Ipv4: model.IntEncodeV4(fr.Metrics.TranslatedFlow.Saddr)}} + pbflowRecord.Xlat.DstAddr = &IP{IpFamily: &IP_Ipv4{Ipv4: model.IntEncodeV4(fr.Metrics.TranslatedFlow.Daddr)}} } if s != nil { seen := make(map[string]bool) @@ -154,6 +163,13 @@ func PBToFlow(pb *Record) *model.Record { Errno: uint8(pb.DnsErrno), Latency: uint64(pb.DnsLatency.AsDuration()), }, + TranslatedFlow: ebpf.BpfTranslatedFlowT{ + Saddr: ipToIPAddr(pb.Xlat.GetSrcAddr()), + Daddr: ipToIPAddr(pb.Xlat.GetDstAddr()), + Sport: uint16(pb.Xlat.GetSrcPort()), + Dport: uint16(pb.Xlat.GetDstPort()), + ZoneId: uint16(pb.Xlat.GetZoneId()), + }, }, }, TimeFlowStart: pb.TimeFlowStart.AsTime(),