xref: /csrg-svn/usr.bin/ftp/cmdtab.c (revision 26049)
121738Sdist /*
2*26049Sminshall  * Copyright (c) 1985 Regents of the University of California.
321738Sdist  * All rights reserved.  The Berkeley software License Agreement
421738Sdist  * specifies the terms and conditions for redistribution.
521738Sdist  */
621738Sdist 
710295Ssam #ifndef lint
8*26049Sminshall static char sccsid[] = "@(#)cmdtab.c	5.3 (Berkeley) 02/03/86";
921738Sdist #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();
25*26049Sminshall int	pwd(), makedir(), removedir(), setcr();
26*26049Sminshall int	account(), doproxy(), reset(), setcase(), setntrans(), setnmap();
27*26049Sminshall int	setsunique(), setrunique(), cdup(), macdef(), domacro();
2810295Ssam 
29*26049Sminshall char	accounthelp[] =	"send account command to remote server";
3011651Ssam char	appendhelp[] =	"append to a file";
3110295Ssam char	asciihelp[] =	"set ascii transfer type";
3210295Ssam char	beephelp[] =	"beep when command completed";
3310295Ssam char	binaryhelp[] =	"set binary transfer type";
34*26049Sminshall char	casehelp[] =	"toggle mget upper/lower case id mapping";
3510295Ssam char	cdhelp[] =	"change remote working directory";
36*26049Sminshall char	cduphelp[] = 	"change remote working directory to parent directory";
3710295Ssam char	connecthelp[] =	"connect to remote tftp";
38*26049Sminshall char	crhelp[] =	"toggle carriage return stripping on ascii gets";
3910295Ssam char	deletehelp[] =	"delete remote file";
4010295Ssam char	debughelp[] =	"toggle/set debugging mode";
4110295Ssam char	dirhelp[] =	"list contents of remote directory";
4210295Ssam char	disconhelp[] =	"terminate ftp session";
43*26049Sminshall char	domachelp[] = 	"execute macro";
4410295Ssam char	formhelp[] =	"set file transfer format";
4511350Ssam char	globhelp[] =	"toggle metacharacter expansion of local file names";
4611651Ssam char	hashhelp[] =	"toggle printing `#' for each buffer transferred";
4710295Ssam char	helphelp[] =	"print local help information";
4810295Ssam char	lcdhelp[] =	"change local working directory";
4910295Ssam char	lshelp[] =	"nlist contents of remote directory";
50*26049Sminshall char	macdefhelp[] =  "define a macro";
5111651Ssam char	mdeletehelp[] =	"delete multiple files";
5211757Ssam char	mdirhelp[] =	"list contents of multiple remote directories";
5311350Ssam char	mgethelp[] =	"get multiple files";
5410295Ssam char	mkdirhelp[] =	"make directory on the remote machine";
5511757Ssam char	mlshelp[] =	"nlist contents of multiple remote directories";
5610295Ssam char	modehelp[] =	"set file transfer mode";
5711350Ssam char	mputhelp[] =	"send multiple files";
58*26049Sminshall char	nmaphelp[] =	"set templates for default file name mapping";
59*26049Sminshall char	ntranshelp[] =	"set translation table for default file name mapping";
6011651Ssam char	porthelp[] =	"toggle use of PORT cmd for each data connection";
6110295Ssam char	prompthelp[] =	"force interactive prompting on multiple commands";
62*26049Sminshall char	proxyhelp[] =	"issue command on alternate connection";
6310295Ssam char	pwdhelp[] =	"print working directory on remote machine";
6410295Ssam char	quithelp[] =	"terminate ftp session and exit";
6510295Ssam char	quotehelp[] =	"send arbitrary ftp command";
6610295Ssam char	receivehelp[] =	"receive file";
6710295Ssam char	remotehelp[] =	"get help from remote server";
6810295Ssam char	renamehelp[] =	"rename file";
6910295Ssam char	rmdirhelp[] =	"remove directory on the remote machine";
70*26049Sminshall char	runiquehelp[] = "toggle store unique for local files";
71*26049Sminshall char	resethelp[] =	"clear queued command replies";
7211350Ssam char	sendhelp[] =	"send one file";
7310295Ssam char	shellhelp[] =	"escape to the shell";
7410295Ssam char	statushelp[] =	"show current status";
7510295Ssam char	structhelp[] =	"set file transfer structure";
76*26049Sminshall char	suniquehelp[] = "toggle store unique on remote machine";
7710295Ssam char	tenexhelp[] =	"set tenex file transfer type";
7810295Ssam char	tracehelp[] =	"toggle packet tracing";
7910295Ssam char	typehelp[] =	"set file transfer type";
8010295Ssam char	userhelp[] =	"send new user information";
8110295Ssam char	verbosehelp[] =	"toggle verbose mode";
8210295Ssam 
8310295Ssam struct cmd cmdtab[] = {
84*26049Sminshall 	{ "!",		shellhelp,	0,	0,	0,	shell },
85*26049Sminshall 	{ "$",		domachelp,	1,	0,	0,	domacro },
86*26049Sminshall 	{ "account",	accounthelp,	0,	1,	1,	account},
87*26049Sminshall 	{ "append",	appendhelp,	1,	1,	1,	put },
88*26049Sminshall 	{ "ascii",	asciihelp,	0,	1,	1,	setascii },
89*26049Sminshall 	{ "bell",	beephelp,	0,	0,	0,	setbell },
90*26049Sminshall 	{ "binary",	binaryhelp,	0,	1,	1,	setbinary },
91*26049Sminshall 	{ "bye",	quithelp,	0,	0,	0,	quit },
92*26049Sminshall 	{ "case",	casehelp,	0,	0,	1,	setcase },
93*26049Sminshall 	{ "cd",		cdhelp,		0,	1,	1,	cd },
94*26049Sminshall 	{ "cdup",	cduphelp,	0,	1,	1,	cdup },
95*26049Sminshall 	{ "close",	disconhelp,	0,	1,	1,	disconnect },
96*26049Sminshall 	{ "cr",		crhelp,		0,	0,	0,	setcr },
97*26049Sminshall 	{ "delete",	deletehelp,	0,	1,	1,	delete },
98*26049Sminshall 	{ "debug",	debughelp,	0,	0,	0,	setdebug },
99*26049Sminshall 	{ "dir",	dirhelp,	1,	1,	1,	ls },
100*26049Sminshall 	{ "disconnect",	disconhelp,	0,	1,	1,	disconnect },
101*26049Sminshall 	{ "form",	formhelp,	0,	1,	1,	setform },
102*26049Sminshall 	{ "get",	receivehelp,	1,	1,	1,	get },
103*26049Sminshall 	{ "glob",	globhelp,	0,	0,	0,	setglob },
104*26049Sminshall 	{ "hash",	hashhelp,	0,	0,	0,	sethash },
105*26049Sminshall 	{ "help",	helphelp,	0,	0,	1,	help },
106*26049Sminshall 	{ "lcd",	lcdhelp,	0,	0,	0,	lcd },
107*26049Sminshall 	{ "ls",		lshelp,		1,	1,	1,	ls },
108*26049Sminshall 	{ "macdef",	macdefhelp,	0,	0,	0,	macdef },
109*26049Sminshall 	{ "mdelete",	mdeletehelp,	1,	1,	1,	mdelete },
110*26049Sminshall 	{ "mdir",	mdirhelp,	1,	1,	1,	mls },
111*26049Sminshall 	{ "mget",	mgethelp,	1,	1,	1,	mget },
112*26049Sminshall 	{ "mkdir",	mkdirhelp,	0,	1,	1,	makedir },
113*26049Sminshall 	{ "mls",	mlshelp,	1,	1,	1,	mls },
114*26049Sminshall 	{ "mode",	modehelp,	0,	1,	1,	setmode },
115*26049Sminshall 	{ "mput",	mputhelp,	1,	1,	1,	mput },
116*26049Sminshall 	{ "nmap",	nmaphelp,	0,	0,	1,	setnmap },
117*26049Sminshall 	{ "ntrans",	ntranshelp,	0,	0,	1,	setntrans },
118*26049Sminshall 	{ "open",	connecthelp,	0,	0,	1,	setpeer },
119*26049Sminshall 	{ "prompt",	prompthelp,	0,	0,	0,	setprompt },
120*26049Sminshall 	{ "proxy",	proxyhelp,	0,	0,	1,	doproxy },
121*26049Sminshall 	{ "sendport",	porthelp,	0,	0,	0,	setport },
122*26049Sminshall 	{ "put",	sendhelp,	1,	1,	1,	put },
123*26049Sminshall 	{ "pwd",	pwdhelp,	0,	1,	1,	pwd },
124*26049Sminshall 	{ "quit",	quithelp,	0,	0,	0,	quit },
125*26049Sminshall 	{ "quote",	quotehelp,	1,	1,	1,	quote },
126*26049Sminshall 	{ "recv",	receivehelp,	1,	1,	1,	get },
127*26049Sminshall 	{ "remotehelp",	remotehelp,	0,	1,	1,	rmthelp },
128*26049Sminshall 	{ "rename",	renamehelp,	0,	1,	1,	renamefile },
129*26049Sminshall 	{ "reset",	resethelp,	0,	1,	1,	reset },
130*26049Sminshall 	{ "rmdir",	rmdirhelp,	0,	1,	1,	removedir },
131*26049Sminshall 	{ "runique",	runiquehelp,	0,	0,	1,	setrunique },
132*26049Sminshall 	{ "send",	sendhelp,	1,	1,	1,	put },
133*26049Sminshall 	{ "status",	statushelp,	0,	0,	1,	status },
134*26049Sminshall 	{ "struct",	structhelp,	0,	1,	1,	setstruct },
135*26049Sminshall 	{ "sunique",	suniquehelp,	0,	0,	1,	setsunique },
136*26049Sminshall 	{ "tenex",	tenexhelp,	0,	1,	1,	settenex },
137*26049Sminshall 	{ "trace",	tracehelp,	0,	0,	0,	settrace },
138*26049Sminshall 	{ "type",	typehelp,	0,	1,	1,	settype },
139*26049Sminshall 	{ "user",	userhelp,	0,	1,	1,	user },
140*26049Sminshall 	{ "verbose",	verbosehelp,	0,	0,	0,	setverbose },
141*26049Sminshall 	{ "?",		helphelp,	0,	0,	1,	help },
14211651Ssam 	{ 0 },
14310295Ssam };
14410295Ssam 
14518287Sralph int	NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1;
146