Commit Graph

27 Commits

Author SHA1 Message Date
Andreas Kling
ddbe6bd7b4 Userland: Rename Core::Object to Core::EventReceiver
This is a more precise description of what this class actually does.
2023-08-06 20:39:51 +02:00
Ben Wiederhake
b4ad3f1b37 LookupServer: Prefer File::read_until_eof over DeprecatedFile 2023-05-19 23:31:20 +02:00
Tim Schumacher
d43a7eae54 LibCore: Rename File to DeprecatedFile
As usual, this removes many unused includes and moves used includes
further down the chain.
2023-02-13 00:50:07 +00:00
Sam Atkins
ba51e2dd3f Services: Replace uses of JsonObject::get_deprecated()/get_ptr() 2023-01-27 08:07:24 -05:00
Sam Atkins
1dd6b7f5b7 AK+Everywhere: Rename JsonObject::get() to ::get_deprecated()
This is a preparatory step to making `get()` return `ErrorOr`.
2023-01-17 19:52:52 -05:00
Tim Schumacher
87c64834ca LibDNS: Use AllocatingMemoryStream in DNS package construction 2023-01-13 18:41:05 -07:00
Alexander Narsudinov
ce2ed7615a LookupServer: Propagate the errors from MulticastDNS::handle_packet()
This is a bit awkward, but I think it is better to make the caller
deal with possible errors.
2022-12-20 10:45:20 +01:00
Alexander Narsudinov
e279a1723b LookupServer: Propagate the errors from MulticastDNS::lookup()
This patch slightly change the signature of lookup() method
and propagates all the errors to the caller with help of ErrorOr.
2022-12-20 10:45:20 +01:00
Alexander Narsudinov
767529ebf5 LibCore: Make UDPServer::receive() return ErrorOr<ByteBuffer>
This is a first step towards handling OOM errors instead of just
crashing the program.

Now UDPServer's method `receive()` return memory allocation
errors explicitly with help of ErrorOr.

This removes one FIXME and make a bunch of new ones. :(
2022-12-20 10:45:20 +01:00
Linus Groh
57dc179b1f Everywhere: Rename to_{string => deprecated_string}() where applicable
This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
2022-12-06 08:54:33 +01:00
Linus Groh
6e19ab2bbc AK+Everywhere: Rename String to DeprecatedString
We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
2022-12-06 08:54:33 +01:00
Liav A
35c98a031a Services: Use new global variables at /sys/kernel/ directory 2022-10-25 15:33:34 -06:00
sin-ack
3f3f45580a Everywhere: Add sv suffix to strings relying on StringView(char const*)
Each of these strings would previously rely on StringView's char const*
constructor overload, which would call __builtin_strlen on the string.
Since we now have operator ""sv, we can replace these with much simpler
versions. This opens the door to being able to remove
StringView(char const*).

No functional changes.
2022-07-12 23:11:35 +02:00
Timon Kruiper
2b82c83ceb LookupServer: Use _POSIX_HOST_NAME_MAX instead of HOST_NAME_MAX
HOST_NAME_MAX is not defined on the BSDs, including macOS. Use
_POSIX_HOST_NAME_MAX instead, which is defined on all the platforms.
2022-07-06 14:24:23 +02:00
Tom
49de4d5f33 LibDNS: Remove the 'DNS' prefix from the various type and class names
Since all types and class names live in the DNS namespace, we don't
need to spell it out twice each time.
2022-04-15 16:34:26 +01:00
Tom
be4a4144f2 LookupServer: Move DNS related code into new LibDNS library
This allows other code to use the DNSPacket class, e.g. when sent
over IPC.
2022-04-15 16:34:26 +01:00
Idan Horowitz
086969277e Everywhere: Run clang-format 2022-04-01 21:24:45 +01:00
sin-ack
0cca6cef95 LibCore+LookupServer: Implement and use UDPServer::send 2021-12-16 22:21:35 +03:30
Andreas Kling
587f9af960 AK: Make JSON parser return ErrorOr<JsonValue> (instead of Optional)
Also add slightly richer parse errors now that we can include a string
literal with returned errors.

This will allow us to use TRY() when working with JSON data.
2021-11-17 00:21:10 +01:00
Jean-Baptiste Boric
8e6241b78b LookupServer: Fix missing POSIX includes 2021-05-23 18:10:29 +02:00
Gunnar Beutner
53d0150827 AK+Userland: Remove nullability feature for the ByteBuffer type
Nobody seems to use this particular feature, in fact there were some
bugs which were uncovered by removing operator bool.
2021-05-16 17:49:42 +02:00
Ali Mohammad Pur
a91a49337c LibCore+Everywhere: Move OpenMode out of IODevice
...and make it an enum class so people don't omit "OpenMode".
2021-05-12 11:00:45 +01:00
Gunnar Beutner
3304d675e1 LookupServer: Correct some flags for DNS packets
This corrects some of the flags in the DNS packets to match
what I saw on my local network.
2021-05-10 17:26:17 +02:00
Gunnar Beutner
7b3bed7910 LookupServer: Turn #defines into enum classes and add formatter 2021-05-10 17:26:17 +02:00
Gunnar Beutner
6e70888315 LookupServer: Split mDNS flags into separate field 2021-05-10 17:26:17 +02:00
Andreas Kling
6024617df3 LookupServer: Remove some unnecessary "rc" temporaries 2021-05-06 13:37:46 +02:00
Sergey Bugaev
bb06e720de LookupServer: Implement basic mDNS support :^)
The implementation is extremely basic, and is far from fully conforming
to the spec. Among other things, it does not really work in case there
are multiple network adapters.

Nevertheless, it works quite well for the simple case! You can now do
this on your host machine:

$ ping courage.local

and same on your Serenity box:

$ ping host-machine-name.local
2021-05-05 21:16:17 +02:00