aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2013-10-21[icmp] Add support for sending ICMP echo requestsMichael Brown9-121/+402
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>
2013-10-21[resolv] Use sock_aton() to allow parsing of arbitrary numeric addressesMichael Brown1-13/+4
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21[ipv6] Add IPv6 socket address converterMichael Brown2-2/+102
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21[ipv4] Add IPv4 socket address converterMichael Brown1-0/+37
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21[socket] Add concept of a generalised socket address converterMichael Brown3-0/+102
Add sock_aton() and sock_ntoa() to allow for parsing and transcription of arbitrary socket addresses. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21[netdevice] Add find_netdev_by_index()Michael Brown2-0/+19
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21[udp] Add AF_INET6 socket openerMichael Brown1-2/+9
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21[tcp] Add AF_INET6 socket openerMichael Brown1-2/+9
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-25[cmdline] Add "nstat" commandMichael Brown3-0/+73
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-25[neighbour] Add nstat() function to print out neighbour tableMichael Brown4-41/+115
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-25[build] Work around bug in gcc >= 4.8Michael Brown6-20/+35
Commit 238050d ("[build] Work around bug in gcc >= 4.8") works around one instance of a bug in recent versions of gcc, in which "ebp" cannot be specified within an asm clobber list. Some versions of gcc seem to exhibit the same bug on other points in the codebase. Fix by changing all instances of "ebp" in a clobber list to use the push/pop %ebp workaround instead. Originally-implemented-by: Víctor Román Archidona <contacto@victor-roman.es> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-11[ipv6] Add inet6_aton()Michael Brown3-5/+141
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-04[tcp] Reduce path MTU to 1280 bytesMichael Brown1-3/+12
The path MTU is currently hardcoded to 1460 bytes, which fails to allow space for TCP options. Sending a maximum-sized datagram (which is viable when using HTTP POST) will therefore fail since the Ethernet MTU will be exceeded. Reduce the hardcoded path MTU to produce a maximum datagram of 1280 bytes, which is the size required of data link layers by IPv6. It is a reasonable assumption that all intermediary data link layers will be able to convey this packet without fragmentation, even for IPv4. Note that this reduction has a minimal impact upon download throughput, since it affects only the transmit data path. Originally-fixed-by: Suresh Sundriyal <ssundriy@vmware.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03[ipv6] Fix uninitialised-variable warningMichael Brown1-0/+3
Fix uninitialised-variable warning reported by gcc 4.5.2. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03[ipv6] Replace IPv6 stackMichael Brown16-652/+1669
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>
2013-09-03[ipv4] Abstract out protocol-specific portions of "route" commandMichael Brown4-14/+115
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03[neighbour] Generalise concept of neighbour discoveryMichael Brown5-357/+579
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>
2013-09-03[tcpip] Pass through network device to transport layer protocolsMichael Brown8-13/+26
NDP requires knowledge of the network device on which a packet was received. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03[linux] Apply MAC address prior to registering network deviceMichael Brown1-5/+6
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03[ethernet] Add support for generating multicast hash for IPv6 addressesMichael Brown1-0/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03[netdevice] Add method for generating EUI-64 address from link-layer addressMichael Brown5-0/+28
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-09-03[netdevice] Add concept of a network device indexMichael Brown2-2/+5
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>
2013-09-03[netdevice] Increase maximum network-layer address lengthMichael Brown1-1/+1
IPv6 uses 16-byte network-layer addresses. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-27[ipv4] Generalise fragment reassembly mechanismMichael Brown4-129/+279
Generalise the concept of fragment reassembly to allow for code sharing between IPv4 and IPv6 protocols. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-27[linux] Give tap devices a name and bus typeMichael Brown3-1/+8
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>
2013-08-27[settings] Make built-in settings a linker tableMichael Brown2-46/+68
Allow for configurable provision of built-in settings by placing them in a linker table rather than an array. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-20[3c90x] Fix High-MTU packet receptionThomas Miletich1-0/+4
Prevent the card from flagging packets of 1518 bytes length as overlength. This fixes the High-MTU loopback test. Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-20[3c90x] Don't round up transmit packet lengthThomas Miletich2-3/+5
The 3c90x B and C revisions support rounding up the packet length to a specific boundary. Disable this feature to avoid overlength packets. This fixes the loopback test. Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-20[3c90x] Stall upload engine before setting RX ring addressThomas Miletich1-0/+4
According to the 3c90x datasheet we have to stall the upload (receive) engine before setting the receive ring address. Signed-off-by: Thomas Miletich <thomas.miletich@gmail.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-19[http] Add support for HTTP POSTMichael Brown1-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>
2013-08-19[uri] Allow URIs to incorporate a parameter listMichael Brown2-1/+34
HTTP POST requires the ability to associate a parameter list with a URI. There is no standardised syntax for this. Use a non-standard URI syntax to incorporate the specification of a parameter list within a URI: URI = [ absoluteURI | relativeURI ] [ "#" fragment ] [ "##params" [ "=" paramsName ] ] e.g. http://boot.ipxe.org/demo/boot.php##params http://boot.ipxe.org/demo/boot.php##params=mylist Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-19[cmdline] Add "params" and "param" commands to manage form parameter listsMichael Brown4-0/+167
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-19[params] Add support for the general concept of a form parameter listMichael Brown4-0/+237
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-12[settings] Expose memory map via settings mechanismMichael Brown4-0/+247
Allow memory map entries to be read using the syntax ${memmap/<region>.<properties>.<scale>} where <region> is the index of the memory region, <properties> is a bitmask where bit 0 represents the start address and bit 1 represents the length (allowing the end address to be encoded by having both bits 0 and 1 set), and <scale> is the number of bits by which to shift the result. This allows for several values of interest to be encoded. For example: ${memmap/<region>.1.0:hexraw} # 64-bit start address of <region> ${memmap/<region>.2.0:hexraw} # 64-bit length of <region>, in bytes ${memmap/<region>.3.0:hexraw} # 64-bit end address of <region> ${memmap/<region>.2.10:int32} # Length of <region>, in kB ${memmap/<region>.2.20:int32} # Length of <region>, in MB The numeric encoding is slightly more sophisticated than described here, allowing a single encoding to cover multiple regions. (See the source code for details.) The primary use case for this feature is to provide the total system memory size (in MB) via the "memsize" predefined setting. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-12[settings] Allow numeric_setting_value() to handle long setting valuesMichael Brown2-4/+10
Allow numeric_setting_value() to handle e.g. the byte sequence 00:00:00:00:12:34:56:78 by returning -ERANGE only if the value actually overflows the return type. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-12[test] Add self-tests for snprintf()Michael Brown2-0/+103
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-07[settings] Expose CPUID instruction via settings mechanismMichael Brown6-19/+303
Allow CPUID values to be read using the syntax ${cpuid/<register>.<function>} For example, ${cpuid/2.0x80000001} will give the value of %ecx after calling CPUID with %eax=0x80000001. Values for <register> are encoded as %eax=0, %ebx=1, %ecx=2, %edx=3. The numeric encoding is more sophisticated than described above, allowing for settings such as the CPU model (obtained by calling CPUID with %eax=0x80000002-0x80000004 inclusive and concatenating the values returned in %eax:%ebx:%ecx:%edx). See the source code for details. The "cpuvendor" and "cpumodel" settings provide easy access to these more complex CPUID settings. This functionality is intended to complement the "cpuid" command, which allows for testing individual CPUID feature bits. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-06[nfs] Fix an issue with the selection of a local portMarin Hannache1-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>
2013-08-06[tcpip] Allow binding to unspecified privileged ports (below 1024)Michael Brown5-81/+117
Originally-implemented-by: Marin Hannache <git@mareo.fr> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-06[ipv6] Rename sin_{family,port} to sin6_{family,port} in struct sockaddr_in6Michael Brown3-5/+5
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-06[udp] Move high-frequency debug messages to DBGLVL_EXTRAMichael Brown1-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>
2013-08-05[cmdline] Add "pciscan" command to allow iteration over PCI devicesMichael Brown3-0/+118
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-05[pci] Add pci_find_next() to iterate over existent PCI devicesMichael Brown2-21/+46
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-01[cmdline] Add "inc" commandMichael Brown1-0/+72
The "inc" command allows the numeric value of a setting to be incremented, allowing for the construction of simple loops within an iPXE script. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-08-01[settings] Introduce the generalised concept of a numeric settingMichael Brown4-183/+542
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-25[script] Allow commands following a script labelMichael Brown1-43/+53
Allow commands to be placed on the same line as a label. This allows for improved legibility of loop constructions by incorporating the loop check condition into the same line as the loop label. For example, to iterate over network devices using the forthcoming "inc" command: set idx:int16 0 :loop isset ${net${idx}/mac} || goto loop_done echo net${idx} is a ${net${idx}/chip} with MAC ${net${idx}/mac} inc idx && goto loop :loop_done Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-25[script] Allow initial whitespace on lines containing labelsMichael Brown1-4/+29
Initial whitespace is already accepted on lines containing commands, since it gets ignored by the system() call. Minimise surprise and allow for neater indentation of scripts by also allowing whitespace on lines containing labels. Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-22[settings] Remove now-unused fetchf_named_setting() and storef_named_setting()Michael Brown2-121/+0
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-22[settings] Eliminate calls to {fetch,store}f_named_setting() in NVO commandsMichael Brown1-40/+56
A deliberate side effect of this commit is that the "read" command will now preserve the type of the setting, if the setting name contains no type information. For example: iPXE> set foo:ipv4 192.168.0.1 iPXE> read foo 192.168.0.100 iPXE> show foo foo:ipv4 = 192.168.0.100 rather than the arguably unexpected behaviour of resetting the type to "string". Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-07-22[settings] Eliminate call to storef_named_setting() in choose_exec()Michael Brown1-5/+12
Signed-off-by: Michael Brown <mcb30@ipxe.org>