Commit | Line | Data |
---|---|---|
edf71f48 | 1 | /* |
9069f68e | 2 | * Copyright (c) 1985 Regents of the University of California. |
edf71f48 DF |
3 | * All rights reserved. The Berkeley software License Agreement |
4 | * specifies the terms and conditions for redistribution. | |
5 | */ | |
6 | ||
53f01c40 | 7 | #ifndef lint |
9069f68e | 8 | static char sccsid[] = "@(#)cmdtab.c 5.3 (Berkeley) %G%"; |
edf71f48 | 9 | #endif not lint |
5ac6fc46 | 10 | |
53f01c40 SL |
11 | #include "ftp_var.h" |
12 | ||
13 | /* | |
14 | * User FTP -- Command Tables. | |
15 | */ | |
16 | int setascii(), setbell(), setbinary(), setdebug(), setform(); | |
7136ef0a | 17 | int setglob(), sethash(), setmode(), setpeer(), setport(); |
5ac6fc46 | 18 | int setprompt(), setstruct(); |
9248b609 | 19 | int settenex(), settrace(), settype(), setverbose(); |
53f01c40 | 20 | int disconnect(); |
5ac6fc46 | 21 | int cd(), lcd(), delete(), mdelete(), user(); |
9072bd8a | 22 | int ls(), mls(), get(), mget(), help(), append(), put(), mput(); |
53f01c40 SL |
23 | int quit(), renamefile(), status(); |
24 | int quote(), rmthelp(), shell(); | |
9069f68e GM |
25 | int pwd(), makedir(), removedir(), setcr(); |
26 | int account(), doproxy(), reset(), setcase(), setntrans(), setnmap(); | |
27 | int setsunique(), setrunique(), cdup(), macdef(), domacro(); | |
53f01c40 | 28 | |
9069f68e | 29 | char accounthelp[] = "send account command to remote server"; |
5ac6fc46 | 30 | char appendhelp[] = "append to a file"; |
53f01c40 SL |
31 | char asciihelp[] = "set ascii transfer type"; |
32 | char beephelp[] = "beep when command completed"; | |
33 | char binaryhelp[] = "set binary transfer type"; | |
9069f68e | 34 | char casehelp[] = "toggle mget upper/lower case id mapping"; |
53f01c40 | 35 | char cdhelp[] = "change remote working directory"; |
9069f68e | 36 | char cduphelp[] = "change remote working directory to parent directory"; |
53f01c40 | 37 | char connecthelp[] = "connect to remote tftp"; |
9069f68e | 38 | char crhelp[] = "toggle carriage return stripping on ascii gets"; |
53f01c40 SL |
39 | char deletehelp[] = "delete remote file"; |
40 | char debughelp[] = "toggle/set debugging mode"; | |
41 | char dirhelp[] = "list contents of remote directory"; | |
42 | char disconhelp[] = "terminate ftp session"; | |
9069f68e | 43 | char domachelp[] = "execute macro"; |
53f01c40 | 44 | char formhelp[] = "set file transfer format"; |
9248b609 | 45 | char globhelp[] = "toggle metacharacter expansion of local file names"; |
5ac6fc46 | 46 | char hashhelp[] = "toggle printing `#' for each buffer transferred"; |
53f01c40 SL |
47 | char helphelp[] = "print local help information"; |
48 | char lcdhelp[] = "change local working directory"; | |
49 | char lshelp[] = "nlist contents of remote directory"; | |
9069f68e | 50 | char macdefhelp[] = "define a macro"; |
5ac6fc46 | 51 | char mdeletehelp[] = "delete multiple files"; |
9072bd8a | 52 | char mdirhelp[] = "list contents of multiple remote directories"; |
9248b609 | 53 | char mgethelp[] = "get multiple files"; |
53f01c40 | 54 | char mkdirhelp[] = "make directory on the remote machine"; |
9072bd8a | 55 | char mlshelp[] = "nlist contents of multiple remote directories"; |
53f01c40 | 56 | char modehelp[] = "set file transfer mode"; |
9248b609 | 57 | char mputhelp[] = "send multiple files"; |
9069f68e GM |
58 | char nmaphelp[] = "set templates for default file name mapping"; |
59 | char ntranshelp[] = "set translation table for default file name mapping"; | |
5ac6fc46 | 60 | char porthelp[] = "toggle use of PORT cmd for each data connection"; |
53f01c40 | 61 | char prompthelp[] = "force interactive prompting on multiple commands"; |
9069f68e | 62 | char proxyhelp[] = "issue command on alternate connection"; |
53f01c40 SL |
63 | char pwdhelp[] = "print working directory on remote machine"; |
64 | char quithelp[] = "terminate ftp session and exit"; | |
65 | char quotehelp[] = "send arbitrary ftp command"; | |
66 | char receivehelp[] = "receive file"; | |
67 | char remotehelp[] = "get help from remote server"; | |
68 | char renamehelp[] = "rename file"; | |
69 | char rmdirhelp[] = "remove directory on the remote machine"; | |
9069f68e GM |
70 | char runiquehelp[] = "toggle store unique for local files"; |
71 | char resethelp[] = "clear queued command replies"; | |
9248b609 | 72 | char sendhelp[] = "send one file"; |
53f01c40 SL |
73 | char shellhelp[] = "escape to the shell"; |
74 | char statushelp[] = "show current status"; | |
75 | char structhelp[] = "set file transfer structure"; | |
9069f68e | 76 | char suniquehelp[] = "toggle store unique on remote machine"; |
53f01c40 SL |
77 | char tenexhelp[] = "set tenex file transfer type"; |
78 | char tracehelp[] = "toggle packet tracing"; | |
79 | char typehelp[] = "set file transfer type"; | |
80 | char userhelp[] = "send new user information"; | |
81 | char verbosehelp[] = "toggle verbose mode"; | |
82 | ||
83 | struct cmd cmdtab[] = { | |
9069f68e GM |
84 | { "!", shellhelp, 0, 0, 0, shell }, |
85 | { "$", domachelp, 1, 0, 0, domacro }, | |
86 | { "account", accounthelp, 0, 1, 1, account}, | |
87 | { "append", appendhelp, 1, 1, 1, put }, | |
88 | { "ascii", asciihelp, 0, 1, 1, setascii }, | |
89 | { "bell", beephelp, 0, 0, 0, setbell }, | |
90 | { "binary", binaryhelp, 0, 1, 1, setbinary }, | |
91 | { "bye", quithelp, 0, 0, 0, quit }, | |
92 | { "case", casehelp, 0, 0, 1, setcase }, | |
93 | { "cd", cdhelp, 0, 1, 1, cd }, | |
94 | { "cdup", cduphelp, 0, 1, 1, cdup }, | |
95 | { "close", disconhelp, 0, 1, 1, disconnect }, | |
96 | { "cr", crhelp, 0, 0, 0, setcr }, | |
97 | { "delete", deletehelp, 0, 1, 1, delete }, | |
98 | { "debug", debughelp, 0, 0, 0, setdebug }, | |
99 | { "dir", dirhelp, 1, 1, 1, ls }, | |
100 | { "disconnect", disconhelp, 0, 1, 1, disconnect }, | |
101 | { "form", formhelp, 0, 1, 1, setform }, | |
102 | { "get", receivehelp, 1, 1, 1, get }, | |
103 | { "glob", globhelp, 0, 0, 0, setglob }, | |
104 | { "hash", hashhelp, 0, 0, 0, sethash }, | |
105 | { "help", helphelp, 0, 0, 1, help }, | |
106 | { "lcd", lcdhelp, 0, 0, 0, lcd }, | |
107 | { "ls", lshelp, 1, 1, 1, ls }, | |
108 | { "macdef", macdefhelp, 0, 0, 0, macdef }, | |
109 | { "mdelete", mdeletehelp, 1, 1, 1, mdelete }, | |
110 | { "mdir", mdirhelp, 1, 1, 1, mls }, | |
111 | { "mget", mgethelp, 1, 1, 1, mget }, | |
112 | { "mkdir", mkdirhelp, 0, 1, 1, makedir }, | |
113 | { "mls", mlshelp, 1, 1, 1, mls }, | |
114 | { "mode", modehelp, 0, 1, 1, setmode }, | |
115 | { "mput", mputhelp, 1, 1, 1, mput }, | |
116 | { "nmap", nmaphelp, 0, 0, 1, setnmap }, | |
117 | { "ntrans", ntranshelp, 0, 0, 1, setntrans }, | |
118 | { "open", connecthelp, 0, 0, 1, setpeer }, | |
119 | { "prompt", prompthelp, 0, 0, 0, setprompt }, | |
120 | { "proxy", proxyhelp, 0, 0, 1, doproxy }, | |
121 | { "sendport", porthelp, 0, 0, 0, setport }, | |
122 | { "put", sendhelp, 1, 1, 1, put }, | |
123 | { "pwd", pwdhelp, 0, 1, 1, pwd }, | |
124 | { "quit", quithelp, 0, 0, 0, quit }, | |
125 | { "quote", quotehelp, 1, 1, 1, quote }, | |
126 | { "recv", receivehelp, 1, 1, 1, get }, | |
127 | { "remotehelp", remotehelp, 0, 1, 1, rmthelp }, | |
128 | { "rename", renamehelp, 0, 1, 1, renamefile }, | |
129 | { "reset", resethelp, 0, 1, 1, reset }, | |
130 | { "rmdir", rmdirhelp, 0, 1, 1, removedir }, | |
131 | { "runique", runiquehelp, 0, 0, 1, setrunique }, | |
132 | { "send", sendhelp, 1, 1, 1, put }, | |
133 | { "status", statushelp, 0, 0, 1, status }, | |
134 | { "struct", structhelp, 0, 1, 1, setstruct }, | |
135 | { "sunique", suniquehelp, 0, 0, 1, setsunique }, | |
136 | { "tenex", tenexhelp, 0, 1, 1, settenex }, | |
137 | { "trace", tracehelp, 0, 0, 0, settrace }, | |
138 | { "type", typehelp, 0, 1, 1, settype }, | |
139 | { "user", userhelp, 0, 1, 1, user }, | |
140 | { "verbose", verbosehelp, 0, 0, 0, setverbose }, | |
141 | { "?", helphelp, 0, 0, 1, help }, | |
5ac6fc46 | 142 | { 0 }, |
53f01c40 SL |
143 | }; |
144 | ||
71a655cd | 145 | int NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1; |