xref: /csrg-svn/usr.bin/ftp/cmdtab.c (revision 10305)
110295Ssam #ifndef lint
2*10305Ssam static char sccsid[] = "@(#)cmdtab.c	4.2 (Berkeley) 01/15/83";
310295Ssam #endif
410295Ssam #include "ftp_var.h"
510295Ssam 
610295Ssam /*
710295Ssam  * User FTP -- Command Tables.
810295Ssam  */
910295Ssam int	setascii(), setbell(), setbinary(), setdebug(), setform();
1010295Ssam int	setmode(), setpeer(), setprompt(), setstruct(), settenex();
1110295Ssam int	settrace(), settype(), setverbose();
1210295Ssam int	disconnect();
1310295Ssam int	cd(), lcd(), delete(), user();
1410295Ssam int	ls(), get(), help(), put();
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";
2910295Ssam char	helphelp[] =	"print local help information";
3010295Ssam char	lcdhelp[] =	"change local working directory";
3110295Ssam char	lshelp[] =	"nlist contents of remote directory";
3210295Ssam char	mkdirhelp[] =	"make directory on the remote machine";
3310295Ssam char	modehelp[] =	"set file transfer mode";
3410295Ssam char	prompthelp[] =	"force interactive prompting on multiple commands";
3510295Ssam char	pwdhelp[] =	"print working directory on remote machine";
3610295Ssam char	quithelp[] =	"terminate ftp session and exit";
3710295Ssam char	quotehelp[] =	"send arbitrary ftp command";
3810295Ssam char	receivehelp[] =	"receive file";
3910295Ssam char	remotehelp[] =	"get help from remote server";
4010295Ssam char	renamehelp[] =	"rename file";
4110295Ssam char	rmdirhelp[] =	"remove directory on the remote machine";
4210295Ssam char	sendhelp[] =	"send file";
4310295Ssam char	shellhelp[] =	"escape to the shell";
4410295Ssam char	statushelp[] =	"show current status";
4510295Ssam char	structhelp[] =	"set file transfer structure";
4610295Ssam char	tenexhelp[] =	"set tenex file transfer type";
4710295Ssam char	tracehelp[] =	"toggle packet tracing";
4810295Ssam char	typehelp[] =	"set file transfer type";
4910295Ssam char	userhelp[] =	"send new user information";
5010295Ssam char	verbosehelp[] =	"toggle verbose mode";
5110295Ssam 
5210295Ssam struct cmd cmdtab[] = {
5310295Ssam 	{ "!",		shellhelp,	0,	shell },
5410295Ssam 	{ "ascii",	asciihelp,	0,	setascii },
5510295Ssam 	{ "bell",	beephelp,	0,	setbell },
5610295Ssam 	{ "binary",	binaryhelp,	0,	setbinary },
5710295Ssam 	{ "bye",	quithelp,	0,	quit },
5810295Ssam 	{ "cd",		cdhelp,		0,	cd },
5910295Ssam 	{ "close",	disconhelp,	0,	disconnect },
6010295Ssam 	{ "delete",	deletehelp,	0,	delete },
6110295Ssam 	{ "debug",	debughelp,	0,	setdebug },
6210295Ssam 	{ "dir",	dirhelp,	1,	ls },
6310295Ssam 	{ "form",	formhelp,	0,	setform },
6410295Ssam 	{ "get",	receivehelp,	1,	get },
6510295Ssam 	{ "help",	helphelp,	0,	help },
6610295Ssam 	{ "lcd",	lcdhelp,	0,	lcd },
6710295Ssam 	{ "ls",		lshelp,		1,	ls },
6810295Ssam 	{ "mode",	modehelp,	0,	setmode },
6910295Ssam 	{ "mkdir",	mkdirhelp,	0,	makedir },
70*10305Ssam 	{ "open",	connecthelp,	0,	setpeer },
7110295Ssam 	{ "prompt",	prompthelp,	0,	setprompt },
7210295Ssam 	{ "put",	sendhelp,	1,	put },
7310295Ssam 	{ "pwd",	pwdhelp,	0,	pwd },
7410295Ssam 	{ "quit",	quithelp,	0,	quit },
7510295Ssam 	{ "quote",	quotehelp,	1,	quote },
7610295Ssam 	{ "recv",	receivehelp,	1,	get },
7710295Ssam 	{ "remotehelp",	remotehelp,	0,	rmthelp },
7810295Ssam 	{ "rename",	renamehelp,	0,	renamefile },
7910295Ssam 	{ "rmdir",	rmdirhelp,	0,	removedir },
8010295Ssam 	{ "send",	sendhelp,	1,	put },
8110295Ssam 	{ "status",	statushelp,	0,	status },
8210295Ssam 	{ "struct",	structhelp,	0,	setstruct },
8310295Ssam 	{ "tenex",	tenexhelp,	0,	settenex },
8410295Ssam 	{ "trace",	tracehelp,	0,	settrace },
8510295Ssam 	{ "type",	typehelp,	0,	settype },
8610295Ssam 	{ "user",	userhelp,	0,	user },
8710295Ssam 	{ "verbose",	verbosehelp,	0,	setverbose },
8810295Ssam 	{ "?",		helphelp,	0,	help },
8910295Ssam 	0
9010295Ssam };
9110295Ssam 
9210295Ssam int	NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
93