bind to 1053 for now

This commit is contained in:
Piper Pentagram 2025-07-08 15:27:34 -07:00
parent 59be43383e
commit f1e00117d9

View file

@ -1,5 +1,6 @@
#include "udp_server.h"
#include "dns_packet_buffer.h"
#include "dns_request.h"
#include <stdio.h>
#include <unistd.h>
@ -40,7 +41,16 @@ int start_server()
int n = recvfrom(sockfd, (char *)pb->buf, sizeof(pb->buf), MSG_WAITALL, 0, &len);
printf("%s", pb->buf);
printf("received %d bytes\n", n);
struct DNSRequest *req = new_dns_request(pb);
printf("packet_id: %x\n", req->header->packet_id);
printf("is_response: %d\n", req->header->is_response);
printf("opcode: %d\n", req->header->opcode);
printf("is_authoritative: %d\n", req->header->is_authoritative);
printf("is_truncated: %d\n", req->header->is_truncated);
printf("recursion_desired: %d\n", req->header->recursion_desired);
close(sockfd);
return 0;