⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 spicom.h

📁 用于嵌入式系统的TCP/IP协议栈及若干服务
💻 H
📖 第 1 页 / 共 2 页
字号:
/*************************************************************************            Copyright (c) 1993-2001 by NETsilicon Inc.**  This software is copyrighted by and is the sole property of*  NETsilicon.  All rights, title, ownership, or other interests*  in the software remain the property of NETsilicon.  This*  software may only be used in accordance with the corresponding*  license agreement.  Any unauthorized use, duplication, transmission,*  distribution, or disclosure of this software is expressly forbidden.**  This Copyright notice may not be removed or modified without prior*  written consent of NETsilicon.**  NETsilicon, reserves the right to modify this software*  without notice.**  NETsilicon*  411 Waverley Oaks Road                  USA 781.647.1234*  Suite 227                               http://www.netsilicon.com*  Waltham, MA 02452                       AmericaSales@netsilicon.com***************************************************************************  $Name: Fusion 6.52 Fusion 6.51 $*  $Date: 2001/09/20 10:38:57 $*  $Source: M:/psisrc/ftp/incl/rcs/spicom.h $*  $Revision: 1.8 $***************************************************************************  File Name : spicom.h**  Description:*     Common declarations for the FTP Server Protocol**     Declarations for the Server Protocol Interpreter (called the*     server-PI in the RFC).  The server protocol interpreter listens*     for a control connection from a client protocol interpreter and*     establishes a control communication connection.  It receives*     standard FTP commands from the client protocol interpreter, sends*     replies, and governs the server data transfer process.*************************************************************************/#ifndef _SPICOM_#define _SPICOM_#include "ftp.h"#define BAD_USER        0#define NEED_PASSWORD   1#define GUEST_OK        2#define USER_OK         3/* kinds of args passed to 'spixxx()' functions */#define NOT_ALLOWED     0       /* no argument allowed */#define STRING          1       /* string required */#define OPT_STRING      2       /* string optional *//* flags */#define LOGGED_IN       1       /* user must be logged in to execute this command *//* * FTP command structure. * This structure is used to determine which function to call upon * receiving an FTP command.  It also specifies what argument (if any) * the command can have, whether the user must be logged in the perform * this command, and a help string. */typedef struct cmd_s   {    char       command[5];     /* FTP command */    void       (*function)(cdc_t  *cdcp, char  *path); /* function to call upon receiving this command */    u8         arg;            /* argument syntax for this command, see below */    u8         flags;          /* command flags, see below */    const char * help;         /* string to be given in reply to a HELP command */   } cmd_t;/*------------------------------------------------- * FTP_authenticate * * Description: *    This defines the signature of the function *    that is used to authenticate a user who *    connects to the FTP server.  The client *    application is responsible for implementing *    this function. * *    When a password (PASS) command is received, *    the 'spipass()' function will invoke this *    authenticate function. *-----------------------------------------------*/int FTP_authenticate         (char    *user_name,          char    *password);/*------------------------------------------------- * aftp_fill * * Description: *    Fill the network input buffer *-----------------------------------------------*/int aftp_fill(cdc_t   * cdcp);/*------------------------------------------------- * spiabor * * Description: *    Process an abort (ABOR) command. * *    The control connection is given by the *    parameter 'cdcp'. *-----------------------------------------------*/void spiabor        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spiacct * * Description: *    Process an account (ACCT) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the account string to use. *-----------------------------------------------*/void spiacct        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spiallo * * Description: *    Process an allocate (ALLO) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' *    should be of the form "<decimal-integer>" *    or "<decimal-integer> R <decimal-integer>". *-----------------------------------------------*/void spiallo        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spiappe * * Description: *    Process an append (APPE) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the pathname of the file to be appended. *-----------------------------------------------*/void spiappe        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spicdup * * Description: *    Process a change to parent directory *    (CDUP) command * *    The control connection is given by the *    parameter 'cdcp'. *-----------------------------------------------*/void spicdup        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spicwd * * Description: *    Process a change working directory (CWD) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the pathname of the directory to change to. *-----------------------------------------------*/void spicwd        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spidele * * Description: *    Process a delete (DELE) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the pathname of the file to be deleted. *-----------------------------------------------*/void spidele        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spihelp * * Description: *    Process a help (HELP) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    optional parameter 'arg' is the command which *    help is desired. *-----------------------------------------------*/void spihelp        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spilist * * Description: *    Process a list (LIST) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the pathname of what is to be listed. *-----------------------------------------------*/void spilist        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spimkd * * Description: *    Process a make directory (MKD) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the pathname of the directory to be created. *-----------------------------------------------*/void spimkd        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spimode * * Description: *    Process a transfer mode (MODE) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the transfer mode to be set. *-----------------------------------------------*/void spimode        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spinlst * * Description: *    Process a name list (NLST) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the pathname of what is to be listed. *-----------------------------------------------*/void spinlst        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spinoop * * Description: *    Process a noop (NOOP) command. * *    The control connection is given by the *    parameter 'cdcp'. *-----------------------------------------------*/void spinoop        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spipass * * Description: *    Process a password (PASS) command. * *    The control connection is given by the *    parameter 'cdcp'.  The parameter 'arg' is *    the password. *-----------------------------------------------*/void spipass        (cdc_t   *cdcp,         char    *arg);/*------------------------------------------------- * spipasv * * Description:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -