-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFTPClient.h
More file actions
72 lines (64 loc) · 1.3 KB
/
FTPClient.h
File metadata and controls
72 lines (64 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//
// FTPClient.h
//
//
// Created by Artem Kovtunenko on 3/5/16.
//
//
#ifndef ____FTPClient__
#define ____FTPClient__
#include <vector>
#include <sys/poll.h>
#include <fstream>
#include <sstream>
#include <iostream>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <netinet/tcp.h>
#include <sys/uio.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include "Socket.h"
#include <sys/stat.h>
#include <fcntl.h>
using namespace std;
const int BUFFERSIZE = 1500;
class FTPClient
{
public:
FTPClient();
~FTPClient();
FTPClient(const char *);
void closeConnection();
void passiveOpen();
void userName();
void passwd();
int sendMessage(char*, char*);
int receiveMessgae(char*);
//char* receive(char *);
void cdCMD();
void lsCMD();
void getCMD();
void putCDM();
void quitCMD();
char* strTochar(char [], string);
bool syst();
int getCode(char []);
void calculatePASSV(char[]);
void setCommandRequest(string);
private:
string commandReques;
Socket *clientSocket;
Socket *dataSocket;
int dataFD;
const char *url;
char databuf[BUFFERSIZE];
};
#endif /* defined(____FTPClient__) */