diff options
author | defanor <defanor@uberspace.net> | 2020-11-14 15:23:22 +0300 |
---|---|---|
committer | defanor <defanor@uberspace.net> | 2020-11-14 17:19:55 +0300 |
commit | 37e8a87ea675b1708d854d39839ee02fcbb9f3aa (patch) | |
tree | f3d0fe29660d93327e6022f1c6cea9c3338c6154 /src/rexmpp_dns.h | |
parent | 3749774b44405f7cdafcd3bb13c7ecbcf34a2f26 (diff) |
Remove the c-ares dependency
Diffstat (limited to 'src/rexmpp_dns.h')
-rw-r--r-- | src/rexmpp_dns.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/rexmpp_dns.h b/src/rexmpp_dns.h new file mode 100644 index 0000000..f9c8b81 --- /dev/null +++ b/src/rexmpp_dns.h @@ -0,0 +1,31 @@ +/** + @file rexmpp_dns.h + @brief DNS helper functions + @author defanor <defanor@uberspace.net> + @date 2020 + @copyright MIT license. +*/ + + +#ifndef REXMPP_DNS_H +#define REXMPP_DNS_H + +#include <stdint.h> + +struct rexmpp_dns_srv { + uint16_t priority; + uint16_t weight; + uint16_t port; + char target[256]; +}; + +/** + @brief Parses an SRV DNS RR's RDATA. + @param[in] in SRV record's RDATA. + @param[in] in_len Length of the input data in octets. + @param[out] out A structure to fill with data. + @returns 0 on success, non-zero on parsing failure. +*/ +int rexmpp_parse_srv (char *in, int in_len, struct rexmpp_dns_srv *out); + +#endif |