xref: /illumos-gate/usr/src/uts/common/io/scsi/adapters/iscsi/radius_auth.h (revision 2eef1f2b3c0d57d3f401f917b9f38f01456fd554)
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 2008 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  *   target_response - The target's CHAP response to be validated.
48  *   identifier - The identifier associated with the CHAP challenge.
49  *   radius_server_ip_address - The IP address of the RADIUS server.
50  *   radius_server_port - The port number of the RADIUS server.
51  *   radius_shared_secret - The shared secret for accessing the RADIUS server.
52  *   radius_shared_secret_len - The length of the shared secret.
53  *
54  * Return: See chap_validation_status_type.
55  */
56 chap_validation_status_type
57 radius_chap_validate(char *target_chap_name,
58 		char *initiator_chap_name,
59 		uint8_t *challenge,
60 		uint8_t *target_response,
61 		uint8_t identifier,
62 		iscsi_ipaddr_t rad_svr_ip_addr,
63 		uint32_t rad_svr_port,
64 		uint8_t *rad_svr_shared_secret,
65 		uint32_t rad_svr_shared_secret_len);
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif /* _RADIUS_AUTH_H */
71