ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libspf/docs/API/doxygen/html/main_8h-source.html
Revision: 1.1
Committed: Tue Nov 13 00:51:28 2007 UTC (18 years, 10 months ago) by root
Content type: text/html
Branch: MAIN
CVS Tags: HEAD
Log Message:
initial import of libspf-1.0.0-p5 from freebsd ports

File Contents

# Content
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>libSPF v1.0: main.h Source File</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.3.8 -->
7 <div class="qindex"> <form class="search" action="search.php" method="get">
8 <a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
9 <h1>main.h</h1><a href="main_8h.html">Go to the documentation of this file.</a><pre class="fragment"><div>00001 <span class="comment">/* libspf - Sender Policy Framework library</span>
10 00002 <span class="comment">*</span>
11 00003 <span class="comment">* ANSI C implementation of spf-draft-200405.txt</span>
12 00004 <span class="comment">*</span>
13 00005 <span class="comment">* Author: James Couzens &lt;jcouzens@codeshare.ca&gt;</span>
14 00006 <span class="comment">* Author: Sean Comeau &lt;scomeau@obscurity.org&gt;</span>
15 00007 <span class="comment">*</span>
16 00008 <span class="comment">* FILE: spf.h</span>
17 00009 <span class="comment">* DESC: main library header file </span>
18 00010 <span class="comment">*</span>
19 00011 <span class="comment">* License:</span>
20 00012 <span class="comment">*</span>
21 00013 <span class="comment">* The libspf Software License, Version 1.0</span>
22 00014 <span class="comment">*</span>
23 00015 <span class="comment">* Copyright (c) 2004 James Couzens &amp; Sean Comeau All rights</span>
24 00016 <span class="comment">* reserved.</span>
25 00017 <span class="comment">*</span>
26 00018 <span class="comment">* Redistribution and use in source and binary forms, with or without</span>
27 00019 <span class="comment">* modification, are permitted provided that the following conditions</span>
28 00020 <span class="comment">* are met:</span>
29 00021 <span class="comment">*</span>
30 00022 <span class="comment">* 1. Redistributions of source code must retain the above copyright</span>
31 00023 <span class="comment">* notice, this list of conditions and the following disclaimer.</span>
32 00024 <span class="comment">*</span>
33 00025 <span class="comment">* 2. Redistributions in binary form must reproduce the above copyright</span>
34 00026 <span class="comment">* notice, this list of conditions and the following disclaimer in</span>
35 00027 <span class="comment">* the documentation and/or other materials provided with the</span>
36 00028 <span class="comment">* distribution.</span>
37 00029 <span class="comment">*</span>
38 00030 <span class="comment">* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED</span>
39 00031 <span class="comment">* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</span>
40 00032 <span class="comment">* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span>
41 00033 <span class="comment">* DISCLAIMED. IN NO EVENT SHALL THE AUTHORS MAKING USE OF THIS LICESEN</span>
42 00034 <span class="comment">* OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
43 00035 <span class="comment">* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT</span>
44 00036 <span class="comment">* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF</span>
45 00037 <span class="comment">* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND</span>
46 00038 <span class="comment">* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</span>
47 00039 <span class="comment">* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT</span>
48 00040 <span class="comment">* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF</span>
49 00041 <span class="comment">* SUCH DAMAGE.</span>
50 00042 <span class="comment">* </span>
51 00043 <span class="comment">*/</span>
52 00044
53 00045
54 00046 <span class="preprocessor">#ifndef _MAIN_H</span>
55 <a name="l00047"></a><a class="code" href="main_8h.html#a0">00047</a> <span class="preprocessor"></span><span class="preprocessor">#define _MAIN_H 1</span>
56 00048 <span class="preprocessor"></span>
57 00049 <span class="preprocessor">#include &lt;stdio.h&gt;</span> <span class="comment">/* stdin / stdout */</span>
58 00050 <span class="preprocessor">#include &lt;stdlib.h&gt;</span> <span class="comment">/* malloc / free */</span>
59 00051 <span class="preprocessor">#include &lt;string.h&gt;</span> <span class="comment">/* strstr / strdup */</span>
60 00052 <span class="preprocessor">#include &lt;stdarg.h&gt;</span> <span class="comment">/* va_snprintf */</span>
61 00053
62 00054 <span class="preprocessor">#ifdef _WITH_OPENBSD</span>
63 00055 <span class="preprocessor"></span><span class="preprocessor">#include &lt;inttypes.h&gt;</span> <span class="comment">/* uintptr_t */</span>
64 00056 <span class="preprocessor">#endif </span><span class="comment">/* _WITH_OPENBBSD */</span>
65 00057
66 00058 <span class="preprocessor">#include "../../config.h"</span> <span class="comment">/* autoconf */</span>
67 00059 <span class="preprocessor">#include "<a class="code" href="spf_8h.html">spf.h</a>"</span>
68 00060
69 00061
70 00062 <span class="preprocessor">#ifdef HAVE__BEGIN_DECLS</span>
71 00063 <span class="preprocessor"></span>__BEGIN_DECLS
72 00064 <span class="preprocessor">#else</span>
73 00065 <span class="preprocessor"></span><span class="preprocessor"># ifdef __cplusplus</span>
74 00066 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
75 00067 <span class="preprocessor"># endif </span><span class="comment">/* __cplusplus */</span>
76 00068 <span class="preprocessor">#endif </span><span class="comment">/* HAVE__BEGIN_DECLS */</span>
77 00069
78 <a name="l00070"></a><a class="code" href="main_8h.html#a1">00070</a> <span class="preprocessor">#define FL_A 2 </span><span class="comment">/* normal debugging */</span>
79 <a name="l00071"></a><a class="code" href="main_8h.html#a2">00071</a> <span class="preprocessor">#define FL_B 4 </span><span class="comment">/* verbose debugging */</span>
80 <a name="l00072"></a><a class="code" href="main_8h.html#a3">00072</a> <span class="preprocessor">#define FL_C 8 </span><span class="comment">/* normal and verbose debugging */</span>
81 <a name="l00073"></a><a class="code" href="main_8h.html#a4">00073</a> <span class="preprocessor">#define FL_D 16 </span><span class="comment">/* profile results */</span>
82 <a name="l00074"></a><a class="code" href="main_8h.html#a5">00074</a> <span class="preprocessor">#define FL_E 32 </span><span class="comment">/* normal debug + profile results */</span>
83 <a name="l00075"></a><a class="code" href="main_8h.html#a6">00075</a> <span class="preprocessor">#define FL_F 64 </span><span class="comment">/* verbose debug + profile results */</span>
84 <a name="l00076"></a><a class="code" href="main_8h.html#a7">00076</a> <span class="preprocessor">#define FL_G 128 </span><span class="comment">/* normal + verbose + profile results */</span>
85 00077
86 00078 <span class="comment">/* # limiting recursion */</span>
87 <a name="l00079"></a><a class="code" href="main_8h.html#a8">00079</a> <span class="preprocessor">#define SPF_MAX_RECURSE 20</span>
88 00080 <span class="preprocessor"></span>
89 00081 <span class="comment">/* spf MTA result strings */</span>
90 <a name="l00082"></a><a class="code" href="main_8h.html#a9">00082</a> <span class="preprocessor">#define RES_PASS "domain of %s designates %s as permitted sender\r\n"</span>
91 <a name="l00083"></a><a class="code" href="main_8h.html#a10">00083</a> <span class="preprocessor"></span><span class="preprocessor">#define RES_NONE "domain of %s does not designate permitted sender " \</span>
92 00084 <span class="preprocessor"> "hosts\r\n"</span>
93 <a name="l00085"></a><a class="code" href="main_8h.html#a11">00085</a> <span class="preprocessor"></span><span class="preprocessor">#define RES_S_FAIL "transitioning domain of %s does not designate %s " \</span>
94 00086 <span class="preprocessor"> "as permitted sender\r\n"</span>
95 <a name="l00087"></a><a class="code" href="main_8h.html#a12">00087</a> <span class="preprocessor"></span><span class="preprocessor">#define RES_H_FAIL "domain of %s does not designate %s as permitted " \</span>
96 00088 <span class="preprocessor"> "sender\r\n"</span>
97 <a name="l00089"></a><a class="code" href="main_8h.html#a13">00089</a> <span class="preprocessor"></span><span class="preprocessor">#define RES_ERROR "encountered temporary error during SPF processing " \</span>
98 00090 <span class="preprocessor"> "of %s\r\n"</span>
99 <a name="l00091"></a><a class="code" href="main_8h.html#a14">00091</a> <span class="preprocessor"></span><span class="preprocessor">#define RES_NEUTRAL "%s is neither permitted nor denied by domain of " \</span>
100 00092 <span class="preprocessor"> "%s\r\n"</span>
101 <a name="l00093"></a><a class="code" href="main_8h.html#a15">00093</a> <span class="preprocessor"></span><span class="preprocessor">#define RES_UNKNOWN "error in processing during lookup of %s\r\n"</span>
102 <a name="l00094"></a><a class="code" href="main_8h.html#a16">00094</a> <span class="preprocessor"></span><span class="preprocessor">#define RES_UNMECH "encountered unrecognized mechanism during SPF " \</span>
103 00095 <span class="preprocessor"> "processing of domain of %s\r\n"</span>
104 00096 <span class="preprocessor"></span>
105 00097 <span class="comment">/* header strings */</span>
106 <a name="l00098"></a><a class="code" href="main_8h.html#a17">00098</a> <span class="preprocessor">#define HDR_PASS "Received-SPF: pass (%s: domain of %s designates " \</span>
107 00099 <span class="preprocessor"> "%s as permitted sender) receiver=%s; client_ip=%s; " \</span>
108 00100 <span class="preprocessor"> "envelope-from=%s;"</span>
109 00101 <span class="preprocessor"></span>
110 <a name="l00102"></a><a class="code" href="main_8h.html#a18">00102</a> <span class="preprocessor">#define HDR_NONE "Received-SPF: none (%s: domain of %s does not " \</span>
111 00103 <span class="preprocessor"> "designate permitted sender hosts)"</span>
112 00104 <span class="preprocessor"></span>
113 <a name="l00105"></a><a class="code" href="main_8h.html#a19">00105</a> <span class="preprocessor">#define HDR_S_FAIL "Received-SPF: softfail (%s: domain of " \</span>
114 00106 <span class="preprocessor"> "transitioning %s does not designate %s as " \</span>
115 00107 <span class="preprocessor"> "permitted sender) receiver=%s; client_ip=%s; " \</span>
116 00108 <span class="preprocessor"> "envelope-from=%s;"</span>
117 00109 <span class="preprocessor"></span>
118 <a name="l00110"></a><a class="code" href="main_8h.html#a20">00110</a> <span class="preprocessor">#define HDR_H_FAIL "Received-SPF: fail (%s: domain of %s does not " \</span>
119 00111 <span class="preprocessor"> "designate %s as permitted sender) receiver=%s; " \</span>
120 00112 <span class="preprocessor"> "client_ip=%s; envelope-from=%s;"</span>
121 00113 <span class="preprocessor"></span>
122 <a name="l00114"></a><a class="code" href="main_8h.html#a21">00114</a> <span class="preprocessor">#define HDR_ERROR "Received-SPF: error (%s: error in processing " \</span>
123 00115 <span class="preprocessor"> "during lookup of %s: %s)"</span>
124 00116 <span class="preprocessor"></span>
125 <a name="l00117"></a><a class="code" href="main_8h.html#a22">00117</a> <span class="preprocessor">#define HDR_NEUTRAL "Received-SPF: neutral (%s: domain of %s is " \</span>
126 00118 <span class="preprocessor"> "neutral about designating %s as permitted sender)"</span>
127 00119 <span class="preprocessor"></span>
128 <a name="l00120"></a><a class="code" href="main_8h.html#a23">00120</a> <span class="preprocessor">#define HDR_UNKNOWN "Received-SPF: unknown (%s: domain of %s " \</span>
129 00121 <span class="preprocessor"> "encountered an error while parsing (check SPF " \</span>
130 00122 <span class="preprocessor"> "record %s for errors))"</span>
131 00123 <span class="preprocessor"></span>
132 <a name="l00124"></a><a class="code" href="main_8h.html#a24">00124</a> <span class="preprocessor">#define HDR_UNMECH "Received-SPF: unknown -extension:%s (%s: domain of " \</span>
133 00125 <span class="preprocessor"> "%s uses a mechanism not recognized by this client)"</span>
134 00126 <span class="preprocessor"></span>
135 00127 <span class="comment">/* Deal with systems where these types are not used and define them where</span>
136 00128 <span class="comment">* they are found to be missing</span>
137 00129 <span class="comment">*/</span>
138 00130 <span class="preprocessor">#ifndef HAVE_U_INT8_T</span>
139 00131 <span class="preprocessor"></span><span class="preprocessor"># ifdef HAVE_UINT8_T</span>
140 00132 <span class="preprocessor"></span><span class="keyword">typedef</span> uint8_t u_int8_t;
141 00133 <span class="preprocessor"># else</span>
142 00134 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> u_int8_t;
143 00135 <span class="preprocessor"># endif </span><span class="comment">/* HAVE_UINT8_T */</span>
144 00136 <span class="preprocessor">#endif </span><span class="comment">/* HAVE_U_INT8_T */</span>
145 00137
146 00138 <span class="preprocessor">#ifndef HAVE_U_INT16_T</span>
147 00139 <span class="preprocessor"></span><span class="preprocessor"># ifdef HAVE_UINT16_T</span>
148 00140 <span class="preprocessor"></span><span class="keyword">typedef</span> uint16_t u_int16_t;
149 00141 <span class="preprocessor"># else</span>
150 00142 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> u_int16_t;
151 00143 <span class="preprocessor"># endif </span><span class="comment">/* HAVE_UINT16_T */</span>
152 00144 <span class="preprocessor">#endif </span><span class="comment">/* HAVE_U_INT16_T */</span>
153 00145
154 00146 <span class="preprocessor">#ifndef HAVE_U_INT32_T</span>
155 00147 <span class="preprocessor"></span><span class="preprocessor"># ifdef HAVE_UINT32_T</span>
156 00148 <span class="preprocessor"></span><span class="keyword">typedef</span> uint32_t u_int32_t;
157 00149 <span class="preprocessor"># else</span>
158 00150 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> u_int32_t;
159 00151 <span class="preprocessor"># endif </span><span class="comment">/* HAVE_UINT32_T */</span>
160 00152 <span class="preprocessor">#endif </span><span class="comment">/* HAVE_U_INT32_T */</span>
161 00153
162 00154 <span class="preprocessor">#ifndef HAVE_UINTPTR_T</span>
163 00155 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <span class="keywordtype">int</span> uintptr_t;
164 00156 <span class="preprocessor">#endif </span><span class="comment">/* HAVE_UINTPTR_T */</span>
165 00157
166 00158
167 00159 <span class="comment">/* Main library functions (main.c) */</span>
168 00160 <a class="code" href="structpeer__info__s.html">peer_info_t</a> *<a class="code" href="spf_8h.html#a77">SPF_init</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *,
169 00161 <span class="keyword">const</span> <span class="keywordtype">char</span> *, u_int32_t, u_int32_t);
170 00162 <a class="code" href="structpeer__info__s.html">peer_info_t</a> *<a class="code" href="spf_8h.html#a78">SPF_close</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *);
171 00163 <a class="code" href="spf_8h.html#a36">SPF_RESULT</a> <a class="code" href="spf_8h.html#a79">SPF_policy_main</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *);
172 00164 <a class="code" href="spf_8h.html#a36">SPF_RESULT</a> <a class="code" href="spf_8h.html#a80">SPF_policy_main_rec</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *);
173 00165 <a class="code" href="spf_8h.html#a35">SPF_BOOL</a> <a class="code" href="spf_8h.html#a81">SPF_parse_policy</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
174 00166 <span class="keywordtype">char</span> *<a class="code" href="spf_8h.html#a82">SPF_result</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *);
175 00167
176 00168 <a class="code" href="spf_8h.html#a35">SPF_BOOL</a> <a class="code" href="spf_8h.html#a83">SPF_smtp_from</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
177 00169 <a class="code" href="spf_8h.html#a35">SPF_BOOL</a> <a class="code" href="spf_8h.html#a84">SPF_smtp_helo</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *, <span class="keyword">const</span> <span class="keywordtype">char</span> *);
178 00170
179 00171 <span class="keywordtype">char</span> *<a class="code" href="spf_8h.html#a85">SPF_build_header</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *);
180 00172 <span class="keywordtype">char</span> *<a class="code" href="spf_8h.html#a86">SPF_get_explain</a>(<a class="code" href="structpeer__info__s.html">peer_info_t</a> *);
181 00173
182 00174
183 00175 <span class="comment">/*</span>
184 00176 <span class="comment"> * private functions </span>
185 00177 <span class="comment"> *</span>
186 00178 <span class="comment">*/</span>
187 00179 <span class="comment">/*</span>
188 00180 <span class="comment">static SPF_BOOL _SPF_clear_holdbufs(peer_info_t *);</span>
189 00181 <span class="comment">*/</span>
190 00182
191 00183
192 00184
193 00185 <span class="preprocessor">#ifdef HAVE__BEGIN_DECLS</span>
194 00186 <span class="preprocessor"></span>__END_DECLS <span class="comment">/* _MAIN_H */</span>
195 00187 <span class="preprocessor">#else</span>
196 00188 <span class="preprocessor"></span><span class="preprocessor"># ifdef __cplusplus</span>
197 00189 <span class="preprocessor"></span>}
198 00190 <span class="preprocessor"># endif </span><span class="comment">/* __cplusplus */</span>
199 00191 <span class="preprocessor">#endif </span><span class="comment">/* HAVE__BEGIN_DECLS */</span>
200 00192
201 00193
202 00194 <span class="preprocessor">#endif </span><span class="comment">/* main.h */</span>
203 </div></pre><hr size="1"><address style="align: right;"><small>Generated on Thu Sep 16 18:10:46 2004 for libSPF v1.0 by
204 <a href="http://www.doxygen.org/index.html">
205 <img src="doxygen.png" alt="doxygen" align="middle" border=0 ></a> 1.3.8 </small></address>
206 </body>
207 </html>