VirtualBox

Changeset 82678 in vbox for trunk/src/VBox/Runtime/generic


Ignore:
Timestamp:
Jan 8, 2020 5:15:44 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
135588
Message:

IPRT/FTP: More command handler stubs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/ftp-server.cpp

    r82673 r82678  
    148148typedef RTFTPSERVERCLIENTSTATE *PRTFTPSERVERCLIENTSTATE;
    149149
     150/** Function pointer declaration for a specific FTP server command handler. */
    150151typedef DECLCALLBACK(int) FNRTFTPSERVERCMD(PRTFTPSERVERCLIENTSTATE pClient);
    151152/** Pointer to a FNRTFTPSERVERCMD(). */
    152153typedef FNRTFTPSERVERCMD *PFNRTFTPSERVERCMD;
    153154
     155/**
     156 * Function prototypes for command handlers.
     157 */
     158static FNRTFTPSERVERCMD rtFTPServerHandleABOR;
     159static FNRTFTPSERVERCMD rtFTPServerHandleCDUP;
     160static FNRTFTPSERVERCMD rtFTPServerHandleCWD;
     161static FNRTFTPSERVERCMD rtFTPServerHandleLIST;
     162static FNRTFTPSERVERCMD rtFTPServerHandleMODE;
     163static FNRTFTPSERVERCMD rtFTPServerHandleNOOP;
     164static FNRTFTPSERVERCMD rtFTPServerHandlePORT;
     165static FNRTFTPSERVERCMD rtFTPServerHandlePWD;
     166static FNRTFTPSERVERCMD rtFTPServerHandleQUIT;
     167static FNRTFTPSERVERCMD rtFTPServerHandleRETR;
     168static FNRTFTPSERVERCMD rtFTPServerHandleRGET;
     169static FNRTFTPSERVERCMD rtFTPServerHandleSTAT;
    154170static FNRTFTPSERVERCMD rtFTPServerHandleSYST;
    155 
     171static FNRTFTPSERVERCMD rtFTPServerHandleTYPE;
     172
     173/**
     174 * Structure for maintaining a single command entry for the command table.
     175 */
    156176typedef struct RTFTPSERVER_CMD_ENTRY
    157177{
     178    /** Command ID. */
    158179    RTFTPSERVER_CMD    enmCmd;
     180    /** Command represented as ASCII string. */
    159181    char               szCmd[RTFTPSERVER_MAX_CMD_LEN];
     182    /** Function pointer invoked to handle the command. */
    160183    PFNRTFTPSERVERCMD  pfnCmd;
    161184} RTFTPSERVER_CMD_ENTRY;
    162185
     186/**
     187 * Table of handled commands.
     188 */
    163189const RTFTPSERVER_CMD_ENTRY g_aCmdMap[] =
    164190{
     191    { RTFTPSERVER_CMD_ABOR,     "ABOR",         rtFTPServerHandleABOR },
     192    { RTFTPSERVER_CMD_CDUP,     "CDUP",         rtFTPServerHandleCDUP },
     193    { RTFTPSERVER_CMD_CWD,      "CWD",          rtFTPServerHandleCWD  },
     194    { RTFTPSERVER_CMD_LIST,     "LIST",         rtFTPServerHandleLIST },
     195    { RTFTPSERVER_CMD_MODE,     "MODE",         rtFTPServerHandleMODE },
     196    { RTFTPSERVER_CMD_NOOP,     "NOOP",         rtFTPServerHandleNOOP },
     197    { RTFTPSERVER_CMD_PORT,     "PORT",         rtFTPServerHandlePORT },
     198    { RTFTPSERVER_CMD_PWD,      "PWD",          rtFTPServerHandlePWD  },
     199    { RTFTPSERVER_CMD_QUIT,     "QUIT",         rtFTPServerHandleQUIT },
     200    { RTFTPSERVER_CMD_RETR,     "RETR",         rtFTPServerHandleRETR },
     201    { RTFTPSERVER_CMD_RGET,     "RGET",         rtFTPServerHandleRGET },
     202    { RTFTPSERVER_CMD_STAT,     "STAT",         rtFTPServerHandleSTAT },
    165203    { RTFTPSERVER_CMD_SYST,     "SYST",         rtFTPServerHandleSYST },
     204    { RTFTPSERVER_CMD_TYPE,     "TYPE",         rtFTPServerHandleTYPE },
    166205    { RTFTPSERVER_CMD_LAST,     "",             NULL }
    167206};
     
    208247}
    209248
     249static int rtFTPServerHandleABOR(PRTFTPSERVERCLIENTSTATE pClient)
     250{
     251    RT_NOREF(pClient);
     252
     253    /** @todo Anything to do here? */
     254    return VINF_SUCCESS;
     255}
     256
     257static int rtFTPServerHandleCDUP(PRTFTPSERVERCLIENTSTATE pClient)
     258{
     259    RT_NOREF(pClient);
     260
     261    /** @todo Anything to do here? */
     262    return VINF_SUCCESS;
     263}
     264
     265static int rtFTPServerHandleCWD(PRTFTPSERVERCLIENTSTATE pClient)
     266{
     267    RT_NOREF(pClient);
     268
     269    /** @todo Anything to do here? */
     270    return VINF_SUCCESS;
     271}
     272
     273static int rtFTPServerHandleLIST(PRTFTPSERVERCLIENTSTATE pClient)
     274{
     275    RT_NOREF(pClient);
     276
     277    /** @todo Anything to do here? */
     278    return VINF_SUCCESS;
     279}
     280
     281static int rtFTPServerHandleMODE(PRTFTPSERVERCLIENTSTATE pClient)
     282{
     283    RT_NOREF(pClient);
     284
     285    /** @todo Anything to do here? */
     286    return VINF_SUCCESS;
     287}
     288
     289static int rtFTPServerHandleNOOP(PRTFTPSERVERCLIENTSTATE pClient)
     290{
     291    RT_NOREF(pClient);
     292
     293    /** @todo Anything to do here? */
     294    return VINF_SUCCESS;
     295}
     296
     297static int rtFTPServerHandlePORT(PRTFTPSERVERCLIENTSTATE pClient)
     298{
     299    RT_NOREF(pClient);
     300
     301    /** @todo Anything to do here? */
     302    return VINF_SUCCESS;
     303}
     304
     305static int rtFTPServerHandlePWD(PRTFTPSERVERCLIENTSTATE pClient)
     306{
     307    RT_NOREF(pClient);
     308
     309    /** @todo Anything to do here? */
     310    return VINF_SUCCESS;
     311}
     312
     313static int rtFTPServerHandleQUIT(PRTFTPSERVERCLIENTSTATE pClient)
     314{
     315    RT_NOREF(pClient);
     316
     317    /** @todo Anything to do here? */
     318    return VINF_SUCCESS;
     319}
     320
     321static int rtFTPServerHandleRETR(PRTFTPSERVERCLIENTSTATE pClient)
     322{
     323    RT_NOREF(pClient);
     324
     325    /** @todo Anything to do here? */
     326    return VINF_SUCCESS;
     327}
     328
     329static int rtFTPServerHandleRGET(PRTFTPSERVERCLIENTSTATE pClient)
     330{
     331    RT_NOREF(pClient);
     332
     333    /** @todo Anything to do here? */
     334    return VINF_SUCCESS;
     335}
     336
     337static int rtFTPServerHandleSTAT(PRTFTPSERVERCLIENTSTATE pClient)
     338{
     339    RT_NOREF(pClient);
     340
     341    /** @todo Anything to do here? */
     342    return VINF_SUCCESS;
     343}
     344
    210345static int rtFTPServerHandleSYST(PRTFTPSERVERCLIENTSTATE pClient)
    211346{
     
    216351
    217352    return rc;
     353}
     354
     355static int rtFTPServerHandleTYPE(PRTFTPSERVERCLIENTSTATE pClient)
     356{
     357    RT_NOREF(pClient);
     358
     359    /** @todo Anything to do here? */
     360    return VINF_SUCCESS;
    218361}
    219362
     
    307450                    rc = rc2;
    308451            }
     452
     453            if (g_aCmdMap[i].enmCmd == RTFTPSERVER_CMD_QUIT)
     454                break;
    309455        }
    310456        else
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette