Main Page Data Structures File List Data Fields Globals Related Pages

# clib/ftp.h

Go to the documentation of this file.

    00001 /****************************************************************************
    00002 *
    00003 * (C) 2000 by Beck IPC GmbH
    00004 *
    00005 *  Beck IPC GmbH
    00006 *  Garbenheimerstr. 36-38
    00007 *  D-35578 Wetzlar
    00008 *
    00009 *  Phone : (49)-6441-905-240
    00010 *  Fax   : (49)-6441-905-245
    00011 *
    00012 * ---------------------------------------------------------------------------
    00013 * Module        : ftp.h
    00014 *
    00015 * Function      : prototypes, constants for FTP functions
    00016 *                 functions must should be used with program memory model large!
    00017 *
    00018 * Compiler    : Tested with Borland C 5.02
    00019 *
    00020 * Author        : Detlef Gerhardt
    00021 * Date          : 20.01.01
    00022 * ---------------------------------------------------------------------------
    00023
    00024 $Header: ftp.h, 2, 16.01.2002 11:51:55, Christoph Stoidner$
    00025
    00026 $Log:
    00027  2    IPC@CHIP  1.1         16.01.2002 11:51:55  Christoph Stoidner add starteam
    00028       directives
    00029  1    IPC@CHIP  1.0         08.03.2001 15:30:02  Christoph Stoidner
    00030 $
    00031
    00032
    00033 * History       :
    00034 *
    00035 *  Vx.yy                   Author  Changes
    00036 *
    00037 *             11.01.01      dg    create
    00038 *             20.01.01      dg    error handling, malloc ftp connection desc.
    00039 *****************************************************************************/
    00040 #ifndef __FTP_H__
    00041 #define __FTP_H__
    00042 /*************************************************************************/
    00043
    00044 // constants
    00045 #define FTP_CTRLPORT 21
    00046 #define FTP_CONN_MAX 2
    00047
    00048 // used FTP messages
    00049 #define FTP_MSG_DATA_CONNECTION_ALREADY_OPEN 125
    00050 #define FTP_MSG_FILE_STATUS_OK 150
    00051 #define FTP_MSG_TYPE_COMMAND_OK 200
    00052 #define FTP_MSG_SERVER_READY 220
    00053 #define FTP_MSG_GOODBYE 221
    00054 #define FTP_MSG_TRANSFER_COMPLETED 226
    00055 #define FTP_MSG_ENTERING_PASSIV_MODE 227
    00056 #define FTP_MSG_USER_LOGGED_IN 230
    00057 #define FTP_MSG_REQ_FILE_ACTION_OK 250
    00058 #define FTP_MSG_CURRENT_DIRECTORY 257
    00059 #define FTP_MSG_DIRECTORY_CREATED 257
    00060 #define FTP_MSG_USERNAME_OK 331
    00061 #define FTP_MSG_SERVICE_NOT_AVAILABLE 421
    00062 #define FTP_MSG_NOT_LOGGED_IN 530
    00063
    00064 #define FTP_ASCII 0
    00065 #define FTP_BINARY 1
    00066
    00067 // ftp connection descriptor
    00068 typedef struct
    00069 {
    00070   int sd_ctrl;  // socket descriptor for control connection
    00071   int sd_data;  // socket descriptor for data connection
    00072   unsigned int local_ctrl_port;
    00073   unsigned int local_data_port;
    00074   unsigned int host_ctrl_port;
    00075   unsigned int host_data_port;
    00076   long HostIPAddr;
    00077   char HostIPStr[20];
    00078 } ftp_desc;
    00079
    00080 //prototypes
    00081 ftp_desc *ftp_open(char *DestIPStr, unsigned int ClientCtrlPort,
    00082         unsigned int ClientDataPort, unsigned int HostCtrlPort,
    00083         int *stat, int *error);
    00084 int ftp_close(ftp_desc *fd, int *error);
    00085 int ftp_login(ftp_desc *fd, char *user, char *pass, int *stat, int *error);
    00086 int ftp_logout(ftp_desc *fd, int *stat, int *error);
    00087 int ftp_pwd(ftp_desc *fd, char *dirstr, int strlen, int *stat, int *error);
    00088 int ftp_cwd(ftp_desc *fd, char *cwdstr, int *stat, int *error);
    00089 int ftp_mkd(ftp_desc *fd, char *mkdstr, int *stat, int *error);
    00090 int ftp_rmd(ftp_desc *fd, char *rmdstr, int *stat, int *error);
    00091 int ftp_dele(ftp_desc *fd, char *filename, int *stat, int *error);
    00092 int ftp_sendfile(ftp_desc *fd, char *LocalName, char *RemoteName, int mode,
    00093           int *stat, int *error);
    00094 int ftp_recvfile(ftp_desc *fd, char *RemoteName, char *LocalName, int mode,
    00095           int *stat, int *error);
    00096
    00097 /*************************************************************************/
    00098 #endif /* __FTP_H__ */
    00099 /*************************************************************************/
    00100 //end rtos.h
    00101 /*************************************************************************/
    00102