|
|
9a267a |
From 8b4da8007ef59bbc833fed882ddae57bbcd51f1c Mon Sep 17 00:00:00 2001
|
|
|
62f653 |
From: rpm-build <rpm-build>
|
|
|
62f653 |
Date: Mon, 26 Jan 2015 12:57:11 -0800
|
|
|
5f4533 |
Subject: [PATCH] libiscsi
|
|
|
62f653 |
|
|
|
62f653 |
---
|
|
|
62f653 |
Makefile | 2 +
|
|
|
5f4533 |
libiscsi/Makefile | 65 +
|
|
|
5f4533 |
libiscsi/libiscsi.c | 617 ++++++++
|
|
|
5f4533 |
libiscsi/libiscsi.doxy | 1473 +++++++++++++++++++
|
|
|
5f4533 |
libiscsi/libiscsi.h | 344 +++++
|
|
|
62f653 |
libiscsi/no_date_footer.html | 6 +
|
|
|
5f4533 |
libiscsi/pylibiscsi.c | 709 +++++++++
|
|
|
62f653 |
libiscsi/setup.py | 9 +
|
|
|
62f653 |
libiscsi/tests/test_discovery_firmware.c | 53 +
|
|
|
5f4533 |
libiscsi/tests/test_discovery_sendtargets.c | 60 +
|
|
|
5f4533 |
libiscsi/tests/test_get_auth.c | 70 +
|
|
|
62f653 |
libiscsi/tests/test_get_initiator_name.c | 38 +
|
|
|
62f653 |
libiscsi/tests/test_get_network_config.c | 45 +
|
|
|
62f653 |
libiscsi/tests/test_login.c | 52 +
|
|
|
62f653 |
libiscsi/tests/test_logout.c | 51 +
|
|
|
62f653 |
libiscsi/tests/test_params.c | 103 ++
|
|
|
5f4533 |
libiscsi/tests/test_set_auth.c | 58 +
|
|
|
62f653 |
usr/Makefile | 2 +-
|
|
|
62f653 |
usr/discovery.c | 5 +
|
|
|
62f653 |
usr/idbm.c | 6 +-
|
|
|
62f653 |
usr/idbm.h | 3 +
|
|
|
62f653 |
usr/iscsi_ipc.h | 2 +
|
|
|
5f4533 |
22 files changed, 3769 insertions(+), 4 deletions(-)
|
|
|
62f653 |
create mode 100644 libiscsi/Makefile
|
|
|
62f653 |
create mode 100644 libiscsi/libiscsi.c
|
|
|
62f653 |
create mode 100644 libiscsi/libiscsi.doxy
|
|
|
62f653 |
create mode 100644 libiscsi/libiscsi.h
|
|
|
62f653 |
create mode 100644 libiscsi/no_date_footer.html
|
|
|
62f653 |
create mode 100644 libiscsi/pylibiscsi.c
|
|
|
62f653 |
create mode 100644 libiscsi/setup.py
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_discovery_firmware.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_discovery_sendtargets.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_get_auth.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_get_initiator_name.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_get_network_config.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_login.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_logout.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_params.c
|
|
|
62f653 |
create mode 100644 libiscsi/tests/test_set_auth.c
|
|
|
62f653 |
|
|
|
62f653 |
diff --git a/Makefile b/Makefile
|
|
|
221d9a |
index 7b445a5..4ab091f 100644
|
|
|
62f653 |
--- a/Makefile
|
|
|
62f653 |
+++ b/Makefile
|
|
|
221d9a |
@@ -65,6 +65,7 @@ user: iscsiuio/Makefile
|
|
|
62f653 |
$(MAKE) -C usr
|
|
|
62f653 |
$(MAKE) -C utils
|
|
|
62f653 |
$(MAKE) -C iscsiuio
|
|
|
62f653 |
+ $(MAKE) -C libiscsi
|
|
|
62f653 |
@echo
|
|
|
62f653 |
@echo "Compilation complete Output file"
|
|
|
62f653 |
@echo "----------------------------------- ----------------"
|
|
|
221d9a |
@@ -85,6 +86,7 @@ iscsiuio/configure iscsiuio/Makefile.in: iscsiuio/configure.ac iscsiuio/Makefile
|
|
|
62f653 |
force: ;
|
|
|
62f653 |
|
|
|
62f653 |
clean:
|
|
|
62f653 |
+ $(MAKE) -C libiscsi clean
|
|
|
62f653 |
$(MAKE) -C utils/sysdeps clean
|
|
|
62f653 |
$(MAKE) -C utils/fwparam_ibft clean
|
|
|
62f653 |
$(MAKE) -C utils clean
|
|
|
62f653 |
diff --git a/libiscsi/Makefile b/libiscsi/Makefile
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..53f9746
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/Makefile
|
|
|
62f653 |
@@ -0,0 +1,65 @@
|
|
|
62f653 |
+# This Makefile will work only with GNU make.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ifeq ($(TOPDIR),)
|
|
|
62f653 |
+ TOPDIR = ..
|
|
|
62f653 |
+endif
|
|
|
62f653 |
+
|
|
|
62f653 |
+OSNAME=$(shell uname -s)
|
|
|
62f653 |
+OPTFLAGS ?= -O2 -g
|
|
|
62f653 |
+WARNFLAGS ?= -Wall -Wstrict-prototypes
|
|
|
62f653 |
+CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I../include -I../usr \
|
|
|
62f653 |
+ -D$(OSNAME) -fPIC -D_GNU_SOURCE -fvisibility=hidden
|
|
|
62f653 |
+LIB = libiscsi.so.0
|
|
|
62f653 |
+TESTS = tests/test_discovery_sendtargets tests/test_discovery_firmware
|
|
|
62f653 |
+TESTS += tests/test_login tests/test_logout tests/test_params
|
|
|
62f653 |
+TESTS += tests/test_get_network_config tests/test_get_initiator_name
|
|
|
62f653 |
+TESTS += tests/test_set_auth tests/test_get_auth
|
|
|
62f653 |
+
|
|
|
62f653 |
+COMMON_SRCS = sysdeps.o
|
|
|
62f653 |
+# sources shared between iscsid, iscsiadm and iscsistart
|
|
|
62f653 |
+ISCSI_LIB_SRCS = netlink.o transport.o cxgbi.o be2iscsi.o iscsi_timer.o initiator_common.o iscsi_err.o session_info.o iscsi_util.o io.o auth.o discovery.o login.o log.o md5.o sha1.o iface.o idbm.o sysfs.o iscsi_sysfs.o iscsi_net_util.o iscsid_req.o iser.o uip_mgmt_ipc.o
|
|
|
62f653 |
+FW_PARAM_SRCS = fw_entry.o prom_lex.o prom_parse.tab.o fwparam_ppc.o fwparam_sysfs.o
|
|
|
62f653 |
+
|
|
|
62f653 |
+# sources shared with the userspace utils, note we build these separately
|
|
|
62f653 |
+# to get PIC versions.
|
|
|
62f653 |
+COMMON_OBJS = $(patsubst %.o, common-objs/%.o, $(COMMON_SRCS))
|
|
|
62f653 |
+USR_OBJS = $(patsubst %.o, usr-objs/%.o, $(ISCSI_LIB_SRCS) strings.o)
|
|
|
62f653 |
+FW_OBJS = $(patsubst %.o, fw-objs/%.o, $(FW_PARAM_SRCS))
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Flags for the tests
|
|
|
62f653 |
+tests/% : CFLAGS = $(OPTFLAGS) $(WARNFLAGS) -I.
|
|
|
62f653 |
+
|
|
|
62f653 |
+all: lib tests html
|
|
|
62f653 |
+
|
|
|
62f653 |
+lib: $(LIB)
|
|
|
62f653 |
+tests: $(TESTS)
|
|
|
62f653 |
+
|
|
|
62f653 |
+common-objs/%.o: ../utils/sysdeps/%.c
|
|
|
62f653 |
+ mkdir -p common-objs
|
|
|
62f653 |
+ $(CC) $(CFLAGS) -c $< -o $@
|
|
|
62f653 |
+
|
|
|
62f653 |
+usr-objs/%.o: ../usr/%.c
|
|
|
62f653 |
+ mkdir -p usr-objs
|
|
|
62f653 |
+ $(CC) $(CFLAGS) -c $< -o $@
|
|
|
62f653 |
+
|
|
|
62f653 |
+fw-objs/%.o: ../utils/fwparam_ibft/%.c
|
|
|
62f653 |
+ mkdir -p fw-objs
|
|
|
62f653 |
+ $(CC) $(CFLAGS) -c $< -o $@
|
|
|
62f653 |
+
|
|
|
62f653 |
+$(LIB): $(COMMON_OBJS) $(FW_OBJS) $(USR_OBJS) libiscsi.o
|
|
|
62f653 |
+ $(CC) $(CFLAGS) -shared -Wl,-soname,$(LIB) $^ -o $@ -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
|
|
|
62f653 |
+ ln -s -f $(LIB) libiscsi.so
|
|
|
62f653 |
+
|
|
|
62f653 |
+$(TESTS): $(FW_OBJS) $(COMMON_OBJS) $(USR_OBJS) $(LIB)
|
|
|
62f653 |
+
|
|
|
62f653 |
+html: libiscsi.h libiscsi.doxy
|
|
|
62f653 |
+ doxygen libiscsi.doxy
|
|
|
62f653 |
+
|
|
|
62f653 |
+clean:
|
|
|
62f653 |
+ rm -rf *.o common-objs usr-objs fw-objs libuip-objs libiscsi.so* \
|
|
|
62f653 |
+ .depend *~ html $(TESTS) tests/*~
|
|
|
62f653 |
+
|
|
|
62f653 |
+depend:
|
|
|
62f653 |
+ gcc $(CFLAGS) -M `ls *.c` > .depend
|
|
|
62f653 |
+
|
|
|
62f653 |
+-include .depend ../usr/.depend
|
|
|
62f653 |
diff --git a/libiscsi/libiscsi.c b/libiscsi/libiscsi.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..064e4b5
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/libiscsi.c
|
|
|
62f653 |
@@ -0,0 +1,617 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include <errno.h>
|
|
|
62f653 |
+#include <unistd.h>
|
|
|
62f653 |
+#include <sys/syslog.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+#include "idbm.h"
|
|
|
62f653 |
+#include "discovery.h"
|
|
|
62f653 |
+#include "log.h"
|
|
|
62f653 |
+#include "sysfs.h"
|
|
|
62f653 |
+#include "iscsi_sysfs.h"
|
|
|
62f653 |
+#include "session_info.h"
|
|
|
62f653 |
+#include "iscsi_util.h"
|
|
|
62f653 |
+#include "sysdeps.h"
|
|
|
62f653 |
+#include "iface.h"
|
|
|
62f653 |
+#include "iscsi_proto.h"
|
|
|
62f653 |
+#include "fw_context.h"
|
|
|
62f653 |
+#include "iscsid_req.h"
|
|
|
62f653 |
+#include "iscsi_err.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+#define CHECK(a) { context->error_str[0] = 0; rc = a; if (rc) goto leave; }
|
|
|
62f653 |
+
|
|
|
62f653 |
+/* UGLY, not thread safe :( */
|
|
|
62f653 |
+static int sysfs_initialized = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+struct libiscsi_context {
|
|
|
62f653 |
+ char error_str[256];
|
|
|
62f653 |
+ /* For get_parameter_helper() */
|
|
|
62f653 |
+ const char *parameter;
|
|
|
62f653 |
+ char *value;
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+static void libiscsi_log(int prio, void *priv, const char *fmt, va_list ap)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_context *context = priv;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (prio > LOG_ERR) /* We are only interested in errors (or worse) */
|
|
|
62f653 |
+ return;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ vsnprintf(context->error_str, sizeof(context->error_str), fmt, ap);
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+struct libiscsi_context *libiscsi_init(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = calloc(1, sizeof *context);
|
|
|
62f653 |
+ if (!context)
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ log_init("libiscsi", 1024, libiscsi_log, context);
|
|
|
62f653 |
+ if (!sysfs_initialized) {
|
|
|
62f653 |
+ sysfs_init();
|
|
|
62f653 |
+ sysfs_initialized = 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ increase_max_files();
|
|
|
62f653 |
+ if (idbm_init(NULL)) {
|
|
|
62f653 |
+ sysfs_cleanup();
|
|
|
62f653 |
+ free(context);
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ iface_setup_host_bindings();
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return context;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+void libiscsi_cleanup(struct libiscsi_context *context)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ idbm_terminate();
|
|
|
62f653 |
+ free_transports();
|
|
|
62f653 |
+ sysfs_cleanup();
|
|
|
62f653 |
+ free(context);
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static void free_iface_list(struct list_head *ifaces)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct iface_rec *iface, *tmp_iface;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ list_for_each_entry_safe(iface, tmp_iface, ifaces, list) {
|
|
|
62f653 |
+ list_del(&iface->list);
|
|
|
62f653 |
+ free(iface);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static void free_rec_list(struct list_head *rec_list)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct node_rec *rec, *tmp;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ list_for_each_entry_safe(rec, tmp, rec_list, list) {
|
|
|
62f653 |
+ list_del(&rec->list);
|
|
|
62f653 |
+ free(rec);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_discover_sendtargets(struct libiscsi_context *context,
|
|
|
62f653 |
+ const char *address, int port,
|
|
|
62f653 |
+ const struct libiscsi_auth_info *auth_info,
|
|
|
62f653 |
+ int *nr_found, struct libiscsi_node **found_nodes)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct discovery_rec drec;
|
|
|
62f653 |
+ LIST_HEAD(bound_rec_list);
|
|
|
62f653 |
+ struct node_rec *rec;
|
|
|
62f653 |
+ int rc = 0, found = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ INIT_LIST_HEAD(&bound_rec_list);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (nr_found)
|
|
|
62f653 |
+ *nr_found = 0;
|
|
|
62f653 |
+ if (found_nodes)
|
|
|
62f653 |
+ *found_nodes = NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(libiscsi_verify_auth_info(context, auth_info))
|
|
|
62f653 |
+
|
|
|
62f653 |
+ /* Fill the drec struct with all needed info */
|
|
|
62f653 |
+ memset(&drec, 0, sizeof drec);
|
|
|
62f653 |
+ idbm_sendtargets_defaults(&drec.u.sendtargets);
|
|
|
62f653 |
+ drec.type = DISCOVERY_TYPE_SENDTARGETS;
|
|
|
62f653 |
+ strlcpy(drec.address, address, sizeof(drec.address));
|
|
|
62f653 |
+ drec.port = port ? port : ISCSI_LISTEN_PORT;
|
|
|
62f653 |
+ switch(auth_info ? auth_info->method : libiscsi_auth_none) {
|
|
|
62f653 |
+ case libiscsi_auth_chap:
|
|
|
62f653 |
+ drec.u.sendtargets.auth.authmethod = AUTH_METHOD_CHAP;
|
|
|
62f653 |
+ strlcpy(drec.u.sendtargets.auth.username,
|
|
|
62f653 |
+ auth_info->chap.username, AUTH_STR_MAX_LEN);
|
|
|
62f653 |
+ strlcpy((char *)drec.u.sendtargets.auth.password,
|
|
|
62f653 |
+ auth_info->chap.password, AUTH_STR_MAX_LEN);
|
|
|
62f653 |
+ drec.u.sendtargets.auth.password_length =
|
|
|
62f653 |
+ strlen((char *)drec.u.sendtargets.auth.password);
|
|
|
62f653 |
+ strlcpy(drec.u.sendtargets.auth.username_in,
|
|
|
62f653 |
+ auth_info->chap.reverse_username, AUTH_STR_MAX_LEN);
|
|
|
62f653 |
+ strlcpy((char *)drec.u.sendtargets.auth.password_in,
|
|
|
62f653 |
+ auth_info->chap.reverse_password, AUTH_STR_MAX_LEN);
|
|
|
62f653 |
+ drec.u.sendtargets.auth.password_in_length =
|
|
|
62f653 |
+ strlen((char *)drec.u.sendtargets.auth.password_in);
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(idbm_add_discovery(&drec))
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(idbm_bind_ifaces_to_nodes(discovery_sendtargets,
|
|
|
62f653 |
+ &drec, NULL, &bound_rec_list))
|
|
|
62f653 |
+
|
|
|
62f653 |
+ /* now add/update records */
|
|
|
62f653 |
+ list_for_each_entry(rec, &bound_rec_list, list) {
|
|
|
62f653 |
+ CHECK(idbm_add_node(rec, &drec, 1 /* overwrite */))
|
|
|
62f653 |
+ found++;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (nr_found)
|
|
|
62f653 |
+ *nr_found = found;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (found_nodes && found) {
|
|
|
62f653 |
+ *found_nodes = calloc(found, sizeof **found_nodes);
|
|
|
62f653 |
+ if (*found_nodes == NULL) {
|
|
|
62f653 |
+ snprintf(context->error_str,
|
|
|
62f653 |
+ sizeof(context->error_str), strerror(ENOMEM));
|
|
|
62f653 |
+ rc = ENOMEM;
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ found = 0;
|
|
|
62f653 |
+ list_for_each_entry(rec, &bound_rec_list, list) {
|
|
|
62f653 |
+ strlcpy((*found_nodes)[found].name, rec->name,
|
|
|
62f653 |
+ LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ (*found_nodes)[found].tpgt = rec->tpgt;
|
|
|
62f653 |
+ strlcpy((*found_nodes)[found].address,
|
|
|
62f653 |
+ rec->conn[0].address, NI_MAXHOST);
|
|
|
62f653 |
+ (*found_nodes)[found].port = rec->conn[0].port;
|
|
|
62f653 |
+ strlcpy((*found_nodes)[found].iface,
|
|
|
62f653 |
+ rec->iface.name, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ found++;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ free_rec_list(&bound_rec_list);
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_discover_firmware(struct libiscsi_context *context,
|
|
|
62f653 |
+ int *nr_found, struct libiscsi_node **found_nodes)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct list_head targets, ifaces, rec_list;
|
|
|
62f653 |
+ discovery_rec_t drec;
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ INIT_LIST_HEAD(&targets;;
|
|
|
62f653 |
+ INIT_LIST_HEAD(&ifaces);
|
|
|
62f653 |
+ INIT_LIST_HEAD(&rec_list);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (nr_found) {
|
|
|
62f653 |
+ *nr_found = 0;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (found_nodes) {
|
|
|
62f653 |
+ *found_nodes = NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = fw_get_targets(&targets;;
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ log_error("%s: Could not get list of targets from firmware "
|
|
|
62f653 |
+ "(err %d).\n", __func__, rc);
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(iface_create_ifaces_from_boot_contexts(&ifaces, &targets));
|
|
|
62f653 |
+
|
|
|
62f653 |
+ memset(&drec, 0, sizeof(drec));
|
|
|
62f653 |
+ drec.type = DISCOVERY_TYPE_FW;
|
|
|
62f653 |
+ rc = idbm_bind_ifaces_to_nodes(discovery_fw, &drec, &ifaces, &rec_list);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ log_error("%s: Could not determine target nodes from firmware "
|
|
|
62f653 |
+ "(err %d).\n", __func__, rc);
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ int node_count = 0;
|
|
|
62f653 |
+ struct list_head *pos;
|
|
|
62f653 |
+ list_for_each(pos, &rec_list) {
|
|
|
62f653 |
+ ++node_count;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ struct libiscsi_node* new_nodes;
|
|
|
62f653 |
+ /* allocate enough space for all the nodes */
|
|
|
62f653 |
+ new_nodes = calloc(node_count, sizeof *new_nodes);
|
|
|
62f653 |
+ if (new_nodes == NULL) {
|
|
|
62f653 |
+ rc = ENOMEM;
|
|
|
62f653 |
+ log_error("%s: %s.\n", __func__, strerror(ENOMEM));
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ struct node_rec *rec;
|
|
|
62f653 |
+ struct libiscsi_node *new_node = new_nodes;
|
|
|
62f653 |
+ /* in one loop, add nodes to idbm and create libiscsi_node entries */
|
|
|
62f653 |
+ list_for_each_entry(rec, &rec_list, list) {
|
|
|
62f653 |
+ CHECK(idbm_add_node(rec, NULL, 1 /* overwrite */));
|
|
|
62f653 |
+
|
|
|
62f653 |
+ strlcpy(new_node->name, rec->name, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ new_node->tpgt = rec->tpgt;
|
|
|
62f653 |
+ strlcpy(new_node->address, rec->conn[0].address, NI_MAXHOST);
|
|
|
62f653 |
+ new_node->port = rec->conn[0].port;
|
|
|
62f653 |
+ strlcpy(new_node->iface, rec->iface.name, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ ++new_node;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ /* update output parameters */
|
|
|
62f653 |
+ if (nr_found) {
|
|
|
62f653 |
+ *nr_found = node_count;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ if (found_nodes) {
|
|
|
62f653 |
+ *found_nodes = new_nodes;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ fw_free_targets(&targets;;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ free_iface_list(&ifaces);
|
|
|
62f653 |
+ free_rec_list(&rec_list);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_verify_auth_info(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_auth_info *auth_info)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ switch(auth_info ? auth_info->method : libiscsi_auth_none) {
|
|
|
62f653 |
+ case libiscsi_auth_none:
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+ case libiscsi_auth_chap:
|
|
|
62f653 |
+ if (!auth_info->chap.username[0]) {
|
|
|
62f653 |
+ strcpy(context->error_str, "Empty username");
|
|
|
62f653 |
+ return EINVAL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ if (!auth_info->chap.password[0]) {
|
|
|
62f653 |
+ strcpy(context->error_str, "Empty password");
|
|
|
62f653 |
+ return EINVAL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ if (auth_info->chap.reverse_username[0] &&
|
|
|
62f653 |
+ !auth_info->chap.reverse_password[0]) {
|
|
|
62f653 |
+ strcpy(context->error_str, "Empty reverse password");
|
|
|
62f653 |
+ return EINVAL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+ default:
|
|
|
62f653 |
+ sprintf(context->error_str,
|
|
|
62f653 |
+ "Invalid authentication method: %d",
|
|
|
62f653 |
+ (int)auth_info->method);
|
|
|
62f653 |
+ return EINVAL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_node_set_auth(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node,
|
|
|
62f653 |
+ const struct libiscsi_auth_info *auth_info)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(libiscsi_verify_auth_info(context, auth_info))
|
|
|
62f653 |
+
|
|
|
62f653 |
+ switch(auth_info ? auth_info->method : libiscsi_auth_none) {
|
|
|
62f653 |
+ case libiscsi_auth_none:
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.authmethod", "None"))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.username", ""))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.password", ""))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.username_in", ""))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.password_in", ""))
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ case libiscsi_auth_chap:
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.authmethod", "CHAP"))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.username",
|
|
|
62f653 |
+ auth_info->chap.username))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.password",
|
|
|
62f653 |
+ auth_info->chap.password))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.username_in",
|
|
|
62f653 |
+ auth_info->chap.reverse_username))
|
|
|
62f653 |
+ CHECK(libiscsi_node_set_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.password_in",
|
|
|
62f653 |
+ auth_info->chap.reverse_password))
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_node_get_auth(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node,
|
|
|
62f653 |
+ struct libiscsi_auth_info *auth_info)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+ char value[LIBISCSI_VALUE_MAXLEN];
|
|
|
62f653 |
+
|
|
|
62f653 |
+ memset(auth_info, 0, sizeof *auth_info);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(libiscsi_node_get_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.authmethod", value))
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!strcmp(value, "None")) {
|
|
|
62f653 |
+ auth_info->method = libiscsi_auth_none;
|
|
|
62f653 |
+ } else if (!strcmp(value, "CHAP")) {
|
|
|
62f653 |
+ auth_info->method = libiscsi_auth_chap;
|
|
|
62f653 |
+ CHECK(libiscsi_node_get_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.username",
|
|
|
62f653 |
+ auth_info->chap.username))
|
|
|
62f653 |
+ CHECK(libiscsi_node_get_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.password",
|
|
|
62f653 |
+ auth_info->chap.password))
|
|
|
62f653 |
+ CHECK(libiscsi_node_get_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.username_in",
|
|
|
62f653 |
+ auth_info->chap.reverse_username))
|
|
|
62f653 |
+ CHECK(libiscsi_node_get_parameter(context, node,
|
|
|
62f653 |
+ "node.session.auth.password_in",
|
|
|
62f653 |
+ auth_info->chap.reverse_password))
|
|
|
62f653 |
+ } else {
|
|
|
62f653 |
+ snprintf(context->error_str, sizeof(context->error_str),
|
|
|
62f653 |
+ "unknown authentication method: %s", value);
|
|
|
62f653 |
+ rc = EINVAL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static void node_to_rec(const struct libiscsi_node *node,
|
|
|
62f653 |
+ struct node_rec *rec)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ memset(rec, 0, sizeof *rec);
|
|
|
62f653 |
+ idbm_node_setup_defaults(rec);
|
|
|
62f653 |
+ strlcpy(rec->name, node->name, TARGET_NAME_MAXLEN);
|
|
|
62f653 |
+ rec->tpgt = node->tpgt;
|
|
|
62f653 |
+ strlcpy(rec->conn[0].address, node->address, NI_MAXHOST);
|
|
|
62f653 |
+ rec->conn[0].port = node->port;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int login_helper(void *data, node_rec_t *rec)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ char *iface = (char*)data;
|
|
|
62f653 |
+ if (strcmp(iface, rec->iface.name))
|
|
|
62f653 |
+ /* different iface, skip it */
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ int rc = iscsid_req_by_rec(MGMT_IPC_SESSION_LOGIN, rec);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ iscsi_err_print_msg(rc);
|
|
|
62f653 |
+ rc = ENOTCONN;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_node_login(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int nr_found = 0, rc;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(idbm_for_each_iface(&nr_found, (void*)node->iface, login_helper,
|
|
|
62f653 |
+ (char *)node->name, node->tpgt,
|
|
|
62f653 |
+ (char *)node->address, node->port))
|
|
|
62f653 |
+ if (nr_found == 0) {
|
|
|
62f653 |
+ strcpy(context->error_str, "No such node");
|
|
|
62f653 |
+ rc = ENODEV;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int logout_helper(void *data, struct session_info *info)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int rc;
|
|
|
62f653 |
+ struct node_rec *rec = data;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!iscsi_match_session(rec, info))
|
|
|
62f653 |
+ /* Tell iscsi_sysfs_for_each_session this session was not a
|
|
|
62f653 |
+ match so that it will not increase nr_found. */
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = iscsid_req_by_sid(MGMT_IPC_SESSION_LOGOUT, info->sid);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ iscsi_err_print_msg(rc);
|
|
|
62f653 |
+ rc = EIO;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_node_logout(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int nr_found = 0, rc;
|
|
|
62f653 |
+ struct node_rec rec;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ node_to_rec(node, &rec);
|
|
|
62f653 |
+ CHECK(iscsi_sysfs_for_each_session(&rec, &nr_found, logout_helper,0))
|
|
|
62f653 |
+ if (nr_found == 0) {
|
|
|
62f653 |
+ strcpy(context->error_str, "No matching session");
|
|
|
62f653 |
+ rc = ENODEV;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_node_set_parameter(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node,
|
|
|
62f653 |
+ const char *parameter, const char *value)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int nr_found = 0, rc;
|
|
|
62f653 |
+ struct user_param *param;
|
|
|
62f653 |
+ struct list_head params;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ INIT_LIST_HEAD(¶ms);
|
|
|
62f653 |
+ param = idbm_alloc_user_param(parameter, value);
|
|
|
62f653 |
+ if (!param) {
|
|
|
62f653 |
+ rc = ENOMEM;
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ list_add_tail(¶ms, ¶m->list);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ CHECK(idbm_for_each_iface(&nr_found, ¶ms, idbm_node_set_param,
|
|
|
62f653 |
+ (char *)node->name, node->tpgt,
|
|
|
62f653 |
+ (char *)node->address, node->port))
|
|
|
62f653 |
+ if (nr_found == 0) {
|
|
|
62f653 |
+ strcpy(context->error_str, "No such node");
|
|
|
62f653 |
+ rc = ENODEV;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ free(param->name);
|
|
|
62f653 |
+ free(param);
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int get_parameter_helper(void *data, node_rec_t *rec)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_context *context = data;
|
|
|
62f653 |
+ recinfo_t *info;
|
|
|
62f653 |
+ int i;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ info = idbm_recinfo_alloc(MAX_KEYS);
|
|
|
62f653 |
+ if (!info) {
|
|
|
62f653 |
+ snprintf(context->error_str, sizeof(context->error_str),
|
|
|
62f653 |
+ strerror(ENOMEM));
|
|
|
62f653 |
+ return ENOMEM;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ idbm_recinfo_node(rec, info);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ for (i = 0; i < MAX_KEYS; i++) {
|
|
|
62f653 |
+ if (!info[i].visible)
|
|
|
62f653 |
+ continue;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (strcmp(context->parameter, info[i].name))
|
|
|
62f653 |
+ continue;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ strlcpy(context->value, info[i].value, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ free(info);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (i == MAX_KEYS) {
|
|
|
62f653 |
+ strcpy(context->error_str, "No such parameter");
|
|
|
62f653 |
+ return EINVAL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_node_get_parameter(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node, const char *parameter, char *value)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int nr_found = 0, rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context->parameter = parameter;
|
|
|
62f653 |
+ context->value = value;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ /* Note we assume there is only one interface, if not we will get
|
|
|
62f653 |
+ the value from the last interface iterated over!
|
|
|
62f653 |
+ This (multiple interfaces) can only happen if someone explicitly
|
|
|
62f653 |
+ created ones using iscsiadm. Even then this should not be a problem
|
|
|
62f653 |
+ as most settings should be the same independent of the iface. */
|
|
|
62f653 |
+ CHECK(idbm_for_each_iface(&nr_found, context, get_parameter_helper,
|
|
|
62f653 |
+ (char *)node->name, node->tpgt,
|
|
|
62f653 |
+ (char *)node->address, node->port))
|
|
|
62f653 |
+ if (nr_found == 0) {
|
|
|
62f653 |
+ strcpy(context->error_str, "No such node");
|
|
|
62f653 |
+ rc = ENODEV;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+const char *libiscsi_get_error_string(struct libiscsi_context *context)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ /* Sometimes the core open-iscsi code does not give us an error
|
|
|
62f653 |
+ message */
|
|
|
62f653 |
+ if (!context->error_str[0])
|
|
|
62f653 |
+ return "Unknown error";
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return context->error_str;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+
|
|
|
62f653 |
+/************************** Utility functions *******************************/
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_get_firmware_network_config(
|
|
|
62f653 |
+ struct libiscsi_network_config *config)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct boot_context fw_entry;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!sysfs_initialized) {
|
|
|
62f653 |
+ sysfs_init();
|
|
|
62f653 |
+ sysfs_initialized = 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ memset(config, 0, sizeof *config);
|
|
|
62f653 |
+ memset(&fw_entry, 0, sizeof fw_entry);
|
|
|
62f653 |
+ if (fw_get_entry(&fw_entry))
|
|
|
62f653 |
+ return ENODEV;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ config->dhcp = strlen(fw_entry.dhcp) ? 1 : 0;
|
|
|
62f653 |
+ strlcpy(config->iface_name, fw_entry.iface, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ strlcpy(config->mac_address, fw_entry.mac, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ strlcpy(config->ip_address, fw_entry.ipaddr, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ strlcpy(config->netmask, fw_entry.mask, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ strlcpy(config->gateway, fw_entry.gateway, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ strlcpy(config->primary_dns, fw_entry.primary_dns, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ strlcpy(config->secondary_dns, fw_entry.secondary_dns, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+int libiscsi_get_firmware_initiator_name(char *initiatorname)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct boot_context fw_entry;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!sysfs_initialized) {
|
|
|
62f653 |
+ sysfs_init();
|
|
|
62f653 |
+ sysfs_initialized = 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ memset(initiatorname, 0, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+ memset(&fw_entry, 0, sizeof fw_entry);
|
|
|
62f653 |
+ if (fw_get_entry(&fw_entry))
|
|
|
62f653 |
+ return ENODEV;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ strlcpy(initiatorname, fw_entry.initiatorname, LIBISCSI_VALUE_MAXLEN);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/libiscsi.doxy b/libiscsi/libiscsi.doxy
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..7a5ff7f
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/libiscsi.doxy
|
|
|
62f653 |
@@ -0,0 +1,1473 @@
|
|
|
62f653 |
+# Doxyfile 1.5.7.1
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This file describes the settings to be used by the documentation system
|
|
|
62f653 |
+# doxygen (www.doxygen.org) for a project
|
|
|
62f653 |
+#
|
|
|
62f653 |
+# All text after a hash (#) is considered a comment and will be ignored
|
|
|
62f653 |
+# The format is:
|
|
|
62f653 |
+# TAG = value [value, ...]
|
|
|
62f653 |
+# For lists items can also be appended using:
|
|
|
62f653 |
+# TAG += value [value, ...]
|
|
|
62f653 |
+# Values that contain spaces should be placed between quotes (" ")
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# Project related configuration options
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This tag specifies the encoding used for all characters in the config file
|
|
|
62f653 |
+# that follow. The default is UTF-8 which is also the encoding used for all
|
|
|
62f653 |
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
|
|
|
62f653 |
+# iconv built into libc) for the transcoding. See
|
|
|
62f653 |
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOXYFILE_ENCODING = UTF-8
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
|
|
|
62f653 |
+# by quotes) that should identify the project.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PROJECT_NAME = libiscsi
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
|
|
|
62f653 |
+# This could be handy for archiving the generated documentation or
|
|
|
62f653 |
+# if some version control system is used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PROJECT_NUMBER =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
|
|
|
62f653 |
+# base path where the generated documentation will be put.
|
|
|
62f653 |
+# If a relative path is entered, it will be relative to the location
|
|
|
62f653 |
+# where doxygen was started. If left blank the current directory will be used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+OUTPUT_DIRECTORY =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
|
|
|
62f653 |
+# 4096 sub-directories (in 2 levels) under the output directory of each output
|
|
|
62f653 |
+# format and will distribute the generated files over these directories.
|
|
|
62f653 |
+# Enabling this option can be useful when feeding doxygen a huge amount of
|
|
|
62f653 |
+# source files, where putting all generated files in the same directory would
|
|
|
62f653 |
+# otherwise cause performance problems for the file system.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CREATE_SUBDIRS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
|
|
|
62f653 |
+# documentation generated by doxygen is written. Doxygen will use this
|
|
|
62f653 |
+# information to generate all constant output in the proper language.
|
|
|
62f653 |
+# The default language is English, other supported languages are:
|
|
|
62f653 |
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
|
|
|
62f653 |
+# Croatian, Czech, Danish, Dutch, Farsi, Finnish, French, German, Greek,
|
|
|
62f653 |
+# Hungarian, Italian, Japanese, Japanese-en (Japanese with English messages),
|
|
|
62f653 |
+# Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, Polish,
|
|
|
62f653 |
+# Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak, Slovene,
|
|
|
62f653 |
+# Spanish, Swedish, and Ukrainian.
|
|
|
62f653 |
+
|
|
|
62f653 |
+OUTPUT_LANGUAGE = English
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# include brief member descriptions after the members that are listed in
|
|
|
62f653 |
+# the file and class documentation (similar to JavaDoc).
|
|
|
62f653 |
+# Set to NO to disable this.
|
|
|
62f653 |
+
|
|
|
62f653 |
+BRIEF_MEMBER_DESC = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
|
|
|
62f653 |
+# the brief description of a member or function before the detailed description.
|
|
|
62f653 |
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
|
|
|
62f653 |
+# brief descriptions will be completely suppressed.
|
|
|
62f653 |
+
|
|
|
62f653 |
+REPEAT_BRIEF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This tag implements a quasi-intelligent brief description abbreviator
|
|
|
62f653 |
+# that is used to form the text in various listings. Each string
|
|
|
62f653 |
+# in this list, if found as the leading text of the brief description, will be
|
|
|
62f653 |
+# stripped from the text and the result after processing the whole list, is
|
|
|
62f653 |
+# used as the annotated text. Otherwise, the brief description is used as-is.
|
|
|
62f653 |
+# If left blank, the following values are used ("$name" is automatically
|
|
|
62f653 |
+# replaced with the name of the entity): "The $name class" "The $name widget"
|
|
|
62f653 |
+# "The $name file" "is" "provides" "specifies" "contains"
|
|
|
62f653 |
+# "represents" "a" "an" "the"
|
|
|
62f653 |
+
|
|
|
62f653 |
+ABBREVIATE_BRIEF =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
|
|
|
62f653 |
+# Doxygen will generate a detailed section even if there is only a brief
|
|
|
62f653 |
+# description.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ALWAYS_DETAILED_SEC = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
|
|
|
62f653 |
+# inherited members of a class in the documentation of that class as if those
|
|
|
62f653 |
+# members were ordinary class members. Constructors, destructors and assignment
|
|
|
62f653 |
+# operators of the base classes will not be shown.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INLINE_INHERITED_MEMB = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
|
|
|
62f653 |
+# path before files name in the file list and in the header files. If set
|
|
|
62f653 |
+# to NO the shortest path that makes the file name unique will be used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+FULL_PATH_NAMES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
|
|
|
62f653 |
+# can be used to strip a user-defined part of the path. Stripping is
|
|
|
62f653 |
+# only done if one of the specified strings matches the left-hand part of
|
|
|
62f653 |
+# the path. The tag can be used to show relative paths in the file list.
|
|
|
62f653 |
+# If left blank the directory from which doxygen is run is used as the
|
|
|
62f653 |
+# path to strip.
|
|
|
62f653 |
+
|
|
|
62f653 |
+STRIP_FROM_PATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
|
|
|
62f653 |
+# the path mentioned in the documentation of a class, which tells
|
|
|
62f653 |
+# the reader which header file to include in order to use a class.
|
|
|
62f653 |
+# If left blank only the name of the header file containing the class
|
|
|
62f653 |
+# definition is used. Otherwise one should specify the include paths that
|
|
|
62f653 |
+# are normally passed to the compiler using the -I flag.
|
|
|
62f653 |
+
|
|
|
62f653 |
+STRIP_FROM_INC_PATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
|
|
|
62f653 |
+# (but less readable) file names. This can be useful is your file systems
|
|
|
62f653 |
+# doesn't support long names like on DOS, Mac, or CD-ROM.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SHORT_NAMES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
|
|
|
62f653 |
+# will interpret the first line (until the first dot) of a JavaDoc-style
|
|
|
62f653 |
+# comment as the brief description. If set to NO, the JavaDoc
|
|
|
62f653 |
+# comments will behave just like regular Qt-style comments
|
|
|
62f653 |
+# (thus requiring an explicit @brief command for a brief description.)
|
|
|
62f653 |
+
|
|
|
62f653 |
+JAVADOC_AUTOBRIEF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
|
|
|
62f653 |
+# interpret the first line (until the first dot) of a Qt-style
|
|
|
62f653 |
+# comment as the brief description. If set to NO, the comments
|
|
|
62f653 |
+# will behave just like regular Qt-style comments (thus requiring
|
|
|
62f653 |
+# an explicit \brief command for a brief description.)
|
|
|
62f653 |
+
|
|
|
62f653 |
+QT_AUTOBRIEF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
|
|
|
62f653 |
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
|
|
|
62f653 |
+# comments) as a brief description. This used to be the default behaviour.
|
|
|
62f653 |
+# The new default is to treat a multi-line C++ comment block as a detailed
|
|
|
62f653 |
+# description. Set this tag to YES if you prefer the old behaviour instead.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MULTILINE_CPP_IS_BRIEF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
|
|
|
62f653 |
+# member inherits the documentation from any documented member that it
|
|
|
62f653 |
+# re-implements.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INHERIT_DOCS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
|
|
|
62f653 |
+# a new page for each member. If set to NO, the documentation of a member will
|
|
|
62f653 |
+# be part of the file/class/namespace that contains it.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SEPARATE_MEMBER_PAGES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
|
|
|
62f653 |
+# Doxygen uses this value to replace tabs by spaces in code fragments.
|
|
|
62f653 |
+
|
|
|
62f653 |
+TAB_SIZE = 8
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This tag can be used to specify a number of aliases that acts
|
|
|
62f653 |
+# as commands in the documentation. An alias has the form "name=value".
|
|
|
62f653 |
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
|
|
|
62f653 |
+# put the command \sideeffect (or @sideeffect) in the documentation, which
|
|
|
62f653 |
+# will result in a user-defined paragraph with heading "Side Effects:".
|
|
|
62f653 |
+# You can put \n's in the value part of an alias to insert newlines.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ALIASES =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
|
|
|
62f653 |
+# sources only. Doxygen will then generate output that is more tailored for C.
|
|
|
62f653 |
+# For instance, some of the names that are used will be different. The list
|
|
|
62f653 |
+# of all members will be omitted, etc.
|
|
|
62f653 |
+
|
|
|
62f653 |
+OPTIMIZE_OUTPUT_FOR_C = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
|
|
|
62f653 |
+# sources only. Doxygen will then generate output that is more tailored for
|
|
|
62f653 |
+# Java. For instance, namespaces will be presented as packages, qualified
|
|
|
62f653 |
+# scopes will look different, etc.
|
|
|
62f653 |
+
|
|
|
62f653 |
+OPTIMIZE_OUTPUT_JAVA = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
|
|
|
62f653 |
+# sources only. Doxygen will then generate output that is more tailored for
|
|
|
62f653 |
+# Fortran.
|
|
|
62f653 |
+
|
|
|
62f653 |
+OPTIMIZE_FOR_FORTRAN = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
|
|
|
62f653 |
+# sources. Doxygen will then generate output that is tailored for
|
|
|
62f653 |
+# VHDL.
|
|
|
62f653 |
+
|
|
|
62f653 |
+OPTIMIZE_OUTPUT_VHDL = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
|
|
|
62f653 |
+# to include (a tag file for) the STL sources as input, then you should
|
|
|
62f653 |
+# set this tag to YES in order to let doxygen match functions declarations and
|
|
|
62f653 |
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
|
|
|
62f653 |
+# func(std::string) {}). This also make the inheritance and collaboration
|
|
|
62f653 |
+# diagrams that involve STL classes more complete and accurate.
|
|
|
62f653 |
+
|
|
|
62f653 |
+BUILTIN_STL_SUPPORT = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
|
|
|
62f653 |
+# enable parsing support.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CPP_CLI_SUPPORT = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
|
|
|
62f653 |
+# Doxygen will parse them like normal C++ but will assume all classes use public
|
|
|
62f653 |
+# instead of private inheritance when no explicit protection keyword is present.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SIP_SUPPORT = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
|
|
|
62f653 |
+# and setter methods for a property. Setting this option to YES (the default)
|
|
|
62f653 |
+# will make doxygen to replace the get and set methods by a property in the
|
|
|
62f653 |
+# documentation. This will only work if the methods are indeed getting or
|
|
|
62f653 |
+# setting a simple type. If this is not the case, or you want to show the
|
|
|
62f653 |
+# methods anyway, you should set this option to NO.
|
|
|
62f653 |
+
|
|
|
62f653 |
+IDL_PROPERTY_SUPPORT = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
|
|
|
62f653 |
+# tag is set to YES, then doxygen will reuse the documentation of the first
|
|
|
62f653 |
+# member in the group (if any) for the other members of the group. By default
|
|
|
62f653 |
+# all members of a group must be documented explicitly.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DISTRIBUTE_GROUP_DOC = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
|
|
|
62f653 |
+# the same type (for instance a group of public functions) to be put as a
|
|
|
62f653 |
+# subgroup of that type (e.g. under the Public Functions section). Set it to
|
|
|
62f653 |
+# NO to prevent subgrouping. Alternatively, this can be done per class using
|
|
|
62f653 |
+# the \nosubgrouping command.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SUBGROUPING = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
|
|
|
62f653 |
+# is documented as struct, union, or enum with the name of the typedef. So
|
|
|
62f653 |
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
|
|
|
62f653 |
+# with name TypeT. When disabled the typedef will appear as a member of a file,
|
|
|
62f653 |
+# namespace, or class. And the struct will be named TypeS. This can typically
|
|
|
62f653 |
+# be useful for C code in case the coding convention dictates that all compound
|
|
|
62f653 |
+# types are typedef'ed and only the typedef is referenced, never the tag name.
|
|
|
62f653 |
+
|
|
|
62f653 |
+TYPEDEF_HIDES_STRUCT = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
|
|
|
62f653 |
+# determine which symbols to keep in memory and which to flush to disk.
|
|
|
62f653 |
+# When the cache is full, less often used symbols will be written to disk.
|
|
|
62f653 |
+# For small to medium size projects (<1000 input files) the default value is
|
|
|
62f653 |
+# probably good enough. For larger projects a too small cache size can cause
|
|
|
62f653 |
+# doxygen to be busy swapping symbols to and from disk most of the time
|
|
|
62f653 |
+# causing a significant performance penality.
|
|
|
62f653 |
+# If the system has enough physical memory increasing the cache will improve the
|
|
|
62f653 |
+# performance by keeping more symbols in memory. Note that the value works on
|
|
|
62f653 |
+# a logarithmic scale so increasing the size by one will rougly double the
|
|
|
62f653 |
+# memory usage. The cache size is given by this formula:
|
|
|
62f653 |
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
|
|
|
62f653 |
+# corresponding to a cache size of 2^16 = 65536 symbols
|
|
|
62f653 |
+
|
|
|
62f653 |
+SYMBOL_CACHE_SIZE = 0
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# Build related configuration options
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
|
|
|
62f653 |
+# documentation are documented, even if no documentation was available.
|
|
|
62f653 |
+# Private class members and static file members will be hidden unless
|
|
|
62f653 |
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTRACT_ALL = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
|
|
|
62f653 |
+# will be included in the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTRACT_PRIVATE = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
|
|
|
62f653 |
+# will be included in the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTRACT_STATIC = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
|
|
|
62f653 |
+# defined locally in source files will be included in the documentation.
|
|
|
62f653 |
+# If set to NO only classes defined in header files are included.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTRACT_LOCAL_CLASSES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This flag is only useful for Objective-C code. When set to YES local
|
|
|
62f653 |
+# methods, which are defined in the implementation section but not in
|
|
|
62f653 |
+# the interface are included in the documentation.
|
|
|
62f653 |
+# If set to NO (the default) only methods in the interface are included.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTRACT_LOCAL_METHODS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If this flag is set to YES, the members of anonymous namespaces will be
|
|
|
62f653 |
+# extracted and appear in the documentation as a namespace called
|
|
|
62f653 |
+# 'anonymous_namespace{file}', where file will be replaced with the base
|
|
|
62f653 |
+# name of the file that contains the anonymous namespace. By default
|
|
|
62f653 |
+# anonymous namespace are hidden.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTRACT_ANON_NSPACES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
|
|
|
62f653 |
+# undocumented members of documented classes, files or namespaces.
|
|
|
62f653 |
+# If set to NO (the default) these members will be included in the
|
|
|
62f653 |
+# various overviews, but no documentation section is generated.
|
|
|
62f653 |
+# This option has no effect if EXTRACT_ALL is enabled.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HIDE_UNDOC_MEMBERS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
|
|
|
62f653 |
+# undocumented classes that are normally visible in the class hierarchy.
|
|
|
62f653 |
+# If set to NO (the default) these classes will be included in the various
|
|
|
62f653 |
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HIDE_UNDOC_CLASSES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
|
|
|
62f653 |
+# friend (class|struct|union) declarations.
|
|
|
62f653 |
+# If set to NO (the default) these declarations will be included in the
|
|
|
62f653 |
+# documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HIDE_FRIEND_COMPOUNDS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
|
|
|
62f653 |
+# documentation blocks found inside the body of a function.
|
|
|
62f653 |
+# If set to NO (the default) these blocks will be appended to the
|
|
|
62f653 |
+# function's detailed documentation block.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HIDE_IN_BODY_DOCS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The INTERNAL_DOCS tag determines if documentation
|
|
|
62f653 |
+# that is typed after a \internal command is included. If the tag is set
|
|
|
62f653 |
+# to NO (the default) then the documentation will be excluded.
|
|
|
62f653 |
+# Set it to YES to include the internal documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INTERNAL_DOCS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
|
|
|
62f653 |
+# file names in lower-case letters. If set to YES upper-case letters are also
|
|
|
62f653 |
+# allowed. This is useful if you have classes or files whose names only differ
|
|
|
62f653 |
+# in case and if your file system supports case sensitive file names. Windows
|
|
|
62f653 |
+# and Mac users are advised to set this option to NO.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CASE_SENSE_NAMES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
|
|
|
62f653 |
+# will show members with their full class and namespace scopes in the
|
|
|
62f653 |
+# documentation. If set to YES the scope will be hidden.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HIDE_SCOPE_NAMES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
|
|
|
62f653 |
+# will put a list of the files that are included by a file in the documentation
|
|
|
62f653 |
+# of that file.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SHOW_INCLUDE_FILES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
|
|
|
62f653 |
+# is inserted in the documentation for inline members.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INLINE_INFO = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
|
|
|
62f653 |
+# will sort the (detailed) documentation of file and class members
|
|
|
62f653 |
+# alphabetically by member name. If set to NO the members will appear in
|
|
|
62f653 |
+# declaration order.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SORT_MEMBER_DOCS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
|
|
|
62f653 |
+# brief documentation of file, namespace and class members alphabetically
|
|
|
62f653 |
+# by member name. If set to NO (the default) the members will appear in
|
|
|
62f653 |
+# declaration order.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SORT_BRIEF_DOCS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
|
|
|
62f653 |
+# hierarchy of group names into alphabetical order. If set to NO (the default)
|
|
|
62f653 |
+# the group names will appear in their defined order.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SORT_GROUP_NAMES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
|
|
|
62f653 |
+# sorted by fully-qualified names, including namespaces. If set to
|
|
|
62f653 |
+# NO (the default), the class list will be sorted only by class name,
|
|
|
62f653 |
+# not including the namespace part.
|
|
|
62f653 |
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
|
|
|
62f653 |
+# Note: This option applies only to the class list, not to the
|
|
|
62f653 |
+# alphabetical list.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SORT_BY_SCOPE_NAME = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
|
|
|
62f653 |
+# disable (NO) the todo list. This list is created by putting \todo
|
|
|
62f653 |
+# commands in the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_TODOLIST = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
|
|
|
62f653 |
+# disable (NO) the test list. This list is created by putting \test
|
|
|
62f653 |
+# commands in the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_TESTLIST = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
|
|
|
62f653 |
+# disable (NO) the bug list. This list is created by putting \bug
|
|
|
62f653 |
+# commands in the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_BUGLIST = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
|
|
|
62f653 |
+# disable (NO) the deprecated list. This list is created by putting
|
|
|
62f653 |
+# \deprecated commands in the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_DEPRECATEDLIST= YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The ENABLED_SECTIONS tag can be used to enable conditional
|
|
|
62f653 |
+# documentation sections, marked by \if sectionname ... \endif.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ENABLED_SECTIONS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
|
|
|
62f653 |
+# the initial value of a variable or define consists of for it to appear in
|
|
|
62f653 |
+# the documentation. If the initializer consists of more lines than specified
|
|
|
62f653 |
+# here it will be hidden. Use a value of 0 to hide initializers completely.
|
|
|
62f653 |
+# The appearance of the initializer of individual variables and defines in the
|
|
|
62f653 |
+# documentation can be controlled using \showinitializer or \hideinitializer
|
|
|
62f653 |
+# command in the documentation regardless of this setting.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MAX_INITIALIZER_LINES = 30
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
|
|
|
62f653 |
+# at the bottom of the documentation of classes and structs. If set to YES the
|
|
|
62f653 |
+# list will mention the files that were used to generate the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SHOW_USED_FILES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the sources in your project are distributed over multiple directories
|
|
|
62f653 |
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
|
|
|
62f653 |
+# in the documentation. The default is NO.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SHOW_DIRECTORIES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
|
|
|
62f653 |
+# This will remove the Files entry from the Quick Index and from the
|
|
|
62f653 |
+# Folder Tree View (if specified). The default is YES.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SHOW_FILES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
|
|
|
62f653 |
+# Namespaces page. This will remove the Namespaces entry from the Quick Index
|
|
|
62f653 |
+# and from the Folder Tree View (if specified). The default is YES.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SHOW_NAMESPACES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
|
|
|
62f653 |
+# doxygen should invoke to get the current version for each file (typically from
|
|
|
62f653 |
+# the version control system). Doxygen will invoke the program by executing (via
|
|
|
62f653 |
+# popen()) the command <command> <input-file>, where <command> is the value of
|
|
|
62f653 |
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
|
|
|
62f653 |
+# provided by doxygen. Whatever the program writes to standard output
|
|
|
62f653 |
+# is used as the file version. See the manual for examples.
|
|
|
62f653 |
+
|
|
|
62f653 |
+FILE_VERSION_FILTER =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
|
|
|
62f653 |
+# doxygen. The layout file controls the global structure of the generated output files
|
|
|
62f653 |
+# in an output format independent way. The create the layout file that represents
|
|
|
62f653 |
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
|
|
|
62f653 |
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
|
|
|
62f653 |
+# of the layout file.
|
|
|
62f653 |
+
|
|
|
62f653 |
+LAYOUT_FILE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to warning and progress messages
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The QUIET tag can be used to turn on/off the messages that are generated
|
|
|
62f653 |
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+QUIET = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The WARNINGS tag can be used to turn on/off the warning messages that are
|
|
|
62f653 |
+# generated by doxygen. Possible values are YES and NO. If left blank
|
|
|
62f653 |
+# NO is used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+WARNINGS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
|
|
|
62f653 |
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
|
|
|
62f653 |
+# automatically be disabled.
|
|
|
62f653 |
+
|
|
|
62f653 |
+WARN_IF_UNDOCUMENTED = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
|
|
|
62f653 |
+# potential errors in the documentation, such as not documenting some
|
|
|
62f653 |
+# parameters in a documented function, or documenting parameters that
|
|
|
62f653 |
+# don't exist or using markup commands wrongly.
|
|
|
62f653 |
+
|
|
|
62f653 |
+WARN_IF_DOC_ERROR = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
|
|
|
62f653 |
+# functions that are documented, but have no documentation for their parameters
|
|
|
62f653 |
+# or return value. If set to NO (the default) doxygen will only warn about
|
|
|
62f653 |
+# wrong or incomplete parameter documentation, but not about the absence of
|
|
|
62f653 |
+# documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+WARN_NO_PARAMDOC = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The WARN_FORMAT tag determines the format of the warning messages that
|
|
|
62f653 |
+# doxygen can produce. The string should contain the $file, $line, and $text
|
|
|
62f653 |
+# tags, which will be replaced by the file and line number from which the
|
|
|
62f653 |
+# warning originated and the warning text. Optionally the format may contain
|
|
|
62f653 |
+# $version, which will be replaced by the version of the file (if it could
|
|
|
62f653 |
+# be obtained via FILE_VERSION_FILTER)
|
|
|
62f653 |
+
|
|
|
62f653 |
+WARN_FORMAT = "$file:$line: $text"
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The WARN_LOGFILE tag can be used to specify a file to which warning
|
|
|
62f653 |
+# and error messages should be written. If left blank the output is written
|
|
|
62f653 |
+# to stderr.
|
|
|
62f653 |
+
|
|
|
62f653 |
+WARN_LOGFILE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the input files
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The INPUT tag can be used to specify the files and/or directories that contain
|
|
|
62f653 |
+# documented source files. You may enter file names like "myfile.cpp" or
|
|
|
62f653 |
+# directories like "/usr/src/myproject". Separate the files or directories
|
|
|
62f653 |
+# with spaces.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INPUT =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This tag can be used to specify the character encoding of the source files
|
|
|
62f653 |
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
|
|
|
62f653 |
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
|
|
|
62f653 |
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
|
|
|
62f653 |
+# the list of possible encodings.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INPUT_ENCODING = UTF-8
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the value of the INPUT tag contains directories, you can use the
|
|
|
62f653 |
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
|
|
62f653 |
+# and *.h) to filter out the source-files in the directories. If left
|
|
|
62f653 |
+# blank the following patterns are tested:
|
|
|
62f653 |
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
|
|
|
62f653 |
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
|
|
|
62f653 |
+
|
|
|
62f653 |
+FILE_PATTERNS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
|
|
|
62f653 |
+# should be searched for input files as well. Possible values are YES and NO.
|
|
|
62f653 |
+# If left blank NO is used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+RECURSIVE = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The EXCLUDE tag can be used to specify files and/or directories that should
|
|
|
62f653 |
+# excluded from the INPUT source files. This way you can easily exclude a
|
|
|
62f653 |
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXCLUDE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
|
|
|
62f653 |
+# directories that are symbolic links (a Unix filesystem feature) are excluded
|
|
|
62f653 |
+# from the input.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXCLUDE_SYMLINKS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the value of the INPUT tag contains directories, you can use the
|
|
|
62f653 |
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
|
|
|
62f653 |
+# certain files from those directories. Note that the wildcards are matched
|
|
|
62f653 |
+# against the file with absolute path, so to exclude all test directories
|
|
|
62f653 |
+# for example use the pattern */test/*
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXCLUDE_PATTERNS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
|
|
|
62f653 |
+# (namespaces, classes, functions, etc.) that should be excluded from the
|
|
|
62f653 |
+# output. The symbol name can be a fully qualified name, a word, or if the
|
|
|
62f653 |
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
|
|
|
62f653 |
+# AClass::ANamespace, ANamespace::*Test
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXCLUDE_SYMBOLS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The EXAMPLE_PATH tag can be used to specify one or more files or
|
|
|
62f653 |
+# directories that contain example code fragments that are included (see
|
|
|
62f653 |
+# the \include command).
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXAMPLE_PATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
|
|
|
62f653 |
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
|
|
62f653 |
+# and *.h) to filter out the source-files in the directories. If left
|
|
|
62f653 |
+# blank all files are included.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXAMPLE_PATTERNS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
|
|
|
62f653 |
+# searched for input files to be used with the \include or \dontinclude
|
|
|
62f653 |
+# commands irrespective of the value of the RECURSIVE tag.
|
|
|
62f653 |
+# Possible values are YES and NO. If left blank NO is used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXAMPLE_RECURSIVE = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The IMAGE_PATH tag can be used to specify one or more files or
|
|
|
62f653 |
+# directories that contain image that are included in the documentation (see
|
|
|
62f653 |
+# the \image command).
|
|
|
62f653 |
+
|
|
|
62f653 |
+IMAGE_PATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
|
|
62f653 |
+# invoke to filter for each input file. Doxygen will invoke the filter program
|
|
|
62f653 |
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
|
|
|
62f653 |
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
|
|
|
62f653 |
+# input file. Doxygen will then use the output that the filter program writes
|
|
|
62f653 |
+# to standard output. If FILTER_PATTERNS is specified, this tag will be
|
|
|
62f653 |
+# ignored.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INPUT_FILTER =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
|
|
|
62f653 |
+# basis. Doxygen will compare the file name with each pattern and apply the
|
|
|
62f653 |
+# filter if there is a match. The filters are a list of the form:
|
|
|
62f653 |
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
|
|
|
62f653 |
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
|
|
|
62f653 |
+# is applied to all files.
|
|
|
62f653 |
+
|
|
|
62f653 |
+FILTER_PATTERNS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
|
|
|
62f653 |
+# INPUT_FILTER) will be used to filter the input files when producing source
|
|
|
62f653 |
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
|
|
|
62f653 |
+
|
|
|
62f653 |
+FILTER_SOURCE_FILES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to source browsing
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
|
|
|
62f653 |
+# be generated. Documented entities will be cross-referenced with these sources.
|
|
|
62f653 |
+# Note: To get rid of all source code in the generated output, make sure also
|
|
|
62f653 |
+# VERBATIM_HEADERS is set to NO.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SOURCE_BROWSER = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Setting the INLINE_SOURCES tag to YES will include the body
|
|
|
62f653 |
+# of functions and classes directly in the documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INLINE_SOURCES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
|
|
|
62f653 |
+# doxygen to hide any special comment blocks from generated source code
|
|
|
62f653 |
+# fragments. Normal C and C++ comments will always remain visible.
|
|
|
62f653 |
+
|
|
|
62f653 |
+STRIP_CODE_COMMENTS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the REFERENCED_BY_RELATION tag is set to YES
|
|
|
62f653 |
+# then for each documented function all documented
|
|
|
62f653 |
+# functions referencing it will be listed.
|
|
|
62f653 |
+
|
|
|
62f653 |
+REFERENCED_BY_RELATION = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the REFERENCES_RELATION tag is set to YES
|
|
|
62f653 |
+# then for each documented function all documented entities
|
|
|
62f653 |
+# called/used by that function will be listed.
|
|
|
62f653 |
+
|
|
|
62f653 |
+REFERENCES_RELATION = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
|
|
|
62f653 |
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
|
|
|
62f653 |
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
|
|
|
62f653 |
+# link to the source code. Otherwise they will link to the documentstion.
|
|
|
62f653 |
+
|
|
|
62f653 |
+REFERENCES_LINK_SOURCE = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the USE_HTAGS tag is set to YES then the references to source code
|
|
|
62f653 |
+# will point to the HTML generated by the htags(1) tool instead of doxygen
|
|
|
62f653 |
+# built-in source browser. The htags tool is part of GNU's global source
|
|
|
62f653 |
+# tagging system (see http://www.gnu.org/software/global/global.html). You
|
|
|
62f653 |
+# will need version 4.8.6 or higher.
|
|
|
62f653 |
+
|
|
|
62f653 |
+USE_HTAGS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
|
|
|
62f653 |
+# will generate a verbatim copy of the header file for each class for
|
|
|
62f653 |
+# which an include is specified. Set to NO to disable this.
|
|
|
62f653 |
+
|
|
|
62f653 |
+VERBATIM_HEADERS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the alphabetical class index
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
|
|
|
62f653 |
+# of all compounds will be generated. Enable this if the project
|
|
|
62f653 |
+# contains a lot of classes, structs, unions or interfaces.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ALPHABETICAL_INDEX = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
|
|
|
62f653 |
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
|
|
|
62f653 |
+# in which this list will be split (can be a number in the range [1..20])
|
|
|
62f653 |
+
|
|
|
62f653 |
+COLS_IN_ALPHA_INDEX = 5
|
|
|
62f653 |
+
|
|
|
62f653 |
+# In case all classes in a project start with a common prefix, all
|
|
|
62f653 |
+# classes will be put under the same header in the alphabetical index.
|
|
|
62f653 |
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
|
|
|
62f653 |
+# should be ignored while generating the index headers.
|
|
|
62f653 |
+
|
|
|
62f653 |
+IGNORE_PREFIX =
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the HTML output
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# generate HTML output.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_HTML = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
|
|
|
62f653 |
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
|
|
62f653 |
+# put in front of it. If left blank `html' will be used as the default path.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HTML_OUTPUT = html
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
|
|
|
62f653 |
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
|
|
|
62f653 |
+# doxygen will generate files with .html extension.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HTML_FILE_EXTENSION = .html
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The HTML_HEADER tag can be used to specify a personal HTML header for
|
|
|
62f653 |
+# each generated HTML page. If it is left blank doxygen will generate a
|
|
|
62f653 |
+# standard header.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HTML_HEADER =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
|
|
|
62f653 |
+# each generated HTML page. If it is left blank doxygen will generate a
|
|
|
62f653 |
+# standard footer.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HTML_FOOTER = no_date_footer.html
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
|
|
|
62f653 |
+# style sheet that is used by each HTML page. It can be used to
|
|
|
62f653 |
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
|
|
|
62f653 |
+# will generate a default style sheet. Note that doxygen will try to copy
|
|
|
62f653 |
+# the style sheet file to the HTML output directory, so don't put your own
|
|
|
62f653 |
+# stylesheet in the HTML output directory as well, or it will be erased!
|
|
|
62f653 |
+
|
|
|
62f653 |
+HTML_STYLESHEET =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
|
|
|
62f653 |
+# files or namespaces will be aligned in HTML using tables. If set to
|
|
|
62f653 |
+# NO a bullet list will be used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HTML_ALIGN_MEMBERS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
|
|
|
62f653 |
+# documentation will contain sections that can be hidden and shown after the
|
|
|
62f653 |
+# page has loaded. For this to work a browser that supports
|
|
|
62f653 |
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
|
|
|
62f653 |
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
|
|
|
62f653 |
+
|
|
|
62f653 |
+HTML_DYNAMIC_SECTIONS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_DOCSET tag is set to YES, additional index files
|
|
|
62f653 |
+# will be generated that can be used as input for Apple's Xcode 3
|
|
|
62f653 |
+# integrated development environment, introduced with OSX 10.5 (Leopard).
|
|
|
62f653 |
+# To create a documentation set, doxygen will generate a Makefile in the
|
|
|
62f653 |
+# HTML output directory. Running make will produce the docset in that
|
|
|
62f653 |
+# directory and running "make install" will install the docset in
|
|
|
62f653 |
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
|
|
|
62f653 |
+# it at startup.
|
|
|
62f653 |
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_DOCSET = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
|
|
|
62f653 |
+# feed. A documentation feed provides an umbrella under which multiple
|
|
|
62f653 |
+# documentation sets from a single provider (such as a company or product suite)
|
|
|
62f653 |
+# can be grouped.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOCSET_FEEDNAME = "Doxygen generated docs"
|
|
|
62f653 |
+
|
|
|
62f653 |
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
|
|
|
62f653 |
+# should uniquely identify the documentation set bundle. This should be a
|
|
|
62f653 |
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
|
|
|
62f653 |
+# will append .docset to the name.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOCSET_BUNDLE_ID = org.doxygen.Project
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
|
|
|
62f653 |
+# will be generated that can be used as input for tools like the
|
|
|
62f653 |
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
|
|
|
62f653 |
+# of the generated HTML documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_HTMLHELP = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
|
|
|
62f653 |
+# be used to specify the file name of the resulting .chm file. You
|
|
|
62f653 |
+# can add a path in front of the file if the result should not be
|
|
|
62f653 |
+# written to the html output directory.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CHM_FILE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
|
|
|
62f653 |
+# be used to specify the location (absolute path including file name) of
|
|
|
62f653 |
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
|
|
|
62f653 |
+# the HTML help compiler on the generated index.hhp.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HHC_LOCATION =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
|
|
|
62f653 |
+# controls if a separate .chi index file is generated (YES) or that
|
|
|
62f653 |
+# it should be included in the master .chm file (NO).
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_CHI = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
|
|
|
62f653 |
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
|
|
|
62f653 |
+# content.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CHM_INDEX_ENCODING =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
|
|
|
62f653 |
+# controls whether a binary table of contents is generated (YES) or a
|
|
|
62f653 |
+# normal table of contents (NO) in the .chm file.
|
|
|
62f653 |
+
|
|
|
62f653 |
+BINARY_TOC = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
|
|
|
62f653 |
+# to the contents of the HTML help documentation and to the tree view.
|
|
|
62f653 |
+
|
|
|
62f653 |
+TOC_EXPAND = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
|
|
|
62f653 |
+# are set, an additional index file will be generated that can be used as input for
|
|
|
62f653 |
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
|
|
|
62f653 |
+# HTML documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_QHP = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
|
|
|
62f653 |
+# be used to specify the file name of the resulting .qch file.
|
|
|
62f653 |
+# The path specified is relative to the HTML output folder.
|
|
|
62f653 |
+
|
|
|
62f653 |
+QCH_FILE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
|
|
|
62f653 |
+# Qt Help Project output. For more information please see
|
|
|
62f653 |
+# Qt Help Project / Namespace.
|
|
|
62f653 |
+
|
|
|
62f653 |
+QHP_NAMESPACE = org.doxygen.Project
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
|
|
|
62f653 |
+# Qt Help Project output. For more information please see
|
|
|
62f653 |
+# Qt Help Project / Virtual Folders.
|
|
|
62f653 |
+
|
|
|
62f653 |
+QHP_VIRTUAL_FOLDER = doc
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
|
|
|
62f653 |
+# be used to specify the location of Qt's qhelpgenerator.
|
|
|
62f653 |
+# If non-empty doxygen will try to run qhelpgenerator on the generated
|
|
|
62f653 |
+# .qhp file .
|
|
|
62f653 |
+
|
|
|
62f653 |
+QHG_LOCATION =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
|
|
|
62f653 |
+# top of each HTML page. The value NO (the default) enables the index and
|
|
|
62f653 |
+# the value YES disables it.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DISABLE_INDEX = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# This tag can be used to set the number of enum values (range [1..20])
|
|
|
62f653 |
+# that doxygen will group on one line in the generated HTML documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ENUM_VALUES_PER_LINE = 4
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
|
|
|
62f653 |
+# structure should be generated to display hierarchical information.
|
|
|
62f653 |
+# If the tag value is set to FRAME, a side panel will be generated
|
|
|
62f653 |
+# containing a tree-like index structure (just like the one that
|
|
|
62f653 |
+# is generated for HTML Help). For this to work a browser that supports
|
|
|
62f653 |
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+,
|
|
|
62f653 |
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are
|
|
|
62f653 |
+# probably better off using the HTML help feature. Other possible values
|
|
|
62f653 |
+# for this tag are: HIERARCHIES, which will generate the Groups, Directories,
|
|
|
62f653 |
+# and Class Hierarchy pages using a tree view instead of an ordered list;
|
|
|
62f653 |
+# ALL, which combines the behavior of FRAME and HIERARCHIES; and NONE, which
|
|
|
62f653 |
+# disables this behavior completely. For backwards compatibility with previous
|
|
|
62f653 |
+# releases of Doxygen, the values YES and NO are equivalent to FRAME and NONE
|
|
|
62f653 |
+# respectively.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_TREEVIEW = NONE
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
|
|
|
62f653 |
+# used to set the initial width (in pixels) of the frame in which the tree
|
|
|
62f653 |
+# is shown.
|
|
|
62f653 |
+
|
|
|
62f653 |
+TREEVIEW_WIDTH = 250
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Use this tag to change the font size of Latex formulas included
|
|
|
62f653 |
+# as images in the HTML documentation. The default is 10. Note that
|
|
|
62f653 |
+# when you change the font size after a successful doxygen run you need
|
|
|
62f653 |
+# to manually remove any form_*.png images from the HTML output directory
|
|
|
62f653 |
+# to force them to be regenerated.
|
|
|
62f653 |
+
|
|
|
62f653 |
+FORMULA_FONTSIZE = 10
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the LaTeX output
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# generate Latex output.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_LATEX = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
|
|
|
62f653 |
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
|
|
62f653 |
+# put in front of it. If left blank `latex' will be used as the default path.
|
|
|
62f653 |
+
|
|
|
62f653 |
+LATEX_OUTPUT = latex
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
|
|
|
62f653 |
+# invoked. If left blank `latex' will be used as the default command name.
|
|
|
62f653 |
+
|
|
|
62f653 |
+LATEX_CMD_NAME = latex
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
|
|
|
62f653 |
+# generate index for LaTeX. If left blank `makeindex' will be used as the
|
|
|
62f653 |
+# default command name.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MAKEINDEX_CMD_NAME = makeindex
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
|
|
|
62f653 |
+# LaTeX documents. This may be useful for small projects and may help to
|
|
|
62f653 |
+# save some trees in general.
|
|
|
62f653 |
+
|
|
|
62f653 |
+COMPACT_LATEX = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The PAPER_TYPE tag can be used to set the paper type that is used
|
|
|
62f653 |
+# by the printer. Possible values are: a4, a4wide, letter, legal and
|
|
|
62f653 |
+# executive. If left blank a4wide will be used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PAPER_TYPE = a4wide
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
|
|
|
62f653 |
+# packages that should be included in the LaTeX output.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTRA_PACKAGES =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
|
|
|
62f653 |
+# the generated latex document. The header should contain everything until
|
|
|
62f653 |
+# the first chapter. If it is left blank doxygen will generate a
|
|
|
62f653 |
+# standard header. Notice: only use this tag if you know what you are doing!
|
|
|
62f653 |
+
|
|
|
62f653 |
+LATEX_HEADER =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
|
|
|
62f653 |
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
|
|
|
62f653 |
+# contain links (just like the HTML output) instead of page references
|
|
|
62f653 |
+# This makes the output suitable for online browsing using a pdf viewer.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PDF_HYPERLINKS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
|
|
|
62f653 |
+# plain latex in the generated Makefile. Set this option to YES to get a
|
|
|
62f653 |
+# higher quality PDF documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+USE_PDFLATEX = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
|
|
|
62f653 |
+# command to the generated LaTeX files. This will instruct LaTeX to keep
|
|
|
62f653 |
+# running if errors occur, instead of asking the user for help.
|
|
|
62f653 |
+# This option is also used when generating formulas in HTML.
|
|
|
62f653 |
+
|
|
|
62f653 |
+LATEX_BATCHMODE = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
|
|
|
62f653 |
+# include the index chapters (such as File Index, Compound Index, etc.)
|
|
|
62f653 |
+# in the output.
|
|
|
62f653 |
+
|
|
|
62f653 |
+LATEX_HIDE_INDICES = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the RTF output
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
|
|
|
62f653 |
+# The RTF output is optimized for Word 97 and may not look very pretty with
|
|
|
62f653 |
+# other RTF readers or editors.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_RTF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
|
|
|
62f653 |
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
|
|
62f653 |
+# put in front of it. If left blank `rtf' will be used as the default path.
|
|
|
62f653 |
+
|
|
|
62f653 |
+RTF_OUTPUT = rtf
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
|
|
|
62f653 |
+# RTF documents. This may be useful for small projects and may help to
|
|
|
62f653 |
+# save some trees in general.
|
|
|
62f653 |
+
|
|
|
62f653 |
+COMPACT_RTF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
|
|
|
62f653 |
+# will contain hyperlink fields. The RTF file will
|
|
|
62f653 |
+# contain links (just like the HTML output) instead of page references.
|
|
|
62f653 |
+# This makes the output suitable for online browsing using WORD or other
|
|
|
62f653 |
+# programs which support those fields.
|
|
|
62f653 |
+# Note: wordpad (write) and others do not support links.
|
|
|
62f653 |
+
|
|
|
62f653 |
+RTF_HYPERLINKS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
|
|
|
62f653 |
+# config file, i.e. a series of assignments. You only have to provide
|
|
|
62f653 |
+# replacements, missing definitions are set to their default value.
|
|
|
62f653 |
+
|
|
|
62f653 |
+RTF_STYLESHEET_FILE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set optional variables used in the generation of an rtf document.
|
|
|
62f653 |
+# Syntax is similar to doxygen's config file.
|
|
|
62f653 |
+
|
|
|
62f653 |
+RTF_EXTENSIONS_FILE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the man page output
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# generate man pages
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_MAN = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
|
|
|
62f653 |
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
|
|
62f653 |
+# put in front of it. If left blank `man' will be used as the default path.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MAN_OUTPUT = man
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The MAN_EXTENSION tag determines the extension that is added to
|
|
|
62f653 |
+# the generated man pages (default is the subroutine's section .3)
|
|
|
62f653 |
+
|
|
|
62f653 |
+MAN_EXTENSION = .3
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
|
|
|
62f653 |
+# then it will generate one additional man file for each entity
|
|
|
62f653 |
+# documented in the real man page(s). These additional files
|
|
|
62f653 |
+# only source the real man page, but without them the man command
|
|
|
62f653 |
+# would be unable to find the correct page. The default is NO.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MAN_LINKS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the XML output
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_XML tag is set to YES Doxygen will
|
|
|
62f653 |
+# generate an XML file that captures the structure of
|
|
|
62f653 |
+# the code including all documentation.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_XML = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
|
|
|
62f653 |
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
|
|
|
62f653 |
+# put in front of it. If left blank `xml' will be used as the default path.
|
|
|
62f653 |
+
|
|
|
62f653 |
+XML_OUTPUT = xml
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The XML_SCHEMA tag can be used to specify an XML schema,
|
|
|
62f653 |
+# which can be used by a validating XML parser to check the
|
|
|
62f653 |
+# syntax of the XML files.
|
|
|
62f653 |
+
|
|
|
62f653 |
+XML_SCHEMA =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The XML_DTD tag can be used to specify an XML DTD,
|
|
|
62f653 |
+# which can be used by a validating XML parser to check the
|
|
|
62f653 |
+# syntax of the XML files.
|
|
|
62f653 |
+
|
|
|
62f653 |
+XML_DTD =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
|
|
|
62f653 |
+# dump the program listings (including syntax highlighting
|
|
|
62f653 |
+# and cross-referencing information) to the XML output. Note that
|
|
|
62f653 |
+# enabling this will significantly increase the size of the XML output.
|
|
|
62f653 |
+
|
|
|
62f653 |
+XML_PROGRAMLISTING = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options for the AutoGen Definitions output
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
|
|
|
62f653 |
+# generate an AutoGen Definitions (see autogen.sf.net) file
|
|
|
62f653 |
+# that captures the structure of the code including all
|
|
|
62f653 |
+# documentation. Note that this feature is still experimental
|
|
|
62f653 |
+# and incomplete at the moment.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_AUTOGEN_DEF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# configuration options related to the Perl module output
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
|
|
|
62f653 |
+# generate a Perl module file that captures the structure of
|
|
|
62f653 |
+# the code including all documentation. Note that this
|
|
|
62f653 |
+# feature is still experimental and incomplete at the
|
|
|
62f653 |
+# moment.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_PERLMOD = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
|
|
|
62f653 |
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
|
|
|
62f653 |
+# to generate PDF and DVI output from the Perl module output.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PERLMOD_LATEX = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
|
|
|
62f653 |
+# nicely formatted so it can be parsed by a human reader. This is useful
|
|
|
62f653 |
+# if you want to understand what is going on. On the other hand, if this
|
|
|
62f653 |
+# tag is set to NO the size of the Perl module output will be much smaller
|
|
|
62f653 |
+# and Perl will parse it just the same.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PERLMOD_PRETTY = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The names of the make variables in the generated doxyrules.make file
|
|
|
62f653 |
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
|
|
|
62f653 |
+# This is useful so different doxyrules.make files included by the same
|
|
|
62f653 |
+# Makefile don't overwrite each other's variables.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PERLMOD_MAKEVAR_PREFIX =
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# Configuration options related to the preprocessor
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# evaluate all C-preprocessor directives found in the sources and include
|
|
|
62f653 |
+# files.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ENABLE_PREPROCESSING = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
|
|
|
62f653 |
+# names in the source code. If set to NO (the default) only conditional
|
|
|
62f653 |
+# compilation will be performed. Macro expansion can be done in a controlled
|
|
|
62f653 |
+# way by setting EXPAND_ONLY_PREDEF to YES.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MACRO_EXPANSION = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
|
|
|
62f653 |
+# then the macro expansion is limited to the macros specified with the
|
|
|
62f653 |
+# PREDEFINED and EXPAND_AS_DEFINED tags.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXPAND_ONLY_PREDEF = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
|
|
|
62f653 |
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SEARCH_INCLUDES = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The INCLUDE_PATH tag can be used to specify one or more directories that
|
|
|
62f653 |
+# contain include files that are not input files but should be processed by
|
|
|
62f653 |
+# the preprocessor.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INCLUDE_PATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
|
|
|
62f653 |
+# patterns (like *.h and *.hpp) to filter out the header-files in the
|
|
|
62f653 |
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
|
|
|
62f653 |
+# be used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INCLUDE_FILE_PATTERNS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The PREDEFINED tag can be used to specify one or more macro names that
|
|
|
62f653 |
+# are defined before the preprocessor is started (similar to the -D option of
|
|
|
62f653 |
+# gcc). The argument of the tag is a list of macros of the form: name
|
|
|
62f653 |
+# or name=definition (no spaces). If the definition and the = are
|
|
|
62f653 |
+# omitted =1 is assumed. To prevent a macro definition from being
|
|
|
62f653 |
+# undefined via #undef or recursively expanded use the := operator
|
|
|
62f653 |
+# instead of the = operator.
|
|
|
62f653 |
+
|
|
|
62f653 |
+PREDEFINED =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
|
|
|
62f653 |
+# this tag can be used to specify a list of macro names that should be expanded.
|
|
|
62f653 |
+# The macro definition that is found in the sources will be used.
|
|
|
62f653 |
+# Use the PREDEFINED tag if you want to use a different macro definition.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXPAND_AS_DEFINED =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
|
|
|
62f653 |
+# doxygen's preprocessor will remove all function-like macros that are alone
|
|
|
62f653 |
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
|
|
|
62f653 |
+# function macros are typically used for boiler-plate code, and will confuse
|
|
|
62f653 |
+# the parser if not removed.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SKIP_FUNCTION_MACROS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# Configuration::additions related to external references
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The TAGFILES option can be used to specify one or more tagfiles.
|
|
|
62f653 |
+# Optionally an initial location of the external documentation
|
|
|
62f653 |
+# can be added for each tagfile. The format of a tag file without
|
|
|
62f653 |
+# this location is as follows:
|
|
|
62f653 |
+# TAGFILES = file1 file2 ...
|
|
|
62f653 |
+# Adding location for the tag files is done as follows:
|
|
|
62f653 |
+# TAGFILES = file1=loc1 "file2 = loc2" ...
|
|
|
62f653 |
+# where "loc1" and "loc2" can be relative or absolute paths or
|
|
|
62f653 |
+# URLs. If a location is present for each tag, the installdox tool
|
|
|
62f653 |
+# does not have to be run to correct the links.
|
|
|
62f653 |
+# Note that each tag file must have a unique name
|
|
|
62f653 |
+# (where the name does NOT include the path)
|
|
|
62f653 |
+# If a tag file is not located in the directory in which doxygen
|
|
|
62f653 |
+# is run, you must also specify the path to the tagfile here.
|
|
|
62f653 |
+
|
|
|
62f653 |
+TAGFILES =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
|
|
|
62f653 |
+# a tag file that is based on the input files it reads.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_TAGFILE =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
|
|
|
62f653 |
+# in the class index. If set to NO only the inherited external classes
|
|
|
62f653 |
+# will be listed.
|
|
|
62f653 |
+
|
|
|
62f653 |
+ALLEXTERNALS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
|
|
|
62f653 |
+# in the modules index. If set to NO, only the current project's groups will
|
|
|
62f653 |
+# be listed.
|
|
|
62f653 |
+
|
|
|
62f653 |
+EXTERNAL_GROUPS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The PERL_PATH should be the absolute path and name of the perl script
|
|
|
62f653 |
+# interpreter (i.e. the result of `which perl').
|
|
|
62f653 |
+
|
|
|
62f653 |
+PERL_PATH = /usr/bin/perl
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# Configuration options related to the dot tool
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
|
|
|
62f653 |
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
|
|
|
62f653 |
+# this option is superseded by the HAVE_DOT option below. This is only a
|
|
|
62f653 |
+# fallback. It is recommended to install and use dot, since it yields more
|
|
|
62f653 |
+# powerful graphs.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CLASS_DIAGRAMS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# You can define message sequence charts within doxygen comments using the \msc
|
|
|
62f653 |
+# command. Doxygen will then run the mscgen tool (see
|
|
|
62f653 |
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
|
|
|
62f653 |
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
|
|
|
62f653 |
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
|
|
|
62f653 |
+# default search path.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MSCGEN_PATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If set to YES, the inheritance and collaboration graphs will hide
|
|
|
62f653 |
+# inheritance and usage relations if the target is undocumented
|
|
|
62f653 |
+# or is not a class.
|
|
|
62f653 |
+
|
|
|
62f653 |
+HIDE_UNDOC_RELATIONS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
|
|
|
62f653 |
+# available from the path. This tool is part of Graphviz, a graph visualization
|
|
|
62f653 |
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
|
|
|
62f653 |
+# have no effect if this option is set to NO (the default)
|
|
|
62f653 |
+
|
|
|
62f653 |
+HAVE_DOT = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# By default doxygen will write a font called FreeSans.ttf to the output
|
|
|
62f653 |
+# directory and reference it in all dot files that doxygen generates. This
|
|
|
62f653 |
+# font does not include all possible unicode characters however, so when you need
|
|
|
62f653 |
+# these (or just want a differently looking font) you can specify the font name
|
|
|
62f653 |
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
|
|
|
62f653 |
+# which can be done by putting it in a standard location or by setting the
|
|
|
62f653 |
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
|
|
|
62f653 |
+# containing the font.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_FONTNAME = FreeSans
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
|
|
|
62f653 |
+# The default size is 10pt.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_FONTSIZE = 10
|
|
|
62f653 |
+
|
|
|
62f653 |
+# By default doxygen will tell dot to use the output directory to look for the
|
|
|
62f653 |
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
|
|
|
62f653 |
+# different font using DOT_FONTNAME you can set the path where dot
|
|
|
62f653 |
+# can find it using this tag.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_FONTPATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
|
|
62f653 |
+# will generate a graph for each documented class showing the direct and
|
|
|
62f653 |
+# indirect inheritance relations. Setting this tag to YES will force the
|
|
|
62f653 |
+# the CLASS_DIAGRAMS tag to NO.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CLASS_GRAPH = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
|
|
62f653 |
+# will generate a graph for each documented class showing the direct and
|
|
|
62f653 |
+# indirect implementation dependencies (inheritance, containment, and
|
|
|
62f653 |
+# class references variables) of the class with other documented classes.
|
|
|
62f653 |
+
|
|
|
62f653 |
+COLLABORATION_GRAPH = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
|
|
|
62f653 |
+# will generate a graph for groups, showing the direct groups dependencies
|
|
|
62f653 |
+
|
|
|
62f653 |
+GROUP_GRAPHS = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
|
|
|
62f653 |
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
|
|
|
62f653 |
+# Language.
|
|
|
62f653 |
+
|
|
|
62f653 |
+UML_LOOK = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If set to YES, the inheritance and collaboration graphs will show the
|
|
|
62f653 |
+# relations between templates and their instances.
|
|
|
62f653 |
+
|
|
|
62f653 |
+TEMPLATE_RELATIONS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
|
|
|
62f653 |
+# tags are set to YES then doxygen will generate a graph for each documented
|
|
|
62f653 |
+# file showing the direct and indirect include dependencies of the file with
|
|
|
62f653 |
+# other documented files.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INCLUDE_GRAPH = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
|
|
|
62f653 |
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
|
|
|
62f653 |
+# documented header file showing the documented files that directly or
|
|
|
62f653 |
+# indirectly include this file.
|
|
|
62f653 |
+
|
|
|
62f653 |
+INCLUDED_BY_GRAPH = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
|
|
|
62f653 |
+# doxygen will generate a call dependency graph for every global function
|
|
|
62f653 |
+# or class method. Note that enabling this option will significantly increase
|
|
|
62f653 |
+# the time of a run. So in most cases it will be better to enable call graphs
|
|
|
62f653 |
+# for selected functions only using the \callgraph command.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CALL_GRAPH = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
|
|
|
62f653 |
+# doxygen will generate a caller dependency graph for every global function
|
|
|
62f653 |
+# or class method. Note that enabling this option will significantly increase
|
|
|
62f653 |
+# the time of a run. So in most cases it will be better to enable caller
|
|
|
62f653 |
+# graphs for selected functions only using the \callergraph command.
|
|
|
62f653 |
+
|
|
|
62f653 |
+CALLER_GRAPH = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
|
|
|
62f653 |
+# will graphical hierarchy of all classes instead of a textual one.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GRAPHICAL_HIERARCHY = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
|
|
|
62f653 |
+# then doxygen will show the dependencies a directory has on other directories
|
|
|
62f653 |
+# in a graphical way. The dependency relations are determined by the #include
|
|
|
62f653 |
+# relations between the files in the directories.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DIRECTORY_GRAPH = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
|
|
|
62f653 |
+# generated by dot. Possible values are png, jpg, or gif
|
|
|
62f653 |
+# If left blank png will be used.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_IMAGE_FORMAT = png
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
|
|
|
62f653 |
+# found. If left blank, it is assumed the dot tool can be found in the path.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_PATH =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
|
|
|
62f653 |
+# contain dot files that are included in the documentation (see the
|
|
|
62f653 |
+# \dotfile command).
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOTFILE_DIRS =
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
|
|
|
62f653 |
+# nodes that will be shown in the graph. If the number of nodes in a graph
|
|
|
62f653 |
+# becomes larger than this value, doxygen will truncate the graph, which is
|
|
|
62f653 |
+# visualized by representing a node as a red box. Note that doxygen if the
|
|
|
62f653 |
+# number of direct children of the root node in a graph is already larger than
|
|
|
62f653 |
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
|
|
|
62f653 |
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_GRAPH_MAX_NODES = 50
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
|
|
|
62f653 |
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
|
|
|
62f653 |
+# from the root by following a path via at most 3 edges will be shown. Nodes
|
|
|
62f653 |
+# that lay further from the root node will be omitted. Note that setting this
|
|
|
62f653 |
+# option to 1 or 2 may greatly reduce the computation time needed for large
|
|
|
62f653 |
+# code bases. Also note that the size of a graph can be further restricted by
|
|
|
62f653 |
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
|
|
|
62f653 |
+
|
|
|
62f653 |
+MAX_DOT_GRAPH_DEPTH = 0
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
|
|
|
62f653 |
+# background. This is disabled by default, because dot on Windows does not
|
|
|
62f653 |
+# seem to support this out of the box. Warning: Depending on the platform used,
|
|
|
62f653 |
+# enabling this option may lead to badly anti-aliased labels on the edges of
|
|
|
62f653 |
+# a graph (i.e. they become hard to read).
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_TRANSPARENT = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
|
|
|
62f653 |
+# files in one run (i.e. multiple -o and -T options on the command line). This
|
|
|
62f653 |
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
|
|
|
62f653 |
+# support this, this feature is disabled by default.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_MULTI_TARGETS = NO
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# generate a legend page explaining the meaning of the various boxes and
|
|
|
62f653 |
+# arrows in the dot generated graphs.
|
|
|
62f653 |
+
|
|
|
62f653 |
+GENERATE_LEGEND = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
|
|
|
62f653 |
+# remove the intermediate dot files that are used to generate
|
|
|
62f653 |
+# the various graphs.
|
|
|
62f653 |
+
|
|
|
62f653 |
+DOT_CLEANUP = YES
|
|
|
62f653 |
+
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+# Configuration::additions related to the search engine
|
|
|
62f653 |
+#---------------------------------------------------------------------------
|
|
|
62f653 |
+
|
|
|
62f653 |
+# The SEARCHENGINE tag specifies whether or not a search engine should be
|
|
|
62f653 |
+# used. If set to NO the values of all tags below this one will be ignored.
|
|
|
62f653 |
+
|
|
|
62f653 |
+SEARCHENGINE = NO
|
|
|
62f653 |
diff --git a/libiscsi/libiscsi.h b/libiscsi/libiscsi.h
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..756590e
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/libiscsi.h
|
|
|
62f653 |
@@ -0,0 +1,344 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#ifndef __LIBISCSI_H
|
|
|
62f653 |
+#define __LIBISCSI_H
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <netdb.h>
|
|
|
62f653 |
+
|
|
|
62f653 |
+#ifdef __cplusplus
|
|
|
62f653 |
+extern "C" {
|
|
|
62f653 |
+#endif /* __cplusplus */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#if __GNUC__ >= 4
|
|
|
62f653 |
+#define PUBLIC __attribute__ ((visibility("default")))
|
|
|
62f653 |
+#else
|
|
|
62f653 |
+#define PUBLIC
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Maximum length for iSCSI values.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Maximum length for iSCSI values such as hostnames and parameter values.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+#define LIBISCSI_VALUE_MAXLEN 256
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief supported authentication methods
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This enum lists all supported authentication methods.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+enum libiscsi_auth_t {
|
|
|
62f653 |
+ libiscsi_auth_none /** No authentication */,
|
|
|
62f653 |
+ libiscsi_auth_chap /** CHAP authentication */,
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief libiscsi context struct
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Note: even though libiscsi uses a context struct, the underlying open-iscsi
|
|
|
62f653 |
+ * code does not, so libiscsi is not thread safe, not even when using one
|
|
|
62f653 |
+ * context per thread!
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+struct libiscsi_context;
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief iSCSI node record
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Struct holding data uniquely identifying an iSCSI node.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+struct libiscsi_node {
|
|
|
62f653 |
+ char name[LIBISCSI_VALUE_MAXLEN] /** iSCSI iqn for the node. */;
|
|
|
62f653 |
+ int tpgt /** Portal group number. */;
|
|
|
62f653 |
+ /* Note open-iscsi has some code in place for multiple connections in one
|
|
|
62f653 |
+ node record and thus multiple address / port combi's, but this does not
|
|
|
62f653 |
+ get used anywhere, so we keep things simple and assume one connection */
|
|
|
62f653 |
+ char address[NI_MAXHOST] /** Portal hostname or IP-address. */;
|
|
|
62f653 |
+ int port /** Portal port number. */;
|
|
|
62f653 |
+ char iface[LIBISCSI_VALUE_MAXLEN] /** Interface to connect through. */;
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief libiscsi CHAP authentication information struct
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Struct holding all data needed for CHAP login / authentication. Note that
|
|
|
62f653 |
+ * \e reverse_username may be a 0 length string in which case only forward
|
|
|
62f653 |
+ * authentication will be done.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+struct libiscsi_chap_auth_info {
|
|
|
62f653 |
+ char username[LIBISCSI_VALUE_MAXLEN] /** Username */;
|
|
|
62f653 |
+ char password[LIBISCSI_VALUE_MAXLEN] /** Password */;
|
|
|
62f653 |
+ char reverse_username[LIBISCSI_VALUE_MAXLEN] /** Reverse Username */;
|
|
|
62f653 |
+ char reverse_password[LIBISCSI_VALUE_MAXLEN] /** Reverse Password */;
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief generic libiscsi authentication information struct
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Struct holding authentication information for discovery and login.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+struct libiscsi_auth_info {
|
|
|
62f653 |
+ enum libiscsi_auth_t method /** Authentication method to use */;
|
|
|
62f653 |
+ union {
|
|
|
62f653 |
+ struct libiscsi_chap_auth_info chap /** Chap specific info */;
|
|
|
62f653 |
+ } /** Union holding method depenend info */;
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Initalize libiscsi
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function creates a libiscsi context and initalizes it. This context
|
|
|
62f653 |
+ * is need to use other libiscsi funtions.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \return A pointer to the created context, or NULL in case of an error.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC struct libiscsi_context *libiscsi_init(void);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Cleanup libiscsi used resource
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function cleanups any used resources and then destroys the passed
|
|
|
62f653 |
+ * context. After this the passed in context may no longer be used!
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC void libiscsi_cleanup(struct libiscsi_context *context);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Discover iSCSI nodes using sendtargets and add them to the node db.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function connects to the given address and port and then tries to
|
|
|
62f653 |
+ * discover iSCSI nodes using the sendtargets protocol. Any found nodes are
|
|
|
62f653 |
+ * added to the local iSCSI node database and are returned in a dynamically
|
|
|
62f653 |
+ * allocated array.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Note that the (optional) authentication info is for authenticating the
|
|
|
62f653 |
+ * discovery, and is not for the found nodes! If the connection(s) to the
|
|
|
62f653 |
+ * node(s) need authentication too, you can set the username / password for
|
|
|
62f653 |
+ * those (which can be different!) using the libiscsi_node_set_auth() function.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param address Hostname or IP-address to connect to.
|
|
|
62f653 |
+ * \param port Port to connect to, or 0 for the default port.
|
|
|
62f653 |
+ * \param auth_info Authentication information, or NULL.
|
|
|
62f653 |
+ * \param nr_found The number of found nodes will be returned
|
|
|
62f653 |
+ * through this pointer if not NULL.
|
|
|
62f653 |
+ * \param found_nodes The address of the dynamically allocated array
|
|
|
62f653 |
+ * of found nodes will be returned through this
|
|
|
62f653 |
+ * pointer if not NULL. The caller must free this
|
|
|
62f653 |
+ * array using free().
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_discover_sendtargets(struct libiscsi_context *context,
|
|
|
62f653 |
+ const char *address, int port, const struct libiscsi_auth_info *auth_info,
|
|
|
62f653 |
+ int *nr_found, struct libiscsi_node **found_nodes);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Read iSCSI node info from firmware and add them to the node db.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function discovers iSCSI nodes using firmware (ppc or ibft). Any found
|
|
|
62f653 |
+ * nodes are added to the local iSCSI node database and are returned in a
|
|
|
62f653 |
+ * dynamically allocated array.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Note that unlike sendtargets discovery, this function will also read
|
|
|
62f653 |
+ * authentication info and store that in the database too.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Note this function currently is a stub which will always return -EINVAL
|
|
|
62f653 |
+ * (IOW it is not yet implemented)
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param nr_found The number of found nodes will be returned
|
|
|
62f653 |
+ * through this pointer if not NULL.
|
|
|
62f653 |
+ * \param found_nodes The address of the dynamically allocated array
|
|
|
62f653 |
+ * of found nodes will be returned through this
|
|
|
62f653 |
+ * pointer if not NULL. The caller must free this
|
|
|
62f653 |
+ * array using free().
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_discover_firmware(struct libiscsi_context *context,
|
|
|
62f653 |
+ int *nr_found, struct libiscsi_node **found_nodes);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Check validity of the given authentication info.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function checks the validity of the given authentication info. For
|
|
|
62f653 |
+ * example in case of CHAP, if the username and password are not empty.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function is mainly intended for use by language bindings.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param auth_info Authentication information to check.
|
|
|
62f653 |
+ * \return 0 on success, otherwise EINVAL.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_verify_auth_info(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_auth_info *auth_info);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Set the authentication info for the given node.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function sets the authentication information for the node described by
|
|
|
62f653 |
+ * the given node record. This will overwrite any existing authentication
|
|
|
62f653 |
+ * information.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This is the way to specify authentication information for nodes found
|
|
|
62f653 |
+ * through sendtargets discovery.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Note:
|
|
|
62f653 |
+ * 1) This is a convience wrapper around libiscsi_node_set_parameter(),
|
|
|
62f653 |
+ * setting the node.session.auth.* parameters.
|
|
|
62f653 |
+ * 2) For nodes found through firmware discovery the authentication information
|
|
|
62f653 |
+ * has already been set from the firmware.
|
|
|
62f653 |
+ * 3) \e auth_info may be NULL in which case any existing authinfo will be
|
|
|
62f653 |
+ * cleared.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param node iSCSI node to set auth information of
|
|
|
62f653 |
+ * \param auth_info Authentication information, or NULL.
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_node_set_auth(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node,
|
|
|
62f653 |
+ const struct libiscsi_auth_info *auth_info);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Get the authentication info for the given node.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function gets the authentication information for the node described by
|
|
|
62f653 |
+ * the given node record.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param node iSCSI node to set auth information of
|
|
|
62f653 |
+ * \param auth_info Pointer to a libiscsi_auth_info struct where
|
|
|
62f653 |
+ * the retreived information will be stored.
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_node_get_auth(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node,
|
|
|
62f653 |
+ struct libiscsi_auth_info *auth_info);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Login to an iSCSI node.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Login to the iSCSI node described by the given node record.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param node iSCSI node to login to.
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_node_login(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Logout of an iSCSI node.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Logout of the iSCSI node described by the given node record.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param node iSCSI node to logout from.
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_node_logout(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Set an iSCSI parameter for the given node
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Set the given nodes iSCSI parameter named by \e parameter to value \e value.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param node iSCSI node to change a parameter from.
|
|
|
62f653 |
+ * \param parameter Name of the parameter to set.
|
|
|
62f653 |
+ * \param value Value to set the parameter too.
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_node_set_parameter(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node,
|
|
|
62f653 |
+ const char *parameter, const char *value);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Get the value of an iSCSI parameter for the given node
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Get the value of the given nodes iSCSI parameter named by \e parameter.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ * \param node iSCSI node to change a parameter from.
|
|
|
62f653 |
+ * \param parameter Name of the parameter to get.
|
|
|
62f653 |
+ * \param value The retreived value is stored here, this buffer must be
|
|
|
62f653 |
+ * atleast LIBISCSI_VALUE_MAXLEN bytes large.
|
|
|
62f653 |
+ * \return 0 on success, otherwise a standard error code
|
|
|
62f653 |
+ * (from errno.h).
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_node_get_parameter(struct libiscsi_context *context,
|
|
|
62f653 |
+ const struct libiscsi_node *node, const char *parameter, char *value);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Get human readable string describing the last libiscsi error.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This function can be called to get a human readable error string when a
|
|
|
62f653 |
+ * libiscsi function has returned an error. This function uses a single buffer
|
|
|
62f653 |
+ * per context, thus the result is only valid as long as no other libiscsi
|
|
|
62f653 |
+ * calls are made on the same context after the failing function call.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param context libiscsi context to operate on.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \return human readable string describing the last libiscsi error.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC const char *libiscsi_get_error_string(struct libiscsi_context *context);
|
|
|
62f653 |
+
|
|
|
62f653 |
+
|
|
|
62f653 |
+/************************** Utility functions *******************************/
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief libiscsi network config struct
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * libiscsi network config struct.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+struct libiscsi_network_config {
|
|
|
62f653 |
+ int dhcp /** Using DHCP? (boolean). */;
|
|
|
62f653 |
+ char iface_name[LIBISCSI_VALUE_MAXLEN] /** Interface name. */;
|
|
|
62f653 |
+ char mac_address[LIBISCSI_VALUE_MAXLEN] /** MAC address. */;
|
|
|
62f653 |
+ char ip_address[LIBISCSI_VALUE_MAXLEN] /** IP address. */;
|
|
|
62f653 |
+ char netmask[LIBISCSI_VALUE_MAXLEN] /** Netmask. */;
|
|
|
62f653 |
+ char gateway[LIBISCSI_VALUE_MAXLEN] /** IP of Default gateway. */;
|
|
|
62f653 |
+ char primary_dns[LIBISCSI_VALUE_MAXLEN] /** IP of the Primary DNS. */;
|
|
|
62f653 |
+ char secondary_dns[LIBISCSI_VALUE_MAXLEN] /** IP of the Secondary DNS. */;
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Get network configuration information from iscsi firmware
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Function can be called to get the network configuration information
|
|
|
62f653 |
+ * (like dhcp, ip, netmask, default gateway, etc.) from the firmware of a
|
|
|
62f653 |
+ * network adapter with iscsi boot firmware.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Note that not all fields of the returned struct are necessarilly filled,
|
|
|
62f653 |
+ * unset fields contain a 0 length string.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param config pointer to a libiscsi_network_config struct to fill.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \return 0 on success, ENODEV when no iscsi firmware was found.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_get_firmware_network_config(
|
|
|
62f653 |
+ struct libiscsi_network_config *config);
|
|
|
62f653 |
+
|
|
|
62f653 |
+/** \brief Get the initiator name (iqn) from the iscsi firmware
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Get the initiator name (iqn) from the iscsi firmware.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * \param initiatorname The initiator name is stored here, this buffer must be
|
|
|
62f653 |
+ * atleast LIBISCSI_VALUE_MAXLEN bytes large.
|
|
|
62f653 |
+ * \return 0 on success, ENODEV when no iscsi firmware was found.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+PUBLIC int libiscsi_get_firmware_initiator_name(char *initiatorname);
|
|
|
62f653 |
+
|
|
|
62f653 |
+#undef PUBLIC
|
|
|
62f653 |
+
|
|
|
62f653 |
+#ifdef __cplusplus
|
|
|
62f653 |
+}
|
|
|
62f653 |
+#endif /* __cplusplus */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
diff --git a/libiscsi/no_date_footer.html b/libiscsi/no_date_footer.html
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..1e0c6c4
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/no_date_footer.html
|
|
|
62f653 |
@@ -0,0 +1,6 @@
|
|
|
62f653 |
+ <address style="text-align: right;"><small>
|
|
|
62f653 |
+Generated for $projectname by
|
|
|
62f653 |
+index.html">
|
|
|
62f653 |
+$doxygenversion</small></address>
|
|
|
62f653 |
+</body>
|
|
|
62f653 |
+</html>
|
|
|
62f653 |
diff --git a/libiscsi/pylibiscsi.c b/libiscsi/pylibiscsi.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..8800853
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/pylibiscsi.c
|
|
|
62f653 |
@@ -0,0 +1,709 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <Python.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+#if PY_MAJOR_VERSION >= 3
|
|
|
62f653 |
+#define IS_PY3K
|
|
|
62f653 |
+#define MODINITERROR return NULL
|
|
|
62f653 |
+#define PYNUM_FROMLONG PyLong_FromLong
|
|
|
62f653 |
+#define PYSTR_FROMSTRING PyUnicode_FromString
|
|
|
62f653 |
+#else
|
|
|
62f653 |
+#define MODINITERROR return
|
|
|
62f653 |
+#define PYNUM_FROMLONG PyInt_FromLong
|
|
|
62f653 |
+#define PYSTR_FROMSTRING PyString_FromString
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
+
|
|
|
62f653 |
+#define RET_TRUE_ELSE_FALSE { Py_RETURN_TRUE; } else { Py_RETURN_FALSE; }
|
|
|
62f653 |
+#define CMP_TO_RICHCMP(cmpfunc) \
|
|
|
62f653 |
+ int comp_res = cmpfunc(self, other); \
|
|
|
62f653 |
+ switch (op) { \
|
|
|
62f653 |
+ case Py_LT: \
|
|
|
62f653 |
+ if (comp_res < 0) RET_TRUE_ELSE_FALSE \
|
|
|
62f653 |
+ case Py_LE: \
|
|
|
62f653 |
+ if (comp_res <= 0) RET_TRUE_ELSE_FALSE \
|
|
|
62f653 |
+ case Py_EQ: \
|
|
|
62f653 |
+ if (comp_res == 0) RET_TRUE_ELSE_FALSE \
|
|
|
62f653 |
+ case Py_NE: \
|
|
|
62f653 |
+ if (comp_res != 0) RET_TRUE_ELSE_FALSE \
|
|
|
62f653 |
+ case Py_GT: \
|
|
|
62f653 |
+ if (comp_res > 0) RET_TRUE_ELSE_FALSE \
|
|
|
62f653 |
+ default: \
|
|
|
62f653 |
+ if (comp_res >= 0) RET_TRUE_ELSE_FALSE \
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+static struct libiscsi_context *context = NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+/****************************** helpers ***********************************/
|
|
|
62f653 |
+static int check_string(const char *string)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ if (strlen(string) >= LIBISCSI_VALUE_MAXLEN) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_ValueError, "string too long");
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+/********************** PyIscsiChapAuthInfo ***************************/
|
|
|
62f653 |
+
|
|
|
62f653 |
+typedef struct {
|
|
|
62f653 |
+ PyObject_HEAD
|
|
|
62f653 |
+
|
|
|
62f653 |
+ struct libiscsi_auth_info info;
|
|
|
62f653 |
+} PyIscsiChapAuthInfo;
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int PyIscsiChapAuthInfo_init(PyObject *self, PyObject *args,
|
|
|
62f653 |
+ PyObject *kwds)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int i;
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *chap = (PyIscsiChapAuthInfo *)self;
|
|
|
62f653 |
+ char *kwlist[] = {"username", "password", "reverse_username",
|
|
|
62f653 |
+ "reverse_password", NULL};
|
|
|
62f653 |
+ const char *string[4] = { NULL, NULL, NULL, NULL };
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
|
|
|
62f653 |
+ "zz|zz:chapAuthInfo.__init__",
|
|
|
62f653 |
+ kwlist, &string[0], &string[1],
|
|
|
62f653 |
+ &string[2], &string[3]))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ for (i = 0; i < 4; i++)
|
|
|
62f653 |
+ if (string[i] && check_string(string[i]))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ memset (&chap->info, 0, sizeof(chap->info));
|
|
|
62f653 |
+ chap->info.method = libiscsi_auth_chap;
|
|
|
62f653 |
+ if (string[0])
|
|
|
62f653 |
+ strcpy(chap->info.chap.username, string[0]);
|
|
|
62f653 |
+ if (string[1])
|
|
|
62f653 |
+ strcpy(chap->info.chap.password, string[1]);
|
|
|
62f653 |
+ if (string[2])
|
|
|
62f653 |
+ strcpy(chap->info.chap.reverse_username, string[2]);
|
|
|
62f653 |
+ if (string[3])
|
|
|
62f653 |
+ strcpy(chap->info.chap.reverse_password, string[3]);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_verify_auth_info(context, &chap->info)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_ValueError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiChapAuthInfo_get(PyObject *self, void *data)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *chap = (PyIscsiChapAuthInfo *)self;
|
|
|
62f653 |
+ const char *attr = (const char *)data;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!strcmp(attr, "username")) {
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(chap->info.chap.username);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "password")) {
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(chap->info.chap.password);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "reverse_username")) {
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(chap->info.chap.reverse_username);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "reverse_password")) {
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(chap->info.chap.reverse_password);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int PyIscsiChapAuthInfo_set(PyObject *self, PyObject *value, void *data)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *chap = (PyIscsiChapAuthInfo *)self;
|
|
|
62f653 |
+ const char *attr = (const char *)data;
|
|
|
62f653 |
+ const char *str;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!PyArg_Parse(value, "s", &str) || check_string(str))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!strcmp(attr, "username")) {
|
|
|
62f653 |
+ strcpy(chap->info.chap.username, str);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "password")) {
|
|
|
62f653 |
+ strcpy(chap->info.chap.password, str);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "reverse_username")) {
|
|
|
62f653 |
+ strcpy(chap->info.chap.reverse_username, str);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "reverse_password")) {
|
|
|
62f653 |
+ strcpy(chap->info.chap.reverse_password, str);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int PyIscsiChapAuthInfo_compare(PyIscsiChapAuthInfo *self,
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *other)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int r;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ r = strcmp(self->info.chap.username, other->info.chap.username);
|
|
|
62f653 |
+ if (r)
|
|
|
62f653 |
+ return r;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ r = strcmp(self->info.chap.password, other->info.chap.password);
|
|
|
62f653 |
+ if (r)
|
|
|
62f653 |
+ return r;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ r = strcmp(self->info.chap.reverse_username,
|
|
|
62f653 |
+ other->info.chap.reverse_username);
|
|
|
62f653 |
+ if (r)
|
|
|
62f653 |
+ return r;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ r = strcmp(self->info.chap.reverse_password,
|
|
|
62f653 |
+ other->info.chap.reverse_password);
|
|
|
62f653 |
+ return r;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+PyObject *PyIscsiChapAuthInfo_richcompare(PyIscsiChapAuthInfo *self,
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *other,
|
|
|
62f653 |
+ int op)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ CMP_TO_RICHCMP(PyIscsiChapAuthInfo_compare)
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiChapAuthInfo_str(PyObject *self)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *chap = (PyIscsiChapAuthInfo *)self;
|
|
|
62f653 |
+ char s[1024], reverse[512] = "";
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (chap->info.chap.reverse_username[0])
|
|
|
62f653 |
+ snprintf(reverse, sizeof(reverse), ", %s:%s",
|
|
|
62f653 |
+ chap->info.chap.reverse_username,
|
|
|
62f653 |
+ chap->info.chap.reverse_password);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ snprintf(s, sizeof(s), "%s:%s%s", chap->info.chap.username,
|
|
|
62f653 |
+ chap->info.chap.password, reverse);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(s);
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static struct PyGetSetDef PyIscsiChapAuthInfo_getseters[] = {
|
|
|
62f653 |
+ {"username", (getter)PyIscsiChapAuthInfo_get,
|
|
|
62f653 |
+ (setter)PyIscsiChapAuthInfo_set,
|
|
|
62f653 |
+ "username", "username"},
|
|
|
62f653 |
+ {"password", (getter)PyIscsiChapAuthInfo_get,
|
|
|
62f653 |
+ (setter)PyIscsiChapAuthInfo_set,
|
|
|
62f653 |
+ "password", "password"},
|
|
|
62f653 |
+ {"reverse_username", (getter)PyIscsiChapAuthInfo_get,
|
|
|
62f653 |
+ (setter)PyIscsiChapAuthInfo_set,
|
|
|
62f653 |
+ "reverse_username", "reverse_username"},
|
|
|
62f653 |
+ {"reverse_password", (getter)PyIscsiChapAuthInfo_get,
|
|
|
62f653 |
+ (setter)PyIscsiChapAuthInfo_set,
|
|
|
62f653 |
+ "reverse_password", "reverse_password"},
|
|
|
62f653 |
+ {NULL}
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+PyTypeObject PyIscsiChapAuthInfo_Type = {
|
|
|
62f653 |
+ PyVarObject_HEAD_INIT(NULL, 0)
|
|
|
62f653 |
+ .tp_name = "libiscsi.chapAuthInfo",
|
|
|
62f653 |
+ .tp_basicsize = sizeof (PyIscsiChapAuthInfo),
|
|
|
62f653 |
+ .tp_getset = PyIscsiChapAuthInfo_getseters,
|
|
|
62f653 |
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
|
|
|
62f653 |
+#ifndef IS_PY3K
|
|
|
62f653 |
+ // Py_TPFLAGS_CHECKTYPES is only needed on Python 2
|
|
|
62f653 |
+ | Py_TPFLAGS_CHECKTYPES
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
+ ,
|
|
|
62f653 |
+ .tp_richcompare = (richcmpfunc)PyIscsiChapAuthInfo_compare,
|
|
|
62f653 |
+ .tp_init = PyIscsiChapAuthInfo_init,
|
|
|
62f653 |
+ .tp_str = PyIscsiChapAuthInfo_str,
|
|
|
62f653 |
+ .tp_new = PyType_GenericNew,
|
|
|
62f653 |
+ .tp_doc = "iscsi chap authentication information.",
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+/***************************** PyIscsiNode ********************************/
|
|
|
62f653 |
+
|
|
|
62f653 |
+typedef struct {
|
|
|
62f653 |
+ PyObject_HEAD
|
|
|
62f653 |
+
|
|
|
62f653 |
+ struct libiscsi_node node;
|
|
|
62f653 |
+} PyIscsiNode;
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int PyIscsiNode_init(PyObject *self, PyObject *args, PyObject *kwds)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ char *kwlist[] = {"name", "tpgt", "address", "port", "iface", NULL};
|
|
|
62f653 |
+ const char *name = NULL, *address = NULL, *iface = NULL;
|
|
|
62f653 |
+ int tpgt = -1, port = 3260;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|isis:node.__init__",
|
|
|
62f653 |
+ kwlist, &name, &tpgt, &address,
|
|
|
62f653 |
+ &port, &iface))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ if (address == NULL) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_ValueError, "address not set");
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ if (check_string(name) || check_string(address) || check_string(iface))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ strcpy(node->node.name, name);
|
|
|
62f653 |
+ node->node.tpgt = tpgt;
|
|
|
62f653 |
+ strcpy(node->node.address, address);
|
|
|
62f653 |
+ node->node.port = port;
|
|
|
62f653 |
+ strcpy(node->node.iface, iface);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_get(PyObject *self, void *data)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ const char *attr = (const char *)data;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!strcmp(attr, "name")) {
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(node->node.name);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "tpgt")) {
|
|
|
62f653 |
+ return PYNUM_FROMLONG(node->node.tpgt);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "address")) {
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(node->node.address);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "port")) {
|
|
|
62f653 |
+ return PYNUM_FROMLONG(node->node.port);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "iface")) {
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(node->node.iface);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int PyIscsiNode_set(PyObject *self, PyObject *value, void *data)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ const char *attr = (const char *)data;
|
|
|
62f653 |
+ const char *str;
|
|
|
62f653 |
+ int i;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!strcmp(attr, "name")) {
|
|
|
62f653 |
+ if (!PyArg_Parse(value, "s", &str) || check_string(str))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ strcpy(node->node.name, str);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "tpgt")) {
|
|
|
62f653 |
+ if (!PyArg_Parse(value, "i", &i))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ node->node.tpgt = i;
|
|
|
62f653 |
+ } else if (!strcmp(attr, "address")) {
|
|
|
62f653 |
+ if (!PyArg_Parse(value, "s", &str) || check_string(str))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ strcpy(node->node.address, str);
|
|
|
62f653 |
+ } else if (!strcmp(attr, "port")) {
|
|
|
62f653 |
+ if (!PyArg_Parse(value, "i", &i))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ node->node.port = i;
|
|
|
62f653 |
+ } else if (!strcmp(attr, "iface")) {
|
|
|
62f653 |
+ if (!PyArg_Parse(value, "s", &str) || check_string(str))
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ strcpy(node->node.iface, str);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static int PyIscsiNode_compare(PyIscsiNode *self, PyIscsiNode *other)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int res;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ res = strcmp(self->node.name, other->node.name);
|
|
|
62f653 |
+ if (res)
|
|
|
62f653 |
+ return res;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (self->node.tpgt < other->node.tpgt)
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ if (self->node.tpgt > other->node.tpgt)
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ res = strcmp(self->node.address, other->node.address);
|
|
|
62f653 |
+ if (res)
|
|
|
62f653 |
+ return res;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (self->node.port < other->node.port)
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+ if (self->node.port > other->node.port)
|
|
|
62f653 |
+ return -1;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ res = strcmp(self->node.iface, other->node.iface);
|
|
|
62f653 |
+ if (res)
|
|
|
62f653 |
+ return res;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+PyObject *PyIscsiNode_richcompare(PyIscsiNode *self, PyIscsiNode *other, int op)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ CMP_TO_RICHCMP(PyIscsiNode_compare)
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_str(PyObject *self)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ char s[1024], tpgt[16] = "";
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (node->node.tpgt != -1)
|
|
|
62f653 |
+ sprintf(tpgt, ",%d", node->node.tpgt);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ snprintf(s, sizeof(s), "%s:%d%s %s", node->node.address,
|
|
|
62f653 |
+ node->node.port, tpgt, node->node.name);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(s);
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_login(PyObject *self)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_node_login(context, &node->node)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ Py_RETURN_NONE;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_logout(PyObject *self)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_node_logout(context, &node->node)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ Py_RETURN_NONE;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_setAuth(PyObject *self, PyObject *args,
|
|
|
62f653 |
+ PyObject *kwds)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ char *kwlist[] = {"authinfo", NULL};
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ PyObject *arg;
|
|
|
62f653 |
+ const struct libiscsi_auth_info *authinfo = NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "O", kwlist, &arg))
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (arg == Py_None) {
|
|
|
62f653 |
+ authinfo = NULL;
|
|
|
62f653 |
+ } else if (PyObject_IsInstance(arg, (PyObject *)
|
|
|
62f653 |
+ &PyIscsiChapAuthInfo_Type)) {
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *pyauthinfo = (PyIscsiChapAuthInfo *)arg;
|
|
|
62f653 |
+ authinfo = &pyauthinfo->info;
|
|
|
62f653 |
+ } else {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_ValueError, "invalid authinfo type");
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_node_set_auth(context, &node->node, authinfo)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ Py_RETURN_NONE;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_getAuth(PyObject *self)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *pyauthinfo;
|
|
|
62f653 |
+ struct libiscsi_auth_info authinfo;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_node_get_auth(context, &node->node, &authinfo)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ switch (authinfo.method) {
|
|
|
62f653 |
+ case libiscsi_auth_chap:
|
|
|
62f653 |
+ pyauthinfo = PyObject_New(PyIscsiChapAuthInfo,
|
|
|
62f653 |
+ &PyIscsiChapAuthInfo_Type);
|
|
|
62f653 |
+ if (!pyauthinfo)
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ pyauthinfo->info = authinfo;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return (PyObject *)pyauthinfo;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ case libiscsi_auth_none:
|
|
|
62f653 |
+ default:
|
|
|
62f653 |
+ Py_RETURN_NONE;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_setParameter(PyObject *self, PyObject *args,
|
|
|
62f653 |
+ PyObject *kwds)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ char *kwlist[] = {"parameter", "value", NULL};
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ const char *parameter, *value;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "ss", kwlist,
|
|
|
62f653 |
+ ¶meter, &value))
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ if (check_string(parameter) || check_string(value))
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_node_set_parameter(context, &node->node, parameter,
|
|
|
62f653 |
+ value)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ Py_RETURN_NONE;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *PyIscsiNode_getParameter(PyObject *self, PyObject *args,
|
|
|
62f653 |
+ PyObject *kwds)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ char *kwlist[] = {"parameter", NULL};
|
|
|
62f653 |
+ PyIscsiNode *node = (PyIscsiNode *)self;
|
|
|
62f653 |
+ const char *parameter;
|
|
|
62f653 |
+ char value[LIBISCSI_VALUE_MAXLEN];
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, ¶meter))
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ if (check_string(parameter))
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_node_get_parameter(context, &node->node, parameter,
|
|
|
62f653 |
+ value)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ return Py_BuildValue("s", value);
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static struct PyGetSetDef PyIscsiNode_getseters[] = {
|
|
|
62f653 |
+ {"name", (getter)PyIscsiNode_get, (setter)PyIscsiNode_set,
|
|
|
62f653 |
+ "name", "name"},
|
|
|
62f653 |
+ {"tpgt", (getter)PyIscsiNode_get, (setter)PyIscsiNode_set,
|
|
|
62f653 |
+ "tpgt", "tpgt"},
|
|
|
62f653 |
+ {"address", (getter)PyIscsiNode_get, (setter)PyIscsiNode_set,
|
|
|
62f653 |
+ "address", "address"},
|
|
|
62f653 |
+ {"port", (getter)PyIscsiNode_get, (setter)PyIscsiNode_set,
|
|
|
62f653 |
+ "port", "port"},
|
|
|
62f653 |
+ {"iface", (getter)PyIscsiNode_get, (setter)PyIscsiNode_set,
|
|
|
62f653 |
+ "iface", "iface"},
|
|
|
62f653 |
+ {NULL}
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+static struct PyMethodDef PyIscsiNode_methods[] = {
|
|
|
62f653 |
+ {"login", (PyCFunction) PyIscsiNode_login, METH_NOARGS,
|
|
|
62f653 |
+ "Log in to the node"},
|
|
|
62f653 |
+ {"logout", (PyCFunction) PyIscsiNode_logout, METH_NOARGS,
|
|
|
62f653 |
+ "Log out of the node"},
|
|
|
62f653 |
+ {"setAuth", (PyCFunction) PyIscsiNode_setAuth,
|
|
|
62f653 |
+ METH_VARARGS|METH_KEYWORDS,
|
|
|
62f653 |
+ "Set authentication information"},
|
|
|
62f653 |
+ {"getAuth", (PyCFunction) PyIscsiNode_getAuth, METH_NOARGS,
|
|
|
62f653 |
+ "Get authentication information"},
|
|
|
62f653 |
+ {"setParameter", (PyCFunction) PyIscsiNode_setParameter,
|
|
|
62f653 |
+ METH_VARARGS|METH_KEYWORDS,
|
|
|
62f653 |
+ "Set an iscsi node parameter"},
|
|
|
62f653 |
+ {"getParameter", (PyCFunction) PyIscsiNode_getParameter,
|
|
|
62f653 |
+ METH_VARARGS|METH_KEYWORDS,
|
|
|
62f653 |
+ "Get an iscsi node parameter"},
|
|
|
62f653 |
+ {NULL}
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+PyTypeObject PyIscsiNode_Type = {
|
|
|
62f653 |
+ PyVarObject_HEAD_INIT(NULL, 0)
|
|
|
62f653 |
+ .tp_name = "libiscsi.node",
|
|
|
62f653 |
+ .tp_basicsize = sizeof (PyIscsiNode),
|
|
|
62f653 |
+ .tp_getset = PyIscsiNode_getseters,
|
|
|
62f653 |
+ .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE
|
|
|
62f653 |
+#ifndef IS_PY3K
|
|
|
62f653 |
+ | Py_TPFLAGS_CHECKTYPES
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
+ ,
|
|
|
62f653 |
+ .tp_methods = PyIscsiNode_methods,
|
|
|
62f653 |
+ .tp_richcompare = (richcmpfunc)PyIscsiNode_richcompare,
|
|
|
62f653 |
+ .tp_init = PyIscsiNode_init,
|
|
|
62f653 |
+ .tp_str = PyIscsiNode_str,
|
|
|
62f653 |
+ .tp_new = PyType_GenericNew,
|
|
|
62f653 |
+ .tp_doc = "The iscsi node contains iscsi node information.",
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+/***************************************************************************/
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *pylibiscsi_discover_sendtargets(PyObject *self,
|
|
|
62f653 |
+ PyObject *args, PyObject *kwds)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ char *kwlist[] = {"address", "port", "authinfo", NULL};
|
|
|
62f653 |
+ const char *address = NULL;
|
|
|
62f653 |
+ int i, nr_found, port = 3260;
|
|
|
62f653 |
+ PyObject *authinfo_arg = NULL;
|
|
|
62f653 |
+ const struct libiscsi_auth_info *authinfo = NULL;
|
|
|
62f653 |
+ struct libiscsi_node *found_nodes;
|
|
|
62f653 |
+ PyObject* found_node_list;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!PyArg_ParseTupleAndKeywords(args, kwds, "s|iO",
|
|
|
62f653 |
+ kwlist, &address, &port,
|
|
|
62f653 |
+ &authinfo_arg))
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (authinfo_arg) {
|
|
|
62f653 |
+ if (PyObject_IsInstance(authinfo_arg, (PyObject *)
|
|
|
62f653 |
+ &PyIscsiChapAuthInfo_Type)) {
|
|
|
62f653 |
+ PyIscsiChapAuthInfo *pyauthinfo =
|
|
|
62f653 |
+ (PyIscsiChapAuthInfo *)authinfo_arg;
|
|
|
62f653 |
+ authinfo = &pyauthinfo->info;
|
|
|
62f653 |
+ } else if (authinfo_arg != Py_None) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_ValueError,
|
|
|
62f653 |
+ "invalid authinfo type");
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_discover_sendtargets(context, address, port, authinfo,
|
|
|
62f653 |
+ &nr_found, &found_nodes)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (nr_found == 0)
|
|
|
62f653 |
+ Py_RETURN_NONE;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ found_node_list = PyList_New(nr_found);
|
|
|
62f653 |
+ if (!found_node_list)
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ for(i = 0; i < nr_found; i++) {
|
|
|
62f653 |
+ PyIscsiNode *pynode;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ pynode = PyObject_New(PyIscsiNode, &PyIscsiNode_Type);
|
|
|
62f653 |
+ if (!pynode) {
|
|
|
62f653 |
+ /* This will deref already added nodes for us */
|
|
|
62f653 |
+ Py_DECREF(found_node_list);
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ pynode->node = found_nodes[i];
|
|
|
62f653 |
+ PyList_SET_ITEM(found_node_list, i, (PyObject *)pynode);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return found_node_list;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *pylibiscsi_discover_firmware(PyObject *self)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ int i, nr_found;
|
|
|
62f653 |
+ struct libiscsi_node *found_nodes;
|
|
|
62f653 |
+ PyObject* found_node_list;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_discover_firmware(context, &nr_found, &found_nodes)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (nr_found == 0)
|
|
|
62f653 |
+ Py_RETURN_NONE;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ found_node_list = PyList_New(nr_found);
|
|
|
62f653 |
+ if (!found_node_list)
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ for(i = 0; i < nr_found; i++) {
|
|
|
62f653 |
+ PyIscsiNode *pynode;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ pynode = PyObject_New(PyIscsiNode, &PyIscsiNode_Type);
|
|
|
62f653 |
+ if (!pynode) {
|
|
|
62f653 |
+ /* This will deref already added nodes for us */
|
|
|
62f653 |
+ Py_DECREF(found_node_list);
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+ pynode->node = found_nodes[i];
|
|
|
62f653 |
+ PyList_SET_ITEM(found_node_list, i, (PyObject *)pynode);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return found_node_list;
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyObject *pylibiscsi_get_firmware_initiator_name(PyObject *self)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ char initiatorname[LIBISCSI_VALUE_MAXLEN];
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_get_firmware_initiator_name(initiatorname)) {
|
|
|
62f653 |
+ PyErr_SetString(PyExc_IOError,
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ return NULL;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return PYSTR_FROMSTRING(initiatorname);
|
|
|
62f653 |
+}
|
|
|
62f653 |
+
|
|
|
62f653 |
+static PyMethodDef pylibiscsi_functions[] = {
|
|
|
62f653 |
+ { "discover_sendtargets",
|
|
|
62f653 |
+ (PyCFunction)pylibiscsi_discover_sendtargets,
|
|
|
62f653 |
+ METH_VARARGS|METH_KEYWORDS,
|
|
|
62f653 |
+ "Do sendtargets discovery and return a list of found nodes)"},
|
|
|
62f653 |
+ { "discover_firmware",
|
|
|
62f653 |
+ (PyCFunction)pylibiscsi_discover_firmware, METH_NOARGS,
|
|
|
62f653 |
+ "Do firmware discovery and return a list of found nodes)"},
|
|
|
62f653 |
+ { "get_firmware_initiator_name",
|
|
|
62f653 |
+ (PyCFunction)pylibiscsi_get_firmware_initiator_name,
|
|
|
62f653 |
+ METH_NOARGS,
|
|
|
62f653 |
+ "Get initator name (iqn) from firmware"},
|
|
|
62f653 |
+ {NULL, NULL}
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+#ifdef IS_PY3K
|
|
|
62f653 |
+static struct PyModuleDef libiscsi_def = {
|
|
|
62f653 |
+ PyModuleDef_HEAD_INIT,
|
|
|
62f653 |
+ "libiscsi",
|
|
|
62f653 |
+ NULL,
|
|
|
62f653 |
+ -1,
|
|
|
62f653 |
+ pylibiscsi_functions,
|
|
|
62f653 |
+ NULL,
|
|
|
62f653 |
+ NULL,
|
|
|
62f653 |
+ NULL,
|
|
|
62f653 |
+ NULL
|
|
|
62f653 |
+};
|
|
|
62f653 |
+
|
|
|
62f653 |
+PyMODINIT_FUNC PyInit_libiscsi(void)
|
|
|
62f653 |
+#else
|
|
|
62f653 |
+PyMODINIT_FUNC initlibiscsi(void)
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ PyObject *m;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (!context) /* We may be called more then once */
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context)
|
|
|
62f653 |
+ MODINITERROR;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (PyType_Ready(&PyIscsiChapAuthInfo_Type) < 0)
|
|
|
62f653 |
+ MODINITERROR;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (PyType_Ready(&PyIscsiNode_Type) < 0)
|
|
|
62f653 |
+ MODINITERROR;
|
|
|
62f653 |
+
|
|
|
62f653 |
+#ifdef IS_PY3K
|
|
|
62f653 |
+ m = PyModule_Create(&libiscsi_def);
|
|
|
62f653 |
+#else
|
|
|
62f653 |
+ m = Py_InitModule("libiscsi", pylibiscsi_functions);
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
+ Py_INCREF(&PyIscsiChapAuthInfo_Type);
|
|
|
62f653 |
+ PyModule_AddObject(m, "chapAuthInfo", (PyObject *) &PyIscsiChapAuthInfo_Type);
|
|
|
62f653 |
+ Py_INCREF(&PyIscsiNode_Type);
|
|
|
62f653 |
+ PyModule_AddObject(m, "node", (PyObject *) &PyIscsiNode_Type);
|
|
|
62f653 |
+#ifdef IS_PY3K
|
|
|
62f653 |
+ return m;
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/setup.py b/libiscsi/setup.py
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..caa4e66
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/setup.py
|
|
|
62f653 |
@@ -0,0 +1,9 @@
|
|
|
62f653 |
+from distutils.core import setup, Extension
|
|
|
62f653 |
+
|
|
|
62f653 |
+module1 = Extension('libiscsi',
|
|
|
62f653 |
+ sources = ['pylibiscsi.c'],
|
|
|
62f653 |
+ libraries = ['iscsi'],
|
|
|
62f653 |
+ library_dirs = ['.'])
|
|
|
62f653 |
+
|
|
|
62f653 |
+setup (name = 'PyIscsi',version = '1.0',
|
|
|
62f653 |
+ description = 'libiscsi python bindings', ext_modules = [module1])
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_discovery_firmware.c b/libiscsi/tests/test_discovery_firmware.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..76e852a
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_discovery_firmware.c
|
|
|
62f653 |
@@ -0,0 +1,53 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_node *found_nodes;
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+ int i, found, rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context) {
|
|
|
62f653 |
+ fprintf(stderr, "Error initializing libiscsi\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_discover_firmware(context, &found, &found_nodes);
|
|
|
62f653 |
+ if (rc)
|
|
|
62f653 |
+ fprintf(stderr, "Error discovering: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+
|
|
|
62f653 |
+ for (i = 0; i < found; i++) {
|
|
|
62f653 |
+ fprintf(stdout, "Found node: %s, tpgt: %d, portal: %s:%d\n",
|
|
|
62f653 |
+ found_nodes[i].name, found_nodes[i].tpgt,
|
|
|
62f653 |
+ found_nodes[i].address, found_nodes[i].port);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ libiscsi_cleanup(context);
|
|
|
62f653 |
+ free (found_nodes);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_discovery_sendtargets.c b/libiscsi/tests/test_discovery_sendtargets.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..1a3c12e
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_discovery_sendtargets.c
|
|
|
62f653 |
@@ -0,0 +1,60 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_node *found_nodes;
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+ struct libiscsi_auth_info auth_info;
|
|
|
62f653 |
+ int i, found, rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context) {
|
|
|
62f653 |
+ fprintf(stderr, "Error initializing libiscsi\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ memset(&auth_info, 0, sizeof(auth_info));
|
|
|
62f653 |
+ auth_info.method = libiscsi_auth_chap;
|
|
|
62f653 |
+ strcpy(auth_info.chap.username, "joe");
|
|
|
62f653 |
+ strcpy(auth_info.chap.password, "secret");
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_discover_sendtargets(context, "127.0.0.1", 3260,
|
|
|
62f653 |
+ &auth_info, &found, &found_nodes);
|
|
|
62f653 |
+ if (rc)
|
|
|
62f653 |
+ fprintf(stderr, "Error discovering: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+
|
|
|
62f653 |
+ for (i = 0; i < found; i++) {
|
|
|
62f653 |
+ fprintf(stdout, "Found node: %s, tpgt: %d, portal: %s:%d\n",
|
|
|
62f653 |
+ found_nodes[i].name, found_nodes[i].tpgt,
|
|
|
62f653 |
+ found_nodes[i].address, found_nodes[i].port);
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ libiscsi_cleanup(context);
|
|
|
62f653 |
+ free (found_nodes);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_get_auth.c b/libiscsi/tests/test_get_auth.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..5e234da
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_get_auth.c
|
|
|
62f653 |
@@ -0,0 +1,70 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_node node;
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+ struct libiscsi_auth_info auth_info;
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ snprintf(node.name, LIBISCSI_VALUE_MAXLEN, "%s",
|
|
|
62f653 |
+ "iqn.2009-01.com.example:testdisk");
|
|
|
62f653 |
+ node.tpgt = 1;
|
|
|
62f653 |
+ snprintf(node.address, NI_MAXHOST, "%s", "127.0.0.1");
|
|
|
62f653 |
+ node.port = 3260;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context) {
|
|
|
62f653 |
+ fprintf(stderr, "Error initializing libiscsi\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_get_auth(context, &node, &auth_info);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ fprintf(stderr, "Error setting authinfo: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ switch (auth_info.method) {
|
|
|
62f653 |
+ case libiscsi_auth_none:
|
|
|
62f653 |
+ printf("Method: \"None\"\n");
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+ case libiscsi_auth_chap:
|
|
|
62f653 |
+ printf("Method: \"CHAP\"\n");
|
|
|
62f653 |
+ printf("User: \"%s\"\n", auth_info.chap.username);
|
|
|
62f653 |
+ printf("Pass: \"%s\"\n", auth_info.chap.password);
|
|
|
62f653 |
+ printf("RevUser: \"%s\"\n",
|
|
|
62f653 |
+ auth_info.chap.reverse_username);
|
|
|
62f653 |
+ printf("RevPass: \"%s\"\n",
|
|
|
62f653 |
+ auth_info.chap.reverse_password);
|
|
|
62f653 |
+ break;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ libiscsi_cleanup(context);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_get_initiator_name.c b/libiscsi/tests/test_get_initiator_name.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..997c053
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_get_initiator_name.c
|
|
|
62f653 |
@@ -0,0 +1,38 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ char initiatorname[LIBISCSI_VALUE_MAXLEN];
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_get_firmware_initiator_name(initiatorname)) {
|
|
|
62f653 |
+ fprintf(stderr, "No iscsi boot firmware found\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ printf("iqn:\t%s\n", initiatorname);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_get_network_config.c b/libiscsi/tests/test_get_network_config.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..2dedd61
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_get_network_config.c
|
|
|
62f653 |
@@ -0,0 +1,45 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_network_config config;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (libiscsi_get_firmware_network_config(&config)) {
|
|
|
62f653 |
+ fprintf(stderr, "No iscsi boot firmware found\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ printf("dhcp:\t%d\n", config.dhcp);
|
|
|
62f653 |
+ printf("iface:\t%s\n", config.iface_name);
|
|
|
62f653 |
+ printf("mac:\t%s\n", config.mac_address);
|
|
|
62f653 |
+ printf("ipaddr:\t%s\n", config.ip_address);
|
|
|
62f653 |
+ printf("mask:\t%s\n", config.netmask);
|
|
|
62f653 |
+ printf("gate:\t%s\n", config.gateway);
|
|
|
62f653 |
+ printf("dns1:\t%s\n", config.primary_dns);
|
|
|
62f653 |
+ printf("dns2:\t%s\n", config.secondary_dns);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return 0;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_login.c b/libiscsi/tests/test_login.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..3eb70d6
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_login.c
|
|
|
62f653 |
@@ -0,0 +1,52 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_node node;
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ snprintf(node.name, LIBISCSI_VALUE_MAXLEN, "%s",
|
|
|
62f653 |
+ "iqn.2009-01.com.example:testdisk");
|
|
|
62f653 |
+ node.tpgt = 1;
|
|
|
62f653 |
+ snprintf(node.address, NI_MAXHOST, "%s", "127.0.0.1");
|
|
|
62f653 |
+ node.port = 3260;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context) {
|
|
|
62f653 |
+ fprintf(stderr, "Error initializing libiscsi\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_login(context, &node);
|
|
|
62f653 |
+ if (rc)
|
|
|
62f653 |
+ fprintf(stderr, "Error logging in: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+
|
|
|
62f653 |
+ libiscsi_cleanup(context);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_logout.c b/libiscsi/tests/test_logout.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..b734dca
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_logout.c
|
|
|
62f653 |
@@ -0,0 +1,51 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_node node;
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ snprintf(node.name, LIBISCSI_VALUE_MAXLEN, "%s",
|
|
|
62f653 |
+ "iqn.2009-01.com.example:testdisk");
|
|
|
62f653 |
+ node.tpgt = 1;
|
|
|
62f653 |
+ snprintf(node.address, NI_MAXHOST, "%s", "127.0.0.1");
|
|
|
62f653 |
+ node.port = 3260;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context) {
|
|
|
62f653 |
+ fprintf(stderr, "Error initializing libiscsi\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_logout(context, &node);
|
|
|
62f653 |
+ if (rc)
|
|
|
62f653 |
+ fprintf(stderr, "Error logging out: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+
|
|
|
62f653 |
+ libiscsi_cleanup(context);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_params.c b/libiscsi/tests/test_params.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..d3223be
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_params.c
|
|
|
62f653 |
@@ -0,0 +1,103 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <errno.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_node node;
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+ char orig_value[LIBISCSI_VALUE_MAXLEN], value[LIBISCSI_VALUE_MAXLEN];
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ snprintf(node.name, LIBISCSI_VALUE_MAXLEN, "%s",
|
|
|
62f653 |
+ "iqn.2009-01.com.example:testdisk");
|
|
|
62f653 |
+ node.tpgt = 1;
|
|
|
62f653 |
+ snprintf(node.address, NI_MAXHOST, "%s", "127.0.0.1");
|
|
|
62f653 |
+ node.port = 3260;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context) {
|
|
|
62f653 |
+ fprintf(stderr, "Error initializing libiscsi\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_get_parameter(context, &node, "node.startup",
|
|
|
62f653 |
+ orig_value);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ fprintf(stderr, "Error getting original value: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_set_parameter(context, &node, "node.startup",
|
|
|
62f653 |
+ "automatic");
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ fprintf(stderr, "Error setting node startup param: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_get_parameter(context, &node, "node.startup",
|
|
|
62f653 |
+ value);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ fprintf(stderr, "Error getting node startup param: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (strcmp(value, "automatic")) {
|
|
|
62f653 |
+ fprintf(stderr, "Error set and get values do not match!\n");
|
|
|
62f653 |
+ rc = EIO;
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_set_parameter(context, &node, "node.startup",
|
|
|
62f653 |
+ orig_value);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ fprintf(stderr, "Error setting original value: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_get_parameter(context, &node, "node.startup",
|
|
|
62f653 |
+ value);
|
|
|
62f653 |
+ if (rc) {
|
|
|
62f653 |
+ fprintf(stderr, "Error re-getting original value: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ if (strcmp(value, orig_value)) {
|
|
|
62f653 |
+ fprintf(stderr,
|
|
|
62f653 |
+ "Error set and get original values do not match!\n");
|
|
|
62f653 |
+ rc = EIO;
|
|
|
62f653 |
+ goto leave;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+leave:
|
|
|
62f653 |
+ libiscsi_cleanup(context);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/libiscsi/tests/test_set_auth.c b/libiscsi/tests/test_set_auth.c
|
|
|
62f653 |
new file mode 100644
|
|
|
5f4533 |
index 0000000..a21f888
|
|
|
62f653 |
--- /dev/null
|
|
|
62f653 |
+++ b/libiscsi/tests/test_set_auth.c
|
|
|
62f653 |
@@ -0,0 +1,58 @@
|
|
|
62f653 |
+/*
|
|
|
62f653 |
+ * iSCSI Administration library
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved.
|
|
|
62f653 |
+ * Copyright (C) 2008-2009 Hans de Goede <hdegoede@redhat.com>
|
|
|
62f653 |
+ * maintained by open-iscsi@googlegroups.com
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is free software; you can redistribute it and/or modify
|
|
|
62f653 |
+ * it under the terms of the GNU General Public License as published
|
|
|
62f653 |
+ * by the Free Software Foundation; either version 2 of the License, or
|
|
|
62f653 |
+ * (at your option) any later version.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * This program is distributed in the hope that it will be useful, but
|
|
|
62f653 |
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
62f653 |
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
62f653 |
+ * General Public License for more details.
|
|
|
62f653 |
+ *
|
|
|
62f653 |
+ * See the file COPYING included with this distribution for more details.
|
|
|
62f653 |
+ */
|
|
|
62f653 |
+
|
|
|
62f653 |
+#include <stdio.h>
|
|
|
62f653 |
+#include <stdlib.h>
|
|
|
62f653 |
+#include <string.h>
|
|
|
62f653 |
+#include "libiscsi.h"
|
|
|
62f653 |
+
|
|
|
62f653 |
+int main(void)
|
|
|
62f653 |
+{
|
|
|
62f653 |
+ struct libiscsi_node node;
|
|
|
62f653 |
+ struct libiscsi_context *context;
|
|
|
62f653 |
+ struct libiscsi_auth_info auth_info;
|
|
|
62f653 |
+ int rc = 0;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ snprintf(node.name, LIBISCSI_VALUE_MAXLEN, "%s",
|
|
|
62f653 |
+ "iqn.2009-01.com.example:testdisk");
|
|
|
62f653 |
+ node.tpgt = 1;
|
|
|
62f653 |
+ snprintf(node.address, NI_MAXHOST, "%s", "127.0.0.1");
|
|
|
62f653 |
+ node.port = 3260;
|
|
|
62f653 |
+
|
|
|
62f653 |
+ memset(&auth_info, 0, sizeof(auth_info));
|
|
|
62f653 |
+ auth_info.method = libiscsi_auth_chap;
|
|
|
62f653 |
+ strcpy(auth_info.chap.username, "joe");
|
|
|
62f653 |
+ strcpy(auth_info.chap.password, "secret");
|
|
|
62f653 |
+
|
|
|
62f653 |
+ context = libiscsi_init();
|
|
|
62f653 |
+ if (!context) {
|
|
|
62f653 |
+ fprintf(stderr, "Error initializing libiscsi\n");
|
|
|
62f653 |
+ return 1;
|
|
|
62f653 |
+ }
|
|
|
62f653 |
+
|
|
|
62f653 |
+ rc = libiscsi_node_set_auth(context, &node, &auth_info);
|
|
|
62f653 |
+ if (rc)
|
|
|
62f653 |
+ fprintf(stderr, "Error setting authinfo: %s\n",
|
|
|
62f653 |
+ libiscsi_get_error_string(context));
|
|
|
62f653 |
+
|
|
|
62f653 |
+ libiscsi_cleanup(context);
|
|
|
62f653 |
+
|
|
|
62f653 |
+ return rc;
|
|
|
62f653 |
+}
|
|
|
62f653 |
diff --git a/usr/Makefile b/usr/Makefile
|
|
|
9a267a |
index 21bb154..885243a 100644
|
|
|
62f653 |
--- a/usr/Makefile
|
|
|
62f653 |
+++ b/usr/Makefile
|
|
|
5f4533 |
@@ -37,7 +37,7 @@ PKG_CONFIG = /usr/bin/pkg-config
|
|
|
62f653 |
CFLAGS ?= -O2 -g
|
|
|
9a267a |
WARNFLAGS ?= -Wall -Wextra -Werror -Wstrict-prototypes -fno-common
|
|
|
62f653 |
CFLAGS += $(WARNFLAGS) -I../include -I. -D_GNU_SOURCE \
|
|
|
62f653 |
- -I$(TOPDIR)/libopeniscsiusr
|
|
|
62f653 |
+ -I$(TOPDIR)/libopeniscsiusr -DISNS_ENABLE
|
|
|
5f4533 |
CFLAGS += $(shell $(PKG_CONFIG) --cflags libkmod)
|
|
|
62f653 |
ISCSI_LIB = -L$(TOPDIR)/libopeniscsiusr -lopeniscsiusr
|
|
|
5f4533 |
LDFLAGS += $(shell $(PKG_CONFIG) --libs libkmod)
|
|
|
62f653 |
diff --git a/usr/discovery.c b/usr/discovery.c
|
|
|
9a267a |
index 7dec696..2cf1838 100644
|
|
|
62f653 |
--- a/usr/discovery.c
|
|
|
62f653 |
+++ b/usr/discovery.c
|
|
|
62f653 |
@@ -36,6 +36,7 @@
|
|
|
62f653 |
#include "types.h"
|
|
|
62f653 |
#include "iscsi_proto.h"
|
|
|
62f653 |
#include "initiator.h"
|
|
|
62f653 |
+#include "config.h"
|
|
|
62f653 |
#include "log.h"
|
|
|
62f653 |
#include "idbm.h"
|
|
|
62f653 |
#include "iscsi_settings.h"
|
|
|
62f653 |
@@ -49,10 +50,12 @@
|
|
|
62f653 |
#include "iface.h"
|
|
|
62f653 |
#include "iscsi_timer.h"
|
|
|
62f653 |
#include "iscsi_err.h"
|
|
|
62f653 |
+#ifdef ISNS_ENABLE
|
|
|
62f653 |
/* libisns includes */
|
|
|
62f653 |
#include <libisns/isns.h>
|
|
|
62f653 |
#include <libisns/paths.h>
|
|
|
62f653 |
#include <libisns/message.h>
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
|
|
|
62f653 |
#ifdef SLP_ENABLE
|
|
|
62f653 |
#include "iscsi-slp-discovery.h"
|
|
|
62f653 |
@@ -98,6 +101,7 @@ static int request_initiator_name(int tmo)
|
|
|
62f653 |
return 0;
|
|
|
62f653 |
}
|
|
|
62f653 |
|
|
|
62f653 |
+#ifdef ISNS_ENABLE
|
|
|
62f653 |
void discovery_isns_free_servername(void)
|
|
|
62f653 |
{
|
|
|
62f653 |
if (isns_config.ic_server_name)
|
|
|
62f653 |
@@ -377,6 +381,7 @@ retry:
|
|
|
62f653 |
discovery_isns_free_servername();
|
|
|
62f653 |
return rc;
|
|
|
62f653 |
}
|
|
|
62f653 |
+#endif
|
|
|
62f653 |
|
|
|
9a267a |
int discovery_fw(void *data,
|
|
|
9a267a |
__attribute__((unused))struct iface_rec *iface,
|
|
|
62f653 |
diff --git a/usr/idbm.c b/usr/idbm.c
|
|
|
9a267a |
index 27cad0a..2498a03 100644
|
|
|
62f653 |
--- a/usr/idbm.c
|
|
|
62f653 |
+++ b/usr/idbm.c
|
|
|
9a267a |
@@ -1825,9 +1825,9 @@ int idbm_print_all_discovery(int info_level)
|
|
|
62f653 |
* fn should return -1 if it skipped the rec, an ISCSI_ERR error code if
|
|
|
62f653 |
* the operation failed or 0 if fn was run successfully.
|
|
|
62f653 |
*/
|
|
|
221d9a |
-static int idbm_for_each_iface(int *found, void *data, idbm_iface_op_fn *fn,
|
|
|
221d9a |
- char *targetname, int tpgt, char *ip, int port,
|
|
|
221d9a |
- bool ruw_lock)
|
|
|
221d9a |
+int idbm_for_each_iface(int *found, void *data, idbm_iface_op_fn *fn,
|
|
|
221d9a |
+ char *targetname, int tpgt, char *ip, int port,
|
|
|
221d9a |
+ bool ruw_lock)
|
|
|
62f653 |
{
|
|
|
62f653 |
DIR *iface_dirfd;
|
|
|
62f653 |
struct dirent *iface_dent;
|
|
|
62f653 |
diff --git a/usr/idbm.h b/usr/idbm.h
|
|
|
9a267a |
index ce098b7..d1a7f63 100644
|
|
|
62f653 |
--- a/usr/idbm.h
|
|
|
62f653 |
+++ b/usr/idbm.h
|
|
|
9a267a |
@@ -105,6 +105,9 @@ struct rec_op_data {
|
|
|
62f653 |
node_rec_t *match_rec;
|
|
|
62f653 |
idbm_iface_op_fn *fn;
|
|
|
62f653 |
};
|
|
|
221d9a |
+extern int idbm_for_each_iface(int *found, void *data, idbm_iface_op_fn *fn,
|
|
|
221d9a |
+ char *targetname, int tpgt, char *ip, int port,
|
|
|
221d9a |
+ bool ruw_lock);
|
|
|
221d9a |
extern int idbm_for_each_portal(int *found, void *data, idbm_portal_op_fn *fn,
|
|
|
221d9a |
char *targetname, bool ruw_lock);
|
|
|
62f653 |
extern int idbm_for_each_node(int *found, void *data,
|
|
|
62f653 |
diff --git a/usr/iscsi_ipc.h b/usr/iscsi_ipc.h
|
|
|
9a267a |
index 47857dd..596543b 100644
|
|
|
62f653 |
--- a/usr/iscsi_ipc.h
|
|
|
62f653 |
+++ b/usr/iscsi_ipc.h
|
|
|
62f653 |
@@ -162,4 +162,6 @@ struct iscsi_ipc {
|
|
|
62f653 |
char *host_stats);
|
|
|
62f653 |
};
|
|
|
62f653 |
|
|
|
9a267a |
+extern struct iscsi_ipc *ipc;
|
|
|
62f653 |
+
|
|
|
62f653 |
#endif /* ISCSI_IPC_H */
|
|
|
62f653 |
--
|
|
|
9a267a |
2.26.2
|
|
|
62f653 |
|