diff --git a/libc/dns/ent.h b/libc/dns/ent.h index b37ab46fe..930ce0f31 100644 --- a/libc/dns/ent.h +++ b/libc/dns/ent.h @@ -7,6 +7,19 @@ COSMOPOLITAN_C_START_ extern int h_errno; +struct netent { + char *n_name; /* official network name */ + char **n_aliases; /* alias list */ + int n_addrtype; /* net address type */ + uint32_t n_net; /* network number */ +}; + +struct protoent { + char *p_name; /* official protocol name */ + char **p_aliases; /* alias list */ + int p_proto; /* protocol number */ +}; + struct hostent { char *h_name; /* official name of host */ char **h_aliases; /* alias list */ @@ -23,6 +36,18 @@ struct servent { char *s_proto; /* protocol to use */ }; +struct netent *getnetent(void); +struct netent *getnetbyname(const char *); +struct netent *getnetbyaddr(uint32_t, int); +void setnetent(int); +void endnetent(void); + +struct protoent *getprotoent(void); +struct protoent *getprotobyname(const char *); +struct protoent *getprotobynumber(int); +void setprotoent(int); +void endprotoent(void); + struct hostent *gethostent(void); struct hostent *gethostbyname(const char *); struct hostent *gethostbyaddr(const void *, socklen_t, int); diff --git a/libc/dns/netent.c b/libc/dns/netent.c new file mode 100644 index 000000000..abca500f0 --- /dev/null +++ b/libc/dns/netent.c @@ -0,0 +1,46 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ This is free and unencumbered software released into the public domain. │ +│ │ +│ Anyone is free to copy, modify, publish, use, compile, sell, or │ +│ distribute this software, either in source code form or as a compiled │ +│ binary, for any purpose, commercial or non-commercial, and by any │ +│ means. │ +│ │ +│ In jurisdictions that recognize copyright laws, the author or authors │ +│ of this software dedicate any and all copyright interest in the │ +│ software to the public domain. We make this dedication for the benefit │ +│ of the public at large and to the detriment of our heirs and │ +│ successors. We intend this dedication to be an overt act of │ +│ relinquishment in perpetuity of all present and future rights to this │ +│ software under copyright law. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ +│ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ +│ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ +│ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ +│ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ +│ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ +│ OTHER DEALINGS IN THE SOFTWARE. │ +│ │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/dns/ent.h" + +struct netent *getnetent(void) { + return NULL; +} + +struct netent *getnetbyname(const char *name) { + return NULL; +} + +struct netent *getnetbyaddr(uint32_t net, int type) { + return NULL; +} + +void setnetent(int stayopen) { +} + +void endnetent(void) { +} diff --git a/libc/dns/protoent.c b/libc/dns/protoent.c new file mode 100644 index 000000000..0e0e6936a --- /dev/null +++ b/libc/dns/protoent.c @@ -0,0 +1,46 @@ +/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│ +│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│ +╞══════════════════════════════════════════════════════════════════════════════╡ +│ This is free and unencumbered software released into the public domain. │ +│ │ +│ Anyone is free to copy, modify, publish, use, compile, sell, or │ +│ distribute this software, either in source code form or as a compiled │ +│ binary, for any purpose, commercial or non-commercial, and by any │ +│ means. │ +│ │ +│ In jurisdictions that recognize copyright laws, the author or authors │ +│ of this software dedicate any and all copyright interest in the │ +│ software to the public domain. We make this dedication for the benefit │ +│ of the public at large and to the detriment of our heirs and │ +│ successors. We intend this dedication to be an overt act of │ +│ relinquishment in perpetuity of all present and future rights to this │ +│ software under copyright law. │ +│ │ +│ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, │ +│ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF │ +│ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. │ +│ IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR │ +│ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, │ +│ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR │ +│ OTHER DEALINGS IN THE SOFTWARE. │ +│ │ +╚─────────────────────────────────────────────────────────────────────────────*/ +#include "libc/dns/ent.h" + +struct protoent *getprotoent(void) { + return NULL; +} + +struct protoent *getprotobyname(const char *name) { + return NULL; +} + +struct protoent *getprotobynumber(int proto) { + return NULL; +} + +void setprotoent(int stayopen) { +} + +void endprotoent(void) { +}