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