fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License (the "License").
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You may not use this file except in compliance with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * or http://www.opensolaris.org/os/licensing.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
5df5713f81d69c1a0797f99b13e95e220da00ef9bing zhao - Sun Microsystems - Beijing China * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifndef _RADIUS_AUTH_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define _RADIUS_AUTH_H
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteextern "C" {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <netinet/in.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <chap.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/*
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Function: radius_chap_validate
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Description: To validate a target response given the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * associated challenge via the specified
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * RADIUS server.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Arguments:
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * target_chap_name - The CHAP name of the target being authenticated.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * initiator_chap_name - The CHAP name of the authenticating initiator.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * challenge - The CHAP challenge to which the target responded.
5df5713f81d69c1a0797f99b13e95e220da00ef9bing zhao - Sun Microsystems - Beijing China * challenge_length - The length of CHAP challenge.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * target_response - The target's CHAP response to be validated.
5df5713f81d69c1a0797f99b13e95e220da00ef9bing zhao - Sun Microsystems - Beijing China * response_length - The length of target's CHAP response.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * identifier - The identifier associated with the CHAP challenge.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * radius_server_ip_address - The IP address of the RADIUS server.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * radius_server_port - The port number of the RADIUS server.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * radius_shared_secret - The shared secret for accessing the RADIUS server.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * radius_shared_secret_len - The length of the shared secret.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Return: See chap_validation_status_type.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortechap_validation_status_type
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteradius_chap_validate(char *target_chap_name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte char *initiator_chap_name,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t *challenge,
5df5713f81d69c1a0797f99b13e95e220da00ef9bing zhao - Sun Microsystems - Beijing China uint32_t challenge_length,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t *target_response,
5df5713f81d69c1a0797f99b13e95e220da00ef9bing zhao - Sun Microsystems - Beijing China uint32_t response_length,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t identifier,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte iscsi_ipaddr_t rad_svr_ip_addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rad_svr_port,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint8_t *rad_svr_shared_secret,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte uint32_t rad_svr_shared_secret_len);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#ifdef __cplusplus
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#endif /* _RADIUS_AUTH_H */