From d66c03628e19e3160735e952c5af79c237fdfc59 Mon Sep 17 00:00:00 2001 From: Mohamed Mahmoud Date: Thu, 26 Oct 2023 11:29:14 -0400 Subject: [PATCH] dbg DNS over TCP NA fields Signed-off-by: Mohamed Mahmoud --- bpf/dns_tracker.h | 11 +++-- bpf/flows.c | 6 ++- bpf/types.h | 1 + pkg/decode/decode_protobuf.go | 2 + pkg/decode/decode_protobuf_test.go | 16 ++++++- pkg/ebpf/bpf_bpfeb.go | 1 + pkg/ebpf/bpf_bpfeb.o | Bin 92752 -> 93000 bytes pkg/ebpf/bpf_bpfel.go | 1 + pkg/ebpf/bpf_bpfel.o | Bin 94504 -> 94760 bytes pkg/exporter/proto.go | 2 + pkg/flow/record.go | 4 ++ pkg/flow/record_test.go | 2 + pkg/pbflow/flow.pb.go | 70 ++++++++++++++++------------- proto/flow.proto | 1 + 14 files changed, 80 insertions(+), 37 deletions(-) diff --git a/bpf/dns_tracker.h b/bpf/dns_tracker.h index 571526958..9fd7a5228 100644 --- a/bpf/dns_tracker.h +++ b/bpf/dns_tracker.h @@ -9,6 +9,7 @@ #define DNS_PORT 53 #define DNS_QR_FLAG 0x8000 #define UDP_MAXMSG 512 +#define EINVAL 22 struct dns_header { u16 id; @@ -64,21 +65,22 @@ static __always_inline u8 calc_dns_header_offset(pkt_info *pkt, void *data_end) return len; } -static __always_inline void track_dns_packet(struct __sk_buff *skb, pkt_info *pkt) { +static __always_inline int track_dns_packet(struct __sk_buff *skb, pkt_info *pkt) { void *data_end = (void *)(long)skb->data_end; if (pkt->id->dst_port == DNS_PORT || pkt->id->src_port == DNS_PORT) { dns_flow_id dns_req; u8 len = calc_dns_header_offset(pkt, data_end); if (!len) { - return; + return EINVAL; } struct dns_header dns; + int ret; u32 dns_offset = (long)pkt->l4_hdr - (long)skb->data + len; - if (bpf_skb_load_bytes(skb, dns_offset, &dns, sizeof(dns)) < 0) { - return; + if ((ret = bpf_skb_load_bytes(skb, dns_offset, &dns, sizeof(dns))) < 0) { + return -ret; } u16 dns_id = bpf_ntohs(dns.id); @@ -101,6 +103,7 @@ static __always_inline void track_dns_packet(struct __sk_buff *skb, pkt_info *pk } } // end of dns response } // end of dns port check + return 0; } #endif // __DNS_TRACKER_H__ diff --git a/bpf/flows.c b/bpf/flows.c index 219660e64..8e633a12a 100644 --- a/bpf/flows.c +++ b/bpf/flows.c @@ -72,9 +72,9 @@ static inline int flow_monitor(struct __sk_buff *skb, u8 direction) { // This is currently not to be enabled by default. calculate_flow_rtt(&pkt, direction, data_end); } - + int dns_errno = 0; if (enable_dns_tracking) { - track_dns_packet(skb, &pkt); + dns_errno = track_dns_packet(skb, &pkt); } // TODO: we need to add spinlock here when we deprecate versions prior to 5.1, or provide // a spinlocked alternative version and use it selectively https://lwn.net/Articles/779120/ @@ -97,6 +97,7 @@ static inline int flow_monitor(struct __sk_buff *skb, u8 direction) { aggregate_flow->dns_record.id = pkt.dns_id; aggregate_flow->dns_record.flags = pkt.dns_flags; aggregate_flow->dns_record.latency = pkt.dns_latency; + aggregate_flow->dns_record.errno = dns_errno; long ret = bpf_map_update_elem(&aggregated_flows, &id, aggregate_flow, BPF_ANY); if (trace_messages && ret != 0) { // usually error -16 (-EBUSY) is printed here. @@ -119,6 +120,7 @@ static inline int flow_monitor(struct __sk_buff *skb, u8 direction) { .dns_record.id = pkt.dns_id, .dns_record.flags = pkt.dns_flags, .dns_record.latency = pkt.dns_latency, + .dns_record.errno = dns_errno, }; // even if we know that the entry is new, another CPU might be concurrently inserting a flow diff --git a/bpf/types.h b/bpf/types.h index f9790427b..7d50bcc59 100644 --- a/bpf/types.h +++ b/bpf/types.h @@ -89,6 +89,7 @@ typedef struct flow_metrics_t { u16 id; u16 flags; u64 latency; + u8 errno; } __attribute__((packed)) dns_record; u64 flow_rtt; } __attribute__((packed)) flow_metrics; diff --git a/pkg/decode/decode_protobuf.go b/pkg/decode/decode_protobuf.go index e91797914..694652589 100644 --- a/pkg/decode/decode_protobuf.go +++ b/pkg/decode/decode_protobuf.go @@ -90,11 +90,13 @@ func PBFlowToMap(flow *pbflow.Record) config.GenericMap { } } + out["DnsErrno"] = flow.GetDnsErrno() if flow.GetDnsId() != 0 { out["DnsLatencyMs"] = flow.DnsLatency.AsDuration().Milliseconds() out["DnsId"] = flow.GetDnsId() out["DnsFlags"] = flow.GetDnsFlags() out["DnsFlagsResponseCode"] = dnsRcodeToStr(flow.GetDnsFlags() & 0xF) + out["DnsErrno"] = uint32(0) } if flow.GetPktDropLatestDropCause() != 0 { diff --git a/pkg/decode/decode_protobuf_test.go b/pkg/decode/decode_protobuf_test.go index 717faae54..67a6cdf77 100644 --- a/pkg/decode/decode_protobuf_test.go +++ b/pkg/decode/decode_protobuf_test.go @@ -55,7 +55,8 @@ func TestDecodeProtobuf(t *testing.T) { AgentIp: &pbflow.IP{ IpFamily: &pbflow.IP_Ipv4{Ipv4: 0x0a090807}, }, - Flags: 0x100, + Flags: 0x100, + DnsErrno: 0, }, expected: &config.GenericMap{ "FlowDirection": 1, @@ -76,6 +77,7 @@ func TestDecodeProtobuf(t *testing.T) { "TimeFlowEndMs": someTime.UnixMilli(), "Interface": "eth0", "AgentIP": "10.9.8.7", + "DnsErrno": uint32(0), }, }, { @@ -109,6 +111,7 @@ func TestDecodeProtobuf(t *testing.T) { AgentIp: &pbflow.IP{ IpFamily: &pbflow.IP_Ipv4{Ipv4: 0x0a090807}, }, + DnsErrno: 0, }, expected: &config.GenericMap{ "FlowDirection": 1, @@ -128,6 +131,7 @@ func TestDecodeProtobuf(t *testing.T) { "TimeFlowEndMs": someTime.UnixMilli(), "Interface": "eth0", "AgentIP": "10.9.8.7", + "DnsErrno": uint32(0), }, }, { @@ -161,6 +165,7 @@ func TestDecodeProtobuf(t *testing.T) { }, IcmpType: 8, IcmpCode: 0, + DnsErrno: 0, }, expected: &config.GenericMap{ "FlowDirection": 1, @@ -180,6 +185,7 @@ func TestDecodeProtobuf(t *testing.T) { "AgentIP": "10.9.8.7", "IcmpType": uint32(8), "IcmpCode": uint32(0), + "DnsErrno": uint32(0), }, }, { @@ -213,6 +219,7 @@ func TestDecodeProtobuf(t *testing.T) { }, IcmpType: 128, IcmpCode: 0, + DnsErrno: 0, }, expected: &config.GenericMap{ "FlowDirection": 1, @@ -232,6 +239,7 @@ func TestDecodeProtobuf(t *testing.T) { "AgentIP": "101:101:101:101:101:101:101:101", "IcmpType": uint32(128), "IcmpCode": uint32(0), + "DnsErrno": uint32(0), }, }, { @@ -264,6 +272,7 @@ func TestDecodeProtobuf(t *testing.T) { AgentIp: &pbflow.IP{ IpFamily: &pbflow.IP_Ipv4{Ipv4: 0x0a090807}, }, + DnsErrno: 0, }, expected: &config.GenericMap{ "FlowDirection": 1, @@ -277,6 +286,7 @@ func TestDecodeProtobuf(t *testing.T) { "TimeFlowEndMs": someTime.UnixMilli(), "Interface": "eth0", "AgentIP": "10.9.8.7", + "DnsErrno": uint32(0), }, }, { @@ -319,6 +329,7 @@ func TestDecodeProtobuf(t *testing.T) { DnsLatency: durationpb.New(someDuration), DnsId: 1, DnsFlags: 0x8001, + DnsErrno: 0, TimeFlowRtt: durationpb.New(someDuration), }, expected: &config.GenericMap{ @@ -349,6 +360,7 @@ func TestDecodeProtobuf(t *testing.T) { "DnsId": uint32(1), "DnsFlags": uint32(0x8001), "DnsFlagsResponseCode": "FormErr", + "DnsErrno": uint32(0), "TimeFlowRttNs": someDuration.Nanoseconds(), }, }, @@ -407,6 +419,7 @@ func TestPBFlowToMap(t *testing.T) { DnsLatency: durationpb.New(someDuration), DnsId: 1, DnsFlags: 0x80, + DnsErrno: 0, TimeFlowRtt: durationpb.New(someDuration), } @@ -441,6 +454,7 @@ func TestPBFlowToMap(t *testing.T) { "DnsId": uint32(1), "DnsFlags": uint32(0x80), "DnsFlagsResponseCode": "NoError", + "DnsErrno": uint32(0), "TimeFlowRttNs": someDuration.Nanoseconds(), }, out) diff --git a/pkg/ebpf/bpf_bpfeb.go b/pkg/ebpf/bpf_bpfeb.go index bb10a1591..7f6ceebd8 100644 --- a/pkg/ebpf/bpf_bpfeb.go +++ b/pkg/ebpf/bpf_bpfeb.go @@ -25,6 +25,7 @@ type BpfDnsRecordT struct { Id uint16 Flags uint16 Latency uint64 + Errno uint8 } type BpfFlowId BpfFlowIdT diff --git a/pkg/ebpf/bpf_bpfeb.o b/pkg/ebpf/bpf_bpfeb.o index 12b4001b8b2cf7624ef8cbbdfb3d4375a891a48f..0af59e932379b347f41e3564b964d6d3cb0ded49 100644 GIT binary patch delta 8769 zcmcgweQ;FQbwBs*3Vo7FDo6_$SYaUvNoZHAuSG~kU;-;FTLKHSF~nMgKr+FwATT1f zS@~nenubmVSN0?Qn8=C8r74prvrI(NB*<;2R>t;NoguBlCjTLAxXL&j`A+aR1=TwUrPt4Q$~c)z zJGs(c#CIa#?JRq9`3`-MJ}(axuHCSW;euC?9%S5pKi}aMq^*{0p%&S;evAB|(6`*` z=Z0$cte^FiD@WHC3ZKmN6$-zcLcL73_zG7C`whE=eqqOR*6u$H+>*TD+nMwK5ca;` zUC8o+Z(s5&CCy$jE{ndnR?d`Xi#&O^{E2NM4QZ%5nMXC8kL9^^0U~d2F1-r5o1dWN`D#XZ;8BBQCvCR!fHcoeDGdB*T!Rfrvi-TC|6#N z@tp{`H#rxm^<*dul4UhDnLlUUGjH6Z0}^W|o^ zE#qAIJ&vE`?6yJ~*mO5@lF@P!Z^`1ufOu1OHqLqb-?+C^Zr^;(`^; z@MYki{S2Ph^fS!&i+r-4xVEUjoV*$dctjw1>!F>7_((Q&R3EiujLKa^v&HJ%6$w(B#Nf13YEe~8QE&4#QWs1FhNiQvtK?jQ=gPGRfY`y>?8Tr+pA>! zc8>hy)(ZK`?TTdO2kX7^lMi#{#~)?q9X@sH_zAf59PjV4>T>@-u9j7QSDYOB*SYkx zTB5Qm^7&sLHTH&*zxd_bnOmbo**{%K0Oex`VjSopu`HV?|FXj0CgH;lnm?vtAMk|y z^wZ5^I$8IhFXktPiR!Ui?)V9bAdJglya->1ZjNZ@=g=4)Px*v~^MPkT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@7k?bW5VSn zNwlAGxo8UQLoP3E&*B8er@flP5Zc;{W5pym?%I9a)_D-D#rwvkR=1@Afko|=V1N>32Ho)2>IF3WDU|DV!hrrr^WnEw`z9Pi~XbDvC09rsrJS%`_ z{4@?VApg@teHsrfWd37CxAXrTI;U#D`V9C-?gE|wYYFjhT73o$X>c5eN{D~4>HZBo zpf+Rv0Y-=C{ZrO2EJYhi$Ob8zSRI8X|rIK^?O0SkCVG`?$YAs70=+5`$?;Q53C z_|6^B1^m660LO8t0r>A=+G}=f6gyIrXg-U>ivy+h3Qqkv9G*t|IgM|ijh{vHcFyg% z%lx5hEryDZ;1{Yjw8Kcx+8v5hky;3R2RaVTX!GTFxC?F0--81s(u)&M-r*$Le1|%G z5^eTzco6L#jrn7ex0`KGQDg*gWL}`id9=Axr-N~{d37DWoW)aFd@YM-vUpZ!EC;`M z^#L{&WbsBlt2t8o#WuuI2=3AM`vCXURcLIoW*Z| z`Kj;NFE8W^Z*_^kGnVu30^U-}tCCkvTzLI)vDUldz*C2xId&wGeEQI{1J4~i+Sgya zyrZ-0!tcAqDWfS|Pdm464Rzafq`O+NQ%Bhx>8??AwN;0^?K;$L{_{RjcCJS(H}CHe z!AkVA$quNtYB*YTNY#<Jd>{erSMfD?b9berP|vC*hV znllM>RcHpDLeCpU%!E~snWI)cVa{0flo>e0_GvSLIzKqXouT)%Id%w17n(CHcdxhQ LoH8?cQ272EcJ%EW diff --git a/pkg/ebpf/bpf_bpfel.go b/pkg/ebpf/bpf_bpfel.go index 8556d19a5..0f869406b 100644 --- a/pkg/ebpf/bpf_bpfel.go +++ b/pkg/ebpf/bpf_bpfel.go @@ -25,6 +25,7 @@ type BpfDnsRecordT struct { Id uint16 Flags uint16 Latency uint64 + Errno uint8 } type BpfFlowId BpfFlowIdT diff --git a/pkg/ebpf/bpf_bpfel.o b/pkg/ebpf/bpf_bpfel.o index 5e001e1de72aa19a7028827941ae9dc6cfda9b3b..f938b3e4570b74b99c7b31e183abbd731f169f01 100644 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(fr *flow.Record) *pbflow.Record { PktDropLatestDropCause: fr.Metrics.PktDrops.LatestDropCause, DnsId: uint32(fr.Metrics.DnsRecord.Id), DnsFlags: uint32(fr.Metrics.DnsRecord.Flags), + DnsErrno: uint32(fr.Metrics.DnsRecord.Errno), TimeFlowRtt: durationpb.New(fr.TimeFlowRtt), } if fr.Metrics.DnsRecord.Latency != 0 { @@ -128,6 +129,7 @@ func v6FlowToPB(fr *flow.Record) *pbflow.Record { PktDropLatestDropCause: fr.Metrics.PktDrops.LatestDropCause, DnsId: uint32(fr.Metrics.DnsRecord.Id), DnsFlags: uint32(fr.Metrics.DnsRecord.Flags), + DnsErrno: uint32(fr.Metrics.DnsRecord.Errno), TimeFlowRtt: durationpb.New(fr.TimeFlowRtt), } if fr.Metrics.DnsRecord.Latency != 0 { diff --git a/pkg/flow/record.go b/pkg/flow/record.go index 54461c602..cd5b3c2b6 100644 --- a/pkg/flow/record.go +++ b/pkg/flow/record.go @@ -115,6 +115,10 @@ func Accumulate(r *ebpf.BpfFlowMetrics, src *ebpf.BpfFlowMetrics) { if src.Dscp != 0 { r.Dscp = src.Dscp } + // Accumulate DNSErrno + if src.DnsRecord.Errno != 0 { + r.DnsRecord.Errno = src.DnsRecord.Errno + } } // IP returns the net.IP equivalent object diff --git a/pkg/flow/record_test.go b/pkg/flow/record_test.go index 8709af0b6..316bbe699 100644 --- a/pkg/flow/record_test.go +++ b/pkg/flow/record_test.go @@ -43,6 +43,7 @@ func TestRecordBinaryEncoding(t *testing.T) { 01, 00, // id 0x80, 00, // flags 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, // latency + 0x00, // errno // u64 flow_rtt 0xad, 0xde, 0xef, 0xbe, 0xef, 0xbe, 0xad, 0xde, })) @@ -82,6 +83,7 @@ func TestRecordBinaryEncoding(t *testing.T) { Id: 0x0001, Flags: 0x0080, Latency: 0x1817161514131211, + Errno: 0, }, FlowRtt: 0xdeadbeefbeefdead, }, diff --git a/pkg/pbflow/flow.pb.go b/pkg/pbflow/flow.pb.go index 16ad2116c..a0ed4ddcd 100644 --- a/pkg/pbflow/flow.pb.go +++ b/pkg/pbflow/flow.pb.go @@ -191,6 +191,7 @@ type Record struct { DnsFlags uint32 `protobuf:"varint,22,opt,name=dns_flags,json=dnsFlags,proto3" json:"dns_flags,omitempty"` DnsLatency *durationpb.Duration `protobuf:"bytes,23,opt,name=dns_latency,json=dnsLatency,proto3" json:"dns_latency,omitempty"` TimeFlowRtt *durationpb.Duration `protobuf:"bytes,24,opt,name=time_flow_rtt,json=timeFlowRtt,proto3" json:"time_flow_rtt,omitempty"` + DnsErrno uint32 `protobuf:"varint,25,opt,name=dns_errno,json=dnsErrno,proto3" json:"dns_errno,omitempty"` } func (x *Record) Reset() { @@ -393,6 +394,13 @@ func (x *Record) GetTimeFlowRtt() *durationpb.Duration { return nil } +func (x *Record) GetDnsErrno() uint32 { + if x != nil { + return x.DnsErrno + } + return 0 +} + type DataLink struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -670,7 +678,7 @@ var file_proto_flow_proto_rawDesc = []byte{ 0x07, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x73, 0x12, 0x28, 0x0a, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x70, 0x62, 0x66, 0x6c, 0x6f, 0x77, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x07, 0x65, 0x6e, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x22, 0xef, 0x07, 0x0a, 0x06, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x21, 0x0a, + 0x65, 0x73, 0x22, 0x8c, 0x08, 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, @@ -733,35 +741,37 @@ var file_proto_flow_proto_rawDesc = []byte{ 0x6f, 0x77, 0x5f, 0x72, 0x74, 0x74, 0x18, 0x18, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x74, 0x69, 0x6d, 0x65, 0x46, 0x6c, 0x6f, - 0x77, 0x52, 0x74, 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, 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, + 0x77, 0x52, 0x74, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x64, 0x6e, 0x73, 0x5f, 0x65, 0x72, 0x72, 0x6e, + 0x6f, 0x18, 0x19, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x08, 0x64, 0x6e, 0x73, 0x45, 0x72, 0x72, 0x6e, + 0x6f, 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, } var ( diff --git a/proto/flow.proto b/proto/flow.proto index 35803d7d6..bf3209caf 100644 --- a/proto/flow.proto +++ b/proto/flow.proto @@ -53,6 +53,7 @@ message Record { uint32 dns_flags = 22; google.protobuf.Duration dns_latency = 23; google.protobuf.Duration time_flow_rtt = 24; + uint32 dns_errno = 25; } message DataLink {