2 * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3 * Copyright (c) 2008-2012 Zmanda, Inc. All Rights Reserved.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * Contact information: Zmanda Inc., 465 N Mathlida Ave, Suite 300
20 * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
25 #include "sockaddr-util.h"
30 * This declaration is entirely private; nothing but xfer_dest_directtcp_listen() references
34 GType xfer_dest_directtcp_listen_get_type(void);
35 #define XFER_DEST_DIRECTTCP_LISTEN_TYPE (xfer_dest_directtcp_listen_get_type())
36 #define XFER_DEST_DIRECTTCP_LISTEN(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListen)
37 #define XFER_DEST_DIRECTTCP_LISTEN_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListen const)
38 #define XFER_DEST_DIRECTTCP_LISTEN_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListenClass)
39 #define IS_XFER_DEST_DIRECTTCP_LISTEN(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), xfer_dest_directtcp_listen_get_type ())
40 #define XFER_DEST_DIRECTTCP_LISTEN_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), xfer_dest_directtcp_listen_get_type(), XferDestDirectTCPListenClass)
42 static GObjectClass *parent_class = NULL;
45 * Main object structure
48 typedef struct XferDestDirectTCPListen {
49 XferElement __parent__;
50 } XferDestDirectTCPListen;
57 XferElementClass __parent__;
58 } XferDestDirectTCPListenClass;
68 elt->output_listen_addrs = elt->upstream->output_listen_addrs;
75 XferDestDirectTCPListenClass * selfc)
77 XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
78 static xfer_element_mech_pair_t mech_pairs[] = {
79 { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
80 { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
83 klass->start = start_impl;
85 klass->perl_class = "Amanda::Xfer::Dest::DirectTCPListen";
86 klass->mech_pairs = mech_pairs;
88 parent_class = g_type_class_peek_parent(selfc);
92 xfer_dest_directtcp_listen_get_type (void)
94 static GType type = 0;
96 if G_UNLIKELY(type == 0) {
97 static const GTypeInfo info = {
98 sizeof (XferDestDirectTCPListenClass),
100 (GBaseFinalizeFunc) NULL,
101 (GClassInitFunc) class_init,
102 (GClassFinalizeFunc) NULL,
103 NULL /* class_data */,
104 sizeof (XferDestDirectTCPListen),
106 (GInstanceInitFunc) NULL,
110 type = g_type_register_static (XFER_ELEMENT_TYPE, "XferDestDirectTCPListen", &info, 0);
116 /* create an element of this class; prototype is in xfer-element.h */
118 xfer_dest_directtcp_listen(void)
120 XferDestDirectTCPListen *self = (XferDestDirectTCPListen *)
121 g_object_new(XFER_DEST_DIRECTTCP_LISTEN_TYPE, NULL);
122 XferElement *elt = XFER_ELEMENT(self);