From 201e15348e9fb4e99bfa7b3066c02a16f0e911c4 Mon Sep 17 00:00:00 2001 From: Piper Pentagram Date: Fri, 18 Jul 2025 16:29:07 -0700 Subject: [PATCH] remove unused byte munching code --- include/dns_packet_buffer.h | 2 -- src/dns_packet_buffer.c | 36 ------------------------------------ 2 files changed, 38 deletions(-) diff --git a/include/dns_packet_buffer.h b/include/dns_packet_buffer.h index 5884dad..9457e54 100644 --- a/include/dns_packet_buffer.h +++ b/include/dns_packet_buffer.h @@ -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 *); diff --git a/src/dns_packet_buffer.c b/src/dns_packet_buffer.c index eb84f12..d47f1e5 100644 --- a/src/dns_packet_buffer.c +++ b/src/dns_packet_buffer.c @@ -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]; -}