NetBurner 3.1
ftp.h
Go to the documentation of this file.
1 /*NB_REVISION*/
2 
3 /*NB_COPYRIGHT*/
4 
15 #ifndef _NB_FTP_H
16 #define _NB_FTP_H
17 
18 #include <nettypes.h>
19 
23 #define FTP_OK (0)
24 #define FTP_TIMEOUT (-1)
25 #define FTP_PASSWORDERROR (-2)
26 #define FTP_CONNECTFAIL (-3)
27 #define FTP_COMMANDFAIL (-4)
28 #define FTP_COMMANDERROR (-4)
29 #define FTP_BADSESSION (-5)
30 #define FTP_NETWORKERROR (-6)
31 
33 
50 int FTP_InitializeSession(IPADDR4 server_address, uint16_t port, PCSTR UserName, PCSTR Password, uint32_t time_out);
51 
62 int FTP_CloseSession(int session);
63 
75 int FTPGetDir(int ftp_Session, char *dir_buf, int nbytes, uint16_t timeout);
76 
87 int FTPSetDir(int ftp_Session, const char *new_dir, uint16_t timeout);
88 
99 int FTPDeleteDir(int ftp_Session, const char *dir_to_delete, uint16_t timeout);
100 
111 int FTPMakeDir(int ftp_Session, const char *dir_to_make, uint16_t timeout);
112 
122 int FTPUpDir(int ftp_Session, uint16_t timeout);
123 
134 int FTPDeleteFile(int ftp_Session, const char *file_name, uint16_t timeout);
135 
147 int FTPRenameFile(int ftp_Session, const char *old_file_name, const char *new_file_name, uint16_t timeout);
148 
189 int FTPSendFile(int ftp_Session, const char *full_file_name, BOOL bBinaryMode, uint16_t timeout);
190 
229 int FTPGetFile(int ftp_Session, const char *full_file_name, BOOL bBinaryMode, uint16_t timeout);
230 
249 int FTPGetList(int ftp_Session, const char *full_dir_name, uint16_t timeout);
250 
269 int FTPGetFileNames(int ftp_Session, const char *full_dir_name, uint16_t timeout);
270 
283 int FTPRawCommand(int ftp_Session, const char *cmd, char *cmd_buf, int nbytes, uint16_t timeout);
284 
304 int FTPGetCommandResult(int ftp_Session, char *cmd_buf, int nbytes, uint16_t timeout);
305 
324 int FTPRawStreamCommand(int ftp_Session, const char *cmd, int *pResult, char *cmd_buf, int nbytes, uint16_t timeout);
325 
332 void FTPActiveMode(int ftp_Session);
333 
340 void FTPPassiveMode(int ftp_Session);
341 
342 #endif
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.
Definition: ftp.cpp:669
int FTPDeleteDir(int ftp_Session, const char *dir_to_delete, uint16_t timeout)
Delete a directory.
Definition: ftp.cpp:461
int FTPGetCommandResult(int ftp_Session, char *cmd_buf, int nbytes, uint16_t timeout)
Returns the result of the last FTP operation.
Definition: ftp.cpp:131
void FTPPassiveMode(int ftp_Session)
Set mode to passive.
Definition: ftp.cpp:360
int FTPGetDir(int ftp_Session, char *dir_buf, int nbytes, uint16_t timeout)
Get the current working directory.
Definition: ftp.cpp:395
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.
Definition: ftp.cpp:745
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.
Definition: ftp.cpp:42
int FTPRenameFile(int ftp_Session, const char *old_file_name, const char *new_file_name, uint16_t timeout)
Rename a file.
Definition: ftp.cpp:588
int FTPSetDir(int ftp_Session, const char *new_dir, uint16_t timeout)
Set the current working directory.
Definition: ftp.cpp:429
void FTPActiveMode(int ftp_Session)
Set mode to active.
Definition: ftp.cpp:366
int FTPUpDir(int ftp_Session, uint16_t timeout)
Move up one directory level.
Definition: ftp.cpp:524
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.
Definition: ftp.cpp:708
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.
Definition: ftp.cpp:253
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.
Definition: ftp.cpp:627
int FTPRawCommand(int ftp_Session, const char *cmd, char *cmd_buf, int nbytes, uint16_t timeout)
Send a FTP command to the FTP server.
Definition: ftp.cpp:136
int FTPMakeDir(int ftp_Session, const char *dir_to_make, uint16_t timeout)
Create a new directory.
Definition: ftp.cpp:493
int FTPDeleteFile(int ftp_Session, const char *file_name, uint16_t timeout)
Delete a file.
Definition: ftp.cpp:554
int FTP_CloseSession(int session)
Close a FTP session.
Definition: ftp.cpp:113