Added all of the MH sources, including RCS files, in
[mmh] / docs / historical / mh-6.8.5 / mts / sendmail / RCS / smail.h,v
1 head    1.3;
2 access;
3 symbols;
4 locks; strict;
5 comment @ * @;
6
7
8 1.3
9 date    92.02.01.00.23.53;      author jromine; state Exp;
10 branches;
11 next    1.2;
12
13 1.2
14 date    92.01.31.21.32.20;      author jromine; state Exp;
15 branches;
16 next    1.1;
17
18 1.1
19 date    92.01.31.21.32.19;      author jromine; state Exp;
20 branches;
21 next    ;
22
23
24 desc
25 @@
26
27
28 1.3
29 log
30 @back off change
31 @
32 text
33 @/* smail.h - definitions for the MH-SendMail/SMTP Interface */
34
35
36 #define S_MAIL  0
37 #define S_SEND  1
38 #define S_SOML  2
39 #define S_SAML  3
40
41
42 struct smtp {
43     int     code;
44     int     length;
45     char    text[BUFSIZ];
46 };
47
48
49 int     client ();
50 int     sm_init (), sm_winit (), sm_wadr (), sm_waend (), sm_wtxt (),
51         sm_wtend (), sm_end ();
52 char   *rp_string ();
53
54 /* \f */
55
56 /* The remainder of this file is derived from "mmdf.h" */
57
58 /*
59  *     Copyright (C) 1979,1980,1981,1982,1983  University of Delaware
60  *     Used by permission, May, 1984.
61  */
62
63 /*
64  *     MULTI-CHANNEL MEMO DISTRIBUTION FACILITY  (MMDF)
65  *     
66  *
67  *     Copyright (C) 1979,1980,1981,1982,1983  University of Delaware
68  *     
69  *     Department of Electrical Engineering
70  *     University of Delaware
71  *     Newark, Delaware  19711
72  *
73  *     Phone:  (302) 738-1163
74  *     
75  *     
76  *     This program module was developed as part of the University
77  *     of Delaware's Multi-Channel Memo Distribution Facility (MMDF).
78  *     
79  *     Acquisition, use, and distribution of this module and its listings
80  *     are subject restricted to the terms of a license agreement.
81  *     Documents describing systems using this module must cite its source.
82  *
83  *     The above statements must be retained with all copies of this
84  *     program and may not be removed without the consent of the
85  *     University of Delaware.
86  *     
87  */
88
89 /*                      Reply Codes for MMDF
90  *
91  *  Based on: "Revised FTP Reply Codes", by Jon Postel & Nancy Neigus Arpanet
92  *      RFC 640 / NIC 30843, in the "Arpanet Protocol Handbook", E.  Feinler
93  *      and J. Postel (eds.), NIC 7104, Network Information Center, SRI
94  *      International:  Menlo Park, CA.  (NTIS AD-A0038901)
95  *
96  *  Actual values are different, but scheme is same.  Codes must fit into
97  *  8-bits (to pass on exit() calls); fields are packed 2-3-3 and interpreted
98  *  as octal numbers.
99  *
100  *  Basic format:
101  *
102  *      0yz: positive completion; entire action done
103  *      1yz: positive intermediate; only part done
104  *      2yz: Transient negative completion; may work later
105  *      3yz: Permanent negative completion; you lose forever
106  *
107  *      x0z: syntax
108  *      x1z: general; doesn't fit any other category
109  *      x2z: connections; truly transfer-related
110  *      x3z: user/authentication/account
111  *      x4x: mail
112  *      x5z: file system
113  *
114  *      3-bit z field is unique to the reply.  In the following,
115  *      the RP_xVAL defines are available for masking to obtain a field.
116  */
117
118 /* \f */
119
120 /***************  FIELD DEFINITIONS & BASIC VALUES  ******************* */
121
122 /*          Field 1:  Basic degree of success (2-bits)                  */
123
124 #define RP_BTYP '\200'            /* good vs. bad; on => bad            */
125
126 #define RP_BVAL '\300'            /* basic degree of success            */
127
128 #define RP_BOK  '\000'            /* went fine; all done                */
129 #define RP_BPOK '\100'            /* only the first part got done       */
130 #define RP_BTNO '\200'            /* temporary failure; try later       */
131 #define RP_BNO  '\300'            /* not now, nor never; you lose       */
132
133 /*          Field 2:  Basic domain of discourse (3-bits)                */
134
135 #define RP_CVAL '\070'            /* basic category (domain) of reply   */
136
137 #define RP_CSYN '\000'            /* purely a matter of form            */
138 #define RP_CGEN '\010'            /* couldn't find anywhere else for it */
139 #define RP_CCON '\020'            /* data-transfer-related issue        */
140 #define RP_CUSR '\030'            /* pertaining to the user             */
141 #define RP_CMAI '\040'            /* specific to mail semantics         */
142 #define RP_CFIL '\050'            /* file system                        */
143 #define RP_CLIO '\060'            /* local i/o system                   */
144
145 /*          Field 3:  Specific value for this reply (3-bits)            */
146
147 #define RP_SVAL '\007'            /* specific value of reply            */
148
149 /* \f */
150
151 /*********************  SPECIFIC SUCCESS VALUES  ********************** */
152
153
154 /*                        Complete Success                              */
155
156 #define RP_DONE (RP_BOK | RP_CGEN | '\000')
157                                   /* done (e.g., w/transaction)         */
158 #define RP_OK   (RP_BOK | RP_CGEN | '\001')
159                                   /* general-purpose OK                 */
160
161 #define RP_MOK  (RP_BOK | RP_CMAI | '\000')
162                                   /* message is accepted (w/text)       */
163
164
165 /*                        Partial Success                               */
166
167 #define RP_MAST (RP_BPOK| RP_CGEN | '\000')
168                                   /* you are the requestor              */
169 #define RP_SLAV (RP_BPOK| RP_CGEN | '\001')
170                                   /* you are the requestee              */
171 #define RP_AOK  (RP_BPOK| RP_CMAI | '\000')
172                                   /* message address is accepted        */
173
174 /* \f */
175
176 /* ********************  SPECIFIC FALURE VALUES  ********************** */
177
178
179 /*                        Partial Failure                               */
180
181 #define RP_AGN  (RP_BTNO | RP_CGEN | '\000')
182                                   /* not now; maybe later               */
183 #define RP_TIME (RP_BTNO | RP_CGEN | '\001')
184                                   /* timeout                            */
185 #define RP_NOOP (RP_BTNO | RP_CGEN | '\002')
186                                   /* no-op; nothing done, this time     */
187 #define RP_EOF  (RP_BTNO | RP_CGEN | '\003')
188                                   /* encountered an end of file         */
189
190 #define RP_NET  (RP_BTNO | RP_CCON | '\000')
191                                   /* channel went bad                   */
192 #define RP_BHST (RP_BTNO | RP_CCON | '\001')
193                                   /* foreign host screwed up            */
194 #define RP_DHST (RP_BTNO | RP_CCON | '\002')
195                                   /* host went away                     */
196 #define RP_NIO  (RP_BTNO | RP_CCON | '\004')
197                                   /* general net i/o problem            */
198
199 #define RP_FIO  (RP_BTNO | RP_CFIL | '\000')
200                                   /* error reading/writing file         */
201 #define RP_FCRT (RP_BTNO | RP_CFIL | '\001')
202                                   /* unable to create file              */
203 #define RP_FOPN (RP_BTNO | RP_CFIL | '\002')
204                                   /* unable to open file                */
205 #define RP_LIO  (RP_BTNO | RP_CLIO | '\000')
206                                   /* general local i/o problem          */
207 #define RP_LOCK (RP_BTNO | RP_CLIO | '\001')
208                                   /* resource currently locked          */
209
210
211 /*                       Complete Failure                               */
212
213 #define RP_MECH (RP_BNO | RP_CGEN | '\000')
214                                   /* bad mechanism/path; try alternate? */
215 #define RP_NO   (RP_BNO | RP_CGEN | '\001')
216                                   /* general-purpose NO                 */
217
218 #define RP_PROT (RP_BNO | RP_CCON | '\000')
219                                   /* general prototocol error           */
220
221 #define RP_RPLY (RP_BNO | RP_CCON | '\001')
222                                   /* bad reply code (PERMANENT ERROR)   */
223
224 #define RP_NDEL (RP_BNO | RP_CMAI | '\000')
225                                   /* couldn't deliver                   */
226
227 #define RP_HUH  (RP_BNO | RP_CSYN | '\000')
228                                   /* couldn't parse the request         */
229 #define RP_NCMD (RP_BNO | RP_CSYN | '\001')
230                                   /* no such command defined            */
231 #define RP_PARM (RP_BNO | RP_CSYN | '\002')
232                                   /* bad parameter                      */
233 #define RP_UCMD (RP_BNO | RP_CSYN | '\003')
234                                   /* command not implemented            */
235 #define RP_USER (RP_BNO | RP_CUSR | '\000')
236                                   /* unknown user                       */
237
238 /* \f */
239
240 /*              PSEUDO-FUNCTIONS TO ACCESS REPLY INFO                   */
241
242 #define rp_gval(val)    ((char) (val))
243                                   /* get the entire return value        */
244
245
246 /*  The next three give the field's bits, within the whole value        */
247
248 #define rp_gbval(val)   (rp_gval (val) & RP_BVAL)
249                                   /* get the basic part of return value */
250 #define rp_gcval(val)   (rp_gval (val) & RP_CVAL)
251                                   /* get the domain part of value       */
252 #define rp_gsval(val)   (rp_gval (val) & RP_SVAL)
253                                   /* get the specific part of value     */
254
255
256 /*  The next three give the numeric value withing the field             */
257
258 #define rp_gbbit(val)   ((rp_gval (val) >> 6) & 03)
259                                   /* get the basic part right-shifted   */
260 #define rp_gcbit(val)   ((rp_gval (val) >> 3 ) & 07)
261                                   /* get the domain part right-shifted  */
262 #define rp_gsbit(val)   (rp_gval (val) & 07)
263                                   /* get the specific part right-shifted */
264
265
266 /* MACHINE DEPENDENCY:  The following treat the value as strictly numeric.
267  *                      It relies on the negative values being numerically
268  *                      negative.
269  */
270
271 #define rp_isgood(val)  (rp_gval (val) >= 0)
272                                   /* is return value positive?          */
273 #define rp_isbad(val)   (rp_gval (val) < 0)
274                                   /* is return value negative?          */
275 @
276
277
278 1.2
279 log
280 @kerberos
281 @
282 text
283 @d210 1
284 a210 1
285 #define rp_gval(val)    ((signed char) (val))
286 @
287
288
289 1.1
290 log
291 @Initial revision
292 @
293 text
294 @d210 1
295 a210 1
296 #define rp_gval(val)    ((char) (val))
297 @