This library contains functions for FTP Client.
#include "rom400_sock.h"
#include "stdio.h"
#include "ftpcodes.h"
#include <string.h>
#include <ctype.h>
Go to the source code of this file.
Defines | |
| #define | FTPCLIENT_VERSION_NUMBER 1 |
| #define | FTPCLIENT_ASCII 0 |
| #define | FTPCLIENT_BINARY 1 |
| #define | FTPCLIENT_PORTNUMBER 21 |
| #define | FTPCLIENT_ACTIVE_MODE 1 |
| #define | FTPCLIENT_PASSIVE_MODE 0 |
| #define | FTPCLIENT_DETAILED_DIRLISTING 1 |
| #define | FTPCLIENT_SHORT_DIRLISTING 0 |
| #define | FTPCLIENT_STATUS_SUCCESS 0 |
| #define | FTPCLIENT_SOCKET_ERROR -1 |
| #define | FTPCLIENT_FILE_NOT_FOUND -2 |
| #define | FTPCLIENT_FILE_IO_ERROR -3 |
| #define | FTPCLIENT_ALREADY_LOGGEDIN -4 |
| #define | FTPCLIENT_NOT_CONNECTED -5 |
Functions | |
| unsigned int | ftpclient_version (void) |
| Returns version number of ftpclient library. | |
| void | ftpclient_init (long milli_seconds) |
| Initializes the ftpclient library. | |
| int | ftpclient_connect (struct sockaddr_in *sa, char *user, char *passwd) |
| Connects with FTP server. | |
| int | ftpclient_settransmissionmode (char flag) |
| Sets data transfer mode in FTP server. | |
| void | ftpclient_setdataconnectionmode (char flag) |
| Set data connection mode in ftpclient library. | |
| int | ftpclient_getfile (char *filename, char *storeas_filename) |
| Downloads file from FTP server. | |
| int | ftpclient_putfile (char *filename, char *storeas_filename) |
| Uploads tini file to FTP server. | |
| int | ftpclient_dir (char *name, char *dir_str, int dir_str_len, char format) |
| Returns FTP server directory list. | |
| int | ftpclient_pwd (char *path_str, int path_str_len) |
| Returns current FTP server directory path. | |
| int | ftpclient_cd (char *path_str) |
| Changes server working directory. | |
| int | ftpclient_rawcmd (char *input_cmd) |
| Sends command to FTP server. | |
| int | ftpclient_dataconnection () |
| Configures for new data connection. exchange port number and ip address information with FTP server for data connection. | |
| int | ftpclient_get_dataconnection_handler () |
| Establishes new data connection and returns socket handler. | |
| int | ftpclient_disconnect (void) |
| Terminates connection with FTP server. | |
| char * | ftpclient_getlaststatus (void) |
| Returns last FTP server response string. | |
|
|
Definition for active data connection mode
|
|
|
Error value indicates that client application is already logged-in |
|
|
Definition for ASCII data transfer mode
|
|
|
Definition for BINARY data transfer mode
|
|
|
Definition for detailed directory listing
|
|
|
File operation error value |
|
|
File not found error value |
|
|
Error value indicates that server is not connected |
|
|
Definition for passive data connection mode
|
|
|
Definition for default FTP server port number
|
|
|
Definition for short directory listing
|
|
|
Socket error value |
|
|
FTP Client Status Success value, this value is returned when operation is completed successfully. |
|
|
Version number associated with this header file. Should be the same as the version number returned by the ftpclient_version function.
|
|
|
Changes server working directory. This function changes server working directory
|
|
||||||||||||||||
|
Connects with FTP server. This function establishes connection with FTP server. Connection with FTP server must be established before calling any other functions that interact with FTP server.
|
|
|
Configures for new data connection. exchange port number and ip address information with FTP server for data connection. This function configures for new data connection. For Active mode connection, sends IP address and port number of ftp client to which the data connection have to be established. For passive mode connection, it gets server IP address and port number for data connection
|
|
||||||||||||||||||||
|
Returns FTP server directory list. This function returns FTP server directory list in short format or detailed format. This function can also be used to retrieve information about specific file.
|
|
|
Terminates connection with FTP server. This function terminates connection with FTP server. the server socket will be closed even if there is any socket error
|
|
|
Establishes new data connection and returns socket handler. This function establishes new data connection and returns socket handler. IMPORTANT NOTE: For Active mode connection, This function has to be called after sending control command to server to initiate the data transfer as server will establish data connection after receiving control command. For passive mode connection, this function has to be called before sending control command to server to initiate the data transfer as server expects data connection to be made before responding for control connection.
|
|
||||||||||||
|
Downloads file from FTP server. This function downloads file from FTP server and store it in tini file system.
|
|
|
Returns last FTP server response string. This function returns the FTP server's response status string for the last control command sent to the server.
|
|
|
Initializes the ftpclient library. This function initializes ftpclient library internal datastructure and configures the library with following default configuration
|
|
||||||||||||
|
Uploads tini file to FTP server. This function uploads tini file to FTP server.
|
|
||||||||||||
|
Returns current FTP server directory path. This function returns the current FTP server directory path name
|
|
|
Sends command to FTP server. This function sends command to FTP server through control connection and returns FTP server status code. This function does NOT check whether server is connected. NOTE: To retrieve the response string of server for control command, call the ftpclient_getlaststatus function
|
|
|
Set data connection mode in ftpclient library. This function sets data connection mode in ftpclient library. All future data connections will be made in the mode set by this function
|
|
|
Sets data transfer mode in FTP server. This function sets data transfer mode in FTP server and ftpclient library
|
|
|
Returns version number of ftpclient library.
|
| Copyright 2005 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |