Commit Graph

13 Commits

Author SHA1 Message Date
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
dayarthvader
5a94402b60 Utilities/nc: Add support to -I/--length option like SO_RCVBUF 2022-02-18 10:43:10 +01:00
brapru
b04528c0de nc: Extend TCP listening port functionality
Previously the nc implementation during listening mode would only accept
a single client and close the listening file description immediately.
Additionally, it did not have support for read/write handling of the
accepted client.

This patch extends the functionality of nc's listening capability by
allowing multiple client connections over TCP. Clients/server are able
to pass data back and forth between the connection.

Being able to listen on sockets and accept connections is helpful for
debugging the networking stack.
2022-02-14 11:47:14 +01:00
sin-ack
11a2e31306 nc: Convert to Core::Stream::UDPSocket 2022-02-14 11:44:09 +01:00
Kenneth Myhra
294cbb7108 nc: Port to LibMain 2022-01-15 22:01:07 +01:00
Ali Mohammad Pur
97e97bccab Everywhere: Make ByteBuffer::{create_*,copy}() OOM-safe 2021-09-06 01:53:26 +02:00
Tim Schumacher
d7797c8bf8 Userland: Treat inet_pton returning 0 as an error
The POSIX man-page states that inet_pton returns 0 if the input is not a
valid IPv4 dotted-decimal string or a valid IPv6 address string. This is
also how it is implemented in SerenityOS.

This means that we should treat a return value of 0 as an error to avoid
using an invalid address (or 0.0.0.0).
2021-05-27 22:56:21 +02:00
Brian Gianforcaro
6ebec090c3 Userland: Allow nc to connect by hostname instead of just address
Allow the user to pass in a hostname to the connect functionality
instead of just an ip address. The call to gethostbyname(..) handles
both seamlessly for us.

Update the argument name / usage message accordingly.
2021-05-23 09:19:16 +02:00
Brian Gianforcaro
1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Spencer Dixon
1206e9803f Userland: Add support for sending UDP to netcat. 2021-04-20 14:15:35 +02:00
Brian Gianforcaro
3019445492 Userland: Use uniform initialization instead of memset 2021-02-21 11:52:47 +01:00
Linus Groh
1fd349b8c2 Userland: Use INET_ADDRSTRLEN for inet_ntop() buffers
There's no point in using different, seemingly randomly sized buffers as
the required size for storing an IPv4 address representation is well
known (16 bytes).
2021-02-09 22:58:19 +01:00
Andreas Kling
ececac65c2 Userland: Move command-line utilities to Userland/Utilities/ 2021-01-12 12:04:09 +01:00