3 * $Id: privconn.h,v 1.1 2003/11/29 20:36:07 mdw Exp $
5 * Making privileged connections
7 * (c) 2003 Straylight/Edgeware
10 /*----- Licensing notice --------------------------------------------------*
12 * This file is part of the `fw' port forwarder.
14 * `fw' is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 2 of the License, or
17 * (at your option) any later version.
19 * `fw' is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
24 * You should have received a copy of the GNU General Public License
25 * along with `fw'; if not, write to the Free Software Foundation,
26 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 /*----- Revision history --------------------------------------------------*
31 * $Log: privconn.h,v $
32 * Revision 1.1 2003/11/29 20:36:07 mdw
33 * Privileged outgoing connections.
44 /*----- Header files ------------------------------------------------------*/
46 #include <arpa/inet.h>
48 #include <mLib/conn.h>
51 /*----- Functions provided ------------------------------------------------*/
53 /* --- @privconn_split@ --- *
55 * Arguments: @sel_state *s@ = select state
59 * Use: Splits off the privileged binding code into a separate
63 extern void privconn_split(sel_state */*s*/);
65 /* --- @privconn_adddest@ --- *
67 * Arguments: @struct in_addr peer@ = address to connect to
68 * @unsigned port@ = port to connect to
70 * Returns: Index for this destination address, or @-1@ if not
73 * Use: Adds a valid destination for a privileged connection.
76 extern int privconn_adddest(struct in_addr /*peer*/, unsigned /*port*/);
78 /* --- @privconn_connect@ --- *
80 * Arguments: @conn *c@ = connection structure to fill in
81 * @sel_state *s@ = pointer to select state to attach to
82 * @int i@ = address index to connect to
83 * @struct in_addr bind@ = address to bind to
84 * @void (*func)(int, void *)@ = function to call on connect
85 * @void *p@ = argument for the function
87 * Returns: Zero on success, @-1@ on failure.
89 * Use: Sets up a privileged connection job.
92 extern int privconn_connect(conn */*c*/, sel_state */*s*/,
93 int /*i*/, struct in_addr /*bind*/,
94 void (*/*func*/)(int, void *), void */*p*/);
96 /*----- That's all, folks -------------------------------------------------*/