summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/in.h
Commit message (Collapse)AuthorAgeFilesLines
* [ipv6] Allow for multiple routersMichael Brown2016-07-251-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Select the IPv6 source address and corresponding router (if any) using a very simplified version of the algorithm from RFC6724: - Ignore any source address that has a smaller scope than the destination address. For example, do not use a link-local source address when sending to a global destination address. - If we have a source address which is on the same link as the destination address, then use that source address. - If we are left with multiple possible source addresses, then choose the address with the smallest scope. For example, if we are sending to a site-local destination address and we have both a global source address and a site-local source address, then use the site-local source address. - If we are still left with multiple possible source addresses, then choose the address with the longest matching prefix. For the purposes of this algorithm, we treat RFC4193 Unique Local Addresses as having organisation-local scope. Since we use only link-local scope for our multicast transmissions, this approximation should remain valid in all practical situations. Originally-implemented-by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Allow IPv4 socket addresses to include a scope IDMichael Brown2015-07-281-2/+9
| | | | | | | | | | | | Extend the IPv6 concept of "scope ID" (indicating the network device index) to IPv4 socket addresses, so that IPv4 multicast transmissions may specify the transmitting network device. The scope ID is not (currently) exposed via the string representation of the socket address, since IPv4 does not use the IPv6 concept of link-local addresses (which could legitimately be specified in a URI). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Redefine IP address constants to avoid unnecessary byte swappingMichael Brown2015-07-281-9/+15
| | | | | | | | Redefine various IPv4 address constants and testing macros to avoid unnecessary byte swapping at runtime, and slightly rename the macros to prevent code from accidentally using the old definitions. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Treat a missing network device name as "netX"Michael Brown2015-07-281-0/+3
| | | | | | | | | When an IPv6 socket address string specifies a link-local or multicast address but does not specify the requisite network device name (e.g. "fe80::69ff:fe50:5845" rather than "fe80::69ff:fe50:5845%net0"), assume the use of "netX". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown2015-03-021-1/+1
| | | | | | | | | | These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Fix definition of IN6_IS_ADDR_LINKLOCAL()Michael Brown2014-05-211-1/+1
| | | | | | | | Fix an erroneous htonl() in the definition of IN6_IS_ADDR_LINKLOCAL(), and add self-tests for the IN6_IS_ADDR_xxx() family of macros. Reported-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [socket] Ensure socket address structure sizes are fixedMichael Brown2013-12-051-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Use given source address only if it is not the unspecified addressMichael Brown2013-11-141-0/+6
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add inet6_aton()Michael Brown2013-09-111-1/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Replace IPv6 stackMichael Brown2013-09-031-14/+17
| | | | | | | | | | | | | | | | Replace the existing partially-implemented IPv6 stack with a fresh implementation. This implementation is not yet complete. The IPv6 transmit and receive datapaths are functional (including fragment reassembly and parsing of arbitrary extension headers). NDP neighbour solicitations and advertisements are supported. ICMPv6 echo is supported. At present, only link-local addresses may be used, and there is no way to specify an IPv6 address as part of a URI (either directly or via a DNS lookup). Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Allow binding to unspecified privileged ports (below 1024)Michael Brown2013-08-061-6/+24
| | | | | Originally-implemented-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Rename sin_{family,port} to sin6_{family,port} in struct sockaddr_in6Michael Brown2013-08-061-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Rename gPXE to iPXEMichael Brown2010-04-201-0/+104
Access to the gpxe.org and etherboot.org domains and associated resources has been revoked by the registrant of the domain. Work around this problem by renaming project from gPXE to iPXE, and updating URLs to match. Also update README, LOG and COPYRIGHTS to remove obsolete information. Signed-off-by: Michael Brown <mcb30@ipxe.org>