164 uint32_t expire, uint32_t minimum, uint32_t refresh, uint32_t retry, uint32_t serial);
174 uint32_t expire, uint32_t minimum, uint32_t refresh, uint32_t retry, uint32_t serial);
182 uint32_t expire, uint32_t minimum, uint32_t refresh, uint32_t retry, uint32_t serial);
287 uint16_t priority, uint16_t weight, uint16_t port,
char * target);
295 uint16_t priority, uint16_t weight, uint16_t port,
char * target);
303 uint16_t priority, uint16_t weight, uint16_t port,
char * target);
325 char * os, uint8_t os_len,
char * cpu, uint8_t cpu_len);
334 char * os, uint8_t os_len,
char * cpu, uint8_t cpu_len);
343 char * os, uint8_t os_len,
char * cpu, uint8_t cpu_len);
int sdns_add_cookie(sdns_context *dns, char *client_cookie, char *server_cookie)
Adds cookie to DNS packet.
int sdns_add_rr_additional_CNAME(sdns_context *dns, char *name, uint32_t ttl, char *cname)
int sdns_add_rr_authority_MX(sdns_context *dns, char *name, uint32_t ttl, uint16_t preference, char *exchange)
Adds MX record to the authority section of the DNS.
int sdns_add_rr_answer_MX(sdns_context *dns, char *name, uint32_t ttl, uint16_t preference, char *exchange)
Adds a MX record to the answer section of the DNS context.
int sdns_add_rr_answer_HINFO(sdns_context *dns, char *name, uint32_t ttl, char *os, uint8_t os_len, char *cpu, uint8_t cpu_len)
Adds a HINFO record to the answer section of the DNS context.
sdns_rr * sdns_get_authority(sdns_context *dns, int *err, uint16_t num)
Returns the authority section of the DNS context.
int sdns_add_rr_additional_PTR(sdns_context *dns, char *name, uint32_t ttl, char *ptrdname)
Adds PTR record to the additional section of the DNS.
int sdns_add_rr_additional_CAA(sdns_context *dns, char *name, uint32_t ttl, uint8_t flag, char *tag, char *value)
Adds CAA record to the asnwer section of the DNS context.
int sdns_add_rr_answer_TXT(sdns_context *dns, char *name, uint32_t ttl, char *text, uint16_t text_len)
Adds a new TXT record to the DNS packet in answer section.
char * sdns_to_network(sdns_context *dns, int *err, uint16_t *buff_len)
Converts the dns packet to the binary form ready to be sent by the socket.
int sdns_add_rr_additional_SRV(sdns_context *dns, char *name, uint32_t ttl, uint16_t priority, uint16_t weight, uint16_t port, char *target)
Add a SRV record to the additional section of the DNS packet.
sdns_context * sdns_create_query(char *name, char *type, char *cls)
Creates a dns context with the given query and ends0 enabled.
int sdns_set_cd(sdns_context *dns, uint8_t cd_bit)
Sets or resets the check disabled bit of the DNS header.
int sdns_add_rr_answer_CNAME(sdns_context *dns, char *name, uint32_t ttl, char *cname)
Adds a CNAME record to the answer section of the DNS context.
int sdns_add_rr_additional_AAAA(sdns_context *dns, char *name, uint32_t ttl, const char *ipv6)
Adds AAAA record to the additional section of the DNS.
int sdns_set_tc(sdns_context *dns, uint8_t tc_bit)
Sets or resets the truncation bit of the DNS header.
int sdns_add_rr_authority_A(sdns_context *dns, char *name, uint32_t ttl, char *ip)
Adds A record to the authority section of the DNS packet.
int sdns_add_rr_authority_AAAA(sdns_context *dns, char *name, uint32_t ttl, const char *ipv6)
Adds AAAA record to the authority section of the DNS.
int sdns_set_rd(sdns_context *dns, uint8_t rd_bit)
Sets or resets the recursion desired bit of the DNS header.
int sdns_set_aa(sdns_context *dns, uint8_t aa_bit)
Sets or resets the athoritative answer bit of the DNS header.
int sdns_add_rr_additional_TXT(sdns_context *dns, char *name, uint32_t ttl, char *text, uint16_t text_len)
Adds TXT record to the additional section of the DNS.
int sdns_set_qr(sdns_context *dns, uint8_t qr_bit)
Sets or resets the query-response bit of the DNS header.
int sdns_add_rr_authority_NS(sdns_context *dns, char *name, uint32_t ttl, char *nsname)
Adds NS record to the authority section of the DNS packet.
sdns_question * sdns_get_question(sdns_context *dns)
Returns a copy of the question section of the DNS context.
char * sdns_get_value_nsid(sdns_context *dns, int *err, uint16_t *nsid_len)
Get NSID value from the DNS context.
int sdns_add_rr_answer_AAAA(sdns_context *dns, char *name, uint32_t ttl, const char *ipv6)
Adds AAAA record to the asnwer section of the DNS context.
int sdns_add_rr_additional_A(sdns_context *dns, char *name, uint32_t ttl, char *ip)
Adds A record to the additional section of the DNS packet.
char * sdns_get_value_cookie_client(sdns_context *dns, int *err)
Returns the client cookie of the packet (if there is any)
int sdns_add_ede(sdns_context *dns, uint16_t ede_code, char *ede_text)
Add extended DNS error to the packet.
int sdns_add_rr_additional_SOA(sdns_context *dns, char *name, uint32_t ttl, char *mname, char *rname, uint32_t expire, uint32_t minimum, uint32_t refresh, uint32_t retry, uint32_t serial)
Adds SOA record to the additional section of the DNS record.
int sdns_add_rr_additional_NS(sdns_context *dns, char *name, uint32_t ttl, char *nsname)
Adds NS record to the additional section of the DNS.
int sdns_add_rr_answer_SRV(sdns_context *dns, char *name, uint32_t ttl, uint16_t priority, uint16_t weight, uint16_t port, char *target)
Adds a SRV record to the answer section of the DNS context.
int sdns_remove_edns(sdns_context *dns)
Revemos EDNS0 option from a DNS context.
int sdns_add_rr_additional_NID(sdns_context *dns, char *name, uint32_t ttl, uint16_t preference, char *nodeid)
Adds NID record to the asnwer section of the DNS context.
int sdns_add_rr_authority_CAA(sdns_context *dns, char *name, uint32_t ttl, uint8_t flag, char *tag, char *value)
Adds CAA record to the asnwer section of the DNS context.
int sdns_set_rcode(sdns_context *dns, uint8_t rcode)
Sets the rcode of the DNS context.
int sdns_add_rr_answer_SOA(sdns_context *dns, char *name, uint32_t ttl, char *mname, char *rname, uint32_t expire, uint32_t minimum, uint32_t refresh, uint32_t retry, uint32_t serial)
Adds a new SOA record to the DNS packet in answer section.
int sdns_add_rr_authority_SOA(sdns_context *dns, char *name, uint32_t ttl, char *mname, char *rname, uint32_t expire, uint32_t minimum, uint32_t refresh, uint32_t retry, uint32_t serial)
Adds SOA record to the authority section of the DNS.
int sdns_add_rr_authority_PTR(sdns_context *dns, char *name, uint32_t ttl, char *ptrdname)
Adds PTR record to the authority section of the DNS.
int sdns_add_nsid(sdns_context *dns, char *nsid)
Adds NSID to the DNS packet.
int sdns_add_rr_authority_NID(sdns_context *dns, char *name, uint32_t ttl, uint16_t preference, char *nodeid)
Adds NID record to the asnwer section of the DNS context.
int sdns_add_rr_authority_HINFO(sdns_context *dns, char *name, uint32_t ttl, char *os, uint8_t os_len, char *cpu, uint8_t cpu_len)
Add a HINFO record to the authority section of the DNS packet.
int sdns_add_rr_answer_CAA(sdns_context *dns, char *name, uint32_t ttl, uint8_t flag, char *tag, char *value)
Adds CAA record to the asnwer section of the DNS context.
int sdns_add_rr_additional_HINFO(sdns_context *dns, char *name, uint32_t ttl, char *os, uint8_t os_len, char *cpu, uint8_t cpu_len)
Add a HINFO record to the additional section of the DNS packet.
int sdns_add_rr_authority_TXT(sdns_context *dns, char *name, uint32_t ttl, char *text, uint16_t text_len)
Adds TXT record to the authority section of the DNS packet.
sdns_rr * sdns_get_additional(sdns_context *dns, int *err, uint16_t num)
Returns the additional section of the DNS context.
int sdns_add_rr_answer_NS(sdns_context *dns, char *name, uint32_t ttl, char *nsname)
Adds a NS record to the dns context in the answer section.
int sdns_add_rr_additional_MX(sdns_context *dns, char *name, uint32_t ttl, uint16_t preference, char *exchange)
Adds MX record to the additional section of the DNS.
int sdns_set_do(sdns_context *dns, uint8_t do_bit)
Sets or resets DNSSEC OK bit in EDNS0 part of the DNS packet.
int sdns_set_ra(sdns_context *dns, uint8_t ra_bit)
Sets or resets the recursion available bit of the DNS header.
int sdns_add_rr_authority_CNAME(sdns_context *dns, char *name, uint32_t ttl, char *cname)
Adds CNAME record to the authority section of the DNS record.
sdns_context * sdns_create_response_from_query(sdns_context *query)
Creates a response DNS context from the query packet.
int sdns_add_rr_answer_A(sdns_context *dns, char *name, uint32_t ttl, char *ip)
Adds an A record to the dns context in the answer section.
sdns_context * sdns_from_network(char *buff, uint16_t buff_len)
Converts the received binary data from the socket to a DNS packet.
int sdns_add_rr_answer_PTR(sdns_context *dns, char *name, uint32_t ttl, char *ptrdname)
Adds a PTR record to the answer section of the DNS context.
int sdns_add_rr_answer_NID(sdns_context *dns, char *name, uint32_t ttl, uint16_t preference, char *nodeid)
Adds NID record to the asnwer section of the DNS context.
int sdns_set_id(sdns_context *dns, uint16_t dns_id)
Sets the ID of the DNS header.
int sdns_add_rr_authority_SRV(sdns_context *dns, char *name, uint32_t ttl, uint16_t priority, uint16_t weight, uint16_t port, char *target)
Adds a SRV record to the authority section of the DNS packet.
sdns_rr * sdns_get_answer(sdns_context *dns, int *err, uint16_t num)
Returns the answer section of the dns context.