* interface file instead.
* ----------------------------------------------------------------------------- */
+#include "../config/config.h"
+
+
#define SWIGPERL
#define SWIG_CASTRANK_MODE
#define SWIGTYPE_p_Device swig_types[0]
#define SWIGTYPE_p_DevicePropertyBase swig_types[1]
-#define SWIGTYPE_p_GValue swig_types[2]
-#define SWIGTYPE_p_a_STRMAX__char swig_types[3]
-#define SWIGTYPE_p_char swig_types[4]
-#define SWIGTYPE_p_double swig_types[5]
-#define SWIGTYPE_p_dumpfile_t swig_types[6]
-#define SWIGTYPE_p_float swig_types[7]
-#define SWIGTYPE_p_guint swig_types[8]
-#define SWIGTYPE_p_guint64 swig_types[9]
-#define SWIGTYPE_p_int swig_types[10]
-#define SWIGTYPE_p_queue_fd_t swig_types[11]
-#define SWIGTYPE_p_unsigned_char swig_types[12]
-static swig_type_info *swig_types[14];
-static swig_module_info swig_module = {swig_types, 13, 0, 0, 0, 0};
+#define SWIGTYPE_p_DirectTCPAddr swig_types[2]
+#define SWIGTYPE_p_DirectTCPConnection swig_types[3]
+#define SWIGTYPE_p_GSList swig_types[4]
+#define SWIGTYPE_p_GValue swig_types[5]
+#define SWIGTYPE_p_a_STRMAX__char swig_types[6]
+#define SWIGTYPE_p_char swig_types[7]
+#define SWIGTYPE_p_double swig_types[8]
+#define SWIGTYPE_p_dumpfile_t swig_types[9]
+#define SWIGTYPE_p_float swig_types[10]
+#define SWIGTYPE_p_guint swig_types[11]
+#define SWIGTYPE_p_guint32 swig_types[12]
+#define SWIGTYPE_p_guint64 swig_types[13]
+#define SWIGTYPE_p_int swig_types[14]
+#define SWIGTYPE_p_p_DirectTCPAddr swig_types[15]
+#define SWIGTYPE_p_unsigned_char swig_types[16]
+static swig_type_info *swig_types[18];
+static swig_module_info swig_module = {swig_types, 17, 0, 0, 0, 0};
#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
#include "device.h"
#include "property.h"
#include "fileheader.h"
+#include "glib-util.h"
+#include "simpleprng.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
/* Utility functions for typemaps, below */
+/* return a new, mortal SV corresponding to the given GValue
+ *
+ * @param value: the value to convert
+ * @returns: a new, mortal SV
+ */
static SV *
set_sv_from_gvalue(GValue *value)
{
/* complex reference types */
switch (fundamental) {
case G_TYPE_LONG:
- sv = sv_2mortal(amglue_newSVi64(g_value_get_long(value)));
- break;
+ return sv_2mortal(amglue_newSVi64(g_value_get_long(value)));
case G_TYPE_ULONG:
- sv = sv_2mortal(amglue_newSVu64(g_value_get_ulong(value)));
- break;
+ return sv_2mortal(amglue_newSVu64(g_value_get_ulong(value)));
case G_TYPE_INT64:
- sv = sv_2mortal(amglue_newSVi64(g_value_get_int64(value)));
- break;
+ return sv_2mortal(amglue_newSVi64(g_value_get_int64(value)));
case G_TYPE_UINT64:
- sv = sv_2mortal(amglue_newSVu64(g_value_get_uint64(value)));
- break;
-
- case G_TYPE_BOXED: {
- GType boxed_type = G_VALUE_TYPE(value);
- QualifiedSize qs;
- HV *hv;
-
- if (boxed_type == QUALIFIED_SIZE_TYPE) {
- qs = *(QualifiedSize*)(g_value_get_boxed(value));
-
- /* build a hash */
- hv = (HV *)sv_2mortal((SV *)newHV());
- hv_store(hv, "accuracy", 8, newSViv(qs.accuracy), 0);
- hv_store(hv, "bytes", 5, amglue_newSVi64(qs.bytes), 0);
-
- sv = newRV((SV *)hv);
- return newRV((SV *)hv);
- } else {
- warn("Unsupported boxed property type #%d", (int)boxed_type);
-
- sv = sv_newmortal();
- sv_setsv(sv, &PL_sv_undef);
- return sv;
- }
- }
+ return sv_2mortal(amglue_newSVu64(g_value_get_uint64(value)));
}
/* simple types that can be constructed with sv_set*v */
return sv;
}
+/* Given an SV and an initialized GValue, set the GValue to the value
+ * represented by the SV. The GValue's type must already be set.
+ *
+ * For basic corresponding types (string -> string, integer -> integer),
+ * the translation is straightforward. However, if the GValue is not a
+ * string, but the SV has a string value, then g_value_set_from_string will
+ * be used to parse the string.
+ *
+ * @param sv: SV to convert
+ * @param value: (input/output) destination
+ * @returns: TRUE on success
+ */
static gboolean
set_gvalue_from_sv(SV *sv, GValue *value)
{
GType fundamental = G_TYPE_FUNDAMENTAL(G_VALUE_TYPE(value));
- switch (fundamental) {
- case G_TYPE_CHAR:
- if (!SvIOK(sv)) return FALSE;
- g_value_set_char(value, SvIV(sv));
- break;
- case G_TYPE_UCHAR:
- if (!SvIOK(sv)) return FALSE;
- g_value_set_uchar(value, SvUV(sv));
- break;
+ /* if we got a string, use g_value_set_from_string to parse any funny
+ * values or suffixes */
+ if (SvPOK(sv)) {
+ if (g_value_set_from_string(value, SvPV_nolen(sv)))
+ return TRUE;
+ }
+ /* otherwise, handle numeric types with SvIV, SvNV, or the amglue_* functions */
+ switch (fundamental) {
case G_TYPE_BOOLEAN:
- if (!SvIOK(sv)) return FALSE;
g_value_set_boolean(value, SvIV(sv));
- break;
+ return TRUE;
+
+ case G_TYPE_CHAR:
+ g_value_set_char(value, amglue_SvI8(sv));
+ return TRUE;
+
+ case G_TYPE_UCHAR:
+ g_value_set_uchar(value, amglue_SvU8(sv));
+ return TRUE;
case G_TYPE_INT:
g_value_set_int(value, amglue_SvI32(sv));
- break;
+ return TRUE;
case G_TYPE_UINT:
g_value_set_uint(value, amglue_SvU32(sv));
- break;
+ return TRUE;
case G_TYPE_LONG:
g_value_set_int64(value, amglue_SvI64(sv));
- break;
+ return TRUE;
case G_TYPE_ULONG:
g_value_set_uint64(value, amglue_SvU64(sv));
- break;
+ return TRUE;
case G_TYPE_INT64:
g_value_set_int64(value, amglue_SvI64(sv));
- break;
+ return TRUE;
case G_TYPE_UINT64:
g_value_set_uint64(value, amglue_SvU64(sv));
- break;
+ return TRUE;
case G_TYPE_FLOAT:
- if (!SvNOK(sv)) return FALSE;
g_value_set_float(value, SvNV(sv));
- break;
+ return TRUE;
case G_TYPE_DOUBLE:
- if (!SvNOK(sv)) return FALSE;
g_value_set_double(value, SvNV(sv));
- break;
-
- case G_TYPE_STRING:
- if (!SvPOK(sv)) return FALSE;
- g_value_set_string(value, SvPV_nolen(sv));
- break;
+ return TRUE;
- case G_TYPE_ENUM:
- if (!SvIOK(sv)) return FALSE;
+ case G_TYPE_ENUM:
g_value_set_enum(value, SvIV(sv));
- break;
+ return TRUE;
case G_TYPE_FLAGS:
- if (!SvIOK(sv)) return FALSE;
g_value_set_flags(value, SvIV(sv));
- break;
+ return TRUE;
- /* Unsupported */
default:
- case G_TYPE_POINTER:
- case G_TYPE_INTERFACE:
- case G_TYPE_BOXED: /* note: *getting* boxed values is supported */
- case G_TYPE_OBJECT:
- case G_TYPE_PARAM:
- return FALSE;
+ /* for anything else, let perl stringify it for us and try parsing it */
+ return g_value_set_from_string(value, SvPV_nolen(sv));
}
-
- return TRUE;
}
+SWIGINTERN void delete_DirectTCPConnection(DirectTCPConnection *self){
+ g_object_unref(self);
+ }
+SWIGINTERN char *DirectTCPConnection_close(DirectTCPConnection *self){
+ return directtcp_connection_close(self);
+ }
SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size)
}
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+ static int init = 0;
+ static swig_type_info* info = 0;
+ if (!init) {
+ info = SWIG_TypeQuery("_p_char");
+ init = 1;
+ }
+ return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
+{
+ if (SvMAGICAL(obj)) {
+ SV *tmp = sv_newmortal();
+ SvSetSV(tmp, obj);
+ obj = tmp;
+ }
+ if (SvPOK(obj)) {
+ STRLEN len = 0;
+ char *cstr = SvPV(obj, len);
+ size_t size = len + 1;
+ if (cptr) {
+ if (alloc) {
+ if (*alloc == SWIG_NEWOBJ) {
+ *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+ } else {
+ *cptr = cstr;
+ *alloc = SWIG_OLDOBJ;
+ }
+ }
+ }
+ if (psize) *psize = size;
+ return SWIG_OK;
+ } else {
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+ if (pchar_descriptor) {
+ char* vptr = 0;
+ if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
+ if (cptr) *cptr = vptr;
+ if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
+ if (alloc) *alloc = SWIG_OLDOBJ;
+ return SWIG_OK;
+ }
+ }
+ }
+ return SWIG_TypeError;
+}
+
+
+
+
+SWIGINTERN Device *new_Device(char *device_name){
+ return device_open(device_name);
+ }
+SWIGINTERN void delete_Device(Device *self){
+ g_object_unref(self);
+ }
+
#include <limits.h>
#if !defined(SWIG_NO_LLONG_MAX)
# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
return res;
}
-SWIGINTERN queue_fd_t *new_queue_fd_t(int fd){
- return queue_fd_new(fd, NULL);
- }
-SWIGINTERN void delete_queue_fd_t(queue_fd_t *self){
- amfree(self->errmsg);
- g_free(self);
- }
-
-SWIGINTERN swig_type_info*
-SWIG_pchar_descriptor(void)
-{
- static int init = 0;
- static swig_type_info* info = 0;
- if (!init) {
- info = SWIG_TypeQuery("_p_char");
- init = 1;
- }
- return info;
-}
-
-
-SWIGINTERN int
-SWIG_AsCharPtrAndSize(SV *obj, char** cptr, size_t* psize, int *alloc)
-{
- if (SvMAGICAL(obj)) {
- SV *tmp = sv_newmortal();
- SvSetSV(tmp, obj);
- obj = tmp;
- }
- if (SvPOK(obj)) {
- STRLEN len = 0;
- char *cstr = SvPV(obj, len);
- size_t size = len + 1;
- if (cptr) {
- if (alloc) {
- if (*alloc == SWIG_NEWOBJ) {
- *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
- } else {
- *cptr = cstr;
- *alloc = SWIG_OLDOBJ;
- }
- }
- }
- if (psize) *psize = size;
- return SWIG_OK;
- } else {
- swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
- if (pchar_descriptor) {
- char* vptr = 0;
- if (SWIG_ConvertPtr(obj, (void**)&vptr, pchar_descriptor, 0) == SWIG_OK) {
- if (cptr) *cptr = vptr;
- if (psize) *psize = vptr ? (strlen(vptr) + 1) : 0;
- if (alloc) *alloc = SWIG_OLDOBJ;
- return SWIG_OK;
- }
- }
- }
- return SWIG_TypeError;
-}
-
-
-
-
-SWIGINTERN Device *new_Device(char *device_name){
- return device_open(device_name);
- }
-SWIGINTERN void delete_Device(Device *self){
- g_object_unref(self);
- }
SWIGINTERN gboolean Device_configure(Device *self,gboolean use_global_config){
return device_configure(self, use_global_config);
}
SWIGINTERN gboolean Device_write_block(Device *self,guint size,gpointer data){
return device_write_block(self, size, data);
}
-SWIGINTERN gboolean Device_write_from_fd(Device *self,queue_fd_t *queue_fd){
- return device_write_from_fd(self, queue_fd);
- }
SWIGINTERN gboolean Device_finish_file(Device *self){
return device_finish_file(self);
}
SWIGINTERN int Device_read_block(Device *self,gpointer buffer,int *size){
return device_read_block(self, buffer, size);
}
-SWIGINTERN gboolean Device_read_to_fd(Device *self,queue_fd_t *queue_fd){
- return device_read_to_fd(self, queue_fd);
+SWIGINTERN gboolean Device_erase(Device *self){
+ return device_erase(self);
+ }
+SWIGINTERN gboolean Device_eject(Device *self){
+ return device_eject(self);
+ }
+SWIGINTERN gboolean Device_directtcp_supported(Device *self){
+ return device_directtcp_supported(self);
+ }
+SWIGINTERN void Device_listen(Device *self,gboolean for_writing,DirectTCPAddr **addrs){
+ /* ensure that the addresses are empty if there was an error */
+ if (!device_listen(self, for_writing, addrs))
+ *addrs = NULL;
+ }
+SWIGINTERN DirectTCPConnection *Device_accept(Device *self){
+ DirectTCPConnection *conn = NULL;
+ gboolean rv;
+
+ rv = device_accept(self, &conn, NULL, NULL);
+ if (!rv && conn) {
+ /* conn is ref'd for our convenience, but we don't want it */
+ g_object_unref(conn);
+ conn = NULL;
+ }
+ return conn;
+ }
+SWIGINTERN DirectTCPConnection *Device_connect(Device *self,gboolean for_writing,DirectTCPAddr *addrs){
+ DirectTCPConnection *conn = NULL;
+ gboolean rv;
+
+ rv = device_connect(self, for_writing, addrs, &conn, NULL, NULL);
+ if (!rv && conn) {
+ /* conn is ref'd for our convenience, but we don't want it */
+ g_object_unref(conn);
+ conn = NULL;
+ }
+ return conn;
+ }
+SWIGINTERN gboolean Device_use_connection(Device *self,DirectTCPConnection *conn){
+ return device_use_connection(self, conn);
+ }
+SWIGINTERN gboolean Device_write_from_connection(Device *self,guint64 size,guint64 *actual_size){
+ return device_write_from_connection(self, size, actual_size);
+ }
+SWIGINTERN gboolean Device_read_to_connection(Device *self,guint64 size,guint64 *actual_size){
+ return device_read_to_connection(self, size, actual_size);
}
SWIGINTERN GSList const *Device_property_list(Device *self){
return device_property_get_list(self);
}
SWIGINTERN void Device_property_get(Device *self,DevicePropertyBase *pbase,GValue *out_val,PropertySurety *surety,PropertySource *source,gboolean *val_found){
- *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source);
+ if (pbase) {
+ *val_found = device_property_get_ex(self, pbase->ID, out_val, surety, source);
+ } else {
+ *val_found = FALSE;
+ }
}
SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,SV *sv){
GValue gval;
+
+ if (!pbase)
+ goto fail;
memset(&gval, 0, sizeof(gval));
g_value_init(&gval, pbase->type);
if (!set_gvalue_from_sv(sv, &gval))
SWIGINTERN char *Device_device_name(Device *self){ return self->device_name; }
SWIGINTERN DeviceAccessMode Device_access_mode(Device *self){ return self->access_mode; }
SWIGINTERN gboolean Device_is_eof(Device *self){ return self->is_eof; }
+SWIGINTERN gboolean Device_is_eom(Device *self){ return self->is_eom; }
SWIGINTERN char *Device_volume_label(Device *self){ return self->volume_label; }
SWIGINTERN char *Device_volume_time(Device *self){ return self->volume_time; }
SWIGINTERN DeviceStatusFlags Device_status(Device *self){ return self->status; }
SWIGINTERN gsize Device_block_size(Device *self){ return self->block_size; }
SWIGINTERN dumpfile_t *Device_volume_header(Device *self){ return self->volume_header; }
-SWIGINTERNINLINE SV *
-SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value)
-{
- SV *obj = sv_newmortal();
- sv_setiv(obj, (IV) value);
- return obj;
-}
+/* write LENGTH bytes of random data to FILENAME, seeded with SEED */
+gboolean
+write_random_to_device(guint32 seed, size_t length, Device *device) {
+ simpleprng_state_t prng;
+ char *buf;
+ gsize block_size = device->block_size;
+ g_assert(block_size < G_MAXUINT);
-SWIGINTERNINLINE SV *
-SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value)
-{
- return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value);
-}
+ buf = g_malloc(block_size);
+ simpleprng_seed(&prng, seed);
-#ifdef __cplusplus
-extern "C" {
-#endif
+ while (length) {
+ size_t to_write = min(block_size, length);
-#ifdef PERL_OBJECT
-#define MAGIC_CLASS _wrap_Amanda__Device_var::
-class _wrap_Amanda__Device_var : public CPerlObj {
-public:
-#else
-#define MAGIC_CLASS
-#endif
-SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
- MAGIC_PPERL
- croak("Value is read-only.");
- return 0;
+ simpleprng_fill_buffer(&prng, buf, to_write);
+ if (!device_write_block(device, (guint)block_size, buf)) {
+ g_free(buf);
+ return FALSE;
+ }
+ length -= to_write;
+ }
+
+ g_free(buf);
+ return TRUE;
}
+/* read LENGTH bytes of random data from FILENAME verifying it against
+ * a PRNG seeded with SEED. Sends any error messages to stderr.
+ */
+gboolean
+verify_random_from_device(guint32 seed, size_t length, Device *device) {
+ simpleprng_state_t prng;
+ char *buf = NULL; /* first device_read_block will get the size */
+ int block_size = 0;
+
+ simpleprng_seed(&prng, seed);
+
+ while (length) {
+ int bytes_read;
+ int size = block_size;
+
+ bytes_read = device_read_block(device, buf, &size);
+ if (bytes_read == 0 && size > block_size) {
+ g_free(buf);
+ block_size = size;
+ buf = g_malloc(block_size);
+ continue;
+ }
+ if (bytes_read == -1) {
+ if (device->status == DEVICE_STATUS_SUCCESS) {
+ g_assert(device->is_eof);
+ g_debug("verify_random_from_device got unexpected EOF");
+ }
+ goto error;
+ }
+
+ /* strip padding */
+ bytes_read = min(bytes_read, length);
-#ifdef PERL_OBJECT
-};
-#endif
+ if (!simpleprng_verify_buffer(&prng, buf, bytes_read))
+ goto error;
-#ifdef __cplusplus
+ length -= bytes_read;
+ }
+
+ g_free(buf);
+ return TRUE;
+
+error:
+ g_free(buf);
+ return FALSE;
}
-#endif
-#ifdef __cplusplus
-extern "C" {
-#endif
-XS(_wrap_queue_fd_t_fd_get) {
- {
- queue_fd_t *arg1 = (queue_fd_t *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long SWIG_PERL_DECL_ARGS_2(SV *obj, unsigned long *val)
+{
+ if (SvUOK(obj)) {
+ if (val) *val = SvUV(obj);
+ return SWIG_OK;
+ } else if (SvIOK(obj)) {
+ long v = SvIV(obj);
+ if (v >= 0) {
+ if (val) *val = v;
+ return SWIG_OK;
+ } else {
+ return SWIG_OverflowError;
+ }
+ } else {
+ int dispatch = 0;
+ const char *nptr = SvPV_nolen(obj);
+ if (nptr) {
+ char *endptr;
+ unsigned long v;
+ errno = 0;
+ v = strtoul(nptr, &endptr,0);
+ if (errno == ERANGE) {
+ errno = 0;
+ return SWIG_OverflowError;
+ } else {
+ if (*endptr == '\0') {
+ if (val) *val = v;
+ return SWIG_Str2NumCast(SWIG_OK);
+ }
+ }
+ }
+ if (!dispatch) {
+ double d;
+ int res = SWIG_AddCast(SWIG_AsVal_double SWIG_PERL_CALL_ARGS_2(obj,&d));
+ if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+ if (val) *val = (unsigned long)(d);
+ return res;
+ }
+ }
+ }
+ return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t SWIG_PERL_DECL_ARGS_2(SV * obj, size_t *val)
+{
+ unsigned long v;
+ int res = SWIG_AsVal_unsigned_SS_long SWIG_PERL_CALL_ARGS_2(obj, val ? &v : 0);
+ if (SWIG_IsOK(res) && val) *val = (size_t)(v);
+ return res;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_long SWIG_PERL_DECL_ARGS_1(long value)
+{
+ SV *obj = sv_newmortal();
+ sv_setiv(obj, (IV) value);
+ return obj;
+}
+
+
+SWIGINTERNINLINE SV *
+SWIG_From_int SWIG_PERL_DECL_ARGS_1(int value)
+{
+ return SWIG_From_long SWIG_PERL_CALL_ARGS_1(value);
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef PERL_OBJECT
+#define MAGIC_CLASS _wrap_Amanda__Device_var::
+class _wrap_Amanda__Device_var : public CPerlObj {
+public:
+#else
+#define MAGIC_CLASS
+#endif
+SWIGCLASS_STATIC int swig_magic_readonly(pTHX_ SV *SWIGUNUSEDPARM(sv), MAGIC *SWIGUNUSEDPARM(mg)) {
+ MAGIC_PPERL
+ croak("Value is read-only.");
+ return 0;
+}
+
+
+#ifdef PERL_OBJECT
+};
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+XS(_wrap_delete_DirectTCPConnection) {
+ {
+ DirectTCPConnection *arg1 = (DirectTCPConnection *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
int argvi = 0;
- int result;
dXSARGS;
if ((items < 1) || (items > 1)) {
- SWIG_croak("Usage: queue_fd_t_fd_get(self);");
+ SWIG_croak("Usage: delete_DirectTCPConnection(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_DirectTCPConnection, SWIG_POINTER_DISOWN | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "queue_fd_t_fd_get" "', argument " "1"" of type '" "queue_fd_t *""'");
- }
- arg1 = (queue_fd_t *)(argp1);
- result = (int) ((arg1)->fd);
- {
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
- argvi++;
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DirectTCPConnection" "', argument " "1"" of type '" "DirectTCPConnection *""'");
}
+ arg1 = (DirectTCPConnection *)(argp1);
+ delete_DirectTCPConnection(arg1);
+ ST(argvi) = sv_newmortal();
XSRETURN(argvi);
fail:
}
-XS(_wrap_queue_fd_t_errmsg_get) {
+XS(_wrap_DirectTCPConnection_close) {
{
- queue_fd_t *arg1 = (queue_fd_t *) 0 ;
+ DirectTCPConnection *arg1 = (DirectTCPConnection *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
dXSARGS;
if ((items < 1) || (items > 1)) {
- SWIG_croak("Usage: queue_fd_t_errmsg_get(self);");
+ SWIG_croak("Usage: DirectTCPConnection_close(self);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, 0 | 0 );
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_DirectTCPConnection, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "queue_fd_t_errmsg_get" "', argument " "1"" of type '" "queue_fd_t *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DirectTCPConnection_close" "', argument " "1"" of type '" "DirectTCPConnection *""'");
}
- arg1 = (queue_fd_t *)(argp1);
- result = (char *) ((arg1)->errmsg);
+ arg1 = (DirectTCPConnection *)(argp1);
+ result = (char *)DirectTCPConnection_close(arg1);
ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+ free((char*)result);
XSRETURN(argvi);
fail:
}
-XS(_wrap_new_queue_fd_t) {
+XS(_wrap_new_DirectTCPConnection) {
{
- int arg1 ;
int argvi = 0;
- queue_fd_t *result = 0 ;
+ DirectTCPConnection *result = 0 ;
dXSARGS;
- if ((items < 1) || (items > 1)) {
- SWIG_croak("Usage: new_queue_fd_t(fd);");
+ if ((items < 0) || (items > 0)) {
+ SWIG_croak("Usage: new_DirectTCPConnection();");
}
- {
- if (sizeof(signed int) == 1) {
- arg1 = amglue_SvI8(ST(0));
- } else if (sizeof(signed int) == 2) {
- arg1 = amglue_SvI16(ST(0));
- } else if (sizeof(signed int) == 4) {
- arg1 = amglue_SvI32(ST(0));
- } else if (sizeof(signed int) == 8) {
- arg1 = amglue_SvI64(ST(0));
- } else {
- g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
- }
- }
- result = (queue_fd_t *)new_queue_fd_t(arg1);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_queue_fd_t, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
-
+ result = (DirectTCPConnection *)calloc(1, sizeof(DirectTCPConnection));
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
-
SWIG_croak_null();
}
}
-XS(_wrap_delete_queue_fd_t) {
+XS(_wrap_unaliased_name) {
{
- queue_fd_t *arg1 = (queue_fd_t *) 0 ;
- void *argp1 = 0 ;
- int res1 = 0 ;
+ char *arg1 = (char *) 0 ;
+ int res1 ;
+ char *buf1 = 0 ;
+ int alloc1 = 0 ;
int argvi = 0;
+ char *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
- SWIG_croak("Usage: delete_queue_fd_t(self);");
+ SWIG_croak("Usage: unaliased_name(char *);");
}
- res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_queue_fd_t, SWIG_POINTER_DISOWN | 0 );
+ res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_queue_fd_t" "', argument " "1"" of type '" "queue_fd_t *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "unaliased_name" "', argument " "1"" of type '" "char *""'");
}
- arg1 = (queue_fd_t *)(argp1);
- delete_queue_fd_t(arg1);
- ST(argvi) = sv_newmortal();
-
+ arg1 = (char *)(buf1);
+ result = (char *)device_unaliased_name(arg1);
+ ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
XSRETURN(argvi);
fail:
-
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
SWIG_croak_null();
}
}
}
arg1 = (Device *)(argp1);
{
- if (sizeof(signed int) == 1) {
- arg2 = amglue_SvI8(ST(1));
- } else if (sizeof(signed int) == 2) {
- arg2 = amglue_SvI16(ST(1));
- } else if (sizeof(signed int) == 4) {
- arg2 = amglue_SvI32(ST(1));
- } else if (sizeof(signed int) == 8) {
- arg2 = amglue_SvI64(ST(1));
- } else {
- g_critical("Unexpected signed int >64 bits?"); /* should be optimized out unless sizeof(signed int) > 8 */
- }
+ arg2 = SvTRUE(ST(1));
}
result = (gboolean)Device_configure(arg1,arg2);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
arg1 = (Device *)(argp1);
result = (DeviceStatusFlags)Device_read_label(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVi64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
arg4 = (char *)(buf4);
result = (gboolean)Device_start(arg1,arg2,arg3,arg4);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
arg1 = (Device *)(argp1);
result = (gboolean)Device_finish(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
arg2 = (dumpfile_t *)(argp2);
result = (gboolean)Device_start_file(arg1,arg2);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
if (!SWIG_IsOK(res3)) {
SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_write_block" "', argument " "3"" of type '" "gpointer""'");
}
- result = (gboolean)Device_write_block(arg1,arg2,arg3);
+ result = (gboolean)Device_write_block(arg1,arg2,arg3);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_finish_file) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: Device_finish_file(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish_file" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ result = (gboolean)Device_finish_file(arg1);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_seek_file) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ guint arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ dumpfile_t *result = 0 ;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: Device_seek_file(self,file);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_file" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ {
+ if (sizeof(guint) == 1) {
+ arg2 = amglue_SvU8(ST(1));
+ } else if (sizeof(guint) == 2) {
+ arg2 = amglue_SvU16(ST(1));
+ } else if (sizeof(guint) == 4) {
+ arg2 = amglue_SvU32(ST(1));
+ } else if (sizeof(guint) == 8) {
+ arg2 = amglue_SvU64(ST(1));
+ } else {
+ croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
+ }
+ }
+ result = (dumpfile_t *)Device_seek_file(arg1,arg2);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ;
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_seek_block) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ guint64 arg2 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: Device_seek_block(self,block);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_block" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ {
+ arg2 = amglue_SvU64(ST(1));
+ }
+ result = (gboolean)Device_seek_block(arg1,arg2);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_read_block) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ gpointer arg2 = (gpointer) 0 ;
+ int *arg3 = (int *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int res2 ;
+ void *argp3 = 0 ;
+ int res3 = 0 ;
+ int argvi = 0;
+ int result;
+ dXSARGS;
+
+ if ((items < 3) || (items > 3)) {
+ SWIG_croak("Usage: Device_read_block(self,buffer,size);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_block" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0);
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_block" "', argument " "2"" of type '" "gpointer""'");
+ }
+ res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_int, 0 | 0 );
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_read_block" "', argument " "3"" of type '" "int *""'");
+ }
+ arg3 = (int *)(argp3);
+ result = (int)Device_read_block(arg1,arg2,arg3);
+ {
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVi64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
+ argvi++;
+ }
+
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_erase) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: Device_erase(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_erase" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ result = (gboolean)Device_erase(arg1);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_eject) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: Device_eject(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_eject" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ result = (gboolean)Device_eject(arg1);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_directtcp_supported) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: Device_directtcp_supported(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_directtcp_supported" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ result = (gboolean)Device_directtcp_supported(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
-
XSRETURN(argvi);
fail:
-
SWIG_croak_null();
}
}
-XS(_wrap_Device_write_from_fd) {
+XS(_wrap_Device_listen) {
{
Device *arg1 = (Device *) 0 ;
- queue_fd_t *arg2 = (queue_fd_t *) 0 ;
+ gboolean arg2 ;
+ DirectTCPAddr **arg3 = (DirectTCPAddr **) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
- void *argp2 = 0 ;
- int res2 = 0 ;
+ DirectTCPAddr *addrs3 ;
int argvi = 0;
- gboolean result;
dXSARGS;
+ {
+ addrs3 = NULL;
+ arg3 = &addrs3;
+ }
if ((items < 2) || (items > 2)) {
- SWIG_croak("Usage: Device_write_from_fd(self,queue_fd);");
+ SWIG_croak("Usage: Device_listen(self,for_writing);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_from_fd" "', argument " "1"" of type '" "Device *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_listen" "', argument " "1"" of type '" "Device *""'");
}
arg1 = (Device *)(argp1);
- res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_queue_fd_t, 0 | 0 );
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_write_from_fd" "', argument " "2"" of type '" "queue_fd_t *""'");
+ {
+ arg2 = SvTRUE(ST(1));
}
- arg2 = (queue_fd_t *)(argp2);
- result = (gboolean)Device_write_from_fd(arg1,arg2);
+ Device_listen(arg1,arg2,arg3);
+ ST(argvi) = sv_newmortal();
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
- argvi++;
+ if (arg3 && *arg3) {
+ DirectTCPAddr *iter = *arg3;
+ AV *av = newAV();
+ int i = 0;
+
+ while (iter && SU_GET_FAMILY(iter) != 0) {
+ char *addr = str_sockaddr_no_port(iter);
+ AV *tuple = newAV();
+
+ g_assert(NULL != av_store(tuple, 0, newSVpv(addr, 0)));
+ g_assert(NULL != av_store(tuple, 1, newSViv(SU_GET_PORT(iter))));
+ g_assert(NULL != av_store(av, i++, newRV_noinc((SV *)tuple)));
+ iter++;
+ }
+
+ ST(argvi) = newRV_noinc((SV *)av);
+ argvi++;
+ }
}
+
XSRETURN(argvi);
fail:
+
SWIG_croak_null();
}
}
-XS(_wrap_Device_finish_file) {
+XS(_wrap_Device_accept) {
{
Device *arg1 = (Device *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
- gboolean result;
+ DirectTCPConnection *result = 0 ;
dXSARGS;
if ((items < 1) || (items > 1)) {
- SWIG_croak("Usage: Device_finish_file(self);");
+ SWIG_croak("Usage: Device_accept(self);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_finish_file" "', argument " "1"" of type '" "Device *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_accept" "', argument " "1"" of type '" "Device *""'");
}
arg1 = (Device *)(argp1);
- result = (gboolean)Device_finish_file(arg1);
- {
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
- argvi++;
- }
+ result = (DirectTCPConnection *)Device_accept(arg1);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
XSRETURN(argvi);
fail:
}
-XS(_wrap_Device_seek_file) {
+XS(_wrap_Device_connect) {
{
Device *arg1 = (Device *) 0 ;
- guint arg2 ;
+ gboolean arg2 ;
+ DirectTCPAddr *arg3 = (DirectTCPAddr *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
int argvi = 0;
- dumpfile_t *result = 0 ;
+ DirectTCPConnection *result = 0 ;
dXSARGS;
- if ((items < 2) || (items > 2)) {
- SWIG_croak("Usage: Device_seek_file(self,file);");
+ if ((items < 3) || (items > 3)) {
+ SWIG_croak("Usage: Device_connect(self,for_writing,addrs);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_file" "', argument " "1"" of type '" "Device *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_connect" "', argument " "1"" of type '" "Device *""'");
}
arg1 = (Device *)(argp1);
{
- if (sizeof(guint) == 1) {
- arg2 = amglue_SvU8(ST(1));
- } else if (sizeof(guint) == 2) {
- arg2 = amglue_SvU16(ST(1));
- } else if (sizeof(guint) == 4) {
- arg2 = amglue_SvU32(ST(1));
- } else if (sizeof(guint) == 8) {
- arg2 = amglue_SvU64(ST(1));
- } else {
- croak("Unexpected guint >64 bits?"); /* should be optimized out unless sizeof(guint) > 8 */
+ arg2 = SvTRUE(ST(1));
+ }
+ {
+ AV *addrs_av;
+ int num_addrs, i;
+
+ if (!SvROK(ST(2)) || SvTYPE(SvRV(ST(2))) != SVt_PVAV) {
+ SWIG_exception_fail(SWIG_TypeError, "must provide an arrayref of DirectTCPAddrs");
+ }
+ addrs_av = (AV *)SvRV(ST(2));
+ num_addrs = av_len(addrs_av)+1;
+
+ arg3 = g_new0(DirectTCPAddr, num_addrs+1);
+
+ for (i = 0; i < num_addrs; i++) {
+ SV **svp = av_fetch(addrs_av, i, 0);
+ AV *addr_av;
+ sockaddr_union addr;
+ IV port;
+
+ if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
+ || av_len((AV *)SvRV(*svp))+1 != 2) {
+ SWIG_exception_fail(SWIG_TypeError, "each DirectTCPAddr must be a 2-element arrayref");
+ }
+
+ addr_av = (AV *)SvRV(*svp);
+
+ /* get address */
+ svp = av_fetch(addr_av, 0, 0);
+ if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
+ SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
+ }
+
+ /* get port */
+ svp = av_fetch(addr_av, 1, 0);
+ if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
+ SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
+ }
+ SU_SET_PORT(&addr, port);
+
+ copy_sockaddr(arg3, &addr);
}
}
- result = (dumpfile_t *)Device_seek_file(arg1,arg2);
- ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dumpfile_t, 0 | SWIG_SHADOW); argvi++ ;
+ result = (DirectTCPConnection *)Device_connect(arg1,arg2,arg3);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DirectTCPConnection, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+
+
XSRETURN(argvi);
fail:
+
+
SWIG_croak_null();
}
}
-XS(_wrap_Device_seek_block) {
+XS(_wrap_Device_use_connection) {
{
Device *arg1 = (Device *) 0 ;
- guint64 arg2 ;
+ DirectTCPConnection *arg2 = (DirectTCPConnection *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
+ void *argp2 = 0 ;
+ int res2 = 0 ;
int argvi = 0;
gboolean result;
dXSARGS;
if ((items < 2) || (items > 2)) {
- SWIG_croak("Usage: Device_seek_block(self,block);");
+ SWIG_croak("Usage: Device_use_connection(self,conn);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_seek_block" "', argument " "1"" of type '" "Device *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_use_connection" "', argument " "1"" of type '" "Device *""'");
}
arg1 = (Device *)(argp1);
- {
- arg2 = amglue_SvU64(ST(1));
+ res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_DirectTCPConnection, 0 | 0 );
+ if (!SWIG_IsOK(res2)) {
+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_use_connection" "', argument " "2"" of type '" "DirectTCPConnection *""'");
}
- result = (gboolean)Device_seek_block(arg1,arg2);
+ arg2 = (DirectTCPConnection *)(argp2);
+ result = (gboolean)Device_use_connection(arg1,arg2);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
+
XSRETURN(argvi);
fail:
+
SWIG_croak_null();
}
}
-XS(_wrap_Device_read_block) {
+XS(_wrap_Device_write_from_connection) {
{
Device *arg1 = (Device *) 0 ;
- gpointer arg2 = (gpointer) 0 ;
- int *arg3 = (int *) 0 ;
+ guint64 arg2 ;
+ guint64 *arg3 = (guint64 *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
- int res2 ;
- void *argp3 = 0 ;
- int res3 = 0 ;
+ guint64 sz3 ;
int argvi = 0;
- int result;
+ gboolean result;
dXSARGS;
- if ((items < 3) || (items > 3)) {
- SWIG_croak("Usage: Device_read_block(self,buffer,size);");
+ {
+ sz3 = 0;
+ arg3 = &sz3;
+ }
+ if ((items < 2) || (items > 2)) {
+ SWIG_croak("Usage: Device_write_from_connection(self,size);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_block" "', argument " "1"" of type '" "Device *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_write_from_connection" "', argument " "1"" of type '" "Device *""'");
}
arg1 = (Device *)(argp1);
- res2 = SWIG_ConvertPtr(ST(1),SWIG_as_voidptrptr(&arg2), 0, 0);
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_block" "', argument " "2"" of type '" "gpointer""'");
- }
- res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_int, 0 | 0 );
- if (!SWIG_IsOK(res3)) {
- SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Device_read_block" "', argument " "3"" of type '" "int *""'");
+ {
+ arg2 = amglue_SvU64(ST(1));
}
- arg3 = (int *)(argp3);
- result = (int)Device_read_block(arg1,arg2,arg3);
+ result = (gboolean)Device_write_from_connection(arg1,arg2,arg3);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
-
+ {
+ SP += argvi; PUTBACK;
+ ST(argvi) = sv_2mortal(amglue_newSVu64(*arg3));
+ SPAGAIN; SP -= argvi; argvi++;
+ }
XSRETURN(argvi);
fail:
-
SWIG_croak_null();
}
}
-XS(_wrap_Device_read_to_fd) {
+XS(_wrap_Device_read_to_connection) {
{
Device *arg1 = (Device *) 0 ;
- queue_fd_t *arg2 = (queue_fd_t *) 0 ;
+ guint64 arg2 ;
+ guint64 *arg3 = (guint64 *) 0 ;
void *argp1 = 0 ;
int res1 = 0 ;
- void *argp2 = 0 ;
- int res2 = 0 ;
+ guint64 sz3 ;
int argvi = 0;
gboolean result;
dXSARGS;
+ {
+ sz3 = 0;
+ arg3 = &sz3;
+ }
if ((items < 2) || (items > 2)) {
- SWIG_croak("Usage: Device_read_to_fd(self,queue_fd);");
+ SWIG_croak("Usage: Device_read_to_connection(self,size);");
}
res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
if (!SWIG_IsOK(res1)) {
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_to_fd" "', argument " "1"" of type '" "Device *""'");
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_read_to_connection" "', argument " "1"" of type '" "Device *""'");
}
arg1 = (Device *)(argp1);
- res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_queue_fd_t, 0 | 0 );
- if (!SWIG_IsOK(res2)) {
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Device_read_to_fd" "', argument " "2"" of type '" "queue_fd_t *""'");
+ {
+ arg2 = amglue_SvU64(ST(1));
}
- arg2 = (queue_fd_t *)(argp2);
- result = (gboolean)Device_read_to_fd(arg1,arg2);
+ result = (gboolean)Device_read_to_connection(arg1,arg2,arg3);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
+ {
+ SP += argvi; PUTBACK;
+ ST(argvi) = sv_2mortal(amglue_newSVu64(*arg3));
+ SPAGAIN; SP -= argvi; argvi++;
+ }
XSRETURN(argvi);
if (SvPOK(ST(1)))
pname = SvPV_nolen(ST(1));
- if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
- if (!pname || !arg2) {
- SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
- }
+ if (pname)
+ arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+ else
+ arg2 = NULL;
}
Device_property_get(arg1,arg2,arg3,arg4,arg5,arg6);
ST(argvi) = sv_newmortal();
{
/* if the result is valid */
if (*arg6) {
- /* move data from arg3 to ST(argvi), somehow */
+ /* move data from arg3 to ST(argvi), somehow, being careful to
+ * save the perl stack while doing so */
+ SP += argvi; PUTBACK;
ST(argvi) = set_sv_from_gvalue(arg3);
- argvi++;
+ SPAGAIN; SP -= argvi; argvi++;
/* free any memory for the GValue */
g_value_unset(arg3);
if (SvPOK(ST(1)))
pname = SvPV_nolen(ST(1));
- if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
- if (!pname || !arg2) {
- SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
- }
+ if (pname)
+ arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+ else
+ arg2 = NULL;
}
arg3 = ST(2);
result = (gboolean)Device_property_set(arg1,arg2,arg3);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
if (SvPOK(ST(1)))
pname = SvPV_nolen(ST(1));
- if (pname) arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
- if (!pname || !arg2) {
- SWIG_exception_fail(SWIG_ValueError, "Invalid property name");
- }
+ if (pname)
+ arg2 = (DevicePropertyBase *)device_property_get_by_name(pname);
+ else
+ arg2 = NULL;
}
arg3 = ST(2);
{
}
result = (gboolean)Device_property_set_ex(arg1,arg2,arg3,arg4,arg5);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
}
result = (gboolean)Device_recycle_file(arg1,arg2);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
arg1 = (Device *)(argp1);
result = (int)Device_file(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVi64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
arg1 = (Device *)(argp1);
result = Device_block(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVu64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
arg1 = (Device *)(argp1);
result = (gboolean)Device_in_file(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
arg1 = (Device *)(argp1);
result = (DeviceAccessMode)Device_access_mode(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVi64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
arg1 = (Device *)(argp1);
result = (gboolean)Device_is_eof(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+ XSRETURN(argvi);
+ fail:
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_Device_is_eom) {
+ {
+ Device *arg1 = (Device *) 0 ;
+ void *argp1 = 0 ;
+ int res1 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: Device_is_eom(self);");
+ }
+ res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res1)) {
+ SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Device_is_eom" "', argument " "1"" of type '" "Device *""'");
+ }
+ arg1 = (Device *)(argp1);
+ result = (gboolean)Device_is_eom(arg1);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
arg1 = (Device *)(argp1);
result = (DeviceStatusFlags)Device_status(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVi64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
arg1 = (Device *)(argp1);
result = Device_min_block_size(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVu64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
arg1 = (Device *)(argp1);
result = Device_max_block_size(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVu64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
arg1 = (Device *)(argp1);
result = Device_block_size(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVu64(result));
+ SV *for_stack;
+ SP += argvi; PUTBACK;
+ for_stack = sv_2mortal(amglue_newSVu64(result));
+ SPAGAIN; SP -= argvi;
+ ST(argvi) = for_stack;
argvi++;
}
}
+XS(_wrap_rait_device_open_from_children) {
+ {
+ GSList *arg1 = (GSList *) 0 ;
+ int argvi = 0;
+ Device *result = 0 ;
+ dXSARGS;
+
+ if ((items < 1) || (items > 1)) {
+ SWIG_croak("Usage: rait_device_open_from_children(child_devices);");
+ }
+ {
+ AV *av;
+ int i, len;
+
+ if (!SvROK(ST(0)) || SvTYPE(SvRV(ST(0))) != SVt_PVAV) {
+ SWIG_exception(SWIG_TypeError, "Expected an arrayref");
+ }
+ av = (AV *)SvRV(ST(0));
+
+ arg1 = NULL;
+ len = av_len(av);
+ for (i = 0; i <= len; i++) {
+ SV **elt = av_fetch(av, i, 0);
+ Device *d;
+
+ if (elt && !SvOK(*elt)) {
+ arg1 = g_slist_append(arg1, NULL); /* 'undef' => NULL */
+ } else if (!elt || SWIG_ConvertPtr(*elt, (void **)&d, SWIGTYPE_p_Device, 0) == -1) {
+ SWIG_exception(SWIG_TypeError, "array member is not a Device");
+ } else {
+ arg1 = g_slist_append(arg1, d);
+ }
+ }
+ }
+ result = (Device *)rait_device_open_from_children(arg1);
+ ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Device, SWIG_OWNER | SWIG_SHADOW); argvi++ ;
+ {
+ g_slist_free(arg1);
+ }
+ XSRETURN(argvi);
+ fail:
+ {
+ g_slist_free(arg1);
+ }
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_write_random_to_device) {
+ {
+ guint32 arg1 ;
+ size_t arg2 ;
+ Device *arg3 = (Device *) 0 ;
+ void *argp3 = 0 ;
+ int res3 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 3) || (items > 3)) {
+ SWIG_croak("Usage: write_random_to_device(seed,length,device);");
+ }
+ {
+ arg1 = amglue_SvU32(ST(0));
+ }
+ {
+ if (sizeof(size_t) == 1) {
+ arg2 = amglue_SvU8(ST(1));
+ } else if (sizeof(size_t) == 2) {
+ arg2 = amglue_SvU16(ST(1));
+ } else if (sizeof(size_t) == 4) {
+ arg2 = amglue_SvU32(ST(1));
+ } else if (sizeof(size_t) == 8) {
+ arg2 = amglue_SvU64(ST(1));
+ } else {
+ croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
+ }
+ }
+ res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "write_random_to_device" "', argument " "3"" of type '" "Device *""'");
+ }
+ arg3 = (Device *)(argp3);
+ result = (gboolean)write_random_to_device(arg1,arg2,arg3);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+ SWIG_croak_null();
+ }
+}
+
+
+XS(_wrap_verify_random_from_device) {
+ {
+ guint32 arg1 ;
+ size_t arg2 ;
+ Device *arg3 = (Device *) 0 ;
+ void *argp3 = 0 ;
+ int res3 = 0 ;
+ int argvi = 0;
+ gboolean result;
+ dXSARGS;
+
+ if ((items < 3) || (items > 3)) {
+ SWIG_croak("Usage: verify_random_from_device(seed,length,device);");
+ }
+ {
+ arg1 = amglue_SvU32(ST(0));
+ }
+ {
+ if (sizeof(size_t) == 1) {
+ arg2 = amglue_SvU8(ST(1));
+ } else if (sizeof(size_t) == 2) {
+ arg2 = amglue_SvU16(ST(1));
+ } else if (sizeof(size_t) == 4) {
+ arg2 = amglue_SvU32(ST(1));
+ } else if (sizeof(size_t) == 8) {
+ arg2 = amglue_SvU64(ST(1));
+ } else {
+ croak("Unexpected size_t >64 bits?"); /* should be optimized out unless sizeof(size_t) > 8 */
+ }
+ }
+ res3 = SWIG_ConvertPtr(ST(2), &argp3,SWIGTYPE_p_Device, 0 | 0 );
+ if (!SWIG_IsOK(res3)) {
+ SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "verify_random_from_device" "', argument " "3"" of type '" "Device *""'");
+ }
+ arg3 = (Device *)(argp3);
+ result = (gboolean)verify_random_from_device(arg1,arg2,arg3);
+ {
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
+ argvi++;
+ }
+
+
+ XSRETURN(argvi);
+ fail:
+
+
+ SWIG_croak_null();
+ }
+}
+
+
XS(_wrap_IS_WRITABLE_ACCESS_MODE) {
{
DeviceAccessMode arg1 ;
}
result = (gboolean)IS_WRITABLE_ACCESS_MODE(arg1);
{
- ST(argvi) = sv_2mortal(amglue_newSVi64(result));
+ if (result)
+ ST(argvi) = &PL_sv_yes;
+ else
+ ST(argvi) = &PL_sv_no;
argvi++;
}
static swig_type_info _swigt__p_Device = {"_p_Device", "struct Device *|Device *", 0, 0, (void*)"Amanda::Device::Device", 0};
static swig_type_info _swigt__p_DevicePropertyBase = {"_p_DevicePropertyBase", "DevicePropertyBase *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_DirectTCPAddr = {"_p_DirectTCPAddr", "DirectTCPAddr *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_DirectTCPConnection = {"_p_DirectTCPConnection", "struct DirectTCPConnection *|DirectTCPConnection *", 0, 0, (void*)"Amanda::Device::DirectTCPConnection", 0};
+static swig_type_info _swigt__p_GSList = {"_p_GSList", "GSList *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_GValue = {"_p_GValue", "GValue *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_a_STRMAX__char = {"_p_a_STRMAX__char", "char (*)[STRMAX]|string_t *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)"Amanda::Types::dumpfile_t", 0};
+static swig_type_info _swigt__p_dumpfile_t = {"_p_dumpfile_t", "dumpfile_t *", 0, 0, (void*)"Amanda::Header::Header", 0};
static swig_type_info _swigt__p_float = {"_p_float", "float *|gfloat *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_guint = {"_p_guint", "guint *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_guint32 = {"_p_guint32", "guint32 *", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_int = {"_p_int", "int *|PropertySurety *|ConcurrencyParadigm *|filetype_t *|PropertySource *|SizeAccuracy *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|DeviceStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0};
-static swig_type_info _swigt__p_queue_fd_t = {"_p_queue_fd_t", "struct queue_fd_t *|queue_fd_t *", 0, 0, (void*)"Amanda::Device::queue_fd_t", 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *|PropertySurety *|ConcurrencyParadigm *|filetype_t *|PropertySource *|StreamingRequirement *|gboolean *|DeviceAccessMode *|MediaAccessMode *|DeviceStatusFlags *|PropertyPhaseFlags *|PropertyAccessFlags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_DirectTCPAddr = {"_p_p_DirectTCPAddr", "DirectTCPAddr **", 0, 0, (void*)0, 0};
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
static swig_type_info *swig_type_initial[] = {
&_swigt__p_Device,
&_swigt__p_DevicePropertyBase,
+ &_swigt__p_DirectTCPAddr,
+ &_swigt__p_DirectTCPConnection,
+ &_swigt__p_GSList,
&_swigt__p_GValue,
&_swigt__p_a_STRMAX__char,
&_swigt__p_char,
&_swigt__p_dumpfile_t,
&_swigt__p_float,
&_swigt__p_guint,
+ &_swigt__p_guint32,
&_swigt__p_guint64,
&_swigt__p_int,
- &_swigt__p_queue_fd_t,
+ &_swigt__p_p_DirectTCPAddr,
&_swigt__p_unsigned_char,
};
static swig_cast_info _swigc__p_Device[] = { {&_swigt__p_Device, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_DevicePropertyBase[] = { {&_swigt__p_DevicePropertyBase, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_DirectTCPAddr[] = { {&_swigt__p_DirectTCPAddr, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_DirectTCPConnection[] = { {&_swigt__p_DirectTCPConnection, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_GSList[] = { {&_swigt__p_GSList, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_GValue[] = { {&_swigt__p_GValue, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_a_STRMAX__char[] = { {&_swigt__p_a_STRMAX__char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_dumpfile_t[] = { {&_swigt__p_dumpfile_t, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_float[] = { {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_guint[] = { {&_swigt__p_guint, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_guint32[] = { {&_swigt__p_guint32, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_guint64[] = { {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
-static swig_cast_info _swigc__p_queue_fd_t[] = { {&_swigt__p_queue_fd_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_DirectTCPAddr[] = { {&_swigt__p_p_DirectTCPAddr, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
static swig_cast_info *swig_cast_initial[] = {
_swigc__p_Device,
_swigc__p_DevicePropertyBase,
+ _swigc__p_DirectTCPAddr,
+ _swigc__p_DirectTCPConnection,
+ _swigc__p_GSList,
_swigc__p_GValue,
_swigc__p_a_STRMAX__char,
_swigc__p_char,
_swigc__p_dumpfile_t,
_swigc__p_float,
_swigc__p_guint,
+ _swigc__p_guint32,
_swigc__p_guint64,
_swigc__p_int,
- _swigc__p_queue_fd_t,
+ _swigc__p_p_DirectTCPAddr,
_swigc__p_unsigned_char,
};
{0,0,0,0}
};
static swig_command_info swig_commands[] = {
-{"Amanda::Devicec::queue_fd_t_fd_get", _wrap_queue_fd_t_fd_get},
-{"Amanda::Devicec::queue_fd_t_errmsg_get", _wrap_queue_fd_t_errmsg_get},
-{"Amanda::Devicec::new_queue_fd_t", _wrap_new_queue_fd_t},
-{"Amanda::Devicec::delete_queue_fd_t", _wrap_delete_queue_fd_t},
+{"Amanda::Devicec::delete_DirectTCPConnection", _wrap_delete_DirectTCPConnection},
+{"Amanda::Devicec::DirectTCPConnection_close", _wrap_DirectTCPConnection_close},
+{"Amanda::Devicec::new_DirectTCPConnection", _wrap_new_DirectTCPConnection},
+{"Amanda::Devicec::unaliased_name", _wrap_unaliased_name},
{"Amanda::Devicec::new_Device", _wrap_new_Device},
{"Amanda::Devicec::delete_Device", _wrap_delete_Device},
{"Amanda::Devicec::Device_configure", _wrap_Device_configure},
{"Amanda::Devicec::Device_finish", _wrap_Device_finish},
{"Amanda::Devicec::Device_start_file", _wrap_Device_start_file},
{"Amanda::Devicec::Device_write_block", _wrap_Device_write_block},
-{"Amanda::Devicec::Device_write_from_fd", _wrap_Device_write_from_fd},
{"Amanda::Devicec::Device_finish_file", _wrap_Device_finish_file},
{"Amanda::Devicec::Device_seek_file", _wrap_Device_seek_file},
{"Amanda::Devicec::Device_seek_block", _wrap_Device_seek_block},
{"Amanda::Devicec::Device_read_block", _wrap_Device_read_block},
-{"Amanda::Devicec::Device_read_to_fd", _wrap_Device_read_to_fd},
+{"Amanda::Devicec::Device_erase", _wrap_Device_erase},
+{"Amanda::Devicec::Device_eject", _wrap_Device_eject},
+{"Amanda::Devicec::Device_directtcp_supported", _wrap_Device_directtcp_supported},
+{"Amanda::Devicec::Device_listen", _wrap_Device_listen},
+{"Amanda::Devicec::Device_accept", _wrap_Device_accept},
+{"Amanda::Devicec::Device_connect", _wrap_Device_connect},
+{"Amanda::Devicec::Device_use_connection", _wrap_Device_use_connection},
+{"Amanda::Devicec::Device_write_from_connection", _wrap_Device_write_from_connection},
+{"Amanda::Devicec::Device_read_to_connection", _wrap_Device_read_to_connection},
{"Amanda::Devicec::Device_property_list", _wrap_Device_property_list},
{"Amanda::Devicec::Device_property_get", _wrap_Device_property_get},
{"Amanda::Devicec::Device_property_set", _wrap_Device_property_set},
{"Amanda::Devicec::Device_device_name", _wrap_Device_device_name},
{"Amanda::Devicec::Device_access_mode", _wrap_Device_access_mode},
{"Amanda::Devicec::Device_is_eof", _wrap_Device_is_eof},
+{"Amanda::Devicec::Device_is_eom", _wrap_Device_is_eom},
{"Amanda::Devicec::Device_volume_label", _wrap_Device_volume_label},
{"Amanda::Devicec::Device_volume_time", _wrap_Device_volume_time},
{"Amanda::Devicec::Device_status", _wrap_Device_status},
{"Amanda::Devicec::Device_max_block_size", _wrap_Device_max_block_size},
{"Amanda::Devicec::Device_block_size", _wrap_Device_block_size},
{"Amanda::Devicec::Device_volume_header", _wrap_Device_volume_header},
+{"Amanda::Devicec::rait_device_open_from_children", _wrap_rait_device_open_from_children},
+{"Amanda::Devicec::write_random_to_device", _wrap_write_random_to_device},
+{"Amanda::Devicec::verify_random_from_device", _wrap_verify_random_from_device},
{"Amanda::Devicec::IS_WRITABLE_ACCESS_MODE", _wrap_IS_WRITABLE_ACCESS_MODE},
{0,0}
};
/* Initialize the Device API on load */
device_api_init();
- SWIG_TypeClientData(SWIGTYPE_p_queue_fd_t, (void*) "Amanda::Device::queue_fd_t");
+ SWIG_TypeClientData(SWIGTYPE_p_DirectTCPConnection, (void*) "Amanda::Device::DirectTCPConnection");
SWIG_TypeClientData(SWIGTYPE_p_Device, (void*) "Amanda::Device::Device");
/*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "ACCESS_NULL", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(MEDIA_ACCESS_MODE_WRITE_ONLY)));
SvREADONLY_on(sv);
} while(0) /*@SWIG@*/;
- /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
- SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_UNKNOWN", TRUE | 0x2 | GV_ADDMULTI);
- sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_UNKNOWN)));
- SvREADONLY_on(sv);
- } while(0) /*@SWIG@*/;
- /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
- SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI);
- sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_ESTIMATE)));
- SvREADONLY_on(sv);
- } while(0) /*@SWIG@*/;
- /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
- SV *sv = get_sv((char*) SWIG_prefix "SIZE_ACCURACY_REAL", TRUE | 0x2 | GV_ADDMULTI);
- sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(SIZE_ACCURACY_REAL)));
- SvREADONLY_on(sv);
- } while(0) /*@SWIG@*/;
/*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
SV *sv = get_sv((char*) SWIG_prefix "PROPERTY_SURETY_BAD", TRUE | 0x2 | GV_ADDMULTI);
sv_setsv(sv, SWIG_From_int SWIG_PERL_CALL_ARGS_1((int)(PROPERTY_SURETY_BAD)));