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