Imported Upstream version 3.3.2
[debian/amanda] / perl / Amanda / XferServer.swg
1 /*
2  * Copyright (c) 2009-2012 Zmanda, Inc.  All Rights Reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 as published
6  * by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
10  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11  * for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16  *
17  * Contact information: Zmanda Inc., 465 S. Mathilda Ave., Suite 300
18  * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
19  */
20
21 %module "Amanda::XferServer"
22 %include "amglue/amglue.swg"
23 %include "exception.i"
24 %import "Amanda/Xfer.swg"
25 %import "Amanda/Device.swg"
26 %import "Amanda/Header.swg"
27
28 %include "Amanda/XferServer.pod"
29
30 %{
31 #include "glib-util.h"
32 #include "amxfer.h"
33 #include "xfer-device.h"
34 #include "xfer-server.h"
35 %}
36
37 %newobject xfer_source_device;
38 XferElement *xfer_source_device(
39     Device *device);
40
41 %newobject xfer_dest_device;
42 XferElement *xfer_dest_device(
43     Device *device,
44     gboolean cancel_at_leom);
45
46 %newobject xfer_source_holding;
47 XferElement * xfer_source_holding(
48     const char *filename);
49
50 guint64 xfer_source_holding_get_bytes_read(
51     XferElement *self);
52
53 %newobject xfer_dest_taper_splitter;
54 XferElement *xfer_dest_taper_splitter(
55     Device *first_device,
56     size_t max_memory,
57     guint64 part_size,
58     gboolean expect_cache_inform);
59
60 %newobject xfer_dest_taper_cacher;
61 XferElement *xfer_dest_taper_cacher(
62     Device *first_device,
63     size_t max_memory,
64     guint64 part_size,
65     gboolean use_mem_cache,
66     const char *disk_cache_dirname);
67
68 %newobject xfer_dest_taper_directtcp;
69 XferElement *xfer_dest_taper_directtcp(
70     Device *first_device,
71     guint64 part_size);
72
73 void xfer_dest_taper_start_part(
74     XferElement *self,
75     gboolean retry_part,
76     dumpfile_t *header);
77
78 void xfer_dest_taper_use_device(
79     XferElement *self,
80     Device *device);
81
82 void xfer_dest_taper_cache_inform(
83     XferElement *self,
84     const char *filename,
85     off_t offset,
86     off_t length);
87
88 guint64 xfer_dest_taper_get_part_bytes_written(
89     XferElement *self);
90
91 %newobject xfer_source_recovery;
92 XferElement *xfer_source_recovery(Device *first_device);
93
94 void xfer_source_recovery_start_part(
95     XferElement *self,
96     Device *device);
97
98 void xfer_source_recovery_use_device(
99     XferElement *self,
100     Device *device);
101
102 guint64 xfer_source_recovery_get_bytes_read(
103     XferElement *self);
104
105
106 /* ---- */
107
108 PACKAGE(Amanda::Xfer::Source::Device)
109 XFER_ELEMENT_SUBCLASS()
110 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_source_device)
111
112 /* ---- */
113
114 PACKAGE(Amanda::Xfer::Dest::Device)
115 XFER_ELEMENT_SUBCLASS()
116 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_device)
117
118 /* ---- */
119
120 PACKAGE(Amanda::Xfer::Source::Holding)
121 XFER_ELEMENT_SUBCLASS()
122 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_source_holding)
123 DECLARE_METHOD(get_bytes_read, Amanda::XferServer::xfer_source_holding_get_bytes_read)
124
125 /* ---- */
126
127 PACKAGE(Amanda::Xfer::Dest::Taper)
128 XFER_ELEMENT_SUBCLASS()
129 DECLARE_METHOD(use_device, Amanda::XferServer::xfer_dest_taper_use_device)
130 DECLARE_METHOD(start_part, Amanda::XferServer::xfer_dest_taper_start_part)
131 DECLARE_METHOD(cache_inform, Amanda::XferServer::xfer_dest_taper_cache_inform)
132 DECLARE_METHOD(get_part_bytes_written, Amanda::XferServer::xfer_dest_taper_get_part_bytes_written)
133
134 /* ---- */
135
136 PACKAGE(Amanda::Xfer::Dest::Taper::Splitter)
137 XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
138 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_splitter)
139
140 /* ---- */
141
142 PACKAGE(Amanda::Xfer::Dest::Taper::Cacher)
143 XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
144 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_cacher)
145
146 /* ---- */
147
148 PACKAGE(Amanda::Xfer::Dest::Taper::DirectTCP)
149 XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
150 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_directtcp)
151
152 /* ---- */
153
154 PACKAGE(Amanda::Xfer::Source::Recovery)
155 XFER_ELEMENT_SUBCLASS()
156 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_source_recovery)
157 DECLARE_METHOD(start_part, Amanda::XferServer::xfer_source_recovery_start_part)
158 DECLARE_METHOD(use_device, Amanda::XferServer::xfer_source_recovery_use_device)
159 DECLARE_METHOD(get_bytes_read, Amanda::XferServer::xfer_source_recovery_get_bytes_read)
160