CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-10-22 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Sat Oct 22 19:09:37 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsic_daemonif.c
iscsic_driverif.c iscsic_globals.h

Log Message:
make this compile with gcc 4.5


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.4
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.3	Mon Aug 15 17:46:36 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c	Sat Oct 22 19:09:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_daemonif.c,v 1.3 2011/08/15 17:46:36 riz Exp $	*/
+/*	$NetBSD: iscsic_daemonif.c,v 1.4 2011/10/22 19:09:37 agc Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -148,7 +148,7 @@ do_remove_target(int argc, char **argv, 
 		if (rsp->status) {
 			status_error_slist(rsp->status);
 		}
-		req.id.id = ((iscsid_sym_id_t *) & rsp->parameter)->id;
+		GET_SYM_ID(req.id.id, rsp->parameter);
 		free_response(rsp);
 	} else {
 		check_extra_args(argc, argv);
@@ -201,7 +201,7 @@ do_refresh(int argc, char **argv, iscsid
 			if (rsp->status) {
 status_error_slist(rsp->status);
 			}
-			req.id[0] = ((iscsid_sym_id_t *) & rsp->parameter)->id;
+			GET_SYM_ID(req.id[0], rsp->parameter);
 			free_response(rsp);
 		} else {
 			req.id[0] = id.id;
@@ -568,7 +568,7 @@ remove_isns_server(int argc, char **argv
 		if (rsp->status) {
 			status_error_slist(rsp->status);
 		}
-		req.id = ((iscsid_sym_id_t *) & rsp->parameter)->id;
+		GET_SYM_ID(req.id, rsp->parameter);
 		free_response(rsp);
 	} else {
 		check_extra_args(argc, argv);
@@ -799,6 +799,7 @@ STATIC void
 login_or_add(iscsid_login_req_t * loginp, int argc, char **argv)
 {
 	iscsid_add_target_req_t *targ = NULL;
+	iscsid_add_target_rsp_t	*tgtrsp;
 	iscsid_set_target_authentication_req_t auth;
 	iscsid_get_set_target_options_t opt;
 	iscsid_search_list_req_t srch;
@@ -832,8 +833,9 @@ login_or_add(iscsid_login_req_t * loginp
 if (rsp->status) {
 	status_error(rsp->status);
 }
-loginp->portal_id.id =
-	((iscsid_add_target_rsp_t *)&rsp->parameter)->target_id;
+tgtrsp = (iscsid_add_target_rsp_t *)(void *)(rsp->parameter);
+(void) memcpy(&loginp->portal_id.id, &tgtrsp->target_id,
+	sizeof(loginp->portal_id.id));
 			} else {
 /* else find the target by its TargetName */
 srch.search_kind = FIND_TARGET_NAME;
@@ -846,7 +848,7 @@ login_or_add(iscsid_login_req_t * loginp
 if (rsp->status) {
 	status_error_slist(rsp->status);
 }
-loginp->portal_id.id = ((iscsid_sym_id_t *)&rsp->parameter)->id;
+GET_SYM_ID(loginp->portal_id.id, rsp->parameter);
 			}
 			free_response(rsp);
 		}
