VxWorks Reference Manual : Libraries
tftpdLib - Trivial File Transfer Protocol server library
tftpdInit( ) - initialize the TFTP server task
tftpdTask( ) - TFTP server daemon task
tftpdDirectoryAdd( ) - add a directory to the access list
tftpdDirectoryRemove( ) - delete a directory from the access list
This library implements the VxWorks Trivial File Transfer Protocol (TFTP) server module. The server can respond to both read and write requests. It is started by a call to tftpdInit( ).
The server has access to a list of directories that can either be provided in the initial call to tftpdInit( ) or changed dynamically using the tftpdDirectoryAdd( ) and tftpDirectoryRemove( ) calls. Requests for files not in the directory trees specified in the access list will be rejected, unless the list is empty, in which case all requests will be allowed. By default, the access list contains the directory given in the global variable tftpdDirectory. It is possible to remove the default by calling tftpdDirectoryRemove( ).
For specific information about the TFTP protocol, see RFC 783, "TFTP Protocol."
tftpdLib.h, tftpLib.h
tftpdLib, tftpLib, RFC 783 "TFTP Protocol", VxWorks Programmer's Guide: Network
tftpdInit( ) - initialize the TFTP server task
STATUS tftpdInit ( int stackSize, /* stack size for the tftpdTask */ int nDirectories, /* number of directories allowed read */ char * *directoryNames, /* array of dir names */ BOOL noControl, /* TRUE if no access control required */ int maxConnections )
This routine will spawn a new TFTP server task, if one does not already exist. If a TFTP server task is running already, tftpdInit( ) will simply return an ERROR value without creating a new task.
To change the default stack size for the TFTP server task, use the stackSize parameter. The task stack size should be set to a large enough value for the needs of your application - use checkStack( ) to evaluate your stack usage. The default size is set in the global variable tftpdTaskStackSize. Setting stackSize to zero will result in the stack size being set to this default.
To set the maximum number of simultaneous TFTP connections (each with its own transfer identifier or TID), set the maxConnections parameter. More information on this is found in RFC 1350 ("The TFTP Protocol (Revision 2)"). Setting maxConnections to zero will result in the maximum number of connections being set to the default which is 10.
If noControl is TRUE, the server will be set up to transfer any file in any location. Otherwise, it will only transfer files in the directories in /tftpboot or the nDirectories directories in the directoryNames list, and will send an access violation error to clients that attempt to access files outside of these directories.
By default, noControl is FALSE, directoryNames is empty, nDirectories is zero, and access is restricted to the /tftpboot directory.
Directories can be added to the access list after initialization by using the tftpdDirectoryAdd( ) routine.
OK, or ERROR if a new TFTP task cannot be created.
tftpdTask( ) - TFTP server daemon task
STATUS tftpdTask ( int nDirectories, /* number of dirs allowed access */ char * *directoryNames, /* array of directory names */ int maxConnections /* max number of simultan. connects */ )
This routine processes incoming TFTP client requests by spawning a new task for each connection that is set up.
This routine is called by tftpdInit( ).
OK, or ERROR if the task returns unexpectedly.
tftpdDirectoryAdd( ) - add a directory to the access list
STATUS tftpdDirectoryAdd ( char * fileName /* name of directory to add to access list */ )
This routine adds the specified directory name to the access list for the TFTP server.
N/A
tftpdDirectoryRemove( ) - delete a directory from the access list
STATUS tftpdDirectoryRemove ( char * fileName /* name of directory to add to access list */ )
This routine deletes the specified directory name from the access list for the TFTP server.
N/A