NetBurner 3.5.0
PDF Version |
|
Functions | |
int | FTP_InitializeSession (IPADDR4 server_address, uint16_t port, PCSTR UserName, PCSTR Password, uint32_t time_out) |
Initialize a FTP session with a FTP server. | |
int | FTP_CloseSession (int session) |
Close a FTP session. | |
int | FTPGetDir (int ftp_Session, char *dir_buf, int nbytes, uint16_t timeout) |
Get the current working directory. | |
int | FTPSetDir (int ftp_Session, const char *new_dir, uint16_t timeout) |
Set the current working directory. | |
int | FTPDeleteDir (int ftp_Session, const char *dir_to_delete, uint16_t timeout) |
Delete a directory. | |
int | FTPMakeDir (int ftp_Session, const char *dir_to_make, uint16_t timeout) |
Create a new directory. | |
int | FTPUpDir (int ftp_Session, uint16_t timeout) |
Move up one directory level. | |
int | FTPDeleteFile (int ftp_Session, const char *file_name, uint16_t timeout) |
Delete a file. | |
int | FTPRenameFile (int ftp_Session, const char *old_file_name, const char *new_file_name, uint16_t timeout) |
Rename a file. | |
int | FTPSendFile (int ftp_Session, const char *full_file_name, BOOL bBinaryMode, uint16_t timeout) |
Initialize the process to send a file to s FTP server. | |
int | FTPGetFile (int ftp_Session, const char *full_file_name, BOOL bBinaryMode, uint16_t timeout) |
Initialize the process to get a file from a FTP server. | |
int | FTPGetList (int ftp_Session, const char *full_dir_name, uint16_t timeout) |
Initialize the process to receive a directory listing from a FTP server. | |
int | FTPGetFileNames (int ftp_Session, const char *full_dir_name, uint16_t timeout) |
Initialize the process to receive just the file names in a directory from a FTP server. | |
int | FTPRawCommand (int ftp_Session, const char *cmd, char *cmd_buf, int nbytes, uint16_t timeout) |
Send a FTP command to the FTP server. | |
int | FTPGetCommandResult (int ftp_Session, char *cmd_buf, int nbytes, uint16_t timeout) |
Returns the result of the last FTP operation. | |
int | FTPRawStreamCommand (int ftp_Session, const char *cmd, int *pResult, char *cmd_buf, int nbytes, uint16_t timeout) |
Send a command and receive a response over a stream connection. | |
void | FTPActiveMode (int ftp_Session) |
Set mode to active. | |
void | FTPPassiveMode (int ftp_Session) |
Set mode to passive. | |
#include< ftp.h >
The NetBurner FTP Client Group
int FTP_CloseSession | ( | int | session | ) |
#include <ftp.h>
Close a FTP session.
session | FTP session number to close |
int FTP_InitializeSession | ( | IPADDR4 | server_address, |
uint16_t | port, | ||
PCSTR | UserName, | ||
PCSTR | Password, | ||
uint32_t | time_out ) |
#include <ftp.h>
Initialize a FTP session with a FTP server.
Open a connection to a FTP server and log in with the specified username and password. The session number returned from this call can be used with the file and directory functions.
server_address | The IP address of the FTP server |
port | The listen port number of the FTP server. Typically 21. |
UserName | Log-in username |
Password | Log-in password |
time_out | Timeout in system Time Ticks |
void FTPActiveMode | ( | int | ftp_Session | ) |
int FTPDeleteDir | ( | int | ftp_Session, |
const char * | dir_to_delete, | ||
uint16_t | timeout ) |
#include <ftp.h>
Delete a directory.
ftp_Session | FTP session number |
dir_to_delete | Directory to delete |
timeout | Timeout in system Time Ticks |
int FTPDeleteFile | ( | int | ftp_Session, |
const char * | file_name, | ||
uint16_t | timeout ) |
#include <ftp.h>
Delete a file.
ftp_Session | FTP session number |
file_name | Name of file to delete |
timeout | Timeout in system Time Ticks |
int FTPGetCommandResult | ( | int | ftp_Session, |
char * | cmd_buf, | ||
int | nbytes, | ||
uint16_t | timeout ) |
#include <ftp.h>
Returns the result of the last FTP operation.
Queries the FTP server for the last FTP operation status.
Must be called after the following functions are used:
ftp_Session | FTP session number |
cmd_buf | The buffer to hold the ASCII FTP server response. See FTP Server return codes for details. |
nbytes | The maximum number of bytes cmd_buf can hold |
timeout | Timeout in system Time Ticks |
int FTPGetDir | ( | int | ftp_Session, |
char * | dir_buf, | ||
int | nbytes, | ||
uint16_t | timeout ) |
#include <ftp.h>
Get the current working directory.
ftp_Session | FTP session number |
dir_buf | The buffer to copy the directory information into |
nbytes | Maximum number of bytes in the dir_buf |
timeout | Timeout in system Time Ticks |
int FTPGetFile | ( | int | ftp_Session, |
const char * | full_file_name, | ||
BOOL | bBinaryMode, | ||
uint16_t | timeout ) |
#include <ftp.h>
Initialize the process to get a file from a FTP server.
This function opens a TCP connection to a FTP server so that a file may be read. it will return a file descriptor that can then be used to read the file data using file I/O functions such as: read() and ReadWithTimeout().
IMPORTANT After reading the file data you must do 2 things:
ftp_Session | FTP session number |
full_file_name | Full file name being read, including the path |
bBinaryMode | True = read file as binary data, False = read file as ASCII data |
timeout | Timeout in system Time Ticks |
int FTPGetFileNames | ( | int | ftp_Session, |
const char * | full_dir_name, | ||
uint16_t | timeout ) |
#include <ftp.h>
Initialize the process to receive just the file names in a directory from a FTP server.
This function opens a TCP connection to a FTP server so that a list of file names may be read. it will return a file descriptor that can then be used to read the file data using file I/O functions such as: read() and ReadWithTimeout().
IMPORTANT After reading the file data you must do 2 things:
ftp_Session | FTP session number |
full_dir_name | Full directory name to read, including the path |
timeout | Timeout in system Time Ticks |
int FTPGetList | ( | int | ftp_Session, |
const char * | full_dir_name, | ||
uint16_t | timeout ) |
#include <ftp.h>
Initialize the process to receive a directory listing from a FTP server.
This function opens a TCP connection to a FTP server so that a directory list may be read. it will return a file descriptor that can then be used to read the file data using file I/O functions such as: read() and ReadWithTimeout().
IMPORTANT After reading the file data you must do 2 things:
ftp_Session | FTP session number |
full_dir_name | Full directory name to read, including the path |
timeout | Timeout in system Time Ticks |
int FTPMakeDir | ( | int | ftp_Session, |
const char * | dir_to_make, | ||
uint16_t | timeout ) |
#include <ftp.h>
Create a new directory.
ftp_Session | FTP session number |
dir_to_make | Directory to create |
timeout | Timeout in system Time Ticks |
void FTPPassiveMode | ( | int | ftp_Session | ) |
int FTPRawCommand | ( | int | ftp_Session, |
const char * | cmd, | ||
char * | cmd_buf, | ||
int | nbytes, | ||
uint16_t | timeout ) |
#include <ftp.h>
Send a FTP command to the FTP server.
ftp_Session | FTP session number. |
cmd | The command to send. Do not include termination such as \r\n . |
cmd_buf | The buffer to hold the FTP server response, in ASCII. |
nbytes | The maximum number of bytes the cmd_buf can hold. |
timeout | Timeout in system Time Ticks. |
int FTPRawStreamCommand | ( | int | ftp_Session, |
const char * | cmd, | ||
int * | pResult, | ||
char * | cmd_buf, | ||
int | nbytes, | ||
uint16_t | timeout ) |
#include <ftp.h>
Send a command and receive a response over a stream connection.
The FTP server will close the connection after all the data has been read. This function is the basis for such functions as FTPGetList() and FTPGetFiles().
IMPORTANT After reading the file data you must call FTPGetCommandResult() to check the result of the operation.
ftp_Session | FTP session number |
cmd | Command to send |
pResult | The server response code integer value |
cmd_buf | The server response code ASCII value (including \r\n ) |
nbytes | Maximum number of bytes cmd_buf can hold |
timeout | Timeout in system Time Ticks |
int FTPRenameFile | ( | int | ftp_Session, |
const char * | old_file_name, | ||
const char * | new_file_name, | ||
uint16_t | timeout ) |
#include <ftp.h>
Rename a file.
ftp_Session | FTP session number |
old_file_name | Name of file to rename |
new_file_name | New name of file |
timeout | Timeout in system Time Ticks |
int FTPSendFile | ( | int | ftp_Session, |
const char * | full_file_name, | ||
BOOL | bBinaryMode, | ||
uint16_t | timeout ) |
#include <ftp.h>
Initialize the process to send a file to s FTP server.
This function opens a TCP connection to a FTP server so that a file may be sent. it will return a file descriptor that can then be used to send the file data using file I/O write functions such as: write(), writeall(), writestring(), etc.
IMPORTANT After sending the file data you must do 2 things:
ftp_Session | FTP session number |
full_file_name | Name of the file being sent |
bBinaryMode | True = send file as binary data, False = send file as ASCII data |
timeout | Timeout in system Time Ticks |
int FTPSetDir | ( | int | ftp_Session, |
const char * | new_dir, | ||
uint16_t | timeout ) |
#include <ftp.h>
Set the current working directory.
ftp_Session | FTP session number |
new_dir | Directory path to set |
timeout | Timeout in system Time Ticks |
int FTPUpDir | ( | int | ftp_Session, |
uint16_t | timeout ) |
#include <ftp.h>
Move up one directory level.
ftp_Session | FTP session number |
timeout | Timeout in system Time Ticks |