1700 Add SCSI UNMAP support
[unleashed.git] / usr / src / uts / common / sys / iscsit / radius_protocol.h
blob76be62909c9be6f510fccc3d4ee29554efb1dc5a
1 /*
2 * CDDL HEADER START
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.
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.
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]
19 * CDDL HEADER END
22 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #ifndef _RADIUS_PROTOCOL_H
27 #define _RADIUS_PROTOCOL_H
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
33 /* Packet type. RFC 2865 section 4. */
34 #define RAD_ACCESS_REQ 1 /* Authentication Request */
35 #define RAD_ACCESS_ACPT 2 /* Authentication Accepted */
36 #define RAD_ACCESS_REJ 3 /* Authentication Rejected */
38 /* RADIUS Attribute Types. RFC 2865 section 5. */
39 #define RAD_USER_NAME 1
40 #define RAD_CHAP_PASSWORD 3
41 #define RAD_CHAP_CHALLENGE 60
43 /* RFC 2865 Section 3. The Identifier field is one octet. */
44 #define RAD_IDENTIFIER_LEN 1
46 /* RFC 2865 Section 5.3. The String field is 16 octets. */
47 #define RAD_CHAP_PASSWD_STR_LEN 16
49 /* RFC 2865 Section 3. Authenticator field is 16 octets. */
50 #define RAD_AUTHENTICATOR_LEN 16
52 /* RFC 2865 Section 5: 1-253 octets */
53 #define MAX_RAD_ATTR_VALUE_LEN 253
55 /* RFC 2865 Section 3. Minimum length 20 octets. */
56 #define MIN_RAD_PACKET_LEN 20
58 /* RFC 2865 Section 3. Maximum length 4096 octets. */
59 #define MAX_RAD_PACKET_LEN 4096
61 /* Maximum RADIUS shared secret length (in fact there is no defined limit) */
62 #define MAX_RAD_SHARED_SECRET_LEN 128
64 /* RFC 2865 Section 3. Minimum RADIUS shared secret length */
65 #define MIN_RAD_SHARED_SECRET_LEN 16
67 /* Raw RADIUS packet. RFC 2865 section 3. */
68 typedef struct radius_packet {
69 uint8_t code; /* RADIUS code, section 3, RFC 2865 */
70 uint8_t identifier; /* 1 octet in length. RFC 2865 section 3 */
71 uint8_t length[2]; /* 2 octets, or sizeof (u_short) */
72 uint8_t authenticator[RAD_AUTHENTICATOR_LEN];
73 uint8_t data[1];
74 } radius_packet_t;
76 /* Length of a RADIUS packet minus the payload */
77 #define RAD_PACKET_HDR_LEN 20
79 #ifdef __cplusplus
81 #endif
83 #endif /* _RADIUS_PROTOCOL_H */