Imported Upstream version 3.2.0
[debian/amanda] / perl / Amanda / XferServer.swg
1 /*
2  * Copyright (c) 2009, 2010 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 %newobject xfer_dest_taper_splitter;
51 XferElement *xfer_dest_taper_splitter(
52     Device *first_device,
53     size_t max_memory,
54     guint64 part_size,
55     gboolean expect_cache_inform);
56
57 %newobject xfer_dest_taper_cacher;
58 XferElement *xfer_dest_taper_cacher(
59     Device *first_device,
60     size_t max_memory,
61     guint64 part_size,
62     gboolean use_mem_cache,
63     const char *disk_cache_dirname);
64
65 %newobject xfer_dest_taper_directtcp;
66 XferElement *xfer_dest_taper_directtcp(
67     Device *first_device,
68     guint64 part_size);
69
70 void xfer_dest_taper_start_part(
71     XferElement *self,
72     gboolean retry_part,
73     dumpfile_t *header);
74
75 void xfer_dest_taper_use_device(
76     XferElement *self,
77     Device *device);
78
79 void xfer_dest_taper_cache_inform(
80     XferElement *self,
81     const char *filename,
82     off_t offset,
83     off_t length);
84
85 guint64 xfer_dest_taper_get_part_bytes_written(
86     XferElement *self);
87
88 %newobject xfer_source_recovery;
89 XferElement *xfer_source_recovery(Device *first_device);
90
91 void xfer_source_recovery_start_part(
92     XferElement *self,
93     Device *device);
94
95 void xfer_source_recovery_use_device(
96     XferElement *self,
97     Device *device);
98
99 /* ---- */
100
101 PACKAGE(Amanda::Xfer::Source::Device)
102 XFER_ELEMENT_SUBCLASS()
103 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_source_device)
104
105 /* ---- */
106
107 PACKAGE(Amanda::Xfer::Dest::Device)
108 XFER_ELEMENT_SUBCLASS()
109 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_device)
110
111 /* ---- */
112
113 PACKAGE(Amanda::Xfer::Source::Holding)
114 XFER_ELEMENT_SUBCLASS()
115 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_source_holding)
116
117 /* ---- */
118
119 PACKAGE(Amanda::Xfer::Dest::Taper)
120 XFER_ELEMENT_SUBCLASS()
121 DECLARE_METHOD(use_device, Amanda::XferServer::xfer_dest_taper_use_device)
122 DECLARE_METHOD(start_part, Amanda::XferServer::xfer_dest_taper_start_part)
123 DECLARE_METHOD(cache_inform, Amanda::XferServer::xfer_dest_taper_cache_inform)
124 DECLARE_METHOD(get_part_bytes_written, Amanda::XferServer::xfer_dest_taper_get_part_bytes_written)
125
126 /* ---- */
127
128 PACKAGE(Amanda::Xfer::Dest::Taper::Splitter)
129 XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
130 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_splitter)
131
132 /* ---- */
133
134 PACKAGE(Amanda::Xfer::Dest::Taper::Cacher)
135 XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
136 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_cacher)
137
138 /* ---- */
139
140 PACKAGE(Amanda::Xfer::Dest::Taper::DirectTCP)
141 XFER_ELEMENT_SUBCLASS_OF(Amanda::Xfer::Dest::Taper)
142 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_dest_taper_directtcp)
143
144 /* ---- */
145
146 PACKAGE(Amanda::Xfer::Source::Recovery)
147 XFER_ELEMENT_SUBCLASS()
148 DECLARE_CONSTRUCTOR(Amanda::XferServer::xfer_source_recovery)
149 DECLARE_METHOD(start_part, Amanda::XferServer::xfer_source_recovery_start_part)
150 DECLARE_METHOD(use_device, Amanda::XferServer::xfer_source_recovery_use_device)