aboutsummaryrefslogtreecommitdiff
path: root/lib/libnet/tftp.h
AgeCommit message (Collapse)AuthorFilesLines
2018-05-29libnet: Add support for DHCPv4 options 209 and 210Thomas Huth1-0/+2
There are two dedicated DHCP options for loading PXELINUX config files, option 209 (config file name) and 210 (path prefix). We should support them, too, in case some users want to configure their boot flow this way. See RFC 5071 and the following URL for more details: https://www.syslinux.org/wiki/index.php?title=PXELINUX#DHCP_options Unlike most other strings in libnet, I've chosen to not use fixed-size arrays for these two strings, but to allocate the memory via malloc here. We always have to make sure not to overflow the stack in Paflof, so adding 2 * 256 byte arrays to struct filename_ip sounded just too dangerous to me. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-05-29libnet: Put code for determing TFTP error strings into a separate functionThomas Huth1-0/+2
This way we can easily re-use the rc --> string translation in later patches. Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-05-29libnet: Pass ip_version via struct filename_ipThomas Huth1-5/+5
When we will support loading of pxelinux.cfg files later, we have to call the tftp load function multiple times from different places. To avoid that we've also got to pass around the ip_version information via function para- meters to all spots, let's rather put it into struct filename_ip instead since we've got this struct filename_ip info available everywhere already. While we're at it, also drop the __attribute__((packed)) from the struct. The struct is only used internally, without exchanging it with the outside world, so the attribute is certainly not necessary here. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-05-25libnet: Get rid of unused huge_load and block_size parametersThomas Huth1-1/+1
The blocksize is hard-coded to 1428 bytes in obp-tftp.fs, so instead of hardcoding this in the Forth code, we could also move this into tftp.c directly instead. A similar condition exists with the huge-tftp-load parameter. While this non-standard variable could still be changed in the obp-tftp package, it does not make much sense to set it to zero since you only lose the possibility to do huge TFTP loads with index wrap-around in that case. Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2018-05-14libnet: Get rid of unnecessary (char *) castsThomas Huth1-1/+1
For some strange reasons, the libnet code is using int8_t arrays for strings in a couple of places where it really does not make any sense. Therefor a lot of "(char *)" casts are needed when the code is using the string functions from the libc. Let's change the strings to use "char" instead of "int8_t" so we can get rid of a lot of these casts. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2017-06-28libnet: Remove remainders of netsave codeThomas Huth1-2/+0
The code does not exist in the repository, so it does not make sense to keep the prototypes and the Forth wrapper around. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-10-10libnet: Make netapps.h includable from .code filesThomas Huth1-2/+3
Unfortunately netapps.h currently can't be included from .code Forth-to-C wrapper files - it includes tftp.h which in turn includes ipv6.h, and that header contains some constructs which can't be used in .code files. So let's make netapps.h independent from tftp.h and add some "extern" keywords like it is done with the other header files already that are included from .code files. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-06-27net: Move files from clients/net-snk/app/netlib/ to lib/libnet/Thomas Huth1-0/+51
When we want to link the network stack to other parts of the firmware later (paflof), we've got to turn it into a proper library first. Note: Make sure to run "make distclean" after this patch, so that the dependencies for the moved files get rebuilt properly. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>