📄 cpi.h
字号:
/*----------------------------------------------- * cpiport * * Description: * Send a data port (PORT) command across the * control connection. * * The control connection is given by the * parameter 'cdcp' which contains a field * 'c_dataaddress' from which the data port * address is determined. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpiport (cdc_t *cdcp);/*----------------------------------------------- * cpipwd * * Description: * Send a print working directory (PWD) command * across the control connection. * * The control connection is given by the * parameter 'cdcp'. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpipwd (cdc_t *cdcp);/*----------------------------------------------- * cpiquit * * Description: * Send a logout (QUIT) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpiquit (cdc_t *cdcp);/*----------------------------------------------- * cpirein * * Description: * Send a reinitialize (REIN) command across * the control connection. * * The control connection is given by the * parameter 'cdcp'. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpirein (cdc_t *cdcp);/*----------------------------------------------- * cpirest * * Description: * Send a restart (REST) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'markp' * contains the information needed to restart * the transfer. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpirest (cdc_t *cdcp, mark_t *markp );/*----------------------------------------------- * cpiretr * * Description: * Send a retrieve (RETR) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'path' is * the pathname of the file to be retrieved at * the server site. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpiretr (cdc_t *cdcp, char *path);/*----------------------------------------------- * cpirmd * * Description: * Send a remove directory (RMD) command across * the control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'path' is * the pathname of the directory to be removed * at the server site. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpirmd (cdc_t *cdcp, char *path);/*----------------------------------------------- * cpirnfr * * Description: * Send a rename from (RNFR) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'from_path' * is the pathname of the file to be renamed at * the server site. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpirnfr (cdc_t *cdcp, char *from_path);/*----------------------------------------------- * cpirnto * * Description: * Send a rename to (RNFR) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'to_path' * is the new pathname of the renamed file at * the server site. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpirnto (cdc_t *cdcp, char *to_path);/*----------------------------------------------- * cpisite * * Description: * Send a site parameters (SITE) command across * the control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'str' is * the string that is to be sent to the server * site. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpisite (cdc_t *cdcp, char *str);/*----------------------------------------------- * cpismnt * * Description: * Send a structure mount (SMNT) command across * the control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'path' is * the directory or other system dependent file * group designator. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpismnt (cdc_t *cdcp, char *path);/*----------------------------------------------- * cpistat * * Description: * Send a status (STAT) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'path' * specifies a directory or other group of * files, or is nil to indicate general status * information about the server FTP process. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpistat (cdc_t *cdcp, char *path);/*----------------------------------------------- * cpistor * * Description: * Send a store (STOR) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'path' * is the pathname of the file to be stored * into at the server site. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpistor (cdc_t *cdcp, char *path);/*----------------------------------------------- * cpistou * * Description: * Send a store unique (STOU) command across * the control connection. * * This function sends data to the server who * then creates a new file in the svr's current * working directory with a name that is * unique to that directory. The server * must respond with a "250 Transfer started" * response which must include the name of * the new file. * * The file to be transferred is specified * either by giving the name of a file * in the 'local_file' argument, or, by * setting that argument to NULL and then * placing the data in the buffer pointed * to by 'cdcp->c_bufptr'. * * The control connection is given by the * parameter 'cdcp'. * * Returns: * OK (0) if the server indicates successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpistou (cdc_t *cdcp, char *local_file);/*----------------------------------------------- * cpistru * * Description: * Send a file structure (STRU) command across * the control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'stru' * is the file structure desired. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpistru (cdc_t *cdcp, stru_t stru);/*----------------------------------------------- * cpisyst * * Description: * Send a system (SYST) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpisyst (cdc_t *cdcp);/*----------------------------------------------- * cpitype * * Description: * Send a representation type (TYPE) command * across the control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'typep' * is a pointer the representaion type desired. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpitype (cdc_t *cdcp, type_t *typep);/*----------------------------------------------- * cpiuser * * Description: * Send a user name (USER) command across the * control connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'name' is * the user name to log in as at the server site * or nil to cause the server to attempt * authentication. Will call 'cpipass' if * a 331 reply is received, 'cpiacct' if a 332 * reply is received. * * Returns: * OK (0) if the reply from the server * indicates that the command was successful. * Otherwise ERR (-1) is returned. *-----------------------------------------------*/extern int cpiuser (cdc_t *cdcp, char *name);/*----------------------------------------------- * ftp_command * * Description: * Send an FTP command across the control * connection. * * The control connection is given by the * parameter 'cdcp'. The parameter 'cmd' is * command string that is to be send. This * string must be terminated with a <CR><LF>. * All client protocol interpreter functions * ('cpi*') utilize 'ftp_command' to perform * the actual sending of the command on the * control connection. * * Returns: * The reply code. *-----------------------------------------------*/extern u16 ftp_command (cdc_t *cdcp, char *cmd);/*----------------------------------------------- * get_reply * * Description: * Wait for a reply from the server. * * The control connection is given by the * parameter 'cdcp'. * * Returns: * The reply code. *-----------------------------------------------*/extern u16 get_reply (cdc_t * cdcp);/*----------------------------------------------- * get_password * * Description: *-----------------------------------------------*/extern char *get_password (cdc_t *cdcp);/*----------------------------------------------- * sftp_fill * * Description: *-----------------------------------------------*/extern int sftp_fill (cdc_t *cdcp);/*----------------------------------------------- * actcmd_null * * Description: *-----------------------------------------------*/extern int actcmd_null (struct cdc_s *c_activehost, char *c_actfile );#endif /*_CPI_*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -