Home | History | Annotate | Download | only in libsa
History log of /src/sys/lib/libsa/tftp.c
RevisionDateAuthorComments
 1.38  07-Aug-2022  rin Consistently use ntohs() instead of htons() when converting from
network to host byte order.

No binary changes both for big and little endian.
 1.37  26-Mar-2021  rin Twiddle also for data transfer for seek.
 1.36  31-Mar-2019  christos branches: 1.36.12; 1.36.14;
fix warnings, printf formats, etc.
 1.35  20-Mar-2014  christos branches: 1.35.30;
reduce size by 1K by sharing the ls code.
 1.34  25-Dec-2011  tsutsui branches: 1.34.6; 1.34.10;
Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

- add 'ls' op to struct fs_ops to support ls command on each fs,
enabled by -DLIBSA_ENABLE_LS_OP and SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
in libsa
- split sys/lib/libsa/ufs_ls.c into UFS specific part and MI part (ls.c)
that opens the target fs and calls fs-depedent XXX_ls() functions
- add a ls op for ext2fs
(all other fs than ufs and ext2fs don't have actual ls ops yet)
- replace existing MD ufs_ls() calls with this new MI ls()

The original patch was written for i386 and ext2fs.
zaurus zboot has been tested by nonaka@.
ews4800mips and x68k loaders have been tested by me (with several fixes).
landisk might be okay since it was almost copied from i386.

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.33  30-Jul-2011  jakllsch branches: 1.33.2; 1.33.6;
Fix printf formating in ifdef DEBUG sections.
 1.32  16-Jun-2011  joerg Add an optional MD calling convention flag for use in libsa when space
optimisation is critical. Use this on i386 to switch to register passing
calling convention for the file system entry points and most assembler
call backs that have to preserve at least 3 registers.
 1.31  11-May-2011  zoltan branches: 1.31.2;
Separate the IP and UDP code paths inside libsa, so I can add HTTP booting
later.
 1.30  13-Jan-2010  drochner branches: 1.30.4; 1.30.6;
RFC783 says the ErrMsg sent with an ERROR packet needs to be
NUL-terminated
 1.29  17-Jan-2009  tsutsui Remove __P().
 1.28  12-Jan-2009  tsutsui Replace time_t values in libsa sources with the following two types
to avoid unnecessary 64 bit ops which would make binaries larger:

satime_t (currently unsigned int):
numbers in seconds returned by the machine dependent getsecs() function
which are used to measure relative time

saseconds_t (currently int):
numbers in seconds used to specify timeout to network drivers

Per discussion on current-users.
 1.27  19-Nov-2008  ad For the x86 boot loader, autoload a kernel module corresponding to the
root file system type.
 1.26  11-May-2008  chris branches: 1.26.4; 1.26.6;
Extend tftp_stat to return the size of the file, rather than -1.

It's not very efficient, as it has to read the whole file, and count the
block sizes. However, this is the only way to work out the size using the
tftp protocol.

This is needed to support loading modules from a tftp server with pxeboot.
 1.25  25-Mar-2008  christos branches: 1.25.2; 1.25.4; 1.25.6;
- use mem* instead of b* routines, and kill the b* routines.
- use the mem* routines from libc.
XXX: There will be some lossage, but I am fixing it.
 1.24  02-Dec-2007  tsutsui branches: 1.24.14;
unsigned -> unsigned int
 1.23  24-Nov-2007  isaki style, indent, and ANSI-fy.
 1.22  05-Mar-2007  he branches: 1.22.14; 1.22.16; 1.22.22;
We need char* for pointer arithmetic.
 1.21  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.20  25-Jan-2006  christos branches: 1.20.24;
free -> dealloc
 1.19  11-Dec-2005  christos branches: 1.19.2;
merge ktrace-lwp.
 1.18  26-Feb-2005  perry branches: 1.18.4;
nuke trailing whitespace
 1.17  24-Mar-2004  drochner branches: 1.17.8; 1.17.10;
remove license clauses 3 and 4 from my cpoyright notices
 1.16  31-Aug-2003  fvdl Fix signed/unsigned warnings.
 1.15  18-Aug-2003  dsl make 'path' argument to ufs_open 'const char *' and fix the fallout.
 1.14  18-Mar-2003  mycroft branches: 1.14.2;
Move some stuff into .rodata.
 1.13  12-Mar-2003  drochner no need to include "netif.h" anymore
(shared interface stuff is in iodesc.h, included by net.h)
 1.12  12-Jan-2003  christos PR/19607: Bernd Ernesti: libsa does not have access to arpa/tftp.h. Put a
copy of it in our tftp.h
 1.11  16-Sep-2002  thorpej Do not #include "/usr/include/arpa/tftp.h" directly. Doing so is
VERY BAD for cross-compiling.
 1.10  30-Mar-2000  augustss branches: 1.10.6; 1.10.8; 1.10.22;
Kill some more register declarations.
 1.9  13-Nov-1999  thorpej Backout my libsa changes.
 1.8  11-Nov-1999  thorpej Update for the improvements to libsa, and don't reference libkern.h.
 1.7  12-Jul-1999  drochner branches: 1.7.2; 1.7.4; 1.7.8;
fix damage in error handling crept in in 1.4
 1.6  31-Mar-1999  cgd branches: 1.6.4;
Make a bunch of backward-compatible changes to the boot blocks which allow
size to be reduced substantially. (backward compatibility verified
by compiling one of the alpha boot blocks which uses all of the code
before and after, diffing the object files, and manually verifying that
the differences were 'correct'. some differences were "unavoidable,"
it wanting to avoid a double-commit, because e.g. local variables which
were previously used were no longer used.) a README which describes
supported options (or at least the ones mentioned below) is forthcoming.

add support for the preprocessor macro LIBSA_NO_TWIDDLE, which
causes calls to twiddle() to be omitted if it's defined.
add support for the preprocessor macros:
LIBSA_NO_FS_CLOSE
LIBSA_NO_FS_WRITE
LIBSA_NO_FS_SEEK
which, if defined, cause the corresponding file system operations
in the individual file system implementations to be omitted. (note
that all of those macros are not supported by all file systems at
this point. comments were added to individual file system files
to indicate lack of support, and should be cleaned up later. Backward
compatibility options e.g. UFS_NOCLOSE, etc., are supported.)
add support for the preprocessor macro LIBSA_NO_FS_SYMLINK, which
removes support for symbolic links from the file system support
functions. (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_FS_SINGLECOMPONENT which
removes all subdirectory and symlink support from the file system
support functions. (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_NO_FD_CHECKING, which
causes code relating to libsa file descriptor checks (e.g. range
checking and checking that a file descriptor is valid) to be
omitted if it's defined.
add support for the preprocessor macro LIBSA_NO_RAW_ACCESS, which
causes code relating to raw device access to be omitted if it's
defined.
change some structure copies to use bcopy() instead. that way
use of bcopy vs. memcpy() can easily be selected by
LIBSA_USE_MEMCPY. (without changes like these, you could end up
having both bcopy() and memcpy() included. eventually, all
calls to bcopy should be changed to calls to memcpy() or memmove()
as appropriate -- hopefully never the latter -- with an option to
use bcopy instead.)
add support for the preprocessor macro LIBSA_NO_DISKLABEL_MSGS, which
causes disklabel() to return '1' as msg rather than a string. Can
be used if the boot blocks don't care about the string, and need to
save the space.
add support for the preprocessor macro LIBSA_SINGLE_FILESYSTEM, which
if defined causes all of the file system switch code to be removed.
Its value should be the name of the file system supported by the
boot block, e.g. "ufs" for the FFS file system. calls to the
file system functions open, close, etc., which were previously
done through a function switch are then done via direct invocation
of <fs>_open, <fs>_close, etc. (e.g. ufs_open, ...).
add support for the preprocessor macro LIBSA_SINGLE_DEVICE, which
does the equivalent of LIBSA_SINGLE_FILESYSTEM but for the device
switch table. Device entry pointes are expected to be named
<dev>foo, e.g. the 'strategy' routine used when LIBSA_SINGLE_DEVICE
is set to 'disk' is diskstrategy.
make ufs.c f_nindir array be unsigned ints. the fact that it was signed
caused ufs.c to require signed division routines (which were otherwise
unnecessary for a small boot block).
 1.5  26-Mar-1999  dbj Changes to compile the next68k bootblocks with
egcs -Wpointer-arith -Wstrict-prototypes
This closes pr 6653
 1.4  28-Feb-1999  kim Made this compile:
- fifth arg to recvtftp should be size_t (not ssize_t)
- the path is passed tftp_makereq as a part of the handle structure
 1.3  26-Feb-1999  christos Add missing prototypes for static functions.
 1.2  25-Feb-1999  ross XXX include libkern.h for strlen() XXX
 1.1  24-Feb-1999  drochner move TFTP filesystem from i386/stand/libsa here, it is mi
 1.6.4.1  02-Aug-1999  thorpej Update from trunk.
 1.7.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.4.1  15-Nov-1999  fvdl Sync with -current
 1.7.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.10.22.1  01-Dec-2002  he Pull up revision 1.11 (requested by thorpej in ticket #836):
Do not #include "/usr/incloude/arpa/tftph" directly.
Fixes problem for cross-compiling.
 1.10.8.1  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.10.6.2  15-Jan-2003  thorpej Sync with HEAD.
 1.10.6.1  17-Sep-2002  nathanw Catch up to -current.
 1.14.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.14.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1  03-Aug-2004  skrll Sync with HEAD
 1.17.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.17.8.1  29-Apr-2005  kent sync with -current
 1.18.4.3  07-Dec-2007  yamt sync with head
 1.18.4.2  03-Sep-2007  yamt sync with head.
 1.18.4.1  21-Jun-2006  yamt sync with head.
 1.19.2.1  01-Feb-2006  yamt sync with head.
 1.20.24.1  12-Mar-2007  rmind Sync with HEAD.
 1.22.22.1  08-Dec-2007  mjf Sync with HEAD.
 1.22.16.1  09-Jan-2008  matt sync with HEAD
 1.22.14.2  03-Dec-2007  joerg Sync with HEAD.
 1.22.14.1  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.24.14.3  17-Jan-2009  mjf Sync with HEAD.
 1.24.14.2  02-Jun-2008  mjf Sync with HEAD.
 1.24.14.1  03-Apr-2008  mjf Sync with HEAD.
 1.25.6.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.25.4.3  11-Mar-2010  yamt sync with head
 1.25.4.2  04-May-2009  yamt sync with head.
 1.25.4.1  16-May-2008  yamt sync with head.
 1.25.2.1  18-May-2008  yamt sync with head.
 1.26.6.1  19-Jan-2009  skrll Sync with HEAD.
 1.26.4.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.30.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.30.4.1  31-May-2011  rmind sync with head
 1.31.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.33.6.1  18-Feb-2012  mrg merge to -current.
 1.33.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.33.2.1  17-Apr-2012  yamt sync with head
 1.34.10.1  18-May-2014  rmind sync with head
 1.34.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.30.1  10-Jun-2019  christos Sync with HEAD
 1.36.14.1  03-Apr-2021  thorpej Sync with HEAD.
 1.36.12.1  03-Apr-2021  thorpej Sync with HEAD.

RSS XML Feed