remove more unused byte munching code

This commit is contained in:
Piper Pentagram 2025-07-18 16:33:52 -07:00
parent 201e15348e
commit 2c24b6d723

View file

@ -3,36 +3,6 @@
#include "dns_request.h"
/*
* get k'th bit from byte c
* because of how the DNS spec works, this starts counting from the LEFTMOST bit.
*/
// unsigned int get_bit(unsigned char c, unsigned int k)
// {
// unsigned int flag = 1U; // flag = 0000.....00001
//
// flag = flag << (8U-k); // flag = 0000...010...000 (shifted k positions)
//
// return c & flag;
// }
/*
* get n bits from byte c starting at position k
* because of how the DNS spec works, this starts counting from the LEFTMOST bit.
*/
// unsigned int get_bits(unsigned char c, unsigned int n, unsigned int k)
// {
// unsigned int ret = 0;
// unsigned int flag = 1U; // flag = 0000.....00001
//
// for (int j = 0; j < n; j++) {
// unsigned int bit_pos = 8U - k + j;
// ret = ret | get_bit(c, k+j) << bit_pos;
// }
//
// return ret;
// }
struct DNSRequest *parse_dns_query(struct DNSPacketBuffer *pb)
{
struct DNSRequest *req;