diff options
| author | daniel <daniel@planethacker.net> | 2025-05-06 16:57:32 -0700 |
|---|---|---|
| committer | daniel <daniel@planethacker.net> | 2025-05-06 16:57:32 -0700 |
| commit | 2278df1493e064c197913e49b5d1935942d83448 (patch) | |
| tree | 42f06ab2f76e2ddf228bafbb03f79621975a4534 /include/dns.h | |
initial import
Diffstat (limited to 'include/dns.h')
| -rw-r--r-- | include/dns.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/dns.h b/include/dns.h new file mode 100644 index 0000000..eb8f125 --- /dev/null +++ b/include/dns.h @@ -0,0 +1,15 @@ +#pragma once + +#include <stdint.h> +#include <stddef.h> + +#define MAX_DNS_NAME_LEN 256 +#define MAX_DNS_QUESTIONS 8 + +struct dns_question { + char name[MAX_DNS_NAME_LEN]; + uint16_t qtype; +}; + +const char *dns_type_to_string(uint16_t type); +size_t parse_dns_udp(const uint8_t *payload, size_t len, struct dns_question *out, size_t max_qs); |
