read the packets into packet structs

This commit is contained in:
Piper Pentagram 2025-07-08 15:36:27 -07:00
parent f1e00117d9
commit 68400a25b7
5 changed files with 53 additions and 4 deletions

View file

@ -1,13 +1,16 @@
#pragma once
#include <stddef.h>
#define PACKET_BUFFER_SIZE 512
#define PB_SIZE 512
#define PB_OUT_OF_BOUNDS 9999;
struct DNSPacketBuffer {
char buf[PACKET_BUFFER_SIZE];
char buf[PB_SIZE];
size_t pos;
};
struct DNSPacketBuffer *new_dns_packet_buffer();
struct DNSPacketHeader *dns_header(struct DNSPacketBuffer);
char pb_read_byte(struct DNSPacketBuffer *);