summaryrefslogtreecommitdiff
path: root/include/net6.h
AgeCommit message (Collapse)Author
2025-05-29net: Include byteorder in net6.hSimon Glass
This file uses byteorder but does not include the header file. Update it. Signed-off-by: Simon Glass <[email protected]>
2025-04-23net: dhcp6: Send DHCPv6 using multicast MACSean Edmond
In IPv6, the broadcast MAC address is not used. Instead, it should use the multicast address (see RFC RFC2464). Add IPV6_ALL_NODE_ETH_ADDR macro for clarity. Signed-off-by: Sean Edmond <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
2023-12-21include: Further cleanup includesTom Rini
Add some missing headers such as <linux/errno.h> or <linux/types.h> or <linux/kernel.h> to header files that make direct usage of things provided by these headers. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2023-07-27net: ipv6: network protocol structures should be packedEhsan Mohandesi
The structure icmp6_ra_prefix_info needs to be packed because it is read from a network stream. Signed-off-by: Ehsan Mohandesi <[email protected]> Reviewed-by: Viacheslav Mitrofanov <[email protected]> Reviewed-by: Ramon Fried <[email protected]>
2023-05-05net: ipv6: Add support for default gateway discovery.Ehsan Mohandesi
In IPv6, the default gateway and prefix length are determined by receiving a router advertisement as defined in - https://www.rfc-editor.org/rfc/rfc4861. Add support for sending router solicitation (RS) and processing router advertisements (RA). If the RA has prefix info option and following conditions are met, then gatewayip6 and net_prefix_length of ip6addr env variables are initialized. These are later consumed by IPv6 code for non-local destination IP. - "Router Lifetime" != 0 - Prefix is NOT link-local prefix (0xfe80::/10) - L flag is 1 - "Valid Lifetime" != 0 Timing Parameters: - MAX_RTR_SOLICITATION_DELAY (0-1s) - RTR_SOLICITATION_INTERVAL (4s) (min retransmit delay) - MAX_RTR_SOLICITATIONS (3 RS transmissions) The functionality is enabled by CONFIG_IPV6_ROUTER_DISCOVERY and invoked automatically from net_init_loop(). Signed-off-by: Ehsan Mohandesi <[email protected]> Tested-by: Viacheslav Mitrofanov <[email protected]>Reviewed-by: Tested-by: Viacheslav Mitrofanov <[email protected]> Reviewed-by: Viacheslav Mitrofanov <[email protected]> Tested-by: Sergei Antonov <[email protected]> Reviewed-by: Sergei Antonov <[email protected]>
2023-02-02net: ipv6: fix alignment errors on ARMSergei Antonov
Commands "ping6" and "tftpboot ... -ipv6" did not work on ARM because machine code expects 4-byte alignment and some structures from net6.h are not aligned in memory. Fix by adding __packed, since it is already used in this file. Signed-off-by: Sergei Antonov <[email protected]> Reviewed-by: Viacheslav Mitrofanov <[email protected]>
2022-12-05net: ping6: Add ping6 commandViacheslav Mitrofanov
Implement ping6 command to ping hosts using IPv6. It works the same way as an ordinary ping command. There is no ICMP request so it is not possible to ping our host. This patch adds options in Kconfig and Makefile to build ping6 command. Series-changes: 3 - Added structures and functions descriptions - Added to ping6_receive() return value instead of void Series-changes: 4 - Fixed structures and functions description style Signed-off-by: Viacheslav Mitrofanov <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-12-05net: ipv6: Add implementation of main IPv6 functionsViacheslav Mitrofanov
Functions that were exposed in "net: ipv6: Add IPv6 basic primitives" had only empty implementations and were exposed as API for futher patches. This patch add implementation of these functions. Main functions are: net_ip6_handler() - IPv6 packet handler for incoming packets; net_send_udp_packet6() - make up and send an UDP packet; csum_ipv6_magic() - compute checksum of IPv6 "psuedo-header" per RFC2460 section 8.1; ip6_addr_in_subnet() - check if an address is in our subnet. Other functions are auxiliary. Series-changes: 3 - Added comments - Fixed style problems - Fixed return codes instead of -1 Signed-off-by: Viacheslav Mitrofanov <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-12-05net: ipv6: Add string_to_ip6 converterViacheslav Mitrofanov
This functions is used as a converter from IPv6 address string notation to struct ip6_addr that is used everywhere in IPv6 implementation. For example it is used to parse and convert IPv6 address from tftpboot command. Conversion algorithm uses two passes, first to verify syntax and locate colons and second pass to read the address. In case of valid IPv6 address it returns 0. Examples of valid strings: 2001:db8::0:1234:1 2001:0db8:0000:0000:0000:0000:1234:0001 ::1 ::ffff:192.168.1.1 Examples of invalid strings 2001:db8::0::0 (:: can only appear once) 2001:db8:192.168.1.1::1 (v4 part can only appear at the end) 192.168.1.1 (we don't implicity map v4) Series-changes: 3 - Added function description - Added length parameter to string_to_ip6() Series-changes: 4 - Fixed function description style Signed-off-by: Viacheslav Mitrofanov <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]>
2022-12-05net: ipv6: Add IPv6 basic primitivesViacheslav Mitrofanov
This patch is a collection of basic primitives that are prerequisite for further IPv6 implementation. There are structures definition such as IPv6 header, UDP header (for TFTP), ICMPv6 header. There are auxiliary defines such as protocol codes, padding, struct size and etc. Also here are functions prototypes and its empty implementation that will be used as API for further patches. Here are variables declaration such as IPv6 address of our host, gateway, ipv6 server. Series-changes: 3 - Added functions and structures descriptions - Removed enums ND_OPT_*. It will be moved into further patches - Substituted -1 for error codes Series-changes: 4 - Changed functions and structures description style Signed-off-by: Viacheslav Mitrofanov <[email protected]> Reviewed-by: Ramon Fried <[email protected]> Reviewed-by: Simon Glass <[email protected]>