Changeset View
Changeset View
Standalone View
Standalone View
src/seeder/dns.h
Show All 28 Lines | struct dns_opt_t { | ||||
const char *ns; | const char *ns; | ||||
const char *mbox; | const char *mbox; | ||||
uint32_t (*cb)(void *opt, char *requested_hostname, addr_t *addr, | uint32_t (*cb)(void *opt, char *requested_hostname, addr_t *addr, | ||||
uint32_t max, uint32_t ipv4, uint32_t ipv6); | uint32_t max, uint32_t ipv4, uint32_t ipv6); | ||||
// stats | // stats | ||||
uint64_t nRequests; | uint64_t nRequests; | ||||
}; | }; | ||||
// 0: ok | enum class ParseNameStatus { | ||||
// -1: premature end of input, forward reference, label > MAX_LABEL_LENGTH, | OK, | ||||
// invalid character | // Premature end of input, forward reference, component > 63 char, invalid | ||||
// -2: insufficient space in output | // character | ||||
int parse_name(const uint8_t **inpos, const uint8_t *inend, | InputError, | ||||
// Insufficient space in output | |||||
OutputBufferError, | |||||
}; | |||||
ParseNameStatus parse_name(const uint8_t **inpos, const uint8_t *inend, | |||||
const uint8_t *inbuf, char *buf, size_t bufsize); | const uint8_t *inbuf, char *buf, size_t bufsize); | ||||
int dnsserver(dns_opt_t *opt); | int dnsserver(dns_opt_t *opt); | ||||
#endif // BITCOIN_SEEDER_DNS_H | #endif // BITCOIN_SEEDER_DNS_H |