bind to 1053 for now
This commit is contained in:
parent
59be43383e
commit
f1e00117d9
1 changed files with 11 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#include "udp_server.h"
|
#include "udp_server.h"
|
||||||
#include "dns_packet_buffer.h"
|
#include "dns_packet_buffer.h"
|
||||||
|
#include "dns_request.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.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);
|
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);
|
close(sockfd);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue