helper.h revision 36c5fee33fa8b822175d410202aebcf592c8d342
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _HELPER_H
#define _HELPER_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define MAX_ISCSI_NAME_LEN 223
#define MAX_ADDRESS_LEN 255
#define MIN_CHAP_SECRET_LEN 12
#define MAX_CHAP_SECRET_LEN 16
#define DEFAULT_ISCSI_PORT 3260
#define DEFAULT_RADIUS_PORT 1812
#define MAX_CHAP_NAME_LEN 512
/* forward declarations */
#define PARSE_ADDR_OK 0
#define PARSE_ADDR_MISSING_CLOSING_BRACKET 1
#define PARSE_ADDR_PORT_OUT_OF_RANGE 2
#define PARSE_TARGET_OK 0
#define PARSE_TARGET_INVALID_TPGT 1
#define PARSE_TARGET_INVALID_ADDR 2
typedef enum iSCSINameCheckStatus {
typedef struct stat_delta {
struct stat_delta *next;
char *device;
} stat_delta_t;
/* helper functions */
int getSecret(char *, int *, int, int);
char *number_to_scaled_string(
char *buf,
unsigned long long number,
int unit_from,
int scale);
void stats_free();
char *dospace(int n);
#ifdef __cplusplus
}
#endif
#endif /* _HELPER_H */