Commit graph

13 commits

Author SHA1 Message Date
Emily Trau
abc150085f LibC: Add missing sys/cdefs.h include
Some header files use __BEGIN_DECLS without including sys/cdefs.h.
This causes issues for C code that compiles against these headers,
which may occur with Ports.
2022-08-23 19:07:12 +01:00
Tim Schumacher
defe7b4ecc LibC: Add IN6_IS_ADDR_MULTICAST 2022-05-05 20:47:38 +02:00
Peter Ross
54fa06e85c LibC: Add IN_MULTICAST to in.h 2022-03-02 11:40:37 +01:00
Brian Gianforcaro
2b14a11238 LibC: Add IN6_IS_ADDR_LINKLOCAL to in.h
I tried the OpenSSH port but it failed to compile due to a missing
definition of this macro. It's simple enough to add, and it's addition
allowed OpenSSH to compile once again.

I also went ahead and added spec comments for these macros as well.
2022-02-03 14:57:16 +01:00
Tim Schumacher
3d3304332a LibC: Correctly evaluate addr in IN6_IS_ADDR_LOOPBACK
Without putting the argument in parentheses we might not evaluate it
correctly.
2021-11-06 00:31:01 -07:00
Kenneth Myhra
3b901e5b2b LibC: Spec compliant IN6_IS_ADDR_V4MAPPED
An IPv4 mapped IPv6 address consist of 80 "0" bits, followed by 16 "1"
bits, followed by the 32-bit IPv4 address.

Example of IPv4 mapped IPv6 address:
IPv4 address: 169.219.13.133
IPv6 address: 0000:0000:0000:0000:FFFF:A9DB:0D85
Simplified  : ::FFFF:A9DB:0D85
2021-09-20 15:26:46 +02:00
Kenneth Myhra
c7422dcef7 LibC: Declare IN6_IS_ADDR_V4MAPPED correctly
When using the IN6_IS_ADDR_V4MAPPED macro in Serenity's LibC it would
fail when compiling with the error message:
'invalid type argument of '->''.

This patch corrects the macro so that e.g. GLib port can compile again.
2021-09-19 15:53:43 +02:00
Peter Elliott
db92e66902 LibC: Make <netinet/in.h> more POSIX compliant
1. Move htonl() etc. from <arpa/inet.h> to <netinet/in.h> (which
   <arpa/inet.h> includes).

   The htonl(), htons(), ntohl(), and ntohs() functions shall be
   available as described in <arpa/inet.h>.  Inclusion of the
   <netinet/in.h> header may also make visible all symbols from
   <arpa/inet.h>.

   - POSIX

2. Define IN6_IS_ADDR_LOOPBACK() and IN6_IS_ADDR_V4MAPPED()
2021-08-22 10:29:06 +02:00
Andreas Kling
9dc1350177 Kernel+LibC: Share definitions for netinet/in.h 2021-08-14 19:58:11 +02:00
Gunnar Beutner
e4339be13b LibC: Add definitions/stubs for IPv6 functionality
This lets us build some of the ports without patching out any of their
IPv6 stuff.
2021-05-09 21:16:11 +02:00
Sergey Bugaev
78459b92d5 Kernel: Implement IP multicast support
An IP socket can now join a multicast group by using the
IP_ADD_MEMBERSHIP sockopt, which will cause it to start receiving
packets sent to the multicast address, even though this address does
not belong to this host.
2021-05-05 21:16:17 +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
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Renamed from Libraries/LibC/netinet/in.h (Browse further)