/usr/include/zorp/connect.h is in libzorpll-6.0-10-dev 6.0.10.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | /***************************************************************************
*
* This file is covered by a dual licence. You can choose whether you
* want to use it according to the terms of the GNU GPL version 2, or
* under the terms of Zorp Professional Firewall System EULA located
* on the Zorp installation CD.
*
***************************************************************************/
#ifndef ZORP_CONNECT_H_INCLUDED
#define ZORP_CONNECT_H_INCLUDED
#include <zorp/zorplib.h>
#include <zorp/sockaddr.h>
#include <zorp/socket.h>
#include <zorp/zobject.h>
#include <zorp/stream.h>
#ifdef __cplusplus
extern "C" {
#endif
/** z_io_connect public interface */
typedef void (*ZConnectFunc)(ZStream *fdstream, GError *error, gpointer user_data);
/**
* Connect to the given socket address using the given local address,
* and call a given callback function if the connection is established.
**/
typedef struct _ZConnector
{
ZObject super;
ZSockAddr *local;
gint fd;
/* private */
ZSockAddr *remote;
/* we use a reference to our GSource, as using source_id would cause a race */
GSource *watch;
gint timeout;
ZConnectFunc callback;
gpointer user_data;
GDestroyNotify destroy_data;
gint refcnt;
GRecMutex lock;
GMainContext *context;
gboolean blocking;
gint socket_type;
guint32 sock_flags;
gchar *session_id;
} ZConnector;
/**
* ZConnector virtual method table type.
**/
typedef struct _ZConnectorFuncs
{
ZObjectFuncs super;
} ZConnectorFuncs;
LIBZORPLL_EXTERN ZClass ZConnector__class;
LIBZORPLL_EXTERN ZClass ZStreamConnector__class;
ZConnector *
z_connector_new(ZClass *_class,
const gchar *session_id,
gint socket_type,
ZSockAddr *local,
ZSockAddr *remote,
guint32 sock_flags,
ZConnectFunc callback,
gpointer user_data,
GDestroyNotify destroy_data);
gboolean z_connector_start_block(ZConnector *self, ZSockAddr **local, ZStream **stream);
gboolean z_connector_start(ZConnector *self, ZSockAddr **local);
gboolean z_connector_start_in_context(ZConnector *self, GMainContext *context, ZSockAddr **local);
void z_connector_set_timeout(ZConnector *self, gint timeout);
void z_connector_set_tos(ZConnector *self, gint tos);
void z_connector_set_mark(ZConnector *self, int mark);
void z_connector_cancel(ZConnector *self);
/**
* Increment reference count and return a reference to a ZConnector.
*
* @param[in] self ZConnector instance
*
* @returns self
**/
static inline ZConnector *
z_connector_ref(ZConnector *self)
{
return Z_CAST(z_object_ref(&self->super), ZConnector);
}
/**
* Decrement reference count of a ZConnector.
*
* @param[in] self ZConnector instance.
**/
static inline void
z_connector_unref(ZConnector *self)
{
z_object_unref(&self->super);
}
/**
* Get session id.
*
* @param[in] self ZConnector instance
*
* @returns session id
**/
static inline const gchar *
z_connector_get_session_id(ZConnector *self)
{
return self->session_id;
}
/**
* Create a new ZStreamConnector instance.
*
* @param[in] session_id session id used for logging
* @param[in] local local address to bind to.
* @param[in] remote remote address to connect to.
* @param[in] sock_flags socket flags
* @param[in] callback function to call when the connection is established.
* @param[in] user_data opaque pointer to pass to callback.
* @param[in] destroy_data destroy callback for user_data
*
* @returns The allocated instance.
**/
static inline ZConnector *
z_stream_connector_new(const gchar *session_id,
ZSockAddr *local,
ZSockAddr *remote,
guint32 sock_flags,
ZConnectFunc callback,
gpointer user_data,
GDestroyNotify destroy_data)
{
return z_connector_new(Z_CLASS(ZStreamConnector), session_id, SOCK_STREAM, local, remote, sock_flags, callback, user_data, destroy_data);
}
#ifdef __cplusplus
}
#endif
#endif
|