Commit graph

15 commits

Author SHA1 Message Date
Idan Horowitz
efb69508f4 LibC: Add the netinet/if_ether.h header and define ETH_ALEN
This header defines various constants related to ethernet packets,
with ETH_ALEN being the length of an ethernet address (which is needed
by some ports).
2021-12-22 00:02:36 -08: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
Thomas Wagenveld
8b61667924 LibC: Add definition for 'struct ip' in netinet/ip.h
The definition is equal to the one defined by the BSDs.
2021-08-03 09:06: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
Hendiadyoin1
f682c9f100 LibC: Add netinet/in_systm.h 2021-04-18 15:52:07 +02:00
William McPherson
2479ead718 Everywhere: Remove unnecessary clang-format offs
Mostly due to the fact that clang-format allows aligned comments via
AlignTrailingComments.

We could also use raw string literals in inline asm, which clang-format
deals with properly (and would be nicer in a lot of places).
2021-03-04 11:01:48 +01:00
Ben Wiederhake
b3f0a5c917 LibC: Fix typo in comment 2021-02-15 22:09:01 +01:00
Linus Groh
2b03e95354 LibC: Define ICMP header type constants in netinet/ip_icmp.h
Let's get rid of some magic numbers soon. :^)
2021-02-08 20:00:08 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00