Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: fusl/src/network/lookup.h

Issue 1573973002: Add a "fork" of musl as //fusl. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fusl/src/network/listen.c ('k') | fusl/src/network/lookup_ipliteral.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fusl/src/network/lookup.h
diff --git a/fusl/src/network/lookup.h b/fusl/src/network/lookup.h
new file mode 100644
index 0000000000000000000000000000000000000000..69419115b3f20ee37f80ffd2fa5a5f922c3f7e16
--- /dev/null
+++ b/fusl/src/network/lookup.h
@@ -0,0 +1,28 @@
+#ifndef LOOKUP_H
+#define LOOKUP_H
+
+#include <stdint.h>
+
+struct address {
+ int family;
+ unsigned scopeid;
+ uint8_t addr[16];
+ int sortkey;
+};
+
+struct service {
+ uint16_t port;
+ unsigned char proto, socktype;
+};
+
+/* The limit of 48 results is a non-sharp bound on the number of addresses
+ * that can fit in one 512-byte DNS packet full of v4 results and a second
+ * packet full of v6 results. Due to headers, the actual limit is lower. */
+#define MAXADDRS 48
+#define MAXSERVS 2
+
+int __lookup_serv(struct service buf[static MAXSERVS], const char *name, int proto, int socktype, int flags);
+int __lookup_name(struct address buf[static MAXADDRS], char canon[static 256], const char *name, int family, int flags);
+int __lookup_ipliteral(struct address buf[static 1], const char *name, int family);
+
+#endif
« no previous file with comments | « fusl/src/network/listen.c ('k') | fusl/src/network/lookup_ipliteral.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698