3 * Making privileged connections
5 * (c) 2003 Straylight/Edgeware
8 /*----- Licensing notice --------------------------------------------------*
10 * This file is part of the `fw' port forwarder.
12 * `fw' is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * `fw' is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with `fw'; if not, write to the Free Software Foundation,
24 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
34 /*----- Header files ------------------------------------------------------*/
36 #include <arpa/inet.h>
38 #include <mLib/conn.h>
41 /*----- Functions provided ------------------------------------------------*/
43 /* --- @privconn_split@ --- *
45 * Arguments: @sel_state *s@ = select state
49 * Use: Splits off the privileged binding code into a separate
53 extern void privconn_split(sel_state */
*s*/
);
55 /* --- @privconn_adddest@ --- *
57 * Arguments: @struct in_addr peer@ = address to connect to
58 * @unsigned port@ = port to connect to
60 * Returns: Index for this destination address, or @-1@ if not
63 * Use: Adds a valid destination for a privileged connection.
66 extern int privconn_adddest(struct in_addr
/*peer*/, unsigned /*port*/);
68 /* --- @privconn_connect@ --- *
70 * Arguments: @conn *c@ = connection structure to fill in
71 * @sel_state *s@ = pointer to select state to attach to
72 * @int i@ = address index to connect to
73 * @struct in_addr bind@ = address to bind to
74 * @void (*func)(int, void *)@ = function to call on connect
75 * @void *p@ = argument for the function
77 * Returns: Zero on success, @-1@ on failure.
79 * Use: Sets up a privileged connection job.
82 extern int privconn_connect(conn */
*c*/
, sel_state */
*s*/
,
83 int /*i*/, struct in_addr
/*bind*/,
84 void (*/
*func*/
)(int, void *), void */
*p*/
);
86 /*----- That's all, folks -------------------------------------------------*/