@@ -960,6 +962,7 @@ int
 add_connection(int argc, char **argv)
 {
 	iscsid_login_req_t loginp;
+	iscsid_login_rsp_t	*loginrsp;
 	iscsid_response_t *rsp;
 
 	memset(&loginp, 0x0, sizeof(loginp));
@@ -974,8 +977,8 @@ add_connection(int argc, char **argv)
 	if (rsp->status) {
 		status_error(rsp->status);
 	}
-	printf("Added Connection %d\n",
-		((iscsid_login_rsp_t *) rsp->parameter)->connection_id.id);
+	loginrsp = (iscsid_login_rsp_t *)(void *)(rsp->parameter);
+	printf("Added Connection %d\n", loginrsp->connection_id.id);
 
 	free_response(rsp);
 	return 0;
Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.4
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.3	Mon Aug 15 17:46:36 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c	Sat Oct 22 19:09:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_driverif.c,v 1.3 2011/08/15 17:46:36 riz Exp $	*/
+/*	$NetBSD: iscsic_driverif.c,v 1.4 2011/10/22 19:09:37 agc Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -268,7 +268,7 @@ get_sessid(int argc, char **argv, int op
 		if (rsp->status)
 			status_error_slist(rsp->status);
 
-		sid.id = ((iscsid_sym_id_t *) & rsp->parameter)->id;
+		GET_SYM_ID(sid.id, rsp->parameter);
 		free_response(rsp);
 	}
 	return sid.id;
@@ -503,6 +503,7 @@ read_capacity(int argc, char **argv)
 	int rc;
 	uint32_t bsz;
 	uint64_t lbn, cap;
+	uint32_t n;
 
 	(void) memset(&io, 0x0, sizeof(io));
 	if ((io.session_id = get_sessid(argc, argv, FALSE)) == 0) {
@@ -519,8 +520,10 @@ read_capacity(int argc, char **argv)
 	if ((rc = do_ioctl(&io, TRUE)) != 0) {
 		return rc;
 	}
-	lbn = (uint64_t) 

CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 02:24:33 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: TODO iscsic_daemonif.c
iscsic_driverif.c iscsic_globals.h iscsic_main.c iscsic_parse.c

Log Message:
Make this compile WARNS=4


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_parse.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/TODO
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.1.1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.2
--- othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.1.1.1	Mon May  2 07:01:06 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/TODO	Mon Aug  8 02:24:33 2011
@@ -1,6 +1,5 @@
 To Do
 =
-mktemp()
 man page
 global buf - make local
 
@@ -14,3 +13,4 @@
 ctype.h
 u_int
 u_char
+mktemp()
Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.1.1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.2
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.1.1.1	Mon May  2 07:01:03 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c	Mon Aug  8 02:24:33 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_daemonif.c,v 1.1.1.1 2011/05/02 07:01:03 agc Exp $	*/
+/*	$NetBSD: iscsic_daemonif.c,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -49,7 +49,8 @@
 	iscsid_get_set_target_options_t opt;
 	iscsid_response_t *rsp;
 	iscsid_add_target_rsp_t *res;
-	int opts, auths, tlen, i;
+	unsigned		i;
+	int opts, auths, tlen;
 	uint32_t tid;
 
 	tlen = cl_get_target(&targ, argc, argv, kind != SEND_TARGETS_LIST);
@@ -134,7 +135,7 @@
 	iscsid_response_t *rsp;
 
 	if (!cl_get_id('I', &req.id, argc, argv)) {
-		if (!cl_get_string('n', srch.strval, argc, argv)) {
+		if (!cl_get_string('n', (char *)srch.strval, argc, argv)) {
 			arg_missing("Target ID or Name");
 		}
 		check_extra_args(argc, argv);
@@ -192,7 +193,8 @@
 
 			srch.search_kind = FIND_NAME;
 			srch.list_kind = kind;
-			strlcpy(srch.strval, id.name, sizeof(srch.strval));
+			strlcpy((char *)srch.strval, (char *)id.name,
+sizeof(srch.strval));
 
 			send_request(ISCSID_SEARCH_LIST, sizeof(srch), &srch);
 			rsp = get_response(FALSE);
@@ -347,7 +349,7 @@
 	iscsid_response_t *trsp, *prsp;
 	iscsid_get_target_rsp_t *targ;
 	iscsid_get_portal_rsp_t *port;
-	int i;
+	unsigned i;
 
 	/* get target info */
 	req.list_kind = kind;
@@ -414,7 +416,7 @@
 	iscsid_get_list_req_t lst;
 	iscsid_response_t *rsp;
 	iscsid_get_list_rsp_t *list;
-	int i;
+	unsigned i;
 
 	check_extra_args(argc, argv);
 
@@ -512,10 +514,11 @@
 int
 add_isns_server(int argc, char **argv)
 {
-	iscsid_add_isns_server_req_t arg = { {0} };
+	iscsid_add_isns_server_req_t arg;
 	iscsid_add_isns_server_rsp_t *res;
 	iscsid_response_t *rsp;
 
+	(void) memset(&arg, 0x0, sizeof(arg));
 	if (!(cl_get_isns(&arg, argc, argv))) {
 		arg_missing("Server Address");
 	}
@@ -553,7 +556,7 @@
 	iscsid_response_t *rsp;
 
 	if (!cl_get_id('I', &req, argc, argv)) {
-		if (!cl_get_string('a', srch.strval, argc, argv)) {
+		if (!cl_get_string('a', (char *)srch.strval, argc, argv)) {
 			arg_missing("Server Address");
 		}
 		check_extra_args(argc, argv);
@@ -615,9 +618,10 @@
 	iscsid_response_t *rsp, *prsp;
 	iscsid_get_list_rsp_t *list;
 	iscsid_get_isns_server_rsp_t *isns;
-	iscsid_sym_id_t req = { 0 };
-	int i;
+	iscsid_sym_id_t req;
+	unsigned i;
 
+	(void) memset(&req, 0x0, sizeof(req));
 	check_extra_args(argc, argv);
 
 	/* get the list of servers */
@@ -674,11 +678,12 @@
 int
 add_initiator(int argc, char **argv)
 {
-	iscsid_add_initiator_req_t req = { {0} };
+	iscsid_add_initiator_req_t req;
 	iscsid_add_initiator_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	if (!cl_get_string('a', req.address, argc, argv)) {
+	(void) memset(&req, 0x0, sizeof(req));
+	if (!cl_get_string('a', (char *)req.address, argc, argv)) {
 		arg_missing("Interface Address");
 	}
 	cl_get_symname(req.name, argc, argv);
@@ -709,9 +714,10 @@
 int
 remove_initiator(int argc, char **argv)
 {
-	iscsid_sym_id_t req = { 0 };
+	iscsid_sym_id_t req;
 	iscsid_response_t *rsp;
 
+	(void) memset(&req, 0x0, sizeof(req));
 	if (!cl_get_id('I', &req, argc, argv)) {
 		arg_missing("Initiator Portal ID");
 	}
@@ -744,9 +750,10 @@
 	iscsid_response_t *rsp, *prsp;
 	iscsid_get_list_rsp_t *list;
 	iscsid_get_initiator_rsp_t *init;
-	iscsid_sym_id_t req = { 0 };
-	int i;
+	iscsid_sym_id_t 

CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 02:25:32 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: Makefile

Log Message:
Make this compile WARNS=4


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.2 \
othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.1.1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.2
--- othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.1.1.1	Mon May  2 07:01:06 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile	Mon Aug  8 02:25:32 2011
@@ -2,12 +2,15 @@
 
 MKMAN=	no
 PROG=	iscsictl
+BINDIR=	/sbin
 
 SRCS=	iscsic_main.c iscsic_driverif.c iscsic_daemonif.c iscsic_parse.c \
 	iscsic_test.c
 
 CPPFLAGS+= -I${DESTDIR}/usr/include/dev/iscsi
 
+WARNS=	4
+
 # CPPFLAGS+= -DISCSI_TEST_MODE -DISCSI_DEBUG
 
 .include 



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 06:53:00 UTC 2011

Added Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsictl.8

Log Message:
Add a first pass at a manual page, iscsictl(8).


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Added files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8
diff -u /dev/null othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.1
--- /dev/null	Mon Aug  8 06:53:00 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8	Mon Aug  8 06:52:59 2011
@@ -0,0 +1,219 @@
+.\" $NetBSD: iscsictl.8,v 1.1 2011/08/08 06:52:59 agc Exp $
+.\"
+.\" Copyright (c) 2011 Alistair Crooks 
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\"notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\"notice, this list of conditions and the following disclaimer in the
+.\"documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.Dd August 5, 2011
+.Dt ISCSICTL 8
+.Os
+.Sh NAME
+.Nm iscsictl
+.Nd program to manage iSCSI instances
+.Sh SYNOPSIS
+.Nm
+.Op Fl v
+.Op Fl d Ar directory
+command
+.Op Ar arguments...
+.Sh DESCRIPTION
+The
+.Nm
+utility manages iSCSI instances on the local computer.
+It talks to the
+.Xr iscsid 8
+program to perform this management.
+.Pp
+iSCSI is a method for transferring SCSI commands across a TCP
+connection.
+The client which issues the SCSI command is called the initiator,
+and the device which receives the command and takes action
+is called the target; this mirrors SCSI devices, although instead
+of being physically attached to a host, the SCSI commands and
+responses take place over a TCP connection.
+iSCSI communication is done in sessions.
+The iSCSI initiator logs in to a terget across the network,
+possible authenticating itself; this creates an iSCSI session between initiator
+and target.
+The initiator can then issue commands
+and read responses from the target.
+.Pp
+Firstly, a TCP connection
+the iSCSI initiator on the local machine must be made
+aware of the network location of the target.
+The
+.Dv add_send_target
+is used in
+.Nm
+to do this.
+The targets can be listed using the
+.Dv list_targets
+command.
+To login from the initiator to the target, the
+.Dv login
+command is used; this creates a session between the initiator and target.
+The sessions can be listed by using
+the
+.Dv list_sessions
+command.
+.Pp
+The
+.Nm
+command argument is taken from one of the following options:
+.Bl -tag -width XCXremove_send_targetXX
+.It version
+return the version number of the
+.Nm
+utility
+.It add_target
+.It add_portal
+.It remove_target
+.It slp_find_targets
+.It refresh_targets
+this command causes the iSCSI initiator to refresh its view of the
+iSCSI targets to which it is connected.
+If this command completes successfully, an
+.Dq OK
+value is printed.
+For more context on the exact usage of this
+command, please ee the worked example below.
+.It list_targets
+.It add_send_target
+this coomand allows the iSCSI initiator to connect to an iSCSI
+target. The subsequent
+.Fl a
+target provides the address of the target.
+This can be provided as a numerical IP address,
+or as a textual FQDN.
+For more context on the exact usage of this
+command, please ee the worked example below.
+.It remove_send_target
+.It list_send_targets
+.It add_isns_server
+.It remove_isns_server
+.It find_isns_servers
+.It list_isns_servers
+.It refresh_isns
+.It login
+To be able to communicate with the iSCSI target, the initiator
+must login. This command allows this login to take place.
+The subsequent
+.Fl P session
+argument provides the session which should be used to
+perform the login.
+On successful completion of this command, the
+session which has been created will be displayed

CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 06:54:41 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: Makefile

Log Message:
Also make the man page for iscsictl(8)


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile:1.2	Mon Aug  8 02:25:32 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/Makefile	Mon Aug  8 06:54:41 2011
@@ -1,6 +1,5 @@
 #	$wasabi: Makefile,v 1.2 2006/05/03 22:45:02 wrstuden Exp $
 
-MKMAN=	no
 PROG=	iscsictl
 BINDIR=	/sbin
 
@@ -9,8 +8,13 @@
 
 CPPFLAGS+= -I${DESTDIR}/usr/include/dev/iscsi
 
+CPPFLAGS+=	-I${.CURDIR}/../../sys/dev/iscsi
+CPPFLAGS+=	-I${.CURDIR}/../../sys
+CPPFLAGS+=	-I${.CURDIR}/../iscsid
 WARNS=	4
 
+MAN=	iscsictl.8
+
 # CPPFLAGS+= -DISCSI_TEST_MODE -DISCSI_DEBUG
 
 .include 



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-07 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Mon Aug  8 06:55:38 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: TODO

Log Message:
i've created the initial draft of the man page - take this off the list of
things to do.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/TODO
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/TODO:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/TODO	Mon Aug  8 06:55:37 2011
@@ -1,6 +1,5 @@
 To Do
 =
-man page
 global buf - make local
 
 Done
@@ -14,3 +13,4 @@
 u_int
 u_char
 mktemp()
+man page



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-08 Thread David A. Holland
Module Name:othersrc
Committed By:   dholland
Date:   Mon Aug  8 07:22:13 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsictl.8

Log Message:
Minor edits (I don't know enough about how thi works to help that much)


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.1 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.2
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.1	Mon Aug  8 06:52:59 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8	Mon Aug  8 07:22:12 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: iscsictl.8,v 1.1 2011/08/08 06:52:59 agc Exp $
+.\" $NetBSD: iscsictl.8,v 1.2 2011/08/08 07:22:12 dholland Exp $
 .\"
 .\" Copyright (c) 2011 Alistair Crooks 
 .\" All rights reserved.
@@ -49,14 +49,15 @@
 and the device which receives the command and takes action
 is called the target; this mirrors SCSI devices, although instead
 of being physically attached to a host, the SCSI commands and
-responses take place over a TCP connection.
+responses take place over a network.
 iSCSI communication is done in sessions.
-The iSCSI initiator logs in to a terget across the network,
-possible authenticating itself; this creates an iSCSI session between initiator
+The iSCSI initiator logs in to a target across the network,
+possibly authenticating itself; this creates an iSCSI session between initiator
 and target.
-The initiator can then issue commands
+The initiator can then issue commands to
 and read responses from the target.
 .Pp
+.\" XXX what does this mean?
 Firstly, a TCP connection
 the iSCSI initiator on the local machine must be made
 aware of the network location of the target.
@@ -98,14 +99,14 @@
 command, please ee the worked example below.
 .It list_targets
 .It add_send_target
-this coomand allows the iSCSI initiator to connect to an iSCSI
+this command allows the iSCSI initiator to connect to an iSCSI
 target. The subsequent
 .Fl a
 target provides the address of the target.
 This can be provided as a numerical IP address,
 or as a textual FQDN.
 For more context on the exact usage of this
-command, please ee the worked example below.
+command, please see the worked example below.
 .It remove_send_target
 .It list_send_targets
 .It add_isns_server
@@ -124,7 +125,7 @@
 session which has been created will be displayed, along with the connection
 number.
 For more context on the exact usage of this
-command, please ee the worked example below.
+command, please see the worked example below.
 .It logout
 .It add_connection
 .It remove_connection
@@ -140,16 +141,15 @@
 To list the session information, this command is used.
 The session number and target information for each of the targets are displayed.
 For more context on the exact usage of this
-command, please ee the worked example below.
+command, please see the worked example below.
 .It set_node_name
 .El
-.Pp
+.Sh EXAMPLES
 .Nm
 is intended to be used as follows:
-.Sh EXAMPLES
 .Pp
-The initiator itself can be loaded as an lkm, and works successfully
-on 2.0 (the "burner" host), running against the NetBSD target on a 5.99 host.
+The initiator itself can be loaded as a kernel module, and works successfully
+on 2.0 (the host called "burner"), running against the NetBSD target on a 5.99 host.
 .Pp
 .Bd -literal
 burner# modload -v -s -p /usr/lkm/iscsi_post.sh /usr/lkm/iscsidrv.o



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-08 Thread Jeff Rizzo
Module Name:othersrc
Committed By:   riz
Date:   Mon Aug  8 16:23:43 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsic_globals.h

Log Message:
Fix bigendian build of iscsictl.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_globals.h	Mon Aug  8 16:23:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_globals.h,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
+/*	$NetBSD: iscsic_globals.h,v 1.3 2011/08/08 16:23:43 riz Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -114,7 +114,7 @@
 	*d++ = *s--;
 	*d = *s;
 #else
-	memcpy(d, &x[2], 6);
+	memcpy(d, &((uint8_t *)&x)[2], 6);
 #endif
 }
 



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-08 Thread Thomas Klausner
Module Name:othersrc
Committed By:   wiz
Date:   Mon Aug  8 19:54:51 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsictl.8

Log Message:
Try to fix a sentence. New sentence, new line.
Add a comment where the example is unclear. Use more markup.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.2	Mon Aug  8 07:22:12 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8	Mon Aug  8 19:54:51 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: iscsictl.8,v 1.2 2011/08/08 07:22:12 dholland Exp $
+.\" $NetBSD: iscsictl.8,v 1.3 2011/08/08 19:54:51 wiz Exp $
 .\"
 .\" Copyright (c) 2011 Alistair Crooks 
 .\" All rights reserved.
@@ -33,8 +33,8 @@
 .Nm
 .Op Fl v
 .Op Fl d Ar directory
-command
-.Op Ar arguments...
+.Ar command
+.Op Ar arguments ...
 .Sh DESCRIPTION
 The
 .Nm
@@ -57,9 +57,7 @@
 The initiator can then issue commands to
 and read responses from the target.
 .Pp
-.\" XXX what does this mean?
-Firstly, a TCP connection
-the iSCSI initiator on the local machine must be made
+Firstly, the iSCSI initiator on the local machine must be made
 aware of the network location of the target.
 The
 .Dv add_send_target
@@ -72,8 +70,7 @@
 To login from the initiator to the target, the
 .Dv login
 command is used; this creates a session between the initiator and target.
-The sessions can be listed by using
-the
+The sessions can be listed by using the
 .Dv list_sessions
 command.
 .Pp
@@ -96,17 +93,18 @@
 .Dq OK
 value is printed.
 For more context on the exact usage of this
-command, please ee the worked example below.
+command, please see the example below.
 .It list_targets
 .It add_send_target
 this command allows the iSCSI initiator to connect to an iSCSI
-target. The subsequent
+target.
+The subsequent
 .Fl a
 target provides the address of the target.
 This can be provided as a numerical IP address,
 or as a textual FQDN.
 For more context on the exact usage of this
-command, please see the worked example below.
+command, please see the example below.
 .It remove_send_target
 .It list_send_targets
 .It add_isns_server
@@ -116,16 +114,17 @@
 .It refresh_isns
 .It login
 To be able to communicate with the iSCSI target, the initiator
-must login. This command allows this login to take place.
+must login.
+This command allows this login to take place.
 The subsequent
-.Fl P session
+.Fl P Ar session
 argument provides the session which should be used to
 perform the login.
 On successful completion of this command, the
 session which has been created will be displayed, along with the connection
 number.
 For more context on the exact usage of this
-command, please see the worked example below.
+command, please see the example below.
 .It logout
 .It add_connection
 .It remove_connection
@@ -141,7 +140,7 @@
 To list the session information, this command is used.
 The session number and target information for each of the targets are displayed.
 For more context on the exact usage of this
-command, please see the worked example below.
+command, please see the example below.
 .It set_node_name
 .El
 .Sh EXAMPLES
@@ -168,6 +167,7 @@
 Created Session 2, Connection 1
 burner# iscsictl list_sessions
 Session 2: Target iqn.1994-04.org.netbsd.iscsi-target:target0
+.\" how do we know that it was assigned sd0?
 burner# newfs /dev/rsd0a
 /dev/rsd0a: 100.0MB (204800 sectors) block size 8192, fragment size 1024
 	using 4 cylinder groups of 25.00MB, 3200 blks, 6144 inodes.



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-15 Thread Jeff Rizzo
Module Name:othersrc
Committed By:   riz
Date:   Mon Aug 15 17:46:37 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsic_daemonif.c
iscsic_driverif.c

Log Message:
Don't bother casting the unused return of snprintf()/memset() to (void).


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_daemonif.c	Mon Aug 15 17:46:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_daemonif.c,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
+/*	$NetBSD: iscsic_daemonif.c,v 1.3 2011/08/15 17:46:36 riz Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -518,7 +518,7 @@
 	iscsid_add_isns_server_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	(void) memset(&arg, 0x0, sizeof(arg));
+	memset(&arg, 0x0, sizeof(arg));
 	if (!(cl_get_isns(&arg, argc, argv))) {
 		arg_missing("Server Address");
 	}
@@ -621,7 +621,7 @@
 	iscsid_sym_id_t req;
 	unsigned i;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	check_extra_args(argc, argv);
 
 	/* get the list of servers */
@@ -682,7 +682,7 @@
 	iscsid_add_initiator_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	if (!cl_get_string('a', (char *)req.address, argc, argv)) {
 		arg_missing("Interface Address");
 	}
@@ -717,7 +717,7 @@
 	iscsid_sym_id_t req;
 	iscsid_response_t *rsp;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	if (!cl_get_id('I', &req, argc, argv)) {
 		arg_missing("Initiator Portal ID");
 	}
@@ -753,7 +753,7 @@
 	iscsid_sym_id_t req;
 	unsigned i;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	check_extra_args(argc, argv);
 
 	/* get the list of servers */
@@ -894,7 +894,7 @@
 	iscsid_login_rsp_t *res;
 	iscsid_response_t *rsp;
 
-	(void) memset(&loginp, 0x0, sizeof(loginp));
+	memset(&loginp, 0x0, sizeof(loginp));
 	loginp.login_type = (cl_get_opt('m', argc, argv))
 		? ISCSI_LOGINTYPE_NOMAP : ISCSI_LOGINTYPE_MAP;
 
@@ -962,7 +962,7 @@
 	iscsid_login_req_t loginp;
 	iscsid_response_t *rsp;
 
-	(void) memset(&loginp, 0x0, sizeof(loginp));
+	memset(&loginp, 0x0, sizeof(loginp));
 	loginp.login_type = ISCSI_LOGINTYPE_MAP;
 	cl_get_id('I', &loginp.session_id, argc, argv);
 
@@ -1043,8 +1043,8 @@
 	unsigned j;
 	int lconn;
 
-	(void) memset(&creq, 0x0, sizeof(creq));
-	(void) memset(&clreq, 0x0, sizeof(clreq));
+	memset(&creq, 0x0, sizeof(creq));
+	memset(&clreq, 0x0, sizeof(clreq));
 	lconn = cl_get_opt('c', argc, argv);
 
 	check_extra_args(argc, argv);
@@ -1117,7 +1117,7 @@
 	iscsid_response_t *rsp;
 	uint64_t isid;
 
-	(void) memset(&req, 0x0, sizeof(req));
+	memset(&req, 0x0, sizeof(req));
 	if (!cl_get_string('n', (char *)req.InitiatorName, argc, argv)) {
 		arg_missing("Initiator Name");
 	}
Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_driverif.c	Mon Aug 15 17:46:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_driverif.c,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
+/*	$NetBSD: iscsic_driverif.c,v 1.3 2011/08/15 17:46:36 riz Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -336,7 +336,7 @@
 	for (pt = asctab; pt->key != NULL && asc >= pt->asc; pt++) {
 		if (asc == pt->asc && ascq == pt->ascq) {
 			bp = (char *)&buf[1024];
-			(void) snprintf(bp, sizeof(buf) - 1024, "%s: %s",
+			snprintf(bp, sizeof(buf) - 1024, "%s: %s",
 	str, pt->key);
 			return bp;
 		}
@@ -373,38 +373,38 @@
 	if (io->req.senselen_used) {
 		switch (io->req.sense[2] & 0x0f) {
 		case 0x01:
-			(void) snprintf(esp = es, sizeof(es), "Recovered Error");
+			snprintf(esp = es, sizeof(es), "Recovered Error");
 			break;
 		case 0x02:
-			(void) snprintf(esp = es, sizeof(es), "Not Ready");
+			snprintf(esp = es, sizeof(es), "Not Ready");
 			break;
 		case 0x03:
-			(void) snprintf(esp = es, sizeof(es), "Medium Error");
+			snprintf(esp = es, sizeof(es), "Medium Error");
 			break;
 		case 0x04:
-			(void) snprintf(esp = es, sizeof(es), "Hardware Error");
+			snprintf(esp = es, sizeof(es), "Hardware Error");
 			break;
 		case 0x05:
-			(void) snpri

CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-17 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Wed Aug 17 14:41:53 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsic_main.c

Log Message:
don't use a -v command line argument to print the version - we have the
version command to do that


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c:1.2 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c:1.3
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c:1.2	Mon Aug  8 02:24:33 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsic_main.c	Wed Aug 17 14:41:53 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: iscsic_main.c,v 1.2 2011/08/08 02:24:33 agc Exp $	*/
+/*	$NetBSD: iscsic_main.c,v 1.3 2011/08/17 14:41:53 agc Exp $	*/
 
 /*-
  * Copyright (c) 2005,2006,2011 The NetBSD Foundation, Inc.
@@ -542,14 +542,11 @@
 	int		 i;
 
 	(void) snprintf(sockdir, sizeof(sockdir), "/tmp/iscsictl.XX");
-	while ((i = getopt(argc, argv, "d:v")) != -1) {
+	while ((i = getopt(argc, argv, "d:")) != -1) {
 		switch(i) {
 		case 'd':
 			(void) snprintf(sockdir, sizeof(sockdir), "%s", optarg);
 			break;
-		case 'v':
-			printf("%s version %s\n", *argv, ISCSICTL_VERSION);
-			break;
 		default:
 			break;
 		}
@@ -571,7 +568,8 @@
 	}
 	if ((driver = open(DEVICE, O_RDONLY)) < 0) {
 		warn("Opening " DEVICE);
-#ifndef ISCSI_DEBUG/* DEBUG ONLY: Allow CLI to operate w/o driver */
+#ifndef ISCSI_DEBUG
+		/* DEBUG ONLY: Allow CLI to operate w/o driver */
 		return EXIT_FAILURE;
 #endif
 	}



CVS commit: othersrc/external/bsd/iscsi/sbin/iscsictl

2011-08-17 Thread Alistair G. Crooks
Module Name:othersrc
Committed By:   agc
Date:   Wed Aug 17 14:43:16 UTC 2011

Modified Files:
othersrc/external/bsd/iscsi/sbin/iscsictl: iscsictl.8

Log Message:
we refer to an iSCSI session later in this man page as a distinguished value,
so define it properly at first use.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8
diff -u othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.3 othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.4
--- othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8:1.3	Mon Aug  8 19:54:51 2011
+++ othersrc/external/bsd/iscsi/sbin/iscsictl/iscsictl.8	Wed Aug 17 14:43:16 2011
@@ -1,4 +1,4 @@
-.\" $NetBSD: iscsictl.8,v 1.3 2011/08/08 19:54:51 wiz Exp $
+.\" $NetBSD: iscsictl.8,v 1.4 2011/08/17 14:43:16 agc Exp $
 .\"
 .\" Copyright (c) 2011 Alistair Crooks 
 .\" All rights reserved.
@@ -23,7 +23,7 @@
 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd August 5, 2011
+.Dd August 8, 2011
 .Dt ISCSICTL 8
 .Os
 .Sh NAME
@@ -52,7 +52,9 @@
 responses take place over a network.
 iSCSI communication is done in sessions.
 The iSCSI initiator logs in to a target across the network,
-possibly authenticating itself; this creates an iSCSI session between initiator
+possibly authenticating itself; this creates an iSCSI
+.Dv session
+between initiator
 and target.
 The initiator can then issue commands to
 and read responses from the target.