Skip to content
Open
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 .github/actions/spelling/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
Dockerfiles
doha
DOOV
DOQ
Douban
downsides
downwardapi
Expand Down Expand Up @@ -259,19 +260,19 @@
JAMCRC
Jameel
Jaytech
jchap-pnnl

Check warning on line 263 in .github/actions/spelling/allow.txt

View workflow job for this annotation

GitHub Actions / Check Spelling

Ignoring entry because it contains non-alpha characters (non-alpha-in-dictionary)
jemalloc
jemallocator
jetbrains
JetBrains
jhbigler-pnnl

Check warning on line 268 in .github/actions/spelling/allow.txt

View workflow job for this annotation

GitHub Actions / Check Spelling

Ignoring entry because it contains non-alpha characters (non-alpha-in-dictionary)
Jia
Jiayu
jimmystewpot
jlambatl
jndi
Joda
jorgehermo9

Check warning on line 275 in .github/actions/spelling/allow.txt

View workflow job for this annotation

GitHub Actions / Check Spelling

Ignoring entry because it contains non-alpha characters (non-alpha-in-dictionary)
journalctl
jsonnet
jsontag
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/25495_dnstap_parser_doq_support.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Added support for DOQ socket protocol in dnstap source. This will prevent error messages when DOQ

Check failure on line 1 in changelog.d/25495_dnstap_parser_doq_support.fix.md

View workflow job for this annotation

GitHub Actions / Check Spelling

`doq` is not a recognized word (check-file-path)
traffic is encountered.

authors: esensar Quad9DNS
23 changes: 5 additions & 18 deletions lib/vector-vrl/dnstap-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1009,23 +1009,9 @@ fn to_socket_family_name(socket_family: i32) -> Result<&'static str> {
}

fn to_socket_protocol_name(socket_protocol: i32) -> Result<&'static str> {
if socket_protocol == SocketProtocol::Udp as i32 {
Ok("UDP")
} else if socket_protocol == SocketProtocol::Tcp as i32 {
Ok("TCP")
} else if socket_protocol == SocketProtocol::Dot as i32 {
Ok("DOT")
} else if socket_protocol == SocketProtocol::Doh as i32 {
Ok("DOH")
} else if socket_protocol == SocketProtocol::DnsCryptUdp as i32 {
Ok("DNSCryptUDP")
} else if socket_protocol == SocketProtocol::DnsCryptTcp as i32 {
Ok("DNSCryptTCP")
} else {
Err(Error::from(format!(
"Unknown socket protocol: {socket_protocol}"
)))
}
SocketProtocol::try_from(socket_protocol)
.map_err(|_| Error::from(format!("Unknown socket protocol: {socket_protocol}")))
.map(|sp| sp.as_str_name())
}

fn to_dnstap_data_type(data_type_id: i32) -> Option<String> {
Expand Down Expand Up @@ -1449,6 +1435,7 @@ mod tests {
assert_eq!("DOH", to_socket_protocol_name(4).unwrap());
assert_eq!("DNSCryptUDP", to_socket_protocol_name(5).unwrap());
assert_eq!("DNSCryptTCP", to_socket_protocol_name(6).unwrap());
assert!(to_socket_protocol_name(7).is_err());
assert_eq!("DOQ", to_socket_protocol_name(7).unwrap());
assert!(to_socket_protocol_name(8).is_err());
}
}
Loading