summaryrefslogtreecommitdiff
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2011-07-13 00:30:50 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2011-08-26 09:29:53 +0200
commit05ff11da8f47e95e16c2d6db93fd6273dc35445e (patch)
tree87b1947139e34915e7f6eac65136df0832e146e8 /libc/inet/resolv.c
parente5153a77782bf7042f50b97959536f3f181bad99 (diff)
inet/resolv: Add dn_comp
Signed-off-by: Daniel Mack <zonque@gmail.com>
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 64e99baa5..a74ab30af 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -2659,6 +2659,20 @@ int dn_expand(const u_char *msg, const u_char *eom, const u_char *src,
dst[0] = '\0';
return n;
}
+
+/*
+ * Pack domain name 'exp_dn' in presentation form into 'comp_dn'.
+ * Return the size of the compressed name or -1.
+ * 'length' is the size of the array pointed to by 'comp_dn'.
+ */
+int
+dn_comp(const char *src, u_char *dst, int dstsiz,
+ u_char **dnptrs, u_char **lastdnptr)
+{
+ return ns_name_compress(src, dst, (size_t) dstsiz,
+ (const u_char **) dnptrs,
+ (const u_char **) lastdnptr);
+}
#endif /* L_res_comp */
@@ -3823,4 +3837,3 @@ void ns_put32(unsigned long src, unsigned char *dst)
/* Unimplemented: */
/* res_mkquery */
/* res_send */
-/* dn_comp */