Created
March 28, 2019 09:05
-
-
Save kaspar030/d1f8fc55748b28aee7091c9aa9cb2e36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit c75725c60c0c9a2f1e149cde76092368cd795cd3 | |
Author: Kaspar Schleiser <kaspar@schleiser.de> | |
Date: Thu Mar 28 10:02:36 2019 +0100 | |
net/sock/dns: move stuff from header to impl for c++ compatibility | |
diff --git a/sys/include/net/sock/dns.h b/sys/include/net/sock/dns.h | |
index a1b39a4439..97a59b136b 100644 | |
--- a/sys/include/net/sock/dns.h | |
+++ b/sys/include/net/sock/dns.h | |
@@ -33,33 +33,11 @@ | |
extern "C" { | |
#endif | |
-/** | |
- * @brief DNS internal structure | |
- */ | |
-typedef struct { | |
- uint16_t id; /**< read */ | |
- uint16_t flags; /**< DNS */ | |
- uint16_t qdcount; /**< RFC */ | |
- uint16_t ancount; /**< for */ | |
- uint16_t nscount; /**< detailed */ | |
- uint16_t arcount; /**< explanations */ | |
- uint8_t payload[]; /**< !! */ | |
-} sock_dns_hdr_t; | |
- | |
/** | |
* @name DNS defines | |
* @{ | |
*/ | |
-#define DNS_TYPE_A (1) | |
-#define DNS_TYPE_AAAA (28) | |
-#define DNS_CLASS_IN (1) | |
- | |
#define SOCK_DNS_PORT (53) | |
-#define SOCK_DNS_RETRIES (2) | |
- | |
-#define SOCK_DNS_MAX_NAME_LEN (64U) /* we're in embedded context. */ | |
-#define SOCK_DNS_QUERYBUF_LEN (sizeof(sock_dns_hdr_t) + 4 + SOCK_DNS_MAX_NAME_LEN) | |
-/** @} */ | |
/** | |
* @brief Get IP address for DNS name | |
diff --git a/sys/net/application_layer/dns/dns.c b/sys/net/application_layer/dns/dns.c | |
index cf82e10a83..8cd7ead764 100644 | |
--- a/sys/net/application_layer/dns/dns.c | |
+++ b/sys/net/application_layer/dns/dns.c | |
@@ -27,6 +27,33 @@ | |
#include "byteorder.h" | |
#endif | |
+/** | |
+ * @brief DNS internal structure | |
+ */ | |
+typedef struct { | |
+ uint16_t id; /**< read */ | |
+ uint16_t flags; /**< DNS */ | |
+ uint16_t qdcount; /**< RFC */ | |
+ uint16_t ancount; /**< for */ | |
+ uint16_t nscount; /**< detailed */ | |
+ uint16_t arcount; /**< explanations */ | |
+ uint8_t payload[]; /**< !! */ | |
+} sock_dns_hdr_t; | |
+ | |
+/** | |
+ * @name DNS defines | |
+ * @{ | |
+ */ | |
+#define DNS_TYPE_A (1) | |
+#define DNS_TYPE_AAAA (28) | |
+#define DNS_CLASS_IN (1) | |
+ | |
+#define SOCK_DNS_RETRIES (2) | |
+ | |
+#define SOCK_DNS_MAX_NAME_LEN (64U) /* we're in embedded context. */ | |
+#define SOCK_DNS_QUERYBUF_LEN (sizeof(sock_dns_hdr_t) + 4 + SOCK_DNS_MAX_NAME_LEN) | |
+/** @} */ | |
+ | |
/* min domain name length is 1, so minimum record length is 7 */ | |
#define DNS_MIN_REPLY_LEN (unsigned)(sizeof(sock_dns_hdr_t ) + 7) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment