{"id":20879905,"url":"https://github.com/bughandler/libdnspacket","last_synced_at":"2025-05-12T16:31:58.675Z","repository":{"id":38337916,"uuid":"506231968","full_name":"bughandler/libdnspacket","owner":"bughandler","description":"A single file cpp17 header only DNS packet parser/builder.","archived":false,"fork":false,"pushed_at":"2022-12-19T11:28:49.000Z","size":75,"stargazers_count":26,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-18T08:29:38.004Z","etag":null,"topics":["cpp17","dns","parser"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bughandler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-22T12:11:23.000Z","updated_at":"2024-07-17T07:30:26.000Z","dependencies_parsed_at":"2023-01-29T21:30:33.453Z","dependency_job_id":null,"html_url":"https://github.com/bughandler/libdnspacket","commit_stats":null,"previous_names":["bughandler/libdnspacket"],"tags_count":null,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bughandler%2Flibdnspacket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bughandler%2Flibdnspacket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bughandler%2Flibdnspacket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bughandler%2Flibdnspacket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bughandler","download_url":"https://codeload.github.com/bughandler/libdnspacket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225142245,"owners_count":17427399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cpp17","dns","parser"],"created_at":"2024-11-18T07:18:14.102Z","updated_at":"2024-11-18T07:18:15.522Z","avatar_url":"https://github.com/bughandler.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libdnspacket\n An ultra lightweight, cross platform and single header DNS packet parser \u0026 builder. \n\n+ Easy to use\n\n+ No external dependency\n\n+ Parse DNS packet\n\n+ Build DNS packet\n\n+ DNS host name compression\n\n+ Support multiple DNS record types\n\n  \u003e + A\n  \u003e + NS\n  \u003e + CNAME\n  \u003e + SOA\n  \u003e + PTR\n  \u003e + MX\n  \u003e + TXT\n  \u003e + AAAA\n  \u003e + SPF\n\n\n\n### How to use\n\n1. Just copy `libdnspacket` into your project folder\n2. Include `libdnspacket/dns.hpp`\n3. You are ready to go\n\n\n\n### APIs\n\n​\tThere are two simple APIs.\n\n+ Parse raw DNS packet into DNS message\n\n  ``` c++\n  //\n  // Parameters:\n  //   buf: point to the raw DNS packet\n  //   bufSize: indicate the size of [buf]\n  // Return:\n  //   \u003cbool, DnsMessage\u003e\n  //   #1: indicate whether the packet was parsed successfully or not\n  //   #2: when #1 value is true, this is the final structured DNS message\n  //\n  std::tuple\u003cbool, DnsMessage\u003e dns::Parse(const uint8_t* buf, size_t bufSize);\n  ```\n\n+ Build raw DNS packet from DNS message\n\n  ``` c++\n  //\n  // Parameters:\n  //   message: the structured DNS message\n  // Return:\n  //   The byte buffer of raw DNS packet\n  //\n  std::vector\u003cstd::byte\u003e dns::Build(const DnsMessage\u0026 message);\n  ```\n\n  \n\n### Notes\n\n+ Any feedback is welcome\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbughandler%2Flibdnspacket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbughandler%2Flibdnspacket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbughandler%2Flibdnspacket/lists"}