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

📄 spidef.h

📁 用于嵌入式系统的TCP/IP协议栈及若干服务
💻 H
字号:
/*************************************************************************            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/spidef.h $*  $Revision: 1.6 $***************************************************************************  File Name : spidef.h**  Description:*     SPI (Server Protocol Interpreter) defines**    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 _SPIDEF_#define _SPIDEF_#include "spicom.h"/* export data */const char r_125[] = "Data connection already open on socket %d; transfer starting.",           r_150[] = "Opening data connection for (%s) (%s).",           r_200[] = "Command okay.",           r_202[] = "Command not implemented, superfluous at this site.",           r_220[] = "Service ready for new user.",           r_221[] = "Service closing control connection.",           r_225[] = "Data connection open; no transfer in progress.",           r_226[] = "Closing data connection.",           r_230[] = "User logged in, proceed.",           r_230a[] ="User logged in, access restricted.",           r_250[] = "Requested file action okay, completed.",           r_250a[] ="Requested file action okay, unique file name is %s.",           r_331[] = "User name okay, need password.",           r_331a[] ="Guest access allowed, please sign in.",           r_332[] = "Need account for login.",           r_350[] = "Requested file action pending further information.",           r_421[] = "Service not available, closing control connection.",           r_425[] = "Can't open data connection.",           r_425a[] = "Can't open data connection: %s.",           r_426[] = "Connection closed; transfer aborted.",           r_450[] = "Requested file action not taken.  File unavailable.",           r_451[] = "Requested action aborted: local error in processing.",           r_451a[] = "Requested action aborted: %s.",           r_452[] = "Requested action not taken.  Insufficient storage space in system.",           r_500[] = "Syntax error, command unrecognized.",           r_501[] = "Syntax error in parameters or arguments.",           r_502[] = "Command not implemented.",           r_503[] = "Bad sequence of commands.",           r_504[] = "Command not implemented for that parameter.",           r_530[] = "Not logged in.",           r_532[] = "Need account for storing files.",           r_550[] = "Requested action not taken.  File not found.",           r_550a[] = "Requested action not taken.  File is a directory.",           r_550b[] = "Requested action not taken: %s",           r_551[] = "Requested action aborted: page type unknown.",           r_552[] = "Requested file action aborted.",           r_553[] = "Requested action not taken.  File name not allowed.";static const char abor_help[] = "Abort previous FTP service command",        acct_help[] = "Argument identifies the user's account",        allo_help[] = "Reserve storage",        appe_help[] = "Append to file",        cdup_help[] = "Change to parent directory",        cwd_help[] =  "Change working directory",        dele_help[] = "Delete file",        help_help[] = "Send helpful information",        list_help[] = "Send file list",        mkd_help[] =  "Create a directory",        mode_help[] = "Specify the transfer mode",        nlst_help[] = "Send a list of file names",        noop_help[] = "No operation",        pass_help[] = "Argument is the user's password",        pasv_help[] = "Cause the server to listen on the data port",        port_help[] = "Data port to be used in data connection",        pwd_help[] =  "Print working directory",        quit_help[] = "Terminate service",        rein_help[] = "Reinitialize control connection",        rest_help[] = "Restart transfer",        retr_help[] = "Retrieve file",        rmd_help[] =  "Remove directory",        rnfr_help[] = "Rename from",        rnto_help[] = "Rename to",        site_help[] = "System specific services: FNS protection=mask owner=name group=name",        smnt_help[] = "Structure mount",        stat_help[] = "Status information",        stor_help[] = "Store file",        stou_help[] = "Store unique file",        stru_help[] = "File structure",        syst_help[] = "System type",        type_help[] = "Representation type",        user_help[] = "User";/*  * Note that if any FTP commands are added to 'cmdtab' the * arrays 'map' and 'mphtab' will need to be recomputed. */const   int cmdcount = 37;const cmd_t cmdtab[] = {/* 0 */ { "ABOR", spiabor,  OPT_STRING,    0,          abor_help },/* 1 */ { "ACCT", spiacct,  STRING,        0,          acct_help },/* 2 */ { "ALLO", spiallo,  STRING,        LOGGED_IN,  allo_help },/* 3 */ { "APPE", spiappe,  STRING,        LOGGED_IN,  appe_help },/* 4 */ { "CDUP", spicdup,  NOT_ALLOWED,   LOGGED_IN,  cdup_help },/* 5 */ { "CWD ", spicwd,   STRING,        LOGGED_IN,  cwd_help  },/* 6 */ { "DELE", spidele,  STRING,        LOGGED_IN,  dele_help },/* 7 */ { "HELP", spihelp,  OPT_STRING,    0,          help_help },/* 8 */ { "LIST", spilist,  OPT_STRING,    LOGGED_IN,  list_help },/* 9 */ { "MKD ", spimkd,   STRING,        LOGGED_IN,  mkd_help  },/* 10 */{ "MODE", spimode,  STRING,        0,          mode_help },/* 11 */{ "NLST", spinlst,  OPT_STRING,    LOGGED_IN,  nlst_help },/* 12 */{ "NOOP", spinoop,  NOT_ALLOWED,   0,          noop_help },/* 13 */{ "PASS", spipass,  STRING,        0,          pass_help },/* 14 */{ "PASV", spipasv,  NOT_ALLOWED,   0,          pasv_help },/* 15 */{ "PORT", spiport,  STRING,        0,          port_help },/* 16 */{ "PWD ", spipwd,   NOT_ALLOWED,   LOGGED_IN,  pwd_help  },/* 17 */{ "QUIT", spiquit,  OPT_STRING,    0,          quit_help },/* 18 */{ "REIN", spirein,  NOT_ALLOWED,   LOGGED_IN,  rein_help },/* 19 */{ "REST", spirest,  STRING,        LOGGED_IN,  rest_help },/* 20 */{ "RETR", spiretr,  STRING,        LOGGED_IN,  retr_help },/* 21 */{ "RMD ", spirmd,   STRING,        LOGGED_IN,  rmd_help  },/* 22 */{ "RNFR", spirnfr,  STRING,        LOGGED_IN,  rnfr_help },/* 23 */{ "RNTO", spirnto,  STRING,        LOGGED_IN,  rnto_help },/* 24 */{ "SITE", spisite,  STRING,        0,          site_help },/* 25 */{ "SMNT", spismnt,  STRING,        LOGGED_IN,  smnt_help },/* 26 */{ "STAT", spistat,  OPT_STRING,    0,          stat_help },/* 27 */{ "STOR", spistor,  STRING,        LOGGED_IN,  stor_help },/* 28 */{ "STOU", spistou,  NOT_ALLOWED,   LOGGED_IN,  stou_help },/* 29 */{ "STRU", spistru,  STRING,        0,          stru_help },/* 30 */{ "SYST", spisyst,  NOT_ALLOWED,   0,          syst_help },/* 31 */{ "TYPE", spitype,  STRING,        0,          type_help },/* 32 */{ "USER", spiuser,  OPT_STRING,    0,          user_help },/* 33 */{ "XCUP", spicdup,  NOT_ALLOWED,   LOGGED_IN,  cdup_help },/* 34 */{ "XMKD", spimkd,   STRING,        LOGGED_IN,  mkd_help  },/* 35 */{ "XPWD", spipwd,   NOT_ALLOWED,   LOGGED_IN,  pwd_help  },/* 36 */{ "XRMD", spirmd,   STRING,        LOGGED_IN,  rmd_help  }};/* character mapping tables for "minimal" perfect hash */const u8    map[26] = { 209,  0,   152, 226,                        11,   0,   0,   231,                        0,    0,   0,   205,                        103,  15,  25,  135,                        201,  148, 67,  1,                        0,    0,   173, 9,                        0,    0 };const cmd_t * mphtab[] = {/* 0 */ (cmd_t *)0,/* 1 */ &cmdtab[4],/* 2 */ &cmdtab[1],/* 3 */ (cmd_t *)0,/* 4 */ &cmdtab[2],/* 5 */ &cmdtab[6],/* 6 */ &cmdtab[7],/* 7 */ &cmdtab[30],/* 8 */ &cmdtab[12],/* 9 */ &cmdtab[5],/* 10 */&cmdtab[17],/* 11 */(cmd_t *)0,/* 12 */(cmd_t *)0,/* 13 */(cmd_t *)0,/* 14 */(cmd_t *)0,/* 15 */&cmdtab[24],/* 16 */(cmd_t *)0,/* 17 */&cmdtab[8],/* 18 */&cmdtab[34],/* 19 */&cmdtab[31],/* 20 */(cmd_t *)0,/* 21 */(cmd_t *)0,/* 22 */&cmdtab[26],/* 23 */(cmd_t *)0,/* 24 */&cmdtab[29],/* 25 */(cmd_t *)0,/* 26 */(cmd_t *)0,/* 27 */&cmdtab[14],/* 28 */(cmd_t *)0,/* 29 */&cmdtab[28],/* 30 */&cmdtab[13],/* 31 */&cmdtab[35],/* 32 */&cmdtab[11],/* 33 */(cmd_t *)0,/* 34 */&cmdtab[32],/* 35 */&cmdtab[19],/* 36 */(cmd_t *)0,/* 37 */(cmd_t *)0,/* 38 */&cmdtab[36],/* 39 */(cmd_t *)0,/* 40 */&cmdtab[33],/* 41 */(cmd_t *)0,/* 42 */&cmdtab[3],/* 43 */&cmdtab[9],/* 44 */(cmd_t *)0,/* 45 */&cmdtab[10],/* 46 */&cmdtab[18],/* 47 */(cmd_t *)0,/* 48 */(cmd_t *)0,/* 49 */&cmdtab[27],/* 50 */(cmd_t *)0,/* 51 */(cmd_t *)0,/* 52 */&cmdtab[20],/* 53 */&cmdtab[15],/* 54 */(cmd_t *)0,/* 55 */&cmdtab[22],/* 56 */&cmdtab[16],/* 57 */(cmd_t *)0,/* 58 */&cmdtab[25],/* 59 */(cmd_t *)0,/* 60 */(cmd_t *)0,/* 61 */&cmdtab[23],/* 62 */&cmdtab[0],/* 63 */&cmdtab[21]};#endif

⌨️ 快捷键说明

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