diff --git a/src/dns_request.c b/src/dns_request.c index 034359e..6e0cd57 100644 --- a/src/dns_request.c +++ b/src/dns_request.c @@ -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;