summaryrefslogtreecommitdiffstats
path: root/src/net
Commit message (Collapse)AuthorAgeFilesLines
...
* [ipv6] Handle IPv6 option length correctlyMichael Brown2013-10-231-1/+1
| | | | | | | The IPv6 option length field represents the length of the option data field, not the overall length of the option. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ping] Add concept of a ping socketMichael Brown2013-10-211-0/+273
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [icmp] Add support for sending ICMP echo requestsMichael Brown2013-10-214-96/+331
| | | | | | | | Merge common functionality between IPv4 and IPv6 ICMP echo handling, and add support for transmitting ICMP echo requests and delivering ICMP echo replies to a (not yet implemented) ping_rx() function. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add IPv6 socket address converterMichael Brown2013-10-211-1/+98
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Add IPv4 socket address converterMichael Brown2013-10-211-0/+37
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [socket] Add concept of a generalised socket address converterMichael Brown2013-10-211-0/+65
| | | | | | | Add sock_aton() and sock_ntoa() to allow for parsing and transcription of arbitrary socket addresses. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add find_netdev_by_index()Michael Brown2013-10-211-0/+18
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [udp] Add AF_INET6 socket openerMichael Brown2013-10-211-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Add AF_INET6 socket openerMichael Brown2013-10-211-2/+9
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [neighbour] Add nstat() function to print out neighbour tableMichael Brown2013-09-251-41/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Add inet6_aton()Michael Brown2013-09-111-4/+73
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Fix uninitialised-variable warningMichael Brown2013-09-031-0/+3
| | | | | | Fix uninitialised-variable warning reported by gcc 4.5.2. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv6] Replace IPv6 stackMichael Brown2013-09-034-480/+1097
| | | | | | | | | | | | | | | | 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>
* [neighbour] Generalise concept of neighbour discoveryMichael Brown2013-09-032-354/+513
| | | | | | | | Split the protocol-independent portions of arp.c into a separate file neighbour.c, to allow for sharing of functionality between IPv4+ARP and IPv6+NDP. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Pass through network device to transport layer protocolsMichael Brown2013-09-037-10/+21
| | | | | | | NDP requires knowledge of the network device on which a packet was received. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ethernet] Add support for generating multicast hash for IPv6 addressesMichael Brown2013-09-031-0/+5
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add method for generating EUI-64 address from link-layer addressMichael Brown2013-09-032-0/+17
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add concept of a network device indexMichael Brown2013-09-031-2/+3
| | | | | | | | | | | | | IPv6 link-local socket addresses require some way to specify a local network device. We cannot simply use a pointer to the network device, since a struct sockaddr_in6 may be long-lived and has no way to hold a reference to the network device. Using a network device index allows a socket address to cleanly refer to a network device without worrying about whether or not that device continues to exist. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [ipv4] Generalise fragment reassembly mechanismMichael Brown2013-08-272-117/+211
| | | | | | | Generalise the concept of fragment reassembly to allow for code sharing between IPv4 and IPv6 protocols. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [linux] Give tap devices a name and bus typeMichael Brown2013-08-271-1/+2
| | | | | | | | Give tap devices a meaningful name, and avoid segmentation faults when attempting to retrieve ${net0/bustype} by assigning a new bus type for tap devices. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [http] Add support for HTTP POSTMichael Brown2013-08-191-3/+121
| | | | | | | | | | | | | | Allow HTTP POST requests to be generated when the URI includes a parameter list. For example: #!ipxe params param mac ${net0/mac} param uuid ${uuid} param asset ${asset} chain http://boot.ipxe.org/demo/boot.php##params Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nfs] Fix an issue with the selection of a local portMarin Hannache2013-08-061-2/+2
| | | | | | Reported-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcpip] Allow binding to unspecified privileged ports (below 1024)Michael Brown2013-08-063-74/+76
| | | | | 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-062-3/+3
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [udp] Move high-frequency debug messages to DBGLVL_EXTRAMichael Brown2013-08-061-5/+5
| | | | | | | | This makes it possible to leave UDP debugging enabled in order to see interesting UDP events, without flooding the console with at least one message per packet. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Clarify usage of the term "named setting"Michael Brown2013-07-181-1/+1
| | | | | | | | | | | | There are currently two conflicting usages of the term "named setting" within iPXE: one refers to predefined settings (such as show up in the "config" UI), the other refers to settings identified by a name (such as "net0.dhcp/ip"). Split these usages into the term "predefined setting" and "named setting" to avoid ambiguity. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [nfs] Add support for NFS protocolMarin Hannache2013-07-156-0/+1658
| | | | | | Tested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [cmdline] Accept "netX" in iPXE commandsMichael Brown2013-07-131-0/+5
| | | | | | | Allow any iPXE command expecting a network device name to accept "netX" as a synonym for "most recently opened network device". Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Make "netX" settings block function as a symbolic linkMichael Brown2013-07-131-0/+49
| | | | | | | | | | | | | | Add a facility for settings blocks to act as symbolic links to other settings blocks, and reimplement the "netX" virtual settings block using this facility. The primary advantage of this approach is that unscoped settings such as ${mac} and ${filename} will now reflect the settings obtained from the most recently opened network device: in most cases, this will mean the settings obtained from the most recent DHCP attempt. This should improve conformance to the principle of least astonishment. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add "bustype" and "busloc" settingsMichael Brown2013-07-121-0/+60
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Fix comment to match code behaviourMichael Brown2013-07-121-1/+1
| | | | | Reported-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tcp] Do not send RST for unrecognised connectionsMichael Brown2013-07-121-1/+0Star
| | | | | | | | | | | | On large networks with substantial numbers of monitoring agents, unwanted TCP connection attempts may end up flooding iPXE's ARP cache. Fix by silently dropping packets received for unrecognised TCP connections. This should not cause problems, since many firewalls will also silently drop any such packets. Reported-by: Jarrod Johnson <jarrod.b.johnson@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Reset MAC address when asked to clear the "mac" settingMichael Brown2013-05-161-3/+11
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add "chip" settingMichael Brown2013-05-161-26/+131
| | | | | Suggested-by: Robin Smidsrød <robin@smidsrod.no> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [settings] Eliminate settings "tag magic"Michael Brown2013-05-013-23/+4Star
| | | | | | | Create an explicit concept of "settings scope" and eliminate the magic values used for numerical setting tags. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add netdev_tx_defer() to allow drivers to defer transmissionsMichael Brown2013-05-011-3/+87
| | | | | | | | Devices with small transmit descriptor rings may temporarily run out of space. Provide netdev_tx_defer() to allow drivers to defer packets for retransmission as soon as a descriptor becomes available. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix dubious uses of bitwise operatorsMichael Brown2013-04-281-1/+1
| | | | | | Detected by sparse. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Fix uses of literal 0 as a NULL pointerMichael Brown2013-04-281-1/+1
| | | | | | Detected using sparse. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Use link-layer address as part of RNG seedMichael Brown2013-04-191-2/+11
| | | | | | | | | | | | | | | | | | | | iPXE currently seeds the random number generator using the system timer tick count. When large numbers of machines are booted simultaneously, multiple machines may end up choosing the same DHCP transaction ID (XID) value; this can cause problems. Fix by using the least significant (and hence most variable) bits of each network device's link-layer address to perturb the random number generator. This introduces some per-machine unique data into the random number generator's seed, and so reduces the chances of DHCP XID collisions. This does not affect the ANS X9.82-compatible random bit generator used by TLS and other cryptography code, which uses an entirely separate source of entropy. Originally-implemented-by: Bernhard Kohl <bernhard.kohl@nsn.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [libc] Use __einfo() tuple as first argument to EUNIQ()Michael Brown2013-04-191-2/+2
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [uuid] Abstract UUID mangling code out to a separate uuid_mangle() functionMichael Brown2013-03-201-3/+1Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [dhcp] Use PXE byte ordering for UUID in DHCP option 97Michael Brown2013-03-201-1/+8
| | | | | | | | The PXE spec does not specify a byte ordering for UUIDs, but RFC4578 suggests that it follows the EFI spec, in which the first three fields are little-endian. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tftp] Allow TFTP block size to be controlled via the PXE TFTP APIMichael Brown2013-03-061-20/+8Star
| | | | | | | | | | | | | | The PXE TFTP API allows the caller to request a particular TFTP block size. Since mid-2008, iPXE has appended a "?blksize=xxx" parameter to the TFTP URI constructed internally; nothing has ever parsed this parameter. Nobody seems to have cared that this parameter has been ignored for almost five years. Fix by using xfer_window(), which provides a fairly natural way to convey the block size information from the PXE TFTP API to the TFTP protocol layer. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Separate VLAN support from presence of VLAN-supporting driversMichael Brown2013-03-011-0/+12
| | | | | | | | | | | | | | | | Some NICs (e.g. Hermon) provide hardware support for stripping the VLAN tag, but do not provide any way for this support to be disabled. Drivers for this hardware must therefore call vlan_find() to identify a suitable receiving network device. Provide a weak version of vlan_find() which will always return NULL if VLAN support has not been enabled (either directly, or by enabling a feature such as FCoE which requires VLAN support). This allows the VLAN code to be omitted from builds where the user has not requested support for VLANs. Inspired-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Add vlan_tag() to get the VLAN tag of a network deviceStefan Hajnoczi2013-03-012-0/+28
| | | | | | | | | | | | The iBFT has a VLAN field that should be filled in. Add the vlan_tag() function to extract the VLAN tag of a network device. Since VLAN support is optional, define a weak function that returns 0 when iPXE is built without VLAN support. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [tls] Concatenate received non-data records before processingMichael Brown2013-01-311-12/+10Star
| | | | | | | | | Allow non-data records to be split across multiple received I/O buffers, to accommodate large certificate chains. Reported-by: Nicola Volpini <Nicola.Volpini@kambi.com> Tested-by: Nicola Volpini <Nicola.Volpini@kambi.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [src] Fix spelling in comments, debug messages and local variable namesStefan Weil2013-01-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes in comments and debug messages: existance -> existence unecessary -> unnecessary occured -> occurred decriptor -> descriptor neccessary -> necessary addres, adress -> address initilize -> initialize sucessfully -> successfully paramter -> parameter acess -> access upto -> up to likelyhood ->likelihood thru -> through substracting -> subtracting lenght -> length isnt -> isn't interupt -> interrupt publically -> publicly (this one was not wrong, but unusual) recieve -> receive accessable -> accessible seperately -> separately pacet -> packet controled -> controlled dectect -> detect indicies -> indices extremly -> extremely boundry -> boundary usefull -> useful unuseable -> unusable auxilliary -> auxiliary embeded -> embedded enviroment -> environment sturcture -> structure complier -> compiler constructes -> constructs supress -> suppress intruduced -> introduced compatability -> compatibility verfication -> verification ths -> the reponse -> response Fixes in local variable names: retreive -> retrieve Most of these fixes were made using codespell. Signed-off-by: Stefan Weil <sw@weilnetz.de> Modified-by: Michael Brown <mcb30@ipxe.org> Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [build] Include version number within only a single object fileMichael Brown2012-11-022-5/+3Star
| | | | Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Clear network device setting before unregisteringMichael Brown2012-10-251-0/+2
| | | | | | | Avoid memory leaks by clearing any (non-child) settings immediately before unregistering the network device settings block. Signed-off-by: Michael Brown <mcb30@ipxe.org>
* [netdevice] Do not force a poll on net_tx()Michael Brown2012-10-241-7/+0Star
| | | | | | | | | | | | | | Including a netdev_poll() within net_tx() can cause the net_step() loop to end up processing hundreds or thousands of packets within a single step, since each received packet being processed may trigger a response which, in turn causes a poll for further received packets. Network devices must now ensure that the TX ring is at least as large as the RX ring, in order to avoid running out of TX descriptors. This should not cause any problems; unlike the RX ring, there is no substantial memory cost incurred by increasing the TX ring size. Signed-off-by: Michael Brown <mcb30@ipxe.org>