VxWorks Reference Manual : Libraries

tftpdLib

NAME

tftpdLib - Trivial File Transfer Protocol server library

ROUTINES

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

DESCRIPTION

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."

INCLUDE FILES

tftpdLib.h, tftpLib.h

SEE ALSO

tftpdLib, tftpLib, RFC 783 "TFTP Protocol", VxWorks Programmer's Guide: Network


Libraries : Routines

tftpdInit( )

NAME

tftpdInit( ) - initialize the TFTP server task

SYNOPSIS

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
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if a new TFTP task cannot be created.

SEE ALSO

tftpdLib


Libraries : Routines

tftpdTask( )

NAME

tftpdTask( ) - TFTP server daemon task

SYNOPSIS

STATUS tftpdTask
    (
    int    nDirectories,    /* number of dirs allowed access */
    char * *directoryNames, /* array of directory names */
    int    maxConnections   /* max number of simultan. connects */
    )

DESCRIPTION

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( ).

RETURNS

OK, or ERROR if the task returns unexpectedly.

SEE ALSO

tftpdLib


Libraries : Routines

tftpdDirectoryAdd( )

NAME

tftpdDirectoryAdd( ) - add a directory to the access list

SYNOPSIS

STATUS tftpdDirectoryAdd
    (
    char * fileName /* name of directory to add to access list */
    )

DESCRIPTION

This routine adds the specified directory name to the access list for the TFTP server.

RETURNS

N/A

SEE ALSO

tftpdLib


Libraries : Routines

tftpdDirectoryRemove( )

NAME

tftpdDirectoryRemove( ) - delete a directory from the access list

SYNOPSIS

STATUS tftpdDirectoryRemove
    (
    char * fileName /* name of directory to add to access list */
    )

DESCRIPTION

This routine deletes the specified directory name from the access list for the TFTP server.

RETURNS

N/A

SEE ALSO

tftpdLib