refactor initial code and accept a UDP request
This commit is contained in:
parent
fb762b2aef
commit
ee64c84ea4
10 changed files with 96 additions and 25 deletions
13
include/dns_packet_buffer.h
Normal file
13
include/dns_packet_buffer.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
#include <stddef.h>
|
||||
|
||||
#define PACKET_BUFFER_SIZE 512
|
||||
|
||||
struct DNSPacketBuffer {
|
||||
char buf[PACKET_BUFFER_SIZE];
|
||||
size_t pos;
|
||||
};
|
||||
|
||||
struct DNSPacketBuffer *new_dns_packet_buffer();
|
||||
|
||||
struct DNSPacketHeader *dns_header(struct DNSPacketBuffer);
|
||||
Loading…
Add table
Add a link
Reference in a new issue