-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
DNS packet struct #2541
Comments
I implemented a zig DNS client library last couple of days, can PR it if this gets accepted (even though it's basically my first try at writing a library, so I can't ensure it's up to standard library's code quality). https://github.com/lnyaa/zigdig/blob/eb026b7e40c12e1040cae858bb4c79339a00748c/src/packet.zig |
Hi, I noticed that the referred PR has been closed. Although I am new to Zig, I would like to work on this and try to raise a PR. I read @andrewrk's comments on this and would like to understand what is missing/required.
Does it mean that you want the APIs , ideally to not take an allocator as argument and try as much as possible to use only the stack to create temporary storage / variables ? |
That's the idea. I rewrote my dns library afterwards, and was able to make serialization work without allocation, but couldn't get deserialization to work mostly because of DNS name pointers.
Yeah! See the musl port in |
Thanks. Apologies in advance if I am asking really silly questions, but I just want to clarify some doubts I have It looks like the Issue/related was started with the motivation to write a DNS packer serializer/deserializer, but looking at the comments, the goals has been changed to provide the DNS resolution (basically the What would be the ideal end for this issue to be considered done: An implementation of |
Apologies for not answering in almost a year. I got myself back on track on my library and was able to refactor algorithms to remove recursion in the library, but it's not up to replacing the internal resolver implementation in |
I also have a DNS implementation in zig that might be useful for this https://github.com/dantecatalfamo/zig-dns |
I missed to give an update in all this time, so, to not leave the issue in a vacuum of information, I was able to implement a dns API in February that does not need to allocate on the simplest case which is an getAddrInfo-style function (note how |
Eventually we're going to need a DNS client in the standard library. Although the networking piece(s) should wait for #1778, we can still write a DNS packet type now.
It should:
packed struct
to represent a DNS packet headerConsider cribbing from https://github.com/wahern/dns/blob/6cefd43f522f67680632309d4c221142c3798b71/src/dns.h#L354
The text was updated successfully, but these errors were encountered: