summaryrefslogtreecommitdiff
path: root/usr/session_info.h
diff options
context:
space:
mode:
authorMike Christie <michaelc@cs.wisc.edu>2008-12-02 19:13:40 -0600
committerMike Christie <michaelc@cs.wisc.edu>2008-12-05 00:34:53 -0600
commit49b8a3a21075304f6cb4d66a74a4048b52c65d6a (patch)
treee1b3e618817eeb30ce6bf78e5b348b1882a51efe /usr/session_info.h
parent299b985ef1117ca08f0c556105a33e3a8d1ec756 (diff)
downloadopen-iscsi-49b8a3a21075304f6cb4d66a74a4048b52c65d6a.tar.gz
iscsiadm: print session and session info running through ifaces in iface mode
If you run iscsiadm -m iface -P 1 or iscsiadm -m iface -I $my_iface -P 1 we print the iface info and if possible the host number and state (only for offload hbas). The P2 level will print the session running through a iface. The P3 level will print the negotiated iscsi params for each session. The P4 level will print the scsi devices accessed through each session.
Diffstat (limited to 'usr/session_info.h')
-rw-r--r--usr/session_info.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/usr/session_info.h b/usr/session_info.h
new file mode 100644
index 0000000..7a22aee
--- /dev/null
+++ b/usr/session_info.h
@@ -0,0 +1,47 @@
+#ifndef SESSION_INFO_H
+#define SESSION_INFO_H
+#include <sys/types.h>
+
+#include "sysfs.h"
+#include "types.h"
+#include "iscsi_proto.h"
+#include "config.h"
+
+struct list;
+
+struct session_info {
+ struct list_head list;
+ /* local info */
+ struct iface_rec iface;
+ int sid;
+
+ /* remote info */
+ char targetname[TARGET_NAME_MAXLEN + 1];
+ int tpgt;
+ char address[NI_MAXHOST + 1];
+ int port;
+ char persistent_address[NI_MAXHOST + 1];
+ int persistent_port;
+};
+
+typedef int (session_match_info_fn_t)(void *data, struct session_info *info);
+
+struct session_link_info {
+ struct list_head *list;
+ session_match_info_fn_t *match_fn;
+ void *data;
+};
+
+#define SESSION_INFO_IFACE 0x1
+#define SESSION_INFO_ISCSI_PARAMS 0x2
+#define SESSION_INFO_ISCSI_STATE 0x4
+#define SESSION_INFO_SCSI_DEVS 0x8
+#define SESSION_INFO_HOST_DEVS 0x10
+
+extern int session_info_create_list(void *data, struct session_info *info);
+extern void session_info_free_list(struct list_head *list);
+extern int session_info_print(int info_level, struct session_info *match_info);
+extern void session_info_print_tree(struct list_head *list, char *prefix,
+ unsigned int flags);
+
+#endif