1*d0cef73dSGregory Neil Shapiro<HTML>
2*d0cef73dSGregory Neil Shapiro<HEAD><TITLE>smfi_opensocket</TITLE></HEAD>
3*d0cef73dSGregory Neil Shapiro<BODY>
4e92d3f3fSGregory Neil Shapiro<!--
5*d0cef73dSGregory Neil Shapiro$Id: smfi_opensocket.html,v 1.8 2013-11-22 20:51:39 ca Exp $
6e92d3f3fSGregory Neil Shapiro-->
7*d0cef73dSGregory Neil Shapiro<H1>smfi_opensocket</H1>
8e92d3f3fSGregory Neil Shapiro
9*d0cef73dSGregory Neil Shapiro<TABLE border="0" cellspacing=4 cellpadding=4>
10e92d3f3fSGregory Neil Shapiro<!---------- Synopsis ----------->
11*d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left width=100>SYNOPSIS</TH><TD>
12*d0cef73dSGregory Neil Shapiro<PRE>
13e92d3f3fSGregory Neil Shapiro#include &lt;libmilter/mfapi.h&gt;
14e92d3f3fSGregory Neil Shapiroint smfi_opensocket(
15e92d3f3fSGregory Neil Shapiro	bool rmsocket
16e92d3f3fSGregory Neil Shapiro);
17*d0cef73dSGregory Neil Shapiro</PRE>
18e92d3f3fSGregory Neil ShapiroAttempt to create the interface socket MTAs will use to connect to the
19e92d3f3fSGregory Neil Shapirofilter.
20*d0cef73dSGregory Neil Shapiro</TD></TR>
21e92d3f3fSGregory Neil Shapiro
22e92d3f3fSGregory Neil Shapiro<!----------- Description ---------->
23*d0cef73dSGregory Neil Shapiro<TR><TH valign="top" align=left>DESCRIPTION</TH><TD>
24*d0cef73dSGregory Neil Shapiro<TABLE border="1" cellspacing=1 cellpadding=4>
25*d0cef73dSGregory Neil Shapiro<TR align="left" valign=top>
26*d0cef73dSGregory Neil Shapiro<TH width="80">Called When</TH>
27*d0cef73dSGregory Neil Shapiro<TD>Called only from program mainline,
28*d0cef73dSGregory Neil Shapiroafter calling <TT>smfi_setconn()</TT> and <TT>smfi_register()</TT>,
29*d0cef73dSGregory Neil Shapirobut before calling <TT>smfi_main()</TT>.
30*d0cef73dSGregory Neil Shapiro</TD>
31*d0cef73dSGregory Neil Shapiro</TR>
32*d0cef73dSGregory Neil Shapiro<TR align="left" valign=top>
33*d0cef73dSGregory Neil Shapiro<TH width="80">Effects</TH>
34e92d3f3fSGregory Neil Shapiro<TD>smfi_opensocket attempts to create the socket specified previously by
35*d0cef73dSGregory Neil Shapiroa call to <TT>smfi_setconn()</TT> which will be the interface between MTAs
36*d0cef73dSGregory Neil Shapiroand the filter.
37*d0cef73dSGregory Neil ShapiroThis allows the calling application to ensure that the socket can be created.
38*d0cef73dSGregory Neil ShapiroIf this is not called,
39e92d3f3fSGregory Neil Shapiro<TT>smfi_main()</TT> will create the socket implicitly
40e92d3f3fSGregory Neil Shapiro(without removing a potentially existing UNIX domain socket).
41*d0cef73dSGregory Neil Shapiro</TD>
42*d0cef73dSGregory Neil Shapiro</TR>
43*d0cef73dSGregory Neil Shapiro</TABLE>
44*d0cef73dSGregory Neil Shapiro</TD></TR>
45*d0cef73dSGregory Neil Shapiro
46e92d3f3fSGregory Neil Shapiro<!----------- Arguments ---------->
47e92d3f3fSGregory Neil Shapiro<TR><TH valign="top" align=left>ARGUMENTS</TH><TD>
48*d0cef73dSGregory Neil Shapiro    <TABLE border="1" cellspacing=0>
49*d0cef73dSGregory Neil Shapiro    <TR bgcolor="#dddddd"><TH>Argument</TH><TH>Description</TH></TR>
50*d0cef73dSGregory Neil Shapiro    <TR valign="top"><TD>rmsocket</TD>
51e92d3f3fSGregory Neil Shapiro	<TD>A flag indicating whether or not the library should try to
52e92d3f3fSGregory Neil Shapiro	remove any existing UNIX domain socket before trying to create
53*d0cef73dSGregory Neil Shapiro        a new one.
54*d0cef73dSGregory Neil Shapiro	</TD></TR>
55e92d3f3fSGregory Neil Shapiro    </TABLE>
56*d0cef73dSGregory Neil Shapiro</TD></TR>
57*d0cef73dSGregory Neil Shapiro
58*d0cef73dSGregory Neil Shapiro<!----------- Return values ---------->
59*d0cef73dSGregory Neil Shapiro<TR>
60e92d3f3fSGregory Neil Shapiro<TH valign="top" align=left>RETURN VALUES</TH>
61*d0cef73dSGregory Neil Shapiro
62*d0cef73dSGregory Neil Shapiro<TD>smfi_opensocket will fail and return MI_FAILURE if:
63e92d3f3fSGregory Neil Shapiro<UL>
64*d0cef73dSGregory Neil Shapiro    <LI>The interface socket could not be created for any reason.
65*d0cef73dSGregory Neil Shapiro    <LI><TT>rmsocket</TT> was <TT>true</TT>, and either the socket could
66e92d3f3fSGregory Neil Shapiro        not be examined, or exists and could not be removed.
67*d0cef73dSGregory Neil Shapiro    <LI><TT>smfi_setconn()</TT> or <TT>smfi_register()</TT>
68e92d3f3fSGregory Neil Shapiro	have not been called.
69*d0cef73dSGregory Neil Shapiro</UL>
70*d0cef73dSGregory Neil ShapiroOtherwise, it will return MI_SUCCESS
71e92d3f3fSGregory Neil Shapiro</TD>
72e92d3f3fSGregory Neil Shapiro</TR>
73*d0cef73dSGregory Neil Shapiro
74e92d3f3fSGregory Neil Shapiro</TABLE>
75e92d3f3fSGregory Neil Shapiro
76*d0cef73dSGregory Neil Shapiro<HR size="1">
77*d0cef73dSGregory Neil Shapiro<FONT size="-1">
78*d0cef73dSGregory Neil ShapiroCopyright (c) 2003, 2008 Proofpoint, Inc. and its suppliers.
79All rights reserved.
80<BR>
81By using this file, you agree to the terms and conditions set
82forth in the LICENSE.
83</FONT>
84</BODY>
85</HTML>
86