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