aboutsummaryrefslogtreecommitdiff
path: root/lib/libstand/net.h
Commit message (Collapse)AuthorAgeFilesLines
* Move lib/libstand to sys/boot/libsaWarner Losh2017-10-121-133/+0
| | | | | | | | | | Move the sources to sys/boot. Make adjustments related to the move. Kill LIBSTAND_SRC since it's no longer needed. Sponsored by: Netflix Notes: svn path=/head/; revision=324551
* Always issue the pxe requestBaptiste Daroussin2017-05-271-1/+1
| | | | | | | | | | | | | | | | | All the code are now only issueing one single dhcp request at startup of the loader meaning we can always request a the PXE informations from the dhcp server. Previous code lost that information, meaning no option 55 anymore (meaning not working with the kea dhcp server) and no request for rootpath etc, no user class Remove the flags from the bootp function which is not needed anymore Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D10952 Notes: svn path=/head/; revision=318989
* loader: add ip layer code into libstandToomas Soome2017-05-151-0/+2
| | | | | | | | | | | | | | | | Implement simple separate ip module and fragment re-assembly. The work is based on send and receive previously implemented in udp.c, moved to ip.c and added the ip fragment re-assembly. This change allows to specify larger tftp or nfs payload, such as: tftp.blksize=4096 or nfs.read_size=4096 Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10631 Notes: svn path=/head/; revision=318320
* loader: network read reworkToomas Soome2017-05-061-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current read from network is working from up to down - we have some protocol needing the data from the network, so we build the buffer space for that protocol, add the extra space for headers and pass this buffer down to be filled by nif get call in hope, we have guessed the incoming packet size right. Amazingly enough this approach mostly does work, but not always... So, this update does work from down to up - we allocate buffer (based on MTU or frame size info), fill it up, and pass on for upper layers. The obvious problem is that when we should free the buffer - if at all. In the current implementation the upper layer will free the packet on error or when the packet is no longer needed. While working on the issue, the additional issue did pop up - the bios implementation does not have generic get/put interface but is using pxe udpsend/udpreceive instead. So the udp calls are gone and undi interface is implemented instead. Which in turn means slight other changes as we do not need to have duplicated pxe implementation and can just use dev_net. To align packet content, the actual read from nic is using shifted buffer by ETHER_ALIGN (2). Reviewed by: bapt Differential Revision: https://reviews.freebsd.org/D10232 Notes: svn path=/head/; revision=317887
* distinguish NFS versus TFTP boot by rootpathBaptiste Daroussin2017-05-061-1/+0
| | | | | | | | | | | | | | | | | Don't use DHCP 150 option to decide which protocol use to netboot. When root-path includes ip address - go thru NFS, if ip address not exists in root-path - go thru TFTP from server which ip address is in next-server. But there is one limitation - only one tftp server in network to provide loader and everything else. Does enybody use more than only one? Submitted by: kczekirda Sponsored by: Oktawave MFC after: 3 weeks Relnote: Yes Differential Revision: https://reviews.freebsd.org/D8740 Notes: svn path=/head/; revision=317886
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Add a comment on the #endif related to the guardsBaptiste Daroussin2016-09-131-1/+1
| | | | | | | Reported by: tsoome Notes: svn path=/head/; revision=305770
* Netboot: allow both tftpfs and nfs in both pxeboot and loader.efiBaptiste Daroussin2016-08-311-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a new 'netproto' variable which can be set for now to NET_TFTP or NET_NFS (default to NET_NONE) From the dhcp options if one sets the root-path option to: "ip:path", the loader will consider it is booting over NFS (meaning same behaviour as the default current behaviour) if the dhcp option "tftp server address" is set (option 150) the loader will consider it is booting over tftpfs, it will then consider the root-path options with 2 possible case 1. "path" then the IP of the tftp server will be the one passed by the option 150, and the files will be retrieved under "path" on the tftp server 2. "ip:path" then the IP of the tftp server will be the one passed in the option "overwritting the IP from the option 150. We could not "abuse" the rootpath option in the form or tftp://ip:path because this is already used for other purpose by iPXE preventing any chainload from iPXE to the FreeBSD loader. Given at each open(), the loader loops over all available filesystems and keep the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa. the tftpfs and nfs implementation in libstand now return EINVAL early if 'netproto' for that purpose. Reviewed by: tsoome Relnotes: yes Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D7628 Notes: svn path=/head/; revision=305125
* If the dhcp server delivers an interface-mtu option, parse it and storeIan Lepore2016-03-211-0/+1
| | | | | | | | | | | the value in a new global intf_mtu for use by the application. These changes were inspired by the patch provided by Robert Blayzor in PR 187094, and will allow loader(8) to propagate the value to the kernel along with the other nfs_diskless parms delivered via environment vars. Notes: svn path=/head/; revision=297150
* Increase maximum network timeout from 20s to 120s. Given that an ETIMEDOUTEd Maste2010-09-281-1/+1
| | | | | | | | return from sendrecv probably means a failure to boot we might as well be generous in the timeout period. Notes: svn path=/head/; revision=213235
* Remove California Regent's clause 3, per letterWarner Losh2007-01-091-4/+0
| | | | Notes: svn path=/head/; revision=165906
* Don't always enable debugging for the network device code.Benno Rice2000-11-101-2/+0
| | | | | | | Reviewed by: obrien Notes: svn path=/head/; revision=68543
* Add support to send the string 'PXEClient' as the Vendor classPaul Saab2000-08-111-1/+1
| | | | | | | | | identifier to the DHCP server. Now you can check for this string in your dhcp configuration to decide whether you will hand out a lease to the client or not. Notes: svn path=/head/; revision=64527
* Cleanup warnings by adding missint prototypes, removing unneeded duplicateJohn Baldwin2000-08-031-0/+5
| | | | | | | | | | prototypes, and adding in several 'const's. Also, add some missing $FreeBSD$'s. Found by: BDECFLAGS Notes: svn path=/head/; revision=64185
* This is libstand; a support library for standalone executables (eg. bootstrapMike Smith1998-08-201-0/+122
modules). Obtained from: NetBSD, with some architectural changes and many additions. Notes: svn path=/cvs2svn/branches/MSMITH/; revision=38451