]> Git Repo - uclibc-ng.git/commitdiff
make __{en,de}code_dotted into macros
authormirabilos <[email protected]>
Mon, 9 Aug 2021 01:36:58 +0000 (03:36 +0200)
committermirabilos <[email protected]>
Mon, 9 Aug 2021 01:36:58 +0000 (03:36 +0200)
they merely call dn_{comp,expand} slightly rearranging the arguments

Signed-off-by: mirabilos <[email protected]>
libc/inet/Makefile.in
libc/inet/decoded.c [deleted file]
libc/inet/encoded.c [deleted file]
libc/inet/resolv.c

index 91c417cc2b0fdc799a5211543d61c0291fe09956..5e43f230381bc209ed234144bdf79d12f267bf7f 100644 (file)
@@ -26,7 +26,7 @@ CSRC-$(V4_OR_V6) += \
        inet_lnaof.c inet_netof.c
 # multi source resolv.c
 CSRC-$(V4_OR_V6) += \
-       encodeh.c decodeh.c encoded.c decoded.c \
+       encodeh.c decodeh.c \
        encodeq.c encodea.c \
        read_etc_hosts_r.c \
        dnslookup.c opennameservers.c closenameservers.c \
diff --git a/libc/inet/decoded.c b/libc/inet/decoded.c
deleted file mode 100644 (file)
index 378cbfa..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright (C) 2000-2006 Erik Andersen <[email protected]>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#define L_decoded
-#include RESOLVER
diff --git a/libc/inet/encoded.c b/libc/inet/encoded.c
deleted file mode 100644 (file)
index 27f92be..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-/*
- * Copyright (C) 2000-2006 Erik Andersen <[email protected]>
- *
- * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
- */
-
-#define L_encoded
-#include RESOLVER
index f02781b0b46280ba0b0f597837029fe1044b05e6..ced3b6542fe3cd8d9279d68610147896c8fe15df 100644 (file)
@@ -396,14 +396,6 @@ extern int __dns_lookup(const char *name,
                int type,
                unsigned char **outpacket,
                struct resolv_answer *a) attribute_hidden;
-extern int __encode_dotted(const char *dotted,
-               unsigned char *dest,
-               int maxlen) attribute_hidden;
-extern int __decode_dotted(const unsigned char *packet,
-               int offset,
-               int packet_len,
-               char *dest,
-               int dest_len) attribute_hidden;
 extern int __encode_header(struct resolv_header *h,
                unsigned char *dest,
                int maxlen) attribute_hidden;
@@ -418,6 +410,12 @@ extern int __encode_answer(struct resolv_answer *a,
 extern void __open_nameservers(void) attribute_hidden;
 extern void __close_nameservers(void) attribute_hidden;
 
+#define __encode_dotted(dotted,dest,maxlen) \
+       dn_comp((dotted), (dest), (maxlen), NULL, NULL)
+#define __decode_dotted(packet,offset,packet_len,dest,dest_len) \
+       dn_expand((packet), (packet) + (packet_len), (packet) + (offset), \
+           (dest), (dest_len))
+
 /*
  * Theory of operation.
  *
@@ -553,33 +551,6 @@ void __decode_header(unsigned char *data,
 #endif /* L_decodeh */
 
 
-#ifdef L_encoded
-
-/* Encode a dotted string into nameserver transport-level encoding.
-   This routine is fairly dumb, and doesn't attempt to compress
-   the data */
-int __encode_dotted(const char *dotted, unsigned char *dest, int maxlen)
-{
-       return (dn_comp(dotted, dest, maxlen, NULL, NULL));
-}
-#endif /* L_encoded */
-
-
-#ifdef L_decoded
-
-/* Decode a dotted string from nameserver transport-level encoding.
-   This routine understands compressed data. */
-int __decode_dotted(const unsigned char *packet,
-               int offset,
-               int packet_len,
-               char *dest,
-               int dest_len)
-{
-       return (dn_expand(packet, packet + packet_len, packet + offset, dest, dest_len));
-}
-#endif /* L_decoded */
-
-
 #ifdef L_encodeq
 
 int __encode_question(const struct resolv_question *q,
This page took 0.030669 seconds and 4 git commands to generate.