xref: /csrg-svn/usr.bin/ftp/cmdtab.c (revision 21738)
1*21738Sdist /*
2*21738Sdist  * Copyright (c) 1980 Regents of the University of California.
3*21738Sdist  * All rights reserved.  The Berkeley software License Agreement
4*21738Sdist  * specifies the terms and conditions for redistribution.
5*21738Sdist  */
6*21738Sdist 
710295Ssam #ifndef lint
8*21738Sdist static char sccsid[] = "@(#)cmdtab.c	5.1 (Berkeley) 05/31/85";
9*21738Sdist #endif not lint
1011651Ssam 
1110295Ssam #include "ftp_var.h"
1210295Ssam 
1310295Ssam /*
1410295Ssam  * User FTP -- Command Tables.
1510295Ssam  */
1610295Ssam int	setascii(), setbell(), setbinary(), setdebug(), setform();
1714144Ssam int	setglob(), sethash(), setmode(), setpeer(), setport();
1811651Ssam int	setprompt(), setstruct();
1911350Ssam int	settenex(), settrace(), settype(), setverbose();
2010295Ssam int	disconnect();
2111651Ssam int	cd(), lcd(), delete(), mdelete(), user();
2211757Ssam int	ls(), mls(), get(), mget(), help(), append(), put(), mput();
2310295Ssam int	quit(), renamefile(), status();
2410295Ssam int	quote(), rmthelp(), shell();
2510295Ssam int	pwd(), makedir(), removedir();
2610295Ssam 
2711651Ssam char	appendhelp[] =	"append to a file";
2810295Ssam char	asciihelp[] =	"set ascii transfer type";
2910295Ssam char	beephelp[] =	"beep when command completed";
3010295Ssam char	binaryhelp[] =	"set binary transfer type";
3110295Ssam char	cdhelp[] =	"change remote working directory";
3210295Ssam char	connecthelp[] =	"connect to remote tftp";
3310295Ssam char	deletehelp[] =	"delete remote file";
3410295Ssam char	debughelp[] =	"toggle/set debugging mode";
3510295Ssam char	dirhelp[] =	"list contents of remote directory";
3610295Ssam char	disconhelp[] =	"terminate ftp session";
3710295Ssam char	formhelp[] =	"set file transfer format";
3811350Ssam char	globhelp[] =	"toggle metacharacter expansion of local file names";
3911651Ssam char	hashhelp[] =	"toggle printing `#' for each buffer transferred";
4010295Ssam char	helphelp[] =	"print local help information";
4110295Ssam char	lcdhelp[] =	"change local working directory";
4210295Ssam char	lshelp[] =	"nlist contents of remote directory";
4311651Ssam char	mdeletehelp[] =	"delete multiple files";
4411757Ssam char	mdirhelp[] =	"list contents of multiple remote directories";
4511350Ssam char	mgethelp[] =	"get multiple files";
4610295Ssam char	mkdirhelp[] =	"make directory on the remote machine";
4711757Ssam char	mlshelp[] =	"nlist contents of multiple remote directories";
4810295Ssam char	modehelp[] =	"set file transfer mode";
4911350Ssam char	mputhelp[] =	"send multiple files";
5011651Ssam char	porthelp[] =	"toggle use of PORT cmd for each data connection";
5110295Ssam char	prompthelp[] =	"force interactive prompting on multiple commands";
5210295Ssam char	pwdhelp[] =	"print working directory on remote machine";
5310295Ssam char	quithelp[] =	"terminate ftp session and exit";
5410295Ssam char	quotehelp[] =	"send arbitrary ftp command";
5510295Ssam char	receivehelp[] =	"receive file";
5610295Ssam char	remotehelp[] =	"get help from remote server";
5710295Ssam char	renamehelp[] =	"rename file";
5810295Ssam char	rmdirhelp[] =	"remove directory on the remote machine";
5911350Ssam char	sendhelp[] =	"send one file";
6010295Ssam char	shellhelp[] =	"escape to the shell";
6110295Ssam char	statushelp[] =	"show current status";
6210295Ssam char	structhelp[] =	"set file transfer structure";
6310295Ssam char	tenexhelp[] =	"set tenex file transfer type";
6410295Ssam char	tracehelp[] =	"toggle packet tracing";
6510295Ssam char	typehelp[] =	"set file transfer type";
6610295Ssam char	userhelp[] =	"send new user information";
6710295Ssam char	verbosehelp[] =	"toggle verbose mode";
6810295Ssam 
6910295Ssam struct cmd cmdtab[] = {
7011651Ssam 	{ "!",		shellhelp,	0,	0,	shell },
7111757Ssam 	{ "append",	appendhelp,	1,	1,	put },
7211651Ssam 	{ "ascii",	asciihelp,	0,	1,	setascii },
7311651Ssam 	{ "bell",	beephelp,	0,	0,	setbell },
7411651Ssam 	{ "binary",	binaryhelp,	0,	1,	setbinary },
7511651Ssam 	{ "bye",	quithelp,	0,	0,	quit },
7611651Ssam 	{ "cd",		cdhelp,		0,	1,	cd },
7711651Ssam 	{ "close",	disconhelp,	0,	1,	disconnect },
7811651Ssam 	{ "delete",	deletehelp,	0,	1,	delete },
7911651Ssam 	{ "debug",	debughelp,	0,	0,	setdebug },
8011651Ssam 	{ "dir",	dirhelp,	1,	1,	ls },
8111651Ssam 	{ "form",	formhelp,	0,	1,	setform },
8211651Ssam 	{ "get",	receivehelp,	1,	1,	get },
8311651Ssam 	{ "glob",	globhelp,	0,	0,	setglob },
8411651Ssam 	{ "hash",	hashhelp,	0,	0,	sethash },
8511651Ssam 	{ "help",	helphelp,	0,	0,	help },
8611651Ssam 	{ "lcd",	lcdhelp,	0,	0,	lcd },
8711651Ssam 	{ "ls",		lshelp,		1,	1,	ls },
8811651Ssam 	{ "mdelete",	mdeletehelp,	1,	1,	mdelete },
8911757Ssam 	{ "mdir",	mdirhelp,	1,	1,	mls },
9011651Ssam 	{ "mget",	mgethelp,	1,	1,	mget },
9111651Ssam 	{ "mkdir",	mkdirhelp,	0,	1,	makedir },
9211757Ssam 	{ "mls",	mlshelp,	1,	1,	mls },
9311651Ssam 	{ "mode",	modehelp,	0,	1,	setmode },
9411651Ssam 	{ "mput",	mputhelp,	1,	1,	mput },
9511651Ssam 	{ "open",	connecthelp,	0,	0,	setpeer },
9611651Ssam 	{ "prompt",	prompthelp,	0,	0,	setprompt },
9711651Ssam 	{ "sendport",	porthelp,	0,	0,	setport },
9811651Ssam 	{ "put",	sendhelp,	1,	1,	put },
9911651Ssam 	{ "pwd",	pwdhelp,	0,	1,	pwd },
10011651Ssam 	{ "quit",	quithelp,	0,	0,	quit },
10111651Ssam 	{ "quote",	quotehelp,	1,	1,	quote },
10211651Ssam 	{ "recv",	receivehelp,	1,	1,	get },
10311651Ssam 	{ "remotehelp",	remotehelp,	0,	1,	rmthelp },
10411651Ssam 	{ "rename",	renamehelp,	0,	1,	renamefile },
10511651Ssam 	{ "rmdir",	rmdirhelp,	0,	1,	removedir },
10611651Ssam 	{ "send",	sendhelp,	1,	1,	put },
10711651Ssam 	{ "status",	statushelp,	0,	0,	status },
10811651Ssam 	{ "struct",	structhelp,	0,	1,	setstruct },
10911651Ssam 	{ "tenex",	tenexhelp,	0,	1,	settenex },
11011651Ssam 	{ "trace",	tracehelp,	0,	0,	settrace },
11111651Ssam 	{ "type",	typehelp,	0,	1,	settype },
11211651Ssam 	{ "user",	userhelp,	0,	1,	user },
11311651Ssam 	{ "verbose",	verbosehelp,	0,	0,	setverbose },
11411651Ssam 	{ "?",		helphelp,	0,	0,	help },
11511651Ssam 	{ 0 },
11610295Ssam };
11710295Ssam 
11818287Sralph int	NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1;
119