1 /* smail.h - definitions for the MH-SendMail/SMTP Interface */
18 int sm_init (), sm_winit (), sm_wadr (), sm_waend (), sm_wtxt (),
19 sm_wtend (), sm_end ();
24 /* The remainder of this file is derived from "mmdf.h" */
27 * Copyright (C) 1979,1980,1981,1982,1983 University of Delaware
28 * Used by permission, May, 1984.
32 * MULTI-CHANNEL MEMO DISTRIBUTION FACILITY (MMDF)
35 * Copyright (C) 1979,1980,1981,1982,1983 University of Delaware
37 * Department of Electrical Engineering
38 * University of Delaware
39 * Newark, Delaware 19711
41 * Phone: (302) 738-1163
44 * This program module was developed as part of the University
45 * of Delaware's Multi-Channel Memo Distribution Facility (MMDF).
47 * Acquisition, use, and distribution of this module and its listings
48 * are subject restricted to the terms of a license agreement.
49 * Documents describing systems using this module must cite its source.
51 * The above statements must be retained with all copies of this
52 * program and may not be removed without the consent of the
53 * University of Delaware.
57 /* Reply Codes for MMDF
59 * Based on: "Revised FTP Reply Codes", by Jon Postel & Nancy Neigus Arpanet
60 * RFC 640 / NIC 30843, in the "Arpanet Protocol Handbook", E. Feinler
61 * and J. Postel (eds.), NIC 7104, Network Information Center, SRI
62 * International: Menlo Park, CA. (NTIS AD-A0038901)
64 * Actual values are different, but scheme is same. Codes must fit into
65 * 8-bits (to pass on exit() calls); fields are packed 2-3-3 and interpreted
70 * 0yz: positive completion; entire action done
71 * 1yz: positive intermediate; only part done
72 * 2yz: Transient negative completion; may work later
73 * 3yz: Permanent negative completion; you lose forever
76 * x1z: general; doesn't fit any other category
77 * x2z: connections; truly transfer-related
78 * x3z: user/authentication/account
82 * 3-bit z field is unique to the reply. In the following,
83 * the RP_xVAL defines are available for masking to obtain a field.
88 /*************** FIELD DEFINITIONS & BASIC VALUES ******************* */
90 /* Field 1: Basic degree of success (2-bits) */
92 #define RP_BTYP '\200' /* good vs. bad; on => bad */
94 #define RP_BVAL '\300' /* basic degree of success */
96 #define RP_BOK '\000' /* went fine; all done */
97 #define RP_BPOK '\100' /* only the first part got done */
98 #define RP_BTNO '\200' /* temporary failure; try later */
99 #define RP_BNO '\300' /* not now, nor never; you lose */
101 /* Field 2: Basic domain of discourse (3-bits) */
103 #define RP_CVAL '\070' /* basic category (domain) of reply */
105 #define RP_CSYN '\000' /* purely a matter of form */
106 #define RP_CGEN '\010' /* couldn't find anywhere else for it */
107 #define RP_CCON '\020' /* data-transfer-related issue */
108 #define RP_CUSR '\030' /* pertaining to the user */
109 #define RP_CMAI '\040' /* specific to mail semantics */
110 #define RP_CFIL '\050' /* file system */
111 #define RP_CLIO '\060' /* local i/o system */
113 /* Field 3: Specific value for this reply (3-bits) */
115 #define RP_SVAL '\007' /* specific value of reply */
119 /********************* SPECIFIC SUCCESS VALUES ********************** */
122 /* Complete Success */
124 #define RP_DONE (RP_BOK | RP_CGEN | '\000')
125 /* done (e.g., w/transaction) */
126 #define RP_OK (RP_BOK | RP_CGEN | '\001')
127 /* general-purpose OK */
129 #define RP_MOK (RP_BOK | RP_CMAI | '\000')
130 /* message is accepted (w/text) */
133 /* Partial Success */
135 #define RP_MAST (RP_BPOK| RP_CGEN | '\000')
136 /* you are the requestor */
137 #define RP_SLAV (RP_BPOK| RP_CGEN | '\001')
138 /* you are the requestee */
139 #define RP_AOK (RP_BPOK| RP_CMAI | '\000')
140 /* message address is accepted */
144 /* ******************** SPECIFIC FALURE VALUES ********************** */
147 /* Partial Failure */
149 #define RP_AGN (RP_BTNO | RP_CGEN | '\000')
150 /* not now; maybe later */
151 #define RP_TIME (RP_BTNO | RP_CGEN | '\001')
153 #define RP_NOOP (RP_BTNO | RP_CGEN | '\002')
154 /* no-op; nothing done, this time */
155 #define RP_EOF (RP_BTNO | RP_CGEN | '\003')
156 /* encountered an end of file */
158 #define RP_NET (RP_BTNO | RP_CCON | '\000')
159 /* channel went bad */
160 #define RP_BHST (RP_BTNO | RP_CCON | '\001')
161 /* foreign host screwed up */
162 #define RP_DHST (RP_BTNO | RP_CCON | '\002')
164 #define RP_NIO (RP_BTNO | RP_CCON | '\004')
165 /* general net i/o problem */
167 #define RP_FIO (RP_BTNO | RP_CFIL | '\000')
168 /* error reading/writing file */
169 #define RP_FCRT (RP_BTNO | RP_CFIL | '\001')
170 /* unable to create file */
171 #define RP_FOPN (RP_BTNO | RP_CFIL | '\002')
172 /* unable to open file */
173 #define RP_LIO (RP_BTNO | RP_CLIO | '\000')
174 /* general local i/o problem */
175 #define RP_LOCK (RP_BTNO | RP_CLIO | '\001')
176 /* resource currently locked */
179 /* Complete Failure */
181 #define RP_MECH (RP_BNO | RP_CGEN | '\000')
182 /* bad mechanism/path; try alternate? */
183 #define RP_NO (RP_BNO | RP_CGEN | '\001')
184 /* general-purpose NO */
186 #define RP_PROT (RP_BNO | RP_CCON | '\000')
187 /* general prototocol error */
189 #define RP_RPLY (RP_BNO | RP_CCON | '\001')
190 /* bad reply code (PERMANENT ERROR) */
192 #define RP_NDEL (RP_BNO | RP_CMAI | '\000')
193 /* couldn't deliver */
195 #define RP_HUH (RP_BNO | RP_CSYN | '\000')
196 /* couldn't parse the request */
197 #define RP_NCMD (RP_BNO | RP_CSYN | '\001')
198 /* no such command defined */
199 #define RP_PARM (RP_BNO | RP_CSYN | '\002')
201 #define RP_UCMD (RP_BNO | RP_CSYN | '\003')
202 /* command not implemented */
203 #define RP_USER (RP_BNO | RP_CUSR | '\000')
208 /* PSEUDO-FUNCTIONS TO ACCESS REPLY INFO */
210 #define rp_gval(val) ((char) (val))
211 /* get the entire return value */
214 /* The next three give the field's bits, within the whole value */
216 #define rp_gbval(val) (rp_gval (val) & RP_BVAL)
217 /* get the basic part of return value */
218 #define rp_gcval(val) (rp_gval (val) & RP_CVAL)
219 /* get the domain part of value */
220 #define rp_gsval(val) (rp_gval (val) & RP_SVAL)
221 /* get the specific part of value */
224 /* The next three give the numeric value withing the field */
226 #define rp_gbbit(val) ((rp_gval (val) >> 6) & 03)
227 /* get the basic part right-shifted */
228 #define rp_gcbit(val) ((rp_gval (val) >> 3 ) & 07)
229 /* get the domain part right-shifted */
230 #define rp_gsbit(val) (rp_gval (val) & 07)
231 /* get the specific part right-shifted */
234 /* MACHINE DEPENDENCY: The following treat the value as strictly numeric.
235 * It relies on the negative values being numerically
239 #define rp_isgood(val) (rp_gval (val) >= 0)
240 /* is return value positive? */
241 #define rp_isbad(val) (rp_gval (val) < 0)
242 /* is return value negative? */