cosmopolitan/libc/dns
Gautham e99a4dcc8c
Add protoent and netent (#209)
The implementations of the getproto* functions follow from the getserv*
functions: same static name allocation, same type of internal function
that opens a file to search, aliases are not written to the struct, same
type of error handling/returns.

This changes also fixes a getaddrinfo AI_PASSIVE memory error. When
getaddrinfo is passed name = NULL and AI_PASSIVE in hints->ai_flags, it was
setting the s_addr value to INADDR_ANY but *not* returning the addrinfo
pointer via *res = ai. This caused a free(NULL) memory error when the caller
tried to free res, because the caller expects res to be a valid pointer to a
struct addrinfo.

Our non-standard API parseport() has been updated to use strtoimax.
strtoimax has an extra parameter endptr to store where the parsing was
terminated. endptr is used in parseport to check if the provided string
was valid.
2021-07-10 12:36:35 -07:00
..
comparednsnames.c Make minor improvements 2021-05-15 21:53:26 -07:00
consts.h Merge HTTP request / response parsing code 2021-06-27 17:04:32 -07:00
dns.h Added getnameinfo with only name lookup (#172) 2021-06-09 19:35:44 -07:00
dns.mk Fix link order in cosmopolitan.a 2021-01-16 12:05:41 -08:00
dns.png Initial import 2020-06-15 07:18:57 -07:00
dnsheader.c Make minor improvements 2021-05-15 21:53:26 -07:00
dnsheader.h Make minor improvements 2021-05-15 21:53:26 -07:00
dnsquestion.h Make minor improvements 2021-05-15 21:53:26 -07:00
ent.h Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
freeaddrinfo.c Make minor improvements 2021-05-15 21:53:26 -07:00
freehoststxt.c Make minor improvements 2021-05-15 21:53:26 -07:00
freeresolvconf.c Make minor improvements 2021-05-15 21:53:26 -07:00
gai_strerror.c Rename eai2str to gai_strerror (#131) 2021-03-20 20:48:40 -07:00
getaddrinfo.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
gethostbyaddr.c Improve getservbyname and getservbyport (#207) 2021-07-05 12:25:26 -07:00
gethostbyname.c Add getservbyname and getservbyport (#204) 2021-07-04 16:31:42 -07:00
gethoststxt.c Add SSL to redbean 2021-06-24 13:20:50 -07:00
getnameinfo.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
getntnameservers.c Make minor improvements 2021-05-15 21:53:26 -07:00
getprotobyname.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
getprotobynumber.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
getresolvconf.c Make minor improvements 2021-05-15 21:53:26 -07:00
getservbyname.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
getservbyport.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
herror.c Add gethostbyname and gethostbyaddr (#200) 2021-07-01 07:55:11 -07:00
hostent.c Add gethostbyname and gethostbyaddr (#200) 2021-07-01 07:55:11 -07:00
hoststxt.h Add SSL to redbean 2021-06-24 13:20:50 -07:00
netent.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
newaddrinfo.c Remove more nonstandard stuff from cosmopolitan.h 2021-03-01 00:18:23 -08:00
parsehoststxt.c Make minor improvements 2021-05-15 21:53:26 -07:00
parseresolvconf.c Make minor improvements 2021-05-15 21:53:26 -07:00
pascalifydnsname.c Make minor improvements 2021-05-15 21:53:26 -07:00
protoent.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
prototxt.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
prototxt.h Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
resolvconf.h Make minor improvements 2021-05-15 21:53:26 -07:00
resolvedns.c Merge HTTP request / response parsing code 2021-06-27 17:04:32 -07:00
resolvednsreverse.c Add SSL to redbean 2021-06-24 13:20:50 -07:00
resolvehostsreverse.c Add test for ioctl(SIOCGIFCONF) and polyfill on BSDs 2021-06-25 18:44:04 -07:00
resolvehoststxt.c Add SSL to redbean 2021-06-24 13:20:50 -07:00
rfc0226.txt Initial import 2020-06-15 07:18:57 -07:00
rfc0247.txt Initial import 2020-06-15 07:18:57 -07:00
rfc1035.txt Initial import 2020-06-15 07:18:57 -07:00
serializednsquestion.c Make minor improvements 2021-05-15 21:53:26 -07:00
servent.c Add getservbyname and getservbyport (#204) 2021-07-04 16:31:42 -07:00
servicestxt.c Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00
servicestxt.h Add protoent and netent (#209) 2021-07-10 12:36:35 -07:00