2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/Inetfile/CFtp.h $
15 * FTP Client class (get only)
18 * Revision 1.2 2002/06/09 04:41:12 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 2 4/20/99 6:39p Dave
26 * Almost done with artillery targeting. Added support for downloading
27 * images on the PXO screen.
29 * 1 4/20/99 4:37p Dave
38 #define FTP_STATE_INTERNAL_ERROR 0
39 #define FTP_STATE_SOCKET_ERROR 1
40 #define FTP_STATE_URL_PARSING_ERROR 2
41 #define FTP_STATE_CONNECTING 3
42 #define FTP_STATE_HOST_NOT_FOUND 4
43 #define FTP_STATE_CANT_CONNECT 5
44 #define FTP_STATE_LOGGING_IN 6
45 #define FTP_STATE_LOGIN_ERROR 7
46 #define FTP_STATE_LOGGED_IN 8
47 #define FTP_STATE_DIRECTORY_INVALID 9
48 #define FTP_STATE_FILE_NOT_FOUND 10
49 #define FTP_STATE_RECEIVING 11
50 #define FTP_STATE_FILE_RECEIVED 12
51 #define FTP_STATE_UNKNOWN_ERROR 13
52 #define FTP_STATE_RECV_FAILED 14
53 #define FTP_STATE_CANT_WRITE_FILE 15
54 #define FTP_STATE_STARTUP 16
57 extern int FTPObjThread( void * obj );
63 CFtpGet(char *URL,char *localfile,char *Username = NULL,char *Password = NULL);
66 unsigned int GetBytesIn();
67 unsigned int GetTotalBytes();
74 int ConnectControlSocket();
76 unsigned int SendFTPCommand(char *command);
77 unsigned int ReadFTPServerReply();
78 unsigned int GetFile();
79 unsigned int IssuePort();
80 unsigned int ReadDataChannel();
81 void FlushControlChannel();
83 unsigned int m_iBytesIn;
84 unsigned int m_iBytesTotal;
90 char m_szUserName[100];
91 char m_szPassword[100];
94 char m_szFilename[100];
96 char recv_buffer[1000];
100 SOCKET m_ControlSock;