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