1fcf3ce44SJohn Forte /*
2fcf3ce44SJohn Forte  * CDDL HEADER START
3fcf3ce44SJohn Forte  *
4fcf3ce44SJohn Forte  * The contents of this file are subject to the terms of the
5fcf3ce44SJohn Forte  * Common Development and Distribution License (the "License").
6fcf3ce44SJohn Forte  * You may not use this file except in compliance with the License.
7fcf3ce44SJohn Forte  *
8fcf3ce44SJohn Forte  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9fcf3ce44SJohn Forte  * or http://www.opensolaris.org/os/licensing.
10fcf3ce44SJohn Forte  * See the License for the specific language governing permissions
11fcf3ce44SJohn Forte  * and limitations under the License.
12fcf3ce44SJohn Forte  *
13fcf3ce44SJohn Forte  * When distributing Covered Code, include this CDDL HEADER in each
14fcf3ce44SJohn Forte  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fcf3ce44SJohn Forte  * If applicable, add the following below this CDDL HEADER, with the
16fcf3ce44SJohn Forte  * fields enclosed by brackets "[]" replaced with your own identifying
17fcf3ce44SJohn Forte  * information: Portions Copyright [yyyy] [name of copyright owner]
18fcf3ce44SJohn Forte  *
19fcf3ce44SJohn Forte  * CDDL HEADER END
20fcf3ce44SJohn Forte  */
21fcf3ce44SJohn Forte /*
22*5df5713fSbing zhao - Sun Microsystems - Beijing China  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23fcf3ce44SJohn Forte  * Use is subject to license terms.
24fcf3ce44SJohn Forte  */
25fcf3ce44SJohn Forte 
26fcf3ce44SJohn Forte #ifndef	_RADIUS_AUTH_H
27fcf3ce44SJohn Forte #define	_RADIUS_AUTH_H
28fcf3ce44SJohn Forte 
29fcf3ce44SJohn Forte #ifdef __cplusplus
30fcf3ce44SJohn Forte extern "C" {
31fcf3ce44SJohn Forte #endif
32fcf3ce44SJohn Forte 
33fcf3ce44SJohn Forte #include <netinet/in.h>
34fcf3ce44SJohn Forte #include <chap.h>
35fcf3ce44SJohn Forte 
36fcf3ce44SJohn Forte /*
37fcf3ce44SJohn Forte  * Function: radius_chap_validate
38fcf3ce44SJohn Forte  *
39fcf3ce44SJohn Forte  * Description: To validate a target response given the
40fcf3ce44SJohn Forte  *              associated challenge via the specified
41fcf3ce44SJohn Forte  *              RADIUS server.
42fcf3ce44SJohn Forte  *
43fcf3ce44SJohn Forte  * Arguments:
44fcf3ce44SJohn Forte  *   target_chap_name - The CHAP name of the target being authenticated.
45fcf3ce44SJohn Forte  *   initiator_chap_name - The CHAP name of the authenticating initiator.
46fcf3ce44SJohn Forte  *   challenge - The CHAP challenge to which the target responded.
47*5df5713fSbing zhao - Sun Microsystems - Beijing China  *   challenge_length - The length of CHAP challenge.
48fcf3ce44SJohn Forte  *   target_response - The target's CHAP response to be validated.
49*5df5713fSbing zhao - Sun Microsystems - Beijing China  *   response_length - The length of target's CHAP response.
50fcf3ce44SJohn Forte  *   identifier - The identifier associated with the CHAP challenge.
51fcf3ce44SJohn Forte  *   radius_server_ip_address - The IP address of the RADIUS server.
52fcf3ce44SJohn Forte  *   radius_server_port - The port number of the RADIUS server.
53fcf3ce44SJohn Forte  *   radius_shared_secret - The shared secret for accessing the RADIUS server.
54fcf3ce44SJohn Forte  *   radius_shared_secret_len - The length of the shared secret.
55fcf3ce44SJohn Forte  *
56fcf3ce44SJohn Forte  * Return: See chap_validation_status_type.
57fcf3ce44SJohn Forte  */
58fcf3ce44SJohn Forte chap_validation_status_type
59fcf3ce44SJohn Forte radius_chap_validate(char *target_chap_name,
60fcf3ce44SJohn Forte 		char *initiator_chap_name,
61fcf3ce44SJohn Forte 		uint8_t *challenge,
62*5df5713fSbing zhao - Sun Microsystems - Beijing China 		uint32_t challenge_length,
63fcf3ce44SJohn Forte 		uint8_t *target_response,
64*5df5713fSbing zhao - Sun Microsystems - Beijing China 		uint32_t response_length,
65fcf3ce44SJohn Forte 		uint8_t identifier,
66fcf3ce44SJohn Forte 		iscsi_ipaddr_t rad_svr_ip_addr,
67fcf3ce44SJohn Forte 		uint32_t rad_svr_port,
68fcf3ce44SJohn Forte 		uint8_t *rad_svr_shared_secret,
69fcf3ce44SJohn Forte 		uint32_t rad_svr_shared_secret_len);
70fcf3ce44SJohn Forte #ifdef __cplusplus
71fcf3ce44SJohn Forte }
72fcf3ce44SJohn Forte #endif
73fcf3ce44SJohn Forte 
74fcf3ce44SJohn Forte #endif /* _RADIUS_AUTH_H */
75