summaryrefslogtreecommitdiff
path: root/Libraries/LibC/netdb.cpp
AgeCommit message (Collapse)Author
2020-04-18LibC: getprotoent() family of functionsRead H
This commit implements the getprotoent() family of functions, including getprotoent() getprotobyname() getprotobynumber() setprotoent() endprotoent() This implementation is very similar to the getservent family of functions, which is what led to the discovery of a bug in the process of reading the aliases. The ByteBuffer for the alias strings didn't include a null terminating character, this was fixed for both the protoent and servent family of functions by appending a null character to the end of them before adding them to the alias lists.
2020-04-16LibC netdb: Requested ChangesRead H
fix all requested changes including: - remove explicit vector initialization - change keep_service_file_open to boolean - closing service file on seek error - change C level char allocation to use ByteBuffer instead - simplified getservby* loops to a single loop - change fill_getserv_buffers return to early-return style
2020-04-16LibC: Service entry APIRead H
This commit implements the getservent family of functions: getservent() setservent() endservent() getservbyname() getservbyport() for accessing the /etc/services file. This commit has addressed the issues identified by utilizing more C++ structures, addressing unchecked error possibilities, strncpy bounds checking, and other issues found in the initial pull request
2020-04-13LibC: Fix strncpy() overflow in gethostbyname()Andreas Kling
2020-02-20LibC: Add h_errno and stub out getservbyname()Andreas Kling
2020-01-26LibC: Only accept the first response from LookupServer in netdb codeAndreas Kling
If a DNS server responds with multiple answers for a question, we will get a newline-separated sequence of answers from LookupServer. However, we don't handle this properly yet in LibC, so just split the response by line and only care about the first answer for now.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2020-01-10LibC: Remove useless retry loop in connect_to_lookup_server()Andreas Kling
2020-01-09LibC: Fail name lookups immediately if we can't connect to LookupServerAndreas Kling
2019-12-09AK: Use size_t for the length of stringsAndreas Kling
Using int was a mistake. This patch changes String, StringImpl, StringView and StringBuilder to use size_t instead of int for lengths. Obviously a lot of code needs to change as a result of this.
2019-11-26LookupServer: Port to socket takeoverSergey Bugaev
2019-10-16LibC: Remove debug spam in gethostbyname()Andreas Kling
2019-09-06AK: Rename <AK/AKString.h> to <AK/String.h>Andreas Kling
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
2019-07-08LibC: Use IPv4Address::from_string() in gethostbyname().Andreas Kling
2019-07-04Libraries: Create top level directory for libraries.Andreas Kling
Things were getting a little crowded in the project root, so this patch moves the Lib*/ directories into Libraries/.