/* * $Id: ftp_command.h,v 1.5 2001/03/20 00:21:11 shane Exp $ * * The following comands are parsed: * * USER * PASS * CWD * CDUP * QUIT * PORT * LPRT * EPRT * PASV * LPSV * EPSV [ ] * TYPE * STRU * MODE * RETR * STOR * PWD * LIST [ ] * NLST [ ] * SYST * HELP [ ] * NOOP * REST */ #ifndef FTP_COMMAND_H #define FTP_COMMAND_H #include #include #include #include "af_portability.h" /* special macro for handling EPSV ALL requests */ #define EPSV_ALL (-1) /* maximum possible number of arguments */ #define MAX_ARG 2 /* maximum string length */ #define MAX_STRING_LEN PATH_MAX typedef struct { char command[5]; int num_arg; union { char string[MAX_STRING_LEN+1]; sockaddr_storage_t host_port; int num; off_t offset; } arg[MAX_ARG]; } ftp_command_t; int ftp_command_parse(const char *input, ftp_command_t *cmd); #endif /* FTP_COMMAND_H */