xref: /csrg-svn/usr.bin/ftp/cmdtab.c (revision 10295)
1*10295Ssam #ifndef lint
2*10295Ssam static char sccsid[] = "@(#)cmdtab.c	4.1 (Berkeley) 01/15/83";
3*10295Ssam #endif
4*10295Ssam #include "ftp_var.h"
5*10295Ssam 
6*10295Ssam /*
7*10295Ssam  * User FTP -- Command Tables.
8*10295Ssam  */
9*10295Ssam int	setascii(), setbell(), setbinary(), setdebug(), setform();
10*10295Ssam int	setmode(), setpeer(), setprompt(), setstruct(), settenex();
11*10295Ssam int	settrace(), settype(), setverbose();
12*10295Ssam int	disconnect();
13*10295Ssam int	cd(), lcd(), delete(), user();
14*10295Ssam int	ls(), get(), help(), put();
15*10295Ssam int	quit(), renamefile(), status();
16*10295Ssam int	quote(), rmthelp(), shell();
17*10295Ssam int	pwd(), makedir(), removedir();
18*10295Ssam 
19*10295Ssam char	asciihelp[] =	"set ascii transfer type";
20*10295Ssam char	beephelp[] =	"beep when command completed";
21*10295Ssam char	binaryhelp[] =	"set binary transfer type";
22*10295Ssam char	cdhelp[] =	"change remote working directory";
23*10295Ssam char	connecthelp[] =	"connect to remote tftp";
24*10295Ssam char	deletehelp[] =	"delete remote file";
25*10295Ssam char	debughelp[] =	"toggle/set debugging mode";
26*10295Ssam char	dirhelp[] =	"list contents of remote directory";
27*10295Ssam char	disconhelp[] =	"terminate ftp session";
28*10295Ssam char	formhelp[] =	"set file transfer format";
29*10295Ssam char	helphelp[] =	"print local help information";
30*10295Ssam char	lcdhelp[] =	"change local working directory";
31*10295Ssam char	lshelp[] =	"nlist contents of remote directory";
32*10295Ssam char	mkdirhelp[] =	"make directory on the remote machine";
33*10295Ssam char	modehelp[] =	"set file transfer mode";
34*10295Ssam char	prompthelp[] =	"force interactive prompting on multiple commands";
35*10295Ssam char	pwdhelp[] =	"print working directory on remote machine";
36*10295Ssam char	quithelp[] =	"terminate ftp session and exit";
37*10295Ssam char	quotehelp[] =	"send arbitrary ftp command";
38*10295Ssam char	receivehelp[] =	"receive file";
39*10295Ssam char	remotehelp[] =	"get help from remote server";
40*10295Ssam char	renamehelp[] =	"rename file";
41*10295Ssam char	rmdirhelp[] =	"remove directory on the remote machine";
42*10295Ssam char	sendhelp[] =	"send file";
43*10295Ssam char	shellhelp[] =	"escape to the shell";
44*10295Ssam char	statushelp[] =	"show current status";
45*10295Ssam char	structhelp[] =	"set file transfer structure";
46*10295Ssam char	tenexhelp[] =	"set tenex file transfer type";
47*10295Ssam char	tracehelp[] =	"toggle packet tracing";
48*10295Ssam char	typehelp[] =	"set file transfer type";
49*10295Ssam char	userhelp[] =	"send new user information";
50*10295Ssam char	verbosehelp[] =	"toggle verbose mode";
51*10295Ssam 
52*10295Ssam struct cmd cmdtab[] = {
53*10295Ssam 	{ "!",		shellhelp,	0,	shell },
54*10295Ssam 	{ "ascii",	asciihelp,	0,	setascii },
55*10295Ssam 	{ "bell",	beephelp,	0,	setbell },
56*10295Ssam 	{ "binary",	binaryhelp,	0,	setbinary },
57*10295Ssam 	{ "bye",	quithelp,	0,	quit },
58*10295Ssam 	{ "cd",		cdhelp,		0,	cd },
59*10295Ssam 	{ "close",	disconhelp,	0,	disconnect },
60*10295Ssam 	{ "connect",	connecthelp,	0,	setpeer },
61*10295Ssam 	{ "delete",	deletehelp,	0,	delete },
62*10295Ssam 	{ "debug",	debughelp,	0,	setdebug },
63*10295Ssam 	{ "dir",	dirhelp,	1,	ls },
64*10295Ssam 	{ "form",	formhelp,	0,	setform },
65*10295Ssam 	{ "get",	receivehelp,	1,	get },
66*10295Ssam 	{ "help",	helphelp,	0,	help },
67*10295Ssam 	{ "lcd",	lcdhelp,	0,	lcd },
68*10295Ssam 	{ "ls",		lshelp,		1,	ls },
69*10295Ssam 	{ "mode",	modehelp,	0,	setmode },
70*10295Ssam 	{ "mkdir",	mkdirhelp,	0,	makedir },
71*10295Ssam 	{ "prompt",	prompthelp,	0,	setprompt },
72*10295Ssam 	{ "put",	sendhelp,	1,	put },
73*10295Ssam 	{ "pwd",	pwdhelp,	0,	pwd },
74*10295Ssam 	{ "quit",	quithelp,	0,	quit },
75*10295Ssam 	{ "quote",	quotehelp,	1,	quote },
76*10295Ssam 	{ "recv",	receivehelp,	1,	get },
77*10295Ssam 	{ "remotehelp",	remotehelp,	0,	rmthelp },
78*10295Ssam 	{ "rename",	renamehelp,	0,	renamefile },
79*10295Ssam 	{ "rmdir",	rmdirhelp,	0,	removedir },
80*10295Ssam 	{ "send",	sendhelp,	1,	put },
81*10295Ssam 	{ "status",	statushelp,	0,	status },
82*10295Ssam 	{ "struct",	structhelp,	0,	setstruct },
83*10295Ssam 	{ "tenex",	tenexhelp,	0,	settenex },
84*10295Ssam 	{ "trace",	tracehelp,	0,	settrace },
85*10295Ssam 	{ "type",	typehelp,	0,	settype },
86*10295Ssam 	{ "user",	userhelp,	0,	user },
87*10295Ssam 	{ "verbose",	verbosehelp,	0,	setverbose },
88*10295Ssam 	{ "?",		helphelp,	0,	help },
89*10295Ssam 	0
90*10295Ssam };
91*10295Ssam 
92*10295Ssam int	NCMDS = sizeof (cmdtab) / sizeof (cmdtab[0]);
93