xref: /csrg-svn/usr.bin/ftp/cmdtab.c (revision 11651)
110295Ssam #ifndef lint
2*11651Ssam static char sccsid[] = "@(#)cmdtab.c	4.4 (Berkeley) 03/23/83";
310295Ssam #endif
4*11651Ssam 
510295Ssam #include "ftp_var.h"
610295Ssam 
710295Ssam /*
810295Ssam  * User FTP -- Command Tables.
910295Ssam  */
1010295Ssam int	setascii(), setbell(), setbinary(), setdebug(), setform();
11*11651Ssam int	setglob(), sethash(), setmode(), setpeer(), setport ();
12*11651Ssam int	setprompt(), setstruct();
1311350Ssam int	settenex(), settrace(), settype(), setverbose();
1410295Ssam int	disconnect();
15*11651Ssam int	cd(), lcd(), delete(), mdelete(), user();
16*11651Ssam int	ls(), get(), mget(), help(), append(), put(), mput();
1710295Ssam int	quit(), renamefile(), status();
1810295Ssam int	quote(), rmthelp(), shell();
1910295Ssam int	pwd(), makedir(), removedir();
2010295Ssam 
21*11651Ssam 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";
33*11651Ssam 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";
37*11651Ssam char	mdeletehelp[] =	"delete multiple files";
3811350Ssam char	mgethelp[] =	"get multiple files";
3910295Ssam char	mkdirhelp[] =	"make directory on the remote machine";
4010295Ssam char	modehelp[] =	"set file transfer mode";
4111350Ssam char	mputhelp[] =	"send multiple files";
42*11651Ssam char	porthelp[] =	"toggle use of PORT cmd for each data connection";
4310295Ssam char	prompthelp[] =	"force interactive prompting on multiple commands";
4410295Ssam char	pwdhelp[] =	"print working directory on remote machine";
4510295Ssam char	quithelp[] =	"terminate ftp session and exit";
4610295Ssam char	quotehelp[] =	"send arbitrary ftp command";
4710295Ssam char	receivehelp[] =	"receive file";
4810295Ssam char	remotehelp[] =	"get help from remote server";
4910295Ssam char	renamehelp[] =	"rename file";
5010295Ssam char	rmdirhelp[] =	"remove directory on the remote machine";
5111350Ssam char	sendhelp[] =	"send one file";
5210295Ssam char	shellhelp[] =	"escape to the shell";
5310295Ssam char	statushelp[] =	"show current status";
5410295Ssam char	structhelp[] =	"set file transfer structure";
5510295Ssam char	tenexhelp[] =	"set tenex file transfer type";
5610295Ssam char	tracehelp[] =	"toggle packet tracing";
5710295Ssam char	typehelp[] =	"set file transfer type";
5810295Ssam char	userhelp[] =	"send new user information";
5910295Ssam char	verbosehelp[] =	"toggle verbose mode";
6010295Ssam 
6110295Ssam struct cmd cmdtab[] = {
62*11651Ssam 	{ "!",		shellhelp,	0,	0,	shell },
63*11651Ssam 	{ "append",	appendhelp,	1,	1,	append },
64*11651Ssam 	{ "ascii",	asciihelp,	0,	1,	setascii },
65*11651Ssam 	{ "bell",	beephelp,	0,	0,	setbell },
66*11651Ssam 	{ "binary",	binaryhelp,	0,	1,	setbinary },
67*11651Ssam 	{ "bye",	quithelp,	0,	0,	quit },
68*11651Ssam 	{ "cd",		cdhelp,		0,	1,	cd },
69*11651Ssam 	{ "close",	disconhelp,	0,	1,	disconnect },
70*11651Ssam 	{ "delete",	deletehelp,	0,	1,	delete },
71*11651Ssam 	{ "debug",	debughelp,	0,	0,	setdebug },
72*11651Ssam 	{ "dir",	dirhelp,	1,	1,	ls },
73*11651Ssam 	{ "form",	formhelp,	0,	1,	setform },
74*11651Ssam 	{ "get",	receivehelp,	1,	1,	get },
75*11651Ssam 	{ "glob",	globhelp,	0,	0,	setglob },
76*11651Ssam 	{ "hash",	hashhelp,	0,	0,	sethash },
77*11651Ssam 	{ "help",	helphelp,	0,	0,	help },
78*11651Ssam 	{ "lcd",	lcdhelp,	0,	0,	lcd },
79*11651Ssam 	{ "ls",		lshelp,		1,	1,	ls },
80*11651Ssam 	{ "mdelete",	mdeletehelp,	1,	1,	mdelete },
81*11651Ssam 	{ "mget",	mgethelp,	1,	1,	mget },
82*11651Ssam 	{ "mkdir",	mkdirhelp,	0,	1,	makedir },
83*11651Ssam 	{ "mode",	modehelp,	0,	1,	setmode },
84*11651Ssam 	{ "mput",	mputhelp,	1,	1,	mput },
85*11651Ssam 	{ "open",	connecthelp,	0,	0,	setpeer },
86*11651Ssam 	{ "prompt",	prompthelp,	0,	0,	setprompt },
87*11651Ssam 	{ "sendport",	porthelp,	0,	0,	setport },
88*11651Ssam 	{ "put",	sendhelp,	1,	1,	put },
89*11651Ssam 	{ "pwd",	pwdhelp,	0,	1,	pwd },
90*11651Ssam 	{ "quit",	quithelp,	0,	0,	quit },
91*11651Ssam 	{ "quote",	quotehelp,	1,	1,	quote },
92*11651Ssam 	{ "recv",	receivehelp,	1,	1,	get },
93*11651Ssam 	{ "remotehelp",	remotehelp,	0,	1,	rmthelp },
94*11651Ssam 	{ "rename",	renamehelp,	0,	1,	renamefile },
95*11651Ssam 	{ "rmdir",	rmdirhelp,	0,	1,	removedir },
96*11651Ssam 	{ "send",	sendhelp,	1,	1,	put },
97*11651Ssam 	{ "status",	statushelp,	0,	0,	status },
98*11651Ssam 	{ "struct",	structhelp,	0,	1,	setstruct },
99*11651Ssam 	{ "tenex",	tenexhelp,	0,	1,	settenex },
100*11651Ssam 	{ "trace",	tracehelp,	0,	0,	settrace },
101*11651Ssam 	{ "type",	typehelp,	0,	1,	settype },
102*11651Ssam 	{ "user",	userhelp,	0,	1,	user },
103*11651Ssam 	{ "verbose",	verbosehelp,	0,	0,	setverbose },
104*11651Ssam 	{ "?",		helphelp,	0,	0,	help },
105*11651Ssam 	{ 0 },
10610295Ssam };
10710295Ssam 
10810295Ssam int	NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
109