Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsdist: add incoming and outgoing protocols to grepq #10833

Merged
merged 5 commits into from
Oct 12, 2021

Conversation

chbruyand
Copy link
Member

Short description

This adds incoming and outgoing protocols to grepq() output :

Time    Client                                          Protocol     Server       ID    Name                      Type  Lat.   TC RD AA Rcode
-20.1   127.0.0.1:55421                                 DoTCP                     44825 www.mayhem.fr.            A               RD    Question
-20.0   127.0.0.1:55421                                 DoH          127.0.0.1:443 44825 www.mayhem.fr.            A     107.8     RD    No Error. 2 answers
-3.0    127.0.0.1:33580                                 DoUDP                     13890 www.powerdns.org.         A               RD    Question
-2.7    127.0.0.1:33580                                 DoUDP        127.0.0.1:53   13890 www.powerdns.org.         A     300.0     RD    No Error. 2 answers

This slightly changes the underlying type of Protocol

Fix #10490

Checklist

I have:

  • read the CONTRIBUTING.md document
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

chbruyand and others added 4 commits October 11, 2021 11:01
…int8_t

This commit makes sure that we always use the dnsdist::Protocol type,
and that we cannot easily convert to or from a different type by mistake.

C++ really dropped the ball by making it impossible to declare methods
on the 'enum class' that solved the issue of making regular enums
implicitly convertible to int and back, thus making it possible to
assign and compare different types of enums together, as well as
enums and ints.
The result is that we are stuck with declaring classes to hold our
methods, along with a lot of plumbing to make sure that we can convert
in some cases but not allow obvious mistakes from happening.
 dnsdist: Prevent implicit conversions between dnsdist::Protocol and uint8_t
@rgacogne rgacogne merged commit 9255aeb into PowerDNS:master Oct 12, 2021
@chbruyand chbruyand deleted the dnsdist-protocol-grepq branch January 19, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dnsdist: Ponder displaying the incoming protocol in grepq
2 participants