17 Commits

Author SHA1 Message Date
d5de7a02d4 group tests 2022-05-08 17:00:33 +02:00
df255f9267 (tests) rcode parsing tests (#22)
Check if valid and invalid response codes are parsed correctly.

Reviewed-on: #22
Co-authored-by: ddidderr <ddidderr@paul.network>
Co-committed-by: ddidderr <ddidderr@paul.network>
2022-05-08 16:48:15 +02:00
6a60951487 DNSMessageType tests added (#21)
Co-authored-by: Tobias Ottenweller <tobi@ottenweller.net>
Reviewed-on: #21
Co-authored-by: mice_on_drugs <tobi@ottenweller.net>
Co-committed-by: mice_on_drugs <tobi@ottenweller.net>
2022-05-08 16:15:02 +02:00
97e786905e (refactor) rename DNS header fields to understandable long names (#19)
Renames the DNS header fields and adds a new `enum DNSMessageType`.

Resolves #14

Co-authored-by: mice_on_drugs <tobi@ottenweller.net>
Reviewed-on: #19
Co-authored-by: ddidderr <ddidderr@paul.network>
Co-committed-by: ddidderr <ddidderr@paul.network>
2022-05-08 14:43:25 +02:00
623a82c2fe (deps) replace hexyl with hexhex (#18)
Since we don't want to add too many dependencies for now, use our own
small hexdump lib `hexhex` instead of `hexyl`.

Reviewed-on: #18
Co-authored-by: ddidderr <ddidderr@paul.network>
Co-committed-by: ddidderr <ddidderr@paul.network>
2022-05-08 14:39:29 +02:00
67608177b0
(docs) README 2022-04-06 20:20:34 +02:00
678e2ca60e
add test script for useful dig command to test queries against the server 2022-04-06 20:20:17 +02:00
e0cc382eeb
Improve tests 2022-04-06 20:20:00 +02:00
00ac8cbb4f
Use result for test 2022-04-06 20:20:00 +02:00
0dc41ef845
(tests) Implement tests for DNS header parsing
* implemented 3 tests
  * valid opcodes
  * invalid opcodes
  * header too short
* fixed byteorder and bit shifting for flags
* added hexdump for main function for testing purposes
2022-04-06 20:19:41 +02:00
cccdf5b5e9
Implement TryFrom for DNSOpCode and DNSRCode. (#15)
Co-authored-by: Tobias Ottenweller <tobi@ottenweller.net>
Reviewed-on: #15
2022-04-06 20:18:38 +02:00
a07fb80b45
(chore) Change DNS OpCode and DNS RCode enum names to CamelCase (#13)
and use the same names as the RFC.
Also added some RFC documentation as doc comments in the code.

Co-authored-by: ddidderr <ddidderr@paul.network>
Reviewed-on: #13
2022-04-06 20:18:19 +02:00
812264e2ab
(chore) replace flume dependency with std::sync::mpsc (#12)
Co-authored-by: ddidderr <ddidderr@paul.network>
Reviewed-on: #12
2022-04-06 20:17:48 +02:00
c67c940ba9 Improve code styling 2022-04-03 17:10:59 +02:00
bc278b7d39 Custom error type for parsing 2022-04-03 17:01:07 +02:00
b9ff4c9a51 Move parsing of udp datagram for dns header into model 2022-03-15 17:01:17 +01:00
71223309d7 Code for parsing headers added. 2022-03-13 21:56:17 +01:00