/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Commmon routines, handling iscsi boot props
*/
#include <sys/bootprops.h>
extern ib_boot_prop_t *iscsiboot_prop;
int iscsi_print_bootprop = 0;
static void
{
return;
}
if (iscsi_print_bootprop == 1) {
}
}
static void
{
return;
}
"Initiator Name : %s\n",
}
"Initiator CHAP Name : %s\n",
}
}
static void
{
int n = 0;
return;
}
"Local IP addr : %s\n", ipaddr);
"Local gateway : %s\n", ipaddr);
"Local DHCP : %s\n", ipaddr);
"Local MAC : %02x:%02x:%02x:%02x:%02x:%02x\n",
}
static void
{
return;
}
"Target Name : %s\n",
}
"Target IP : %s\n"
"Target Port : %d\n"
"Boot LUN : %02x%02x-%02x%02x-%02x%02x-%02x%02x\n",
itgtp->tgt_boot_lun[0],
"CHAP Name : %s\n",
}
}
void
{
if (iscsiboot_prop == NULL) {
return;
}
}
void
{
return;
}
init->ini_name_len = 0;
}
init->ini_chap_name_len = 0;
}
init->ini_chap_sec_len = 0;
}
}
void
{
return;
}
target->tgt_name_len = 0;
}
target->tgt_chap_name_len = 0;
}
target->tgt_chap_sec_len = 0;
}
target->tgt_boot_par_len = 0;
}
}
/*
* Free the memory used by boot property.
*/
void
{
if (iscsiboot_prop == NULL) {
return;
}
}
static void
{
unsigned char *p = NULL;
int i = 0;
return;
}
p = (unsigned char *)in;
} else {
for (i = 0; i < 14; i = i + 2) {
}
}
}
#ifndef BO_MAXOBJNAME
#endif
#ifndef ISCSI_BOOT_ISID
#endif
/*
* Generate the 'ssd' bootpath of an iSCSI boot device
* The caller is responsible to alloc the buf with BO_MAXOBJNAME length
*/
void
{
if (iscsiboot_prop == NULL)
ld_ib_prop();
if (iscsiboot_prop == NULL)
return;
}
/*
* Generate the 'disk' bootpath of an iSCSI boot device
* The caller is responsible to alloc the buf with BO_MAXOBJNAME length
*/
void
{
if (iscsiboot_prop == NULL)
ld_ib_prop();
if (iscsiboot_prop == NULL)
return;
return;
}
}
{
unsigned char *p = NULL;
int i = 0;
return (-1);
}
for (p = source; *p != '\0'; p++, i++) {
if (i >= n) {
return (-1);
}
switch (*p) {
case ':':
*dst = '%';
dst++;
*dst = '3';
dst++;
*dst = 'A';
dst++;
break;
case ' ':
*dst = '%';
dst++;
*dst = '2';
dst++;
*dst = '0';
dst++;
break;
case '@':
*dst = '%';
dst++;
*dst = '4';
dst++;
*dst = '0';
dst++;
break;
case '/':
*dst = '%';
dst++;
*dst = '2';
dst++;
*dst = 'F';
dst++;
break;
default:
*dst = *p;
dst++;
}
}
*dst = '\0';
return (0);
}