Commit | Line | Data |
---|---|---|
edf71f48 DF |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
5 | */ | |
6 | ||
53f01c40 | 7 | #ifndef lint |
a0b49579 | 8 | static char sccsid[] = "@(#)cmdtab.c 5.2 (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(); | |
25 | int pwd(), makedir(), removedir(); | |
26 | ||
5ac6fc46 | 27 | char appendhelp[] = "append to a file"; |
53f01c40 SL |
28 | char asciihelp[] = "set ascii transfer type"; |
29 | char beephelp[] = "beep when command completed"; | |
30 | char binaryhelp[] = "set binary transfer type"; | |
31 | char cdhelp[] = "change remote working directory"; | |
32 | char connecthelp[] = "connect to remote tftp"; | |
33 | char deletehelp[] = "delete remote file"; | |
34 | char debughelp[] = "toggle/set debugging mode"; | |
35 | char dirhelp[] = "list contents of remote directory"; | |
36 | char disconhelp[] = "terminate ftp session"; | |
37 | char formhelp[] = "set file transfer format"; | |
9248b609 | 38 | char globhelp[] = "toggle metacharacter expansion of local file names"; |
5ac6fc46 | 39 | char hashhelp[] = "toggle printing `#' for each buffer transferred"; |
53f01c40 SL |
40 | char helphelp[] = "print local help information"; |
41 | char lcdhelp[] = "change local working directory"; | |
42 | char lshelp[] = "nlist contents of remote directory"; | |
5ac6fc46 | 43 | char mdeletehelp[] = "delete multiple files"; |
9072bd8a | 44 | char mdirhelp[] = "list contents of multiple remote directories"; |
9248b609 | 45 | char mgethelp[] = "get multiple files"; |
53f01c40 | 46 | char mkdirhelp[] = "make directory on the remote machine"; |
9072bd8a | 47 | char mlshelp[] = "nlist contents of multiple remote directories"; |
53f01c40 | 48 | char modehelp[] = "set file transfer mode"; |
9248b609 | 49 | char mputhelp[] = "send multiple files"; |
5ac6fc46 | 50 | char porthelp[] = "toggle use of PORT cmd for each data connection"; |
53f01c40 SL |
51 | char prompthelp[] = "force interactive prompting on multiple commands"; |
52 | char pwdhelp[] = "print working directory on remote machine"; | |
53 | char quithelp[] = "terminate ftp session and exit"; | |
54 | char quotehelp[] = "send arbitrary ftp command"; | |
55 | char receivehelp[] = "receive file"; | |
56 | char remotehelp[] = "get help from remote server"; | |
57 | char renamehelp[] = "rename file"; | |
58 | char rmdirhelp[] = "remove directory on the remote machine"; | |
9248b609 | 59 | char sendhelp[] = "send one file"; |
53f01c40 SL |
60 | char shellhelp[] = "escape to the shell"; |
61 | char statushelp[] = "show current status"; | |
62 | char structhelp[] = "set file transfer structure"; | |
63 | char tenexhelp[] = "set tenex file transfer type"; | |
64 | char tracehelp[] = "toggle packet tracing"; | |
65 | char typehelp[] = "set file transfer type"; | |
66 | char userhelp[] = "send new user information"; | |
67 | char verbosehelp[] = "toggle verbose mode"; | |
68 | ||
69 | struct cmd cmdtab[] = { | |
5ac6fc46 | 70 | { "!", shellhelp, 0, 0, shell }, |
9072bd8a | 71 | { "append", appendhelp, 1, 1, put }, |
5ac6fc46 SL |
72 | { "ascii", asciihelp, 0, 1, setascii }, |
73 | { "bell", beephelp, 0, 0, setbell }, | |
74 | { "binary", binaryhelp, 0, 1, setbinary }, | |
75 | { "bye", quithelp, 0, 0, quit }, | |
76 | { "cd", cdhelp, 0, 1, cd }, | |
77 | { "close", disconhelp, 0, 1, disconnect }, | |
78 | { "delete", deletehelp, 0, 1, delete }, | |
79 | { "debug", debughelp, 0, 0, setdebug }, | |
80 | { "dir", dirhelp, 1, 1, ls }, | |
a0b49579 | 81 | { "disconnect", disconhelp, 0, 1, disconnect }, |
5ac6fc46 SL |
82 | { "form", formhelp, 0, 1, setform }, |
83 | { "get", receivehelp, 1, 1, get }, | |
84 | { "glob", globhelp, 0, 0, setglob }, | |
85 | { "hash", hashhelp, 0, 0, sethash }, | |
86 | { "help", helphelp, 0, 0, help }, | |
87 | { "lcd", lcdhelp, 0, 0, lcd }, | |
88 | { "ls", lshelp, 1, 1, ls }, | |
89 | { "mdelete", mdeletehelp, 1, 1, mdelete }, | |
9072bd8a | 90 | { "mdir", mdirhelp, 1, 1, mls }, |
5ac6fc46 SL |
91 | { "mget", mgethelp, 1, 1, mget }, |
92 | { "mkdir", mkdirhelp, 0, 1, makedir }, | |
9072bd8a | 93 | { "mls", mlshelp, 1, 1, mls }, |
5ac6fc46 SL |
94 | { "mode", modehelp, 0, 1, setmode }, |
95 | { "mput", mputhelp, 1, 1, mput }, | |
96 | { "open", connecthelp, 0, 0, setpeer }, | |
97 | { "prompt", prompthelp, 0, 0, setprompt }, | |
98 | { "sendport", porthelp, 0, 0, setport }, | |
99 | { "put", sendhelp, 1, 1, put }, | |
100 | { "pwd", pwdhelp, 0, 1, pwd }, | |
101 | { "quit", quithelp, 0, 0, quit }, | |
102 | { "quote", quotehelp, 1, 1, quote }, | |
103 | { "recv", receivehelp, 1, 1, get }, | |
104 | { "remotehelp", remotehelp, 0, 1, rmthelp }, | |
105 | { "rename", renamehelp, 0, 1, renamefile }, | |
106 | { "rmdir", rmdirhelp, 0, 1, removedir }, | |
107 | { "send", sendhelp, 1, 1, put }, | |
108 | { "status", statushelp, 0, 0, status }, | |
109 | { "struct", structhelp, 0, 1, setstruct }, | |
110 | { "tenex", tenexhelp, 0, 1, settenex }, | |
111 | { "trace", tracehelp, 0, 0, settrace }, | |
112 | { "type", typehelp, 0, 1, settype }, | |
113 | { "user", userhelp, 0, 1, user }, | |
114 | { "verbose", verbosehelp, 0, 0, setverbose }, | |
115 | { "?", helphelp, 0, 0, help }, | |
116 | { 0 }, | |
53f01c40 SL |
117 | }; |
118 | ||
71a655cd | 119 | int NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1; |