FtpConfig.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2002,2003 Sony Corporation 
00003 //
00004 // Permission to use, copy, modify, and redistribute this software for
00005 // non-commercial use is hereby granted.
00006 //
00007 // This software is provided "as is" without warranty of any kind,
00008 // either expressed or implied, including but not limited to the
00009 // implied warranties of fitness for a particular purpose.
00010 //
00011 
00012 #ifndef _FtpConfig_h_DEFINED
00013 #define _FtpConfig_h_DEFINED
00014 
00015 #define FTP_LISTEN_PORT    21
00016 #define FTP_DATA_PORT      20
00017 #define FTP_PASV_DATA_PORT 3000
00018 #define FTP_CONNECTION_MAX 4
00019 #define FTP_BUFFER_SIZE    8192
00020 #define FTP_PASSWD_PATH    "/MS/OPEN-R/MW/CONF/PASSWD"
00021 #define MAX_STRING_LENGTH  128
00022 #define MAX_LOGIN          8
00023 
00024 // some character constants
00025 // ---------------------------------------
00026 
00027 #define CR 13   // carriage return
00028 #define LF 10   // line feed
00029 #define HT 9    // horizontal tab
00030 #define SP 32   // space
00031 
00032 struct Passwd {
00033     char user[MAX_STRING_LENGTH];
00034     char pass[MAX_STRING_LENGTH];
00035     char home[MAX_STRING_LENGTH];
00036 
00037     Passwd() {
00038         user[0] = '\0';
00039         pass[0] = '\0';
00040         home[0] = '\0';
00041     }
00042 };
00043 
00044 enum FTPLoginState {
00045     FTP_NOT_LOGIN,
00046     FTP_LOGIN,
00047     FTP_GET_REQUEST,
00048     FTP_UNDEF
00049 };
00050 
00051 enum FTPDataType {
00052     FTP_DATA_I,
00053     FTP_DATA_A
00054 };
00055 
00056 // FTP Method
00057 // --------------------------------------------------------
00058 enum FTPMethod {
00059     FTP_METHOD_USER,
00060     FTP_METHOD_PASS,
00061     FTP_METHOD_PORT,
00062     FTP_METHOD_PASV,
00063     FTP_METHOD_TYPE,
00064     FTP_METHOD_MODE,
00065     FTP_METHOD_STRU,
00066     FTP_METHOD_RETR,
00067     FTP_METHOD_STOR,
00068     FTP_METHOD_APPE,
00069     FTP_METHOD_RNFR,
00070     FTP_METHOD_RNTO,
00071     FTP_METHOD_DELE,
00072     FTP_METHOD_CWD,
00073     FTP_METHOD_CDUP,
00074     FTP_METHOD_RMD,
00075     FTP_METHOD_MKD,
00076     FTP_METHOD_PWD,
00077     FTP_METHOD_LIST,
00078     FTP_METHOD_NLST,
00079     FTP_METHOD_SYST,
00080     FTP_METHOD_STAT,
00081     FTP_METHOD_HELP,
00082     FTP_METHOD_NOOP,
00083     FTP_METHOD_QUIT,
00084     FTP_METHOD_UNSUPPORTED
00085 };
00086 
00087 // FTP Status
00088 // --------------------------------------------------------
00089 enum FTPReplyCode
00090 {
00091     // Positive Preliminary reply
00092     FTP_REPLY_RESTART_MARKER  = 110,
00093     FTP_REPLY_SERVER_READY    = 120,
00094     FTP_REPLY_TRANSFER_START  = 125,
00095     FTP_REPLY_OPEN_CONNECTION = 150,
00096 
00097     // Positive Completion reply
00098     FTP_REPLY_COMMAND_OK      = 200,
00099     FTP_REPLY_SUPERFLUOUS     = 202,
00100     FTP_REPLY_SYSTEM_STATUS   = 211,
00101     FTP_REPLY_HELP_MESSAGE    = 214,
00102     FTP_REPLY_SYSTEM_TYPE     = 215,
00103     FTP_REPLY_SERVICE_READY   = 220,
00104     FTP_REPLY_SERVICE_CLOSE   = 221,
00105     FTP_REPLY_CLOSE_DATA      = 226,
00106     FTP_REPLY_ENTER_PASSIVE   = 227,
00107     FTP_REPLY_USER_LOGIN      = 230,
00108     FTP_REPLY_FILE_ACTION_OK  = 250,
00109     FTP_REPLY_PATH_CREATED    = 257,
00110 
00111     // Positive Intermediate reply
00112     FTP_REPLY_NEED_PASSWD     = 331,
00113     FTP_REPLY_REQUESTED_FILE  = 350,
00114 
00115     // Transient Negative Completion reply
00116     FTP_REPLY_NOT_AVAILABLE   = 421,
00117     FTP_REPLY_TRANSFER_ABORT  = 426,
00118     FTP_REPLY_NOT_TAKEN       = 450,
00119 
00120     // Permanent Negative Completion reply
00121     FTP_REPLY_UNKNOWN_COMMAND = 500,
00122     FTP_REPLY_NOT_IMPLEMENT   = 502,
00123     FTP_REPLY_BAD_SEQUENCE    = 503,
00124     FTP_REPLY_NOT_LOGIN       = 530,
00125     FTP_REPLY_NO_FILE         = 550,
00126     FTP_REPLY_NOT_TOKEN       = 553,
00127 
00128     // Undefined Reply
00129     FTP_REPLY_NONE = 999
00130 };
00131 
00132 #endif /* _FtpConfig_h_DEFINED*/

Generated on Sun Dec 2 23:04:28 2007 for openSDK by  doxygen 1.3.9.1