#include <seeder/dns.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <strings.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#include <util/time.h>
#include <cctype>
#include <cstdbool>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
Go to the source code of this file.
|
enum | dns_class { CLASS_IN = 1
, QCLASS_ANY = 255
} |
|
enum | dns_type {
TYPE_A = 1
, TYPE_NS = 2
, TYPE_CNAME = 5
, TYPE_SOA = 6
,
TYPE_MX = 15
, TYPE_AAAA = 28
, TYPE_SRV = 33
, QTYPE_ANY = 255
} |
|
enum class | DNSResponseCode : uint8_t {
OK = 0
, FORMAT_ERROR = 1
, SERVER_FAILURE = 2
, NAME_ERROR = 3
,
NOT_IMPLEMENTED = 4
, REFUSED = 5
} |
|
|
ParseNameStatus | parse_name (const uint8_t **inpos, const uint8_t *inend, const uint8_t *inbuf, char *buf, size_t bufsize) |
|
int | write_name (uint8_t **outpos, const uint8_t *outend, const char *name, int offset) |
|
static int | write_record (uint8_t **outpos, const uint8_t *outend, const char *name, int offset, dns_type typ, dns_class cls, int ttl) |
|
static int | write_record_a (uint8_t **outpos, const uint8_t *outend, const char *name, int offset, dns_class cls, int ttl, const addr_t *ip) |
|
static int | write_record_aaaa (uint8_t **outpos, const uint8_t *outend, const char *name, int offset, dns_class cls, int ttl, const addr_t *ip) |
|
static int | write_record_ns (uint8_t **outpos, const uint8_t *outend, const char *name, int offset, dns_class cls, int ttl, const char *ns) |
|
static int | write_record_soa (uint8_t **outpos, const uint8_t *outend, const char *name, int offset, dns_class cls, int ttl, const char *mname, const char *rname, uint32_t serial, uint32_t refresh, uint32_t retry, uint32_t expire, uint32_t minimum) |
|
static ssize_t | dnshandle (dns_opt_t *opt, const uint8_t *inbuf, size_t insize, uint8_t *outbuf) |
|
int | dnsserver (dns_opt_t *opt) |
|
◆ BUFLEN
◆ dns_class
Enumerator |
---|
CLASS_IN | |
QCLASS_ANY | |
Definition at line 41 of file dns.cpp.
◆ dns_type
Enumerator |
---|
TYPE_A | |
TYPE_NS | |
TYPE_CNAME | |
TYPE_SOA | |
TYPE_MX | |
TYPE_AAAA | |
TYPE_SRV | |
QTYPE_ANY | |
Definition at line 46 of file dns.cpp.
◆ DNSResponseCode
Enumerator |
---|
OK | |
FORMAT_ERROR | |
SERVER_FAILURE | |
NAME_ERROR | |
NOT_IMPLEMENTED | |
REFUSED | |
Definition at line 57 of file dns.cpp.
◆ dnshandle()
◆ dnsserver()
◆ parse_name()
◆ write_name()
◆ write_record()
◆ write_record_a()
◆ write_record_aaaa()
◆ write_record_ns()
◆ write_record_soa()
static int write_record_soa |
( |
uint8_t ** |
outpos, |
|
|
const uint8_t * |
outend, |
|
|
const char * |
name, |
|
|
int |
offset, |
|
|
dns_class |
cls, |
|
|
int |
ttl, |
|
|
const char * |
mname, |
|
|
const char * |
rname, |
|
|
uint32_t |
serial, |
|
|
uint32_t |
refresh, |
|
|
uint32_t |
retry, |
|
|
uint32_t |
expire, |
|
|
uint32_t |
minimum |
|
) |
| |
|
static |
◆ listenSocket