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