remove unused byte munching code

This commit is contained in:
Piper Pentagram 2025-07-18 16:29:07 -07:00
parent 5cd390f7b1
commit 201e15348e
2 changed files with 0 additions and 38 deletions

View file

@ -11,6 +11,4 @@ struct DNSPacketBuffer {
struct DNSPacketBuffer *new_dns_packet_buffer();
struct DNSPacketHeader *dns_header(struct DNSPacketBuffer);
unsigned char pb_read_byte(struct DNSPacketBuffer *);

View file

@ -8,39 +8,3 @@ struct DNSPacketBuffer *new_dns_packet_buffer()
buf = malloc(sizeof(struct DNSPacketBuffer));
return buf;
}
struct DNSPacketHeader *dns_header(struct DNSPacketBuffer)
{
}
// read a single byte and move the cursor one byte forward
unsigned char pb_read_byte(struct DNSPacketBuffer *pb)
{
unsigned char b = pb->buf[pb->pos];
pb->pos++;
if (pb->pos >= PB_SIZE) {
printf(
"WARN: pb_read_byte: advanced packetbuffer cursor pos to %lu, which is greater than the max %d",
pb->pos,
PB_SIZE
);
}
return b;
}
unsigned char pb_get_byte(struct DNSPacketBuffer *pb)
{
if (pb->pos >= PB_SIZE) {
printf(
"WARN: pb_get_byte: accessing packetbuffer cursor pos %lu, which is greater than the max %d",
pb->pos,
PB_SIZE
);
}
return pb->buf[pb->pos];
}