iscsi_targetparam.c revision fcf3ce441efd61da9bb2884968af01cb7c1452cc
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* iSCSI session interfaces
*/
#include "iscsi.h" /* main header */
/* protocol structs and defines */
#include "iscsi_targetparam.h"
#include "persistent.h"
#include <sys/ethernet.h>
static iscsi_targetparams_t iscsi_targets;
/*
* Initializes the target list structure. Called from iscsi_attach.
*/
void
}
/*
* Frees target param list and destroys the list lock.
*/
void
while (curr_entry) {
}
}
/*
* Creates a target param entry and adds it to the target param
* entry list.
*
*/
static iscsi_targetparam_entry_t *
KM_SLEEP);
sizeof (target->target_name));
/* assign unique key for the target */
/* Add new target to the target list */
} else {
}
return (target);
}
/*
* Returns a target param entry's oid given the target name. If the target
* param entry cannot be found one is created and the new oid is returned.
*
*/
int name_length;
while (curr_entry != NULL) {
(char *)name, name_length) == 0)) {
return (curr_entry->target_oid);
}
}
return (curr_entry->target_oid);
}
/*
* Returns a target param entry's target name given its oid. If the oid cannot
* be found, NULL is returned.
*
*/
while (curr_entry != NULL) {
return (curr_entry->target_name);
}
}
return (NULL);
}
/*
* Removes a target param entry from the target param entry list. The
* oid is used to lookup the entry to be removed.
*
*/
int
prev_entry = NULL;
while (curr_entry != NULL) {
if (prev_entry == NULL) {
} else {
}
sizeof (iscsi_targetparam_entry_t));
return (0);
}
}
return (0);
}
/*
* Returns the next element in the target param entry list. If
* NULL is passed as the reference entry then the first item in
* the list is returned. NULL will be returned when the last
* element in the list is used as the reference entry.
*
*/
} else {
}
return (entry);
}
/*
* Lock target param list.
*
*/
void
}
/*
* Unlock target param list.
*
*/
void
}