| 1 |
hirohitohigashi |
1 |
/* |
| 2 |
|
|
|
| 3 |
|
|
libftp 1.0 (stable): this is an FTP library to simplify the work to a Developer |
| 4 |
|
|
who want to work with FTP servers (RFC 959). |
| 5 |
|
|
Copyright (C) 2007/2008 omnipresent - omnipresent[at]email.it |
| 6 |
|
|
|
| 7 |
|
|
This program is free software: you can redistribute it and/or modify |
| 8 |
|
|
it under the terms of the GNU General Public License as published by |
| 9 |
|
|
the Free Software Foundation, either version 3 of the License, or |
| 10 |
|
|
(at your option) any later version. |
| 11 |
|
|
|
| 12 |
|
|
This program is distributed in the hope that it will be useful, |
| 13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
|
|
GNU General Public License for more details. |
| 16 |
|
|
|
| 17 |
|
|
You should have received a copy of the GNU General Public License |
| 18 |
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 19 |
|
|
|
| 20 |
|
|
*/ |
| 21 |
|
|
|
| 22 |
|
|
#include <sys/socket.h> |
| 23 |
|
|
#include <sys/types.h> |
| 24 |
|
|
#include <netinet/in.h> |
| 25 |
|
|
|
| 26 |
|
|
/* Error handlers */ |
| 27 |
|
|
extern int h_errno; |
| 28 |
|
|
extern int errno; |
| 29 |
|
|
|
| 30 |
|
|
#ifdef __cplusplus |
| 31 |
|
|
extern "C" { |
| 32 |
|
|
#endif |
| 33 |
|
|
|
| 34 |
|
|
int strfnbytes(char *big_str, char *needle, int bytes); |
| 35 |
|
|
int find_pasv (char *StrPasv, int verbose); |
| 36 |
|
|
int ftp_DataPort (int PortOne, int PortTwo); |
| 37 |
|
|
int ftp_path (char *PathCurDir); |
| 38 |
|
|
|
| 39 |
|
|
int ftp_cwd (int sck, char *Directory, int verbose); |
| 40 |
|
|
int ftp_del (int sck, char *FileName, int verbose); |
| 41 |
|
|
int ftp_mkd (int sck, char *Directory, int verbose); |
| 42 |
|
|
int ftp_rename (int sck, char *old_name, char *new_name, int verbose); |
| 43 |
|
|
int ftp_rmd (int sck, char *Directory, int verbose); |
| 44 |
|
|
int ftp_type(int sck, int type_cmd, int verbose); |
| 45 |
|
|
int ftp_noop(int sck, int verbose); |
| 46 |
|
|
int ftp_dir(int sck, int verbose); |
| 47 |
|
|
int ftp_system (int sck, int verbose); |
| 48 |
|
|
|
| 49 |
|
|
int ftp_login_handler (char *cmd_reply, int verbose); |
| 50 |
|
|
int ftp_dir_handler (char *cmd_reply, int verbose); |
| 51 |
|
|
int ftp_file_handler (char *cmd_reply, int verbose); |
| 52 |
|
|
|
| 53 |
|
|
int ftp_pasv (int sck, int verbose); |
| 54 |
|
|
int ftp_auth(int sck, char *usr, char *pwd, int verbose); |
| 55 |
|
|
int ftp_connect(char *host, int port, struct sockaddr_in *ftp_server, int verbose); |
| 56 |
|
|
int ftp_quit(int sck, int verbose); |
| 57 |
|
|
int ftp_get (int sck, char *FileName, int verbose); |
| 58 |
|
|
int ftp_list (int sck, int verbose); |
| 59 |
|
|
int ftp_nlist (int sck, int verbose); |
| 60 |
|
|
int ftp_put (int sck, char *FileName, int verbose); |
| 61 |
|
|
|
| 62 |
|
|
#ifdef __cplusplus |
| 63 |
|
|
} |
| 64 |
|
|
#endif |