110295Ssam #ifndef lint 2*11757Ssam static char sccsid[] = "@(#)cmdtab.c 4.5 (Berkeley) 03/29/83"; 310295Ssam #endif 411651Ssam 510295Ssam #include "ftp_var.h" 610295Ssam 710295Ssam /* 810295Ssam * User FTP -- Command Tables. 910295Ssam */ 1010295Ssam int setascii(), setbell(), setbinary(), setdebug(), setform(); 1111651Ssam int setglob(), sethash(), setmode(), setpeer(), setport (); 1211651Ssam int setprompt(), setstruct(); 1311350Ssam int settenex(), settrace(), settype(), setverbose(); 1410295Ssam int disconnect(); 1511651Ssam int cd(), lcd(), delete(), mdelete(), user(); 16*11757Ssam int ls(), mls(), get(), mget(), help(), append(), put(), mput(); 1710295Ssam int quit(), renamefile(), status(); 1810295Ssam int quote(), rmthelp(), shell(); 1910295Ssam int pwd(), makedir(), removedir(); 2010295Ssam 2111651Ssam char appendhelp[] = "append to a file"; 2210295Ssam char asciihelp[] = "set ascii transfer type"; 2310295Ssam char beephelp[] = "beep when command completed"; 2410295Ssam char binaryhelp[] = "set binary transfer type"; 2510295Ssam char cdhelp[] = "change remote working directory"; 2610295Ssam char connecthelp[] = "connect to remote tftp"; 2710295Ssam char deletehelp[] = "delete remote file"; 2810295Ssam char debughelp[] = "toggle/set debugging mode"; 2910295Ssam char dirhelp[] = "list contents of remote directory"; 3010295Ssam char disconhelp[] = "terminate ftp session"; 3110295Ssam char formhelp[] = "set file transfer format"; 3211350Ssam char globhelp[] = "toggle metacharacter expansion of local file names"; 3311651Ssam char hashhelp[] = "toggle printing `#' for each buffer transferred"; 3410295Ssam char helphelp[] = "print local help information"; 3510295Ssam char lcdhelp[] = "change local working directory"; 3610295Ssam char lshelp[] = "nlist contents of remote directory"; 3711651Ssam char mdeletehelp[] = "delete multiple files"; 38*11757Ssam char mdirhelp[] = "list contents of multiple remote directories"; 3911350Ssam char mgethelp[] = "get multiple files"; 4010295Ssam char mkdirhelp[] = "make directory on the remote machine"; 41*11757Ssam char mlshelp[] = "nlist contents of multiple remote directories"; 4210295Ssam char modehelp[] = "set file transfer mode"; 4311350Ssam char mputhelp[] = "send multiple files"; 4411651Ssam char porthelp[] = "toggle use of PORT cmd for each data connection"; 4510295Ssam char prompthelp[] = "force interactive prompting on multiple commands"; 4610295Ssam char pwdhelp[] = "print working directory on remote machine"; 4710295Ssam char quithelp[] = "terminate ftp session and exit"; 4810295Ssam char quotehelp[] = "send arbitrary ftp command"; 4910295Ssam char receivehelp[] = "receive file"; 5010295Ssam char remotehelp[] = "get help from remote server"; 5110295Ssam char renamehelp[] = "rename file"; 5210295Ssam char rmdirhelp[] = "remove directory on the remote machine"; 5311350Ssam char sendhelp[] = "send one file"; 5410295Ssam char shellhelp[] = "escape to the shell"; 5510295Ssam char statushelp[] = "show current status"; 5610295Ssam char structhelp[] = "set file transfer structure"; 5710295Ssam char tenexhelp[] = "set tenex file transfer type"; 5810295Ssam char tracehelp[] = "toggle packet tracing"; 5910295Ssam char typehelp[] = "set file transfer type"; 6010295Ssam char userhelp[] = "send new user information"; 6110295Ssam char verbosehelp[] = "toggle verbose mode"; 6210295Ssam 6310295Ssam struct cmd cmdtab[] = { 6411651Ssam { "!", shellhelp, 0, 0, shell }, 65*11757Ssam { "append", appendhelp, 1, 1, put }, 6611651Ssam { "ascii", asciihelp, 0, 1, setascii }, 6711651Ssam { "bell", beephelp, 0, 0, setbell }, 6811651Ssam { "binary", binaryhelp, 0, 1, setbinary }, 6911651Ssam { "bye", quithelp, 0, 0, quit }, 7011651Ssam { "cd", cdhelp, 0, 1, cd }, 7111651Ssam { "close", disconhelp, 0, 1, disconnect }, 7211651Ssam { "delete", deletehelp, 0, 1, delete }, 7311651Ssam { "debug", debughelp, 0, 0, setdebug }, 7411651Ssam { "dir", dirhelp, 1, 1, ls }, 7511651Ssam { "form", formhelp, 0, 1, setform }, 7611651Ssam { "get", receivehelp, 1, 1, get }, 7711651Ssam { "glob", globhelp, 0, 0, setglob }, 7811651Ssam { "hash", hashhelp, 0, 0, sethash }, 7911651Ssam { "help", helphelp, 0, 0, help }, 8011651Ssam { "lcd", lcdhelp, 0, 0, lcd }, 8111651Ssam { "ls", lshelp, 1, 1, ls }, 8211651Ssam { "mdelete", mdeletehelp, 1, 1, mdelete }, 83*11757Ssam { "mdir", mdirhelp, 1, 1, mls }, 8411651Ssam { "mget", mgethelp, 1, 1, mget }, 8511651Ssam { "mkdir", mkdirhelp, 0, 1, makedir }, 86*11757Ssam { "mls", mlshelp, 1, 1, mls }, 8711651Ssam { "mode", modehelp, 0, 1, setmode }, 8811651Ssam { "mput", mputhelp, 1, 1, mput }, 8911651Ssam { "open", connecthelp, 0, 0, setpeer }, 9011651Ssam { "prompt", prompthelp, 0, 0, setprompt }, 9111651Ssam { "sendport", porthelp, 0, 0, setport }, 9211651Ssam { "put", sendhelp, 1, 1, put }, 9311651Ssam { "pwd", pwdhelp, 0, 1, pwd }, 9411651Ssam { "quit", quithelp, 0, 0, quit }, 9511651Ssam { "quote", quotehelp, 1, 1, quote }, 9611651Ssam { "recv", receivehelp, 1, 1, get }, 9711651Ssam { "remotehelp", remotehelp, 0, 1, rmthelp }, 9811651Ssam { "rename", renamehelp, 0, 1, renamefile }, 9911651Ssam { "rmdir", rmdirhelp, 0, 1, removedir }, 10011651Ssam { "send", sendhelp, 1, 1, put }, 10111651Ssam { "status", statushelp, 0, 0, status }, 10211651Ssam { "struct", structhelp, 0, 1, setstruct }, 10311651Ssam { "tenex", tenexhelp, 0, 1, settenex }, 10411651Ssam { "trace", tracehelp, 0, 0, settrace }, 10511651Ssam { "type", typehelp, 0, 1, settype }, 10611651Ssam { "user", userhelp, 0, 1, user }, 10711651Ssam { "verbose", verbosehelp, 0, 0, setverbose }, 10811651Ssam { "?", helphelp, 0, 0, help }, 10911651Ssam { 0 }, 11010295Ssam }; 11110295Ssam 11210295Ssam int NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]); 113