Skip to content

Commit

Permalink
fix(protobuf): remove SrcAddrIp and DstAddrIp
Browse files Browse the repository at this point in the history
  • Loading branch information
tgragnato committed Nov 19, 2024
1 parent 52b89ab commit cb09310
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 60 deletions.
76 changes: 28 additions & 48 deletions pb/flow.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pb/flow.proto
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ message FlowMessage {
string src_country = 1000;
string dst_country = 1001;
string lms_target_index = 1002;
bytes src_addr_ip = 1003;
bytes dst_addr_ip = 1004;
string src_asn = 1005;
string dst_asn = 1006;
string src_asn = 1003;
string dst_asn = 1004;
}
8 changes: 0 additions & 8 deletions producer/proto/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ func (p *ProtoProducer) Produce(msg interface{}, args *producer.ProduceArgs) (fl
fmsg.TimeReceivedNs = tr
fmsg.SamplerAddress = sa
fmsg.LmsTargetIndex = LMS_TARGET_INDEX
fmsg.SrcAddrIp = fmsg.SrcAddr
fmsg.SrcCountry = geoip.GetCountryByByteSlice(fmsg.SrcAddr)
fmsg.SrcAs, fmsg.SrcAsn = geoip.GetASNByByteSlice(fmsg.SrcAddr)
fmsg.DstAddrIp = fmsg.DstAddr
fmsg.DstCountry = geoip.GetCountryByByteSlice(fmsg.DstAddr)
fmsg.DstAs, fmsg.DstAsn = geoip.GetASNByByteSlice(fmsg.DstAddr)
if len(fmsg.AsPath) == 0 {
Expand All @@ -74,10 +72,8 @@ func (p *ProtoProducer) Produce(msg interface{}, args *producer.ProduceArgs) (fl
fmsg.TimeReceivedNs = tr
fmsg.SamplerAddress = sa
fmsg.LmsTargetIndex = LMS_TARGET_INDEX
fmsg.SrcAddrIp = fmsg.SrcAddr
fmsg.SrcCountry = geoip.GetCountryByByteSlice(fmsg.SrcAddr)
fmsg.SrcAs, fmsg.SrcAsn = geoip.GetASNByByteSlice(fmsg.SrcAddr)
fmsg.DstAddrIp = fmsg.DstAddr
fmsg.DstCountry = geoip.GetCountryByByteSlice(fmsg.DstAddr)
fmsg.DstAs, fmsg.DstAsn = geoip.GetASNByByteSlice(fmsg.DstAddr)
if len(fmsg.AsPath) == 0 {
Expand All @@ -92,10 +88,8 @@ func (p *ProtoProducer) Produce(msg interface{}, args *producer.ProduceArgs) (fl
fmsg.TimeReceivedNs = tr
fmsg.SamplerAddress = sa
fmsg.LmsTargetIndex = LMS_TARGET_INDEX
fmsg.SrcAddrIp = fmsg.SrcAddr
fmsg.SrcCountry = geoip.GetCountryByByteSlice(fmsg.SrcAddr)
fmsg.SrcAs, fmsg.SrcAsn = geoip.GetASNByByteSlice(fmsg.SrcAddr)
fmsg.DstAddrIp = fmsg.DstAddr
fmsg.DstCountry = geoip.GetCountryByByteSlice(fmsg.DstAddr)
fmsg.DstAs, fmsg.DstAsn = geoip.GetASNByByteSlice(fmsg.DstAddr)
if len(fmsg.AsPath) == 0 {
Expand All @@ -110,10 +104,8 @@ func (p *ProtoProducer) Produce(msg interface{}, args *producer.ProduceArgs) (fl
fmsg.TimeFlowStartNs = tr
fmsg.TimeFlowEndNs = tr
fmsg.LmsTargetIndex = LMS_TARGET_INDEX
fmsg.SrcAddrIp = fmsg.SrcAddr
fmsg.SrcCountry = geoip.GetCountryByByteSlice(fmsg.SrcAddr)
fmsg.SrcAs, fmsg.SrcAsn = geoip.GetASNByByteSlice(fmsg.SrcAddr)
fmsg.DstAddrIp = fmsg.DstAddr
fmsg.DstCountry = geoip.GetCountryByByteSlice(fmsg.DstAddr)
fmsg.DstAs, fmsg.DstAsn = geoip.GetASNByByteSlice(fmsg.DstAddr)
if len(fmsg.AsPath) == 0 {
Expand Down

0 comments on commit cb09310

Please sign in to comment.