aboutsummaryrefslogtreecommitdiff
path: root/lib/libnet/libnet.code
AgeCommit message (Collapse)AuthorFilesLines
2018-05-25libnet: Get rid of unused huge_load and block_size parametersThomas Huth1-3/+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>
2017-09-26netboot: Create bootp-response when bootp is usedNikunj A Dadhania1-3/+1
According to TFTP Booting extension, after the success of BOOTP, BOOTREPLY packet should be copied to bootp-response property under "/chosen" While in current case, even when DHCP was used, bootp-response was being set. So set bootp-response when BOOTP is used and dhcp-response for DHCP Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-10-17libnet: Simplify the net-load arguments passingThomas Huth1-14/+9
There is no need anymore to pass most of the arguments as strings, we can use integers and pointers now instead. While we're at it, change the maximum TFTP packet block size in obp-tftp.fs from 1432 to 1428, since this is the correct value (with 1432, there might be problems with networking over VLANs). The code in tftp.c forces this value to 1428 anyway (see the MAX_BLOCKSIZE constant there), so this change is just cosmetical, and should not change the behavior of the TFTP loading process. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-10-17libnet: Simplify the Forth-to-C wrapper of ping()Thomas Huth1-13/+2
Now that we do not link libnet against net-snk anymore, we can change the prototype of ping() and thus simplify the "net-ping" Forth-to-C wrapper. There is no need to convert the parameters to a temporary argv[] array anymore. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-10-17Add a Forth-to-C wrapper for the ping command, tooThomas Huth1-0/+17
Now that we link libnet to Paflof, we can call the ping function there directly instead of using the one from net-snk. We add a similar Forth-to-C wrapper like it has already been done for netboot() - simplification and clean-up will be done in a later patch once we do not link against net-snk anymore. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
2016-10-17Link libnet code to Paflof and add a wrapper for netboot()Thomas Huth1-0/+19
Now that all necessary functions are provided by Paflof, too, we can finally link the libnet code to this binary. To be able to call the netboot() function from the Forth code now, we also add a wrapper that takes the parameter string from the obp-tftp package and converts it to an argv array that is expected by the netboot() function. Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>