#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <errno.h>
#include <string.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <sys/select.h>
#include "liboftp.h"
#include "sub.h"
関数 | |
int | sendn (int sd, const char *buf, int len, int flags) |
int | ftp_send_command (LIBOFTP *ftp, const char *cmd) |
int | ftp_receive_response (LIBOFTP *ftp, char *res_buf, int bufsiz) |
int | ftp_getready_active (LIBOFTP *ftp, const char *cmd, const char *fname) |
int | ftp_getready_pasv (LIBOFTP *ftp, const char *cmd, const char *fname) |
int ftp_getready_active | ( | LIBOFTP * | ftp, | |
const char * | cmd, | |||
const char * | fname | |||
) |
送受信準備 アクティブモード
ftp | LIBOFTPへのポインタ。 | |
cmd | FTPコマンド (ex: RETR, STOR, APPE) | |
fname | サーバ上のファイル名 |
int | ソケット, マイナス値ならエラーコード |
int ftp_getready_pasv | ( | LIBOFTP * | ftp, | |
const char * | cmd, | |||
const char * | fname | |||
) |
送受信準備 パッシブモード
ftp | LIBOFTPへのポインタ。 | |
cmd | FTPコマンド (ex: RETR, STOR, APPE) | |
fname | サーバ上のファイル名 |
int | ソケット, マイナス値ならエラーコード |
int ftp_receive_response | ( | LIBOFTP * | ftp, | |
char * | res_buf, | |||
int | bufsiz | |||
) |
receive response
ftp | pointer of LIBOFTP. | |
res_buf | response buffer ( null ok ) | |
bufsiz | response buffer size. |
int | reply code, or error code (minus value) |
int ftp_send_command | ( | LIBOFTP * | ftp, | |
const char * | cmd | |||
) |
send ftp command
ftp | pointer of LIBOFTP. | |
cmd | ftp command. |
int | 0 is no error, or -1 if an error. |
int sendn | ( | int | sd, | |
const char * | buf, | |||
int | len, | |||
int | flags | |||
) |
send n bytes.
sd | socket descriptor | |
buf | pointer of send buffer | |
len | message length | |
flags | flags of send() |
int | number of bytes sent, or -1 if an error. |