xref: /csrg-svn/usr.bin/ftp/cmdtab.c (revision 11350)
110295Ssam #ifndef lint
2*11350Ssam static char sccsid[] = "@(#)cmdtab.c	4.3 (Berkeley) 03/01/83";
310295Ssam #endif
410295Ssam #include "ftp_var.h"
510295Ssam 
610295Ssam /*
710295Ssam  * User FTP -- Command Tables.
810295Ssam  */
910295Ssam int	setascii(), setbell(), setbinary(), setdebug(), setform();
10*11350Ssam int	setglob(), setmode(), setpeer(), setprompt(), setstruct();
11*11350Ssam int	settenex(), settrace(), settype(), setverbose();
1210295Ssam int	disconnect();
1310295Ssam int	cd(), lcd(), delete(), user();
14*11350Ssam int	ls(), get(), mget(), help(), put(), mput();
1510295Ssam int	quit(), renamefile(), status();
1610295Ssam int	quote(), rmthelp(), shell();
1710295Ssam int	pwd(), makedir(), removedir();
1810295Ssam 
1910295Ssam char	asciihelp[] =	"set ascii transfer type";
2010295Ssam char	beephelp[] =	"beep when command completed";
2110295Ssam char	binaryhelp[] =	"set binary transfer type";
2210295Ssam char	cdhelp[] =	"change remote working directory";
2310295Ssam char	connecthelp[] =	"connect to remote tftp";
2410295Ssam char	deletehelp[] =	"delete remote file";
2510295Ssam char	debughelp[] =	"toggle/set debugging mode";
2610295Ssam char	dirhelp[] =	"list contents of remote directory";
2710295Ssam char	disconhelp[] =	"terminate ftp session";
2810295Ssam char	formhelp[] =	"set file transfer format";
29*11350Ssam char	globhelp[] =	"toggle metacharacter expansion of local file names";
3010295Ssam char	helphelp[] =	"print local help information";
3110295Ssam char	lcdhelp[] =	"change local working directory";
3210295Ssam char	lshelp[] =	"nlist contents of remote directory";
33*11350Ssam char	mgethelp[] =	"get multiple files";
3410295Ssam char	mkdirhelp[] =	"make directory on the remote machine";
3510295Ssam char	modehelp[] =	"set file transfer mode";
36*11350Ssam char	mputhelp[] =	"send multiple files";
3710295Ssam char	prompthelp[] =	"force interactive prompting on multiple commands";
3810295Ssam char	pwdhelp[] =	"print working directory on remote machine";
3910295Ssam char	quithelp[] =	"terminate ftp session and exit";
4010295Ssam char	quotehelp[] =	"send arbitrary ftp command";
4110295Ssam char	receivehelp[] =	"receive file";
4210295Ssam char	remotehelp[] =	"get help from remote server";
4310295Ssam char	renamehelp[] =	"rename file";
4410295Ssam char	rmdirhelp[] =	"remove directory on the remote machine";
45*11350Ssam char	sendhelp[] =	"send one file";
4610295Ssam char	shellhelp[] =	"escape to the shell";
4710295Ssam char	statushelp[] =	"show current status";
4810295Ssam char	structhelp[] =	"set file transfer structure";
4910295Ssam char	tenexhelp[] =	"set tenex file transfer type";
5010295Ssam char	tracehelp[] =	"toggle packet tracing";
5110295Ssam char	typehelp[] =	"set file transfer type";
5210295Ssam char	userhelp[] =	"send new user information";
5310295Ssam char	verbosehelp[] =	"toggle verbose mode";
5410295Ssam 
5510295Ssam struct cmd cmdtab[] = {
5610295Ssam 	{ "!",		shellhelp,	0,	shell },
5710295Ssam 	{ "ascii",	asciihelp,	0,	setascii },
5810295Ssam 	{ "bell",	beephelp,	0,	setbell },
5910295Ssam 	{ "binary",	binaryhelp,	0,	setbinary },
6010295Ssam 	{ "bye",	quithelp,	0,	quit },
6110295Ssam 	{ "cd",		cdhelp,		0,	cd },
6210295Ssam 	{ "close",	disconhelp,	0,	disconnect },
6310295Ssam 	{ "delete",	deletehelp,	0,	delete },
6410295Ssam 	{ "debug",	debughelp,	0,	setdebug },
6510295Ssam 	{ "dir",	dirhelp,	1,	ls },
6610295Ssam 	{ "form",	formhelp,	0,	setform },
6710295Ssam 	{ "get",	receivehelp,	1,	get },
68*11350Ssam 	{ "glob",	globhelp,	0,	setglob },
6910295Ssam 	{ "help",	helphelp,	0,	help },
7010295Ssam 	{ "lcd",	lcdhelp,	0,	lcd },
7110295Ssam 	{ "ls",		lshelp,		1,	ls },
72*11350Ssam 	{ "mget",	mgethelp,	1,	mget },
73*11350Ssam 	{ "mkdir",	mkdirhelp,	0,	makedir },
7410295Ssam 	{ "mode",	modehelp,	0,	setmode },
75*11350Ssam 	{ "mput",	mputhelp,	1,	mput },
7610305Ssam 	{ "open",	connecthelp,	0,	setpeer },
7710295Ssam 	{ "prompt",	prompthelp,	0,	setprompt },
7810295Ssam 	{ "put",	sendhelp,	1,	put },
7910295Ssam 	{ "pwd",	pwdhelp,	0,	pwd },
8010295Ssam 	{ "quit",	quithelp,	0,	quit },
8110295Ssam 	{ "quote",	quotehelp,	1,	quote },
8210295Ssam 	{ "recv",	receivehelp,	1,	get },
8310295Ssam 	{ "remotehelp",	remotehelp,	0,	rmthelp },
8410295Ssam 	{ "rename",	renamehelp,	0,	renamefile },
8510295Ssam 	{ "rmdir",	rmdirhelp,	0,	removedir },
8610295Ssam 	{ "send",	sendhelp,	1,	put },
8710295Ssam 	{ "status",	statushelp,	0,	status },
8810295Ssam 	{ "struct",	structhelp,	0,	setstruct },
8910295Ssam 	{ "tenex",	tenexhelp,	0,	settenex },
9010295Ssam 	{ "trace",	tracehelp,	0,	settrace },
9110295Ssam 	{ "type",	typehelp,	0,	settype },
9210295Ssam 	{ "user",	userhelp,	0,	user },
9310295Ssam 	{ "verbose",	verbosehelp,	0,	setverbose },
9410295Ssam 	{ "?",		helphelp,	0,	help },
9510295Ssam 	0
9610295Ssam };
9710295Ssam 
9810295Ssam int	NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
99