file reorg, pathnames.h, paths.h
[unix-history] / usr / src / usr.bin / ftp / cmdtab.c
CommitLineData
edf71f48 1/*
63c685da 2 * Copyright (c) 1985, 1989 Regents of the University of California.
11c5f0a3
KB
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
b36fc510
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
ff00793c 15 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
edf71f48
DF
16 */
17
53f01c40 18#ifndef lint
23d74d65 19static char sccsid[] = "@(#)cmdtab.c 5.9 (Berkeley) %G%";
11c5f0a3 20#endif /* not lint */
5ac6fc46 21
53f01c40
SL
22#include "ftp_var.h"
23
24/*
25 * User FTP -- Command Tables.
26 */
27int setascii(), setbell(), setbinary(), setdebug(), setform();
7136ef0a 28int setglob(), sethash(), setmode(), setpeer(), setport();
5ac6fc46 29int setprompt(), setstruct();
9248b609 30int settenex(), settrace(), settype(), setverbose();
63c685da 31int disconnect(), syst();
5ac6fc46 32int cd(), lcd(), delete(), mdelete(), user();
9072bd8a 33int ls(), mls(), get(), mget(), help(), append(), put(), mput();
53f01c40 34int quit(), renamefile(), status();
23d74d65 35int quote(), rmthelp(), shell(), site();
9069f68e
GM
36int pwd(), makedir(), removedir(), setcr();
37int account(), doproxy(), reset(), setcase(), setntrans(), setnmap();
38int setsunique(), setrunique(), cdup(), macdef(), domacro();
63c685da 39int sizecmd(), modtime(), rmtstatus();
53f01c40 40
9069f68e 41char accounthelp[] = "send account command to remote server";
5ac6fc46 42char appendhelp[] = "append to a file";
53f01c40
SL
43char asciihelp[] = "set ascii transfer type";
44char beephelp[] = "beep when command completed";
45char binaryhelp[] = "set binary transfer type";
9069f68e 46char casehelp[] = "toggle mget upper/lower case id mapping";
53f01c40 47char cdhelp[] = "change remote working directory";
9069f68e 48char cduphelp[] = "change remote working directory to parent directory";
23d74d65 49char chmodhelp[] = "change file permissions of remote file";
53f01c40 50char connecthelp[] = "connect to remote tftp";
9069f68e 51char crhelp[] = "toggle carriage return stripping on ascii gets";
53f01c40
SL
52char deletehelp[] = "delete remote file";
53char debughelp[] = "toggle/set debugging mode";
54char dirhelp[] = "list contents of remote directory";
55char disconhelp[] = "terminate ftp session";
9069f68e 56char domachelp[] = "execute macro";
53f01c40 57char formhelp[] = "set file transfer format";
9248b609 58char globhelp[] = "toggle metacharacter expansion of local file names";
5ac6fc46 59char hashhelp[] = "toggle printing `#' for each buffer transferred";
53f01c40 60char helphelp[] = "print local help information";
23d74d65 61char idlehelp[] = "get (set) idle timer on remote side";
53f01c40 62char lcdhelp[] = "change local working directory";
ff00793c 63char lshelp[] = "list contents of remote directory";
9069f68e 64char macdefhelp[] = "define a macro";
5ac6fc46 65char mdeletehelp[] = "delete multiple files";
9072bd8a 66char mdirhelp[] = "list contents of multiple remote directories";
9248b609 67char mgethelp[] = "get multiple files";
53f01c40 68char mkdirhelp[] = "make directory on the remote machine";
63c685da 69char mlshelp[] = "nlist contents of multiple remote directories";
ff00793c 70char modtimehelp[] = "show last modification time of remote file";
53f01c40 71char modehelp[] = "set file transfer mode";
9248b609 72char mputhelp[] = "send multiple files";
ff00793c 73char nlisthelp[] = "nlist contents of remote directory";
9069f68e
GM
74char nmaphelp[] = "set templates for default file name mapping";
75char ntranshelp[] = "set translation table for default file name mapping";
5ac6fc46 76char porthelp[] = "toggle use of PORT cmd for each data connection";
53f01c40 77char prompthelp[] = "force interactive prompting on multiple commands";
9069f68e 78char proxyhelp[] = "issue command on alternate connection";
53f01c40
SL
79char pwdhelp[] = "print working directory on remote machine";
80char quithelp[] = "terminate ftp session and exit";
81char quotehelp[] = "send arbitrary ftp command";
82char receivehelp[] = "receive file";
83char remotehelp[] = "get help from remote server";
84char renamehelp[] = "rename file";
85char rmdirhelp[] = "remove directory on the remote machine";
ff00793c 86char rmtstatushelp[]="show status of remote machine";
9069f68e
GM
87char runiquehelp[] = "toggle store unique for local files";
88char resethelp[] = "clear queued command replies";
9248b609 89char sendhelp[] = "send one file";
23d74d65 90char sitehelp[] = "send site specific command to remote server\n\t\tTry \"rhelp site\" or \"site help\" for more information";
53f01c40 91char shellhelp[] = "escape to the shell";
ff00793c 92char sizecmdhelp[] = "show size of remote file";
53f01c40
SL
93char statushelp[] = "show current status";
94char structhelp[] = "set file transfer structure";
9069f68e 95char suniquehelp[] = "toggle store unique on remote machine";
ff00793c 96char systemhelp[] = "show remote system type";
53f01c40
SL
97char tenexhelp[] = "set tenex file transfer type";
98char tracehelp[] = "toggle packet tracing";
99char typehelp[] = "set file transfer type";
23d74d65 100char umaskhelp[] = "get (set) umask on remote side";
53f01c40
SL
101char userhelp[] = "send new user information";
102char verbosehelp[] = "toggle verbose mode";
103
104struct cmd cmdtab[] = {
9069f68e
GM
105 { "!", shellhelp, 0, 0, 0, shell },
106 { "$", domachelp, 1, 0, 0, domacro },
107 { "account", accounthelp, 0, 1, 1, account},
108 { "append", appendhelp, 1, 1, 1, put },
109 { "ascii", asciihelp, 0, 1, 1, setascii },
110 { "bell", beephelp, 0, 0, 0, setbell },
111 { "binary", binaryhelp, 0, 1, 1, setbinary },
112 { "bye", quithelp, 0, 0, 0, quit },
113 { "case", casehelp, 0, 0, 1, setcase },
114 { "cd", cdhelp, 0, 1, 1, cd },
115 { "cdup", cduphelp, 0, 1, 1, cdup },
23d74d65 116 { "chmod", chmodhelp, 0, 1, 1, do_chmod },
9069f68e
GM
117 { "close", disconhelp, 0, 1, 1, disconnect },
118 { "cr", crhelp, 0, 0, 0, setcr },
119 { "delete", deletehelp, 0, 1, 1, delete },
120 { "debug", debughelp, 0, 0, 0, setdebug },
121 { "dir", dirhelp, 1, 1, 1, ls },
122 { "disconnect", disconhelp, 0, 1, 1, disconnect },
123 { "form", formhelp, 0, 1, 1, setform },
124 { "get", receivehelp, 1, 1, 1, get },
125 { "glob", globhelp, 0, 0, 0, setglob },
126 { "hash", hashhelp, 0, 0, 0, sethash },
127 { "help", helphelp, 0, 0, 1, help },
23d74d65 128 { "idle", idlehelp, 0, 1, 1, idle },
a2d52b81 129 { "image", binaryhelp, 0, 1, 1, setbinary },
9069f68e
GM
130 { "lcd", lcdhelp, 0, 0, 0, lcd },
131 { "ls", lshelp, 1, 1, 1, ls },
132 { "macdef", macdefhelp, 0, 0, 0, macdef },
133 { "mdelete", mdeletehelp, 1, 1, 1, mdelete },
134 { "mdir", mdirhelp, 1, 1, 1, mls },
135 { "mget", mgethelp, 1, 1, 1, mget },
136 { "mkdir", mkdirhelp, 0, 1, 1, makedir },
137 { "mls", mlshelp, 1, 1, 1, mls },
138 { "mode", modehelp, 0, 1, 1, setmode },
ff00793c 139 { "modtime", modtimehelp, 0, 1, 1, modtime },
9069f68e
GM
140 { "mput", mputhelp, 1, 1, 1, mput },
141 { "nmap", nmaphelp, 0, 0, 1, setnmap },
ff00793c 142 { "nlist", nlisthelp, 1, 1, 1, ls },
9069f68e
GM
143 { "ntrans", ntranshelp, 0, 0, 1, setntrans },
144 { "open", connecthelp, 0, 0, 1, setpeer },
145 { "prompt", prompthelp, 0, 0, 0, setprompt },
146 { "proxy", proxyhelp, 0, 0, 1, doproxy },
147 { "sendport", porthelp, 0, 0, 0, setport },
148 { "put", sendhelp, 1, 1, 1, put },
149 { "pwd", pwdhelp, 0, 1, 1, pwd },
150 { "quit", quithelp, 0, 0, 0, quit },
151 { "quote", quotehelp, 1, 1, 1, quote },
152 { "recv", receivehelp, 1, 1, 1, get },
63c685da 153 { "remotehelp", remotehelp, 0, 1, 1, rmthelp },
cdc35b45
MK
154 { "rstatus", rmtstatushelp, 0, 1, 1, rmtstatus },
155 { "rhelp", remotehelp, 0, 1, 1, rmthelp },
9069f68e
GM
156 { "rename", renamehelp, 0, 1, 1, renamefile },
157 { "reset", resethelp, 0, 1, 1, reset },
158 { "rmdir", rmdirhelp, 0, 1, 1, removedir },
159 { "runique", runiquehelp, 0, 0, 1, setrunique },
160 { "send", sendhelp, 1, 1, 1, put },
23d74d65 161 { "site", sitehelp, 0, 1, 1, site },
ff00793c 162 { "size", sizecmdhelp, 1, 1, 1, sizecmd },
9069f68e
GM
163 { "status", statushelp, 0, 0, 1, status },
164 { "struct", structhelp, 0, 1, 1, setstruct },
ff00793c 165 { "system", systemhelp, 0, 1, 1, syst },
9069f68e
GM
166 { "sunique", suniquehelp, 0, 0, 1, setsunique },
167 { "tenex", tenexhelp, 0, 1, 1, settenex },
168 { "trace", tracehelp, 0, 0, 0, settrace },
169 { "type", typehelp, 0, 1, 1, settype },
170 { "user", userhelp, 0, 1, 1, user },
23d74d65 171 { "umask", umaskhelp, 0, 1, 1, do_umask },
9069f68e
GM
172 { "verbose", verbosehelp, 0, 0, 0, setverbose },
173 { "?", helphelp, 0, 0, 1, help },
5ac6fc46 174 { 0 },
53f01c40
SL
175};
176
71a655cd 177int NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1;