Changeset 82678 in vbox for trunk/src/VBox/Runtime/generic
- Timestamp:
- Jan 8, 2020 5:15:44 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 135588
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/ftp-server.cpp
r82673 r82678 148 148 typedef RTFTPSERVERCLIENTSTATE *PRTFTPSERVERCLIENTSTATE; 149 149 150 /** Function pointer declaration for a specific FTP server command handler. */ 150 151 typedef DECLCALLBACK(int) FNRTFTPSERVERCMD(PRTFTPSERVERCLIENTSTATE pClient); 151 152 /** Pointer to a FNRTFTPSERVERCMD(). */ 152 153 typedef FNRTFTPSERVERCMD *PFNRTFTPSERVERCMD; 153 154 155 /** 156 * Function prototypes for command handlers. 157 */ 158 static FNRTFTPSERVERCMD rtFTPServerHandleABOR; 159 static FNRTFTPSERVERCMD rtFTPServerHandleCDUP; 160 static FNRTFTPSERVERCMD rtFTPServerHandleCWD; 161 static FNRTFTPSERVERCMD rtFTPServerHandleLIST; 162 static FNRTFTPSERVERCMD rtFTPServerHandleMODE; 163 static FNRTFTPSERVERCMD rtFTPServerHandleNOOP; 164 static FNRTFTPSERVERCMD rtFTPServerHandlePORT; 165 static FNRTFTPSERVERCMD rtFTPServerHandlePWD; 166 static FNRTFTPSERVERCMD rtFTPServerHandleQUIT; 167 static FNRTFTPSERVERCMD rtFTPServerHandleRETR; 168 static FNRTFTPSERVERCMD rtFTPServerHandleRGET; 169 static FNRTFTPSERVERCMD rtFTPServerHandleSTAT; 154 170 static FNRTFTPSERVERCMD rtFTPServerHandleSYST; 155 171 static FNRTFTPSERVERCMD rtFTPServerHandleTYPE; 172 173 /** 174 * Structure for maintaining a single command entry for the command table. 175 */ 156 176 typedef struct RTFTPSERVER_CMD_ENTRY 157 177 { 178 /** Command ID. */ 158 179 RTFTPSERVER_CMD enmCmd; 180 /** Command represented as ASCII string. */ 159 181 char szCmd[RTFTPSERVER_MAX_CMD_LEN]; 182 /** Function pointer invoked to handle the command. */ 160 183 PFNRTFTPSERVERCMD pfnCmd; 161 184 } RTFTPSERVER_CMD_ENTRY; 162 185 186 /** 187 * Table of handled commands. 188 */ 163 189 const RTFTPSERVER_CMD_ENTRY g_aCmdMap[] = 164 190 { 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 }, 165 203 { RTFTPSERVER_CMD_SYST, "SYST", rtFTPServerHandleSYST }, 204 { RTFTPSERVER_CMD_TYPE, "TYPE", rtFTPServerHandleTYPE }, 166 205 { RTFTPSERVER_CMD_LAST, "", NULL } 167 206 }; … … 208 247 } 209 248 249 static int rtFTPServerHandleABOR(PRTFTPSERVERCLIENTSTATE pClient) 250 { 251 RT_NOREF(pClient); 252 253 /** @todo Anything to do here? */ 254 return VINF_SUCCESS; 255 } 256 257 static int rtFTPServerHandleCDUP(PRTFTPSERVERCLIENTSTATE pClient) 258 { 259 RT_NOREF(pClient); 260 261 /** @todo Anything to do here? */ 262 return VINF_SUCCESS; 263 } 264 265 static int rtFTPServerHandleCWD(PRTFTPSERVERCLIENTSTATE pClient) 266 { 267 RT_NOREF(pClient); 268 269 /** @todo Anything to do here? */ 270 return VINF_SUCCESS; 271 } 272 273 static int rtFTPServerHandleLIST(PRTFTPSERVERCLIENTSTATE pClient) 274 { 275 RT_NOREF(pClient); 276 277 /** @todo Anything to do here? */ 278 return VINF_SUCCESS; 279 } 280 281 static int rtFTPServerHandleMODE(PRTFTPSERVERCLIENTSTATE pClient) 282 { 283 RT_NOREF(pClient); 284 285 /** @todo Anything to do here? */ 286 return VINF_SUCCESS; 287 } 288 289 static int rtFTPServerHandleNOOP(PRTFTPSERVERCLIENTSTATE pClient) 290 { 291 RT_NOREF(pClient); 292 293 /** @todo Anything to do here? */ 294 return VINF_SUCCESS; 295 } 296 297 static int rtFTPServerHandlePORT(PRTFTPSERVERCLIENTSTATE pClient) 298 { 299 RT_NOREF(pClient); 300 301 /** @todo Anything to do here? */ 302 return VINF_SUCCESS; 303 } 304 305 static int rtFTPServerHandlePWD(PRTFTPSERVERCLIENTSTATE pClient) 306 { 307 RT_NOREF(pClient); 308 309 /** @todo Anything to do here? */ 310 return VINF_SUCCESS; 311 } 312 313 static int rtFTPServerHandleQUIT(PRTFTPSERVERCLIENTSTATE pClient) 314 { 315 RT_NOREF(pClient); 316 317 /** @todo Anything to do here? */ 318 return VINF_SUCCESS; 319 } 320 321 static int rtFTPServerHandleRETR(PRTFTPSERVERCLIENTSTATE pClient) 322 { 323 RT_NOREF(pClient); 324 325 /** @todo Anything to do here? */ 326 return VINF_SUCCESS; 327 } 328 329 static int rtFTPServerHandleRGET(PRTFTPSERVERCLIENTSTATE pClient) 330 { 331 RT_NOREF(pClient); 332 333 /** @todo Anything to do here? */ 334 return VINF_SUCCESS; 335 } 336 337 static int rtFTPServerHandleSTAT(PRTFTPSERVERCLIENTSTATE pClient) 338 { 339 RT_NOREF(pClient); 340 341 /** @todo Anything to do here? */ 342 return VINF_SUCCESS; 343 } 344 210 345 static int rtFTPServerHandleSYST(PRTFTPSERVERCLIENTSTATE pClient) 211 346 { … … 216 351 217 352 return rc; 353 } 354 355 static int rtFTPServerHandleTYPE(PRTFTPSERVERCLIENTSTATE pClient) 356 { 357 RT_NOREF(pClient); 358 359 /** @todo Anything to do here? */ 360 return VINF_SUCCESS; 218 361 } 219 362 … … 307 450 rc = rc2; 308 451 } 452 453 if (g_aCmdMap[i].enmCmd == RTFTPSERVER_CMD_QUIT) 454 break; 309 455 } 310 456 else
Note:
See TracChangeset
for help on using the changeset viewer.