The aim of this project is to get more understanding of client/server programming in C. In this project, you will be implementing a simple TCP based FTP server and client program. Your implementation must be in C using the BSD sockets. Your server and client program should be designed to run on UNIX machines of CATS. The specifications for the server and client side are as follows:
myftpd dir_name port_numberWhere dir_name is the name of the default directory which will be displayed when a client is connected and port_number is the port number for the server to listen. Whenever your server receives a connection request from a client, the server should ask the client for a password. The connection must be terminated with an error message (Authentication Failure), if the password does not match the expected password. On successful authentication the client should be greeted with a Success message followed by an ftp prompt.
The client should be designed to start by typing the command,
myftp server_name port_number
Where server_name is the name or ip address of the server and port_number is the port where the FTP server is running. This should be followed by password authentication.
The following commands should be available in the ftp prompt:
myftp> lsNo arguments. To display directory listing in the remote server.
myftp> llsNo arguments. To display directory listing in the local machine.
myftp> pwdNo arguments. To display current directory name in the remote server.
myftp> lpwdNo arguments. To display current directory name in the local machine.
myftp> cd remote-pathChange directory in the remote server.
myftp> lcd local-pathChange directory in the local machine.
myftp> get remote-file [local-file]Get the file 'remote-file' from the remote server to the local machine with name 'local-file' (if specified in the command line else it should be same as the remote file name).
myftp> put local-file [remote-file]Transfer local-file to the remote server.
myftp> exitExit the connection.
myftp> helpList all the available commands with a short description.
All these commands when executed should return a Success/Failure status. All the path names and file names should be considered relative to the current directory (unless absolute path name is given). After a successful file transfer, a success message should be displayed with the number of bytes transferred (Optionally you could display status for ongoing transfers by some means).
Full credit will be awarded only if all the requirements are met. If your server/client fails the tests in the automated scripts, partial credits might be given depending on the error.
Contact Venkatesh (venkat@soe.ucsc.edu).