All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
radius.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 2 of the License, or
5  * (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
15  */
16 #ifndef _FR_RADIUS_H
17 #define _FR_RADIUS_H
18 /**
19  * $Id: 82d57c094ae5b11559ad82156fe22f18603683d6 $
20  *
21  * @file include/radius.h
22  * @brief Constants for the RADIUS protocol.
23  *
24  * @copyright 2015 The FreeRADIUS server project
25  */
26 RCSIDH(radius_h, "$Id: 82d57c094ae5b11559ad82156fe22f18603683d6 $")
27 
28 /** Internal data types used within libfreeradius
29  *
30  */
31 typedef enum {
32  PW_TYPE_INVALID = 0, //!< Invalid (uninitialised) attribute type.
33  PW_TYPE_STRING, //!< String of printable characters.
34  PW_TYPE_INTEGER, //!< 32 Bit unsigned integer.
35  PW_TYPE_IPV4_ADDR, //!< 32 Bit IPv4 Address.
36  PW_TYPE_DATE, //!< 32 Bit Unix timestamp.
37  PW_TYPE_ABINARY, //!< Ascend binary format a packed data structure.
38  PW_TYPE_OCTETS, //!< Raw octets.
39  PW_TYPE_IFID, //!< Interface ID.
40  PW_TYPE_IPV6_ADDR, //!< 128 Bit IPv6 Address.
41  PW_TYPE_IPV6_PREFIX, //!< IPv6 Prefix.
42  PW_TYPE_BYTE, //!< 8 Bit unsigned integer.
43  PW_TYPE_SHORT, //!< 16 Bit unsigned integer.
44  PW_TYPE_ETHERNET, //!< 48 Bit Mac-Address.
45  PW_TYPE_SIGNED, //!< 32 Bit signed integer.
46  PW_TYPE_COMBO_IP_ADDR, //!< WiMAX IPv4 or IPv6 address depending on length.
47  PW_TYPE_TLV, //!< Contains nested attributes.
48  PW_TYPE_EXTENDED, //!< Extended attribute space attribute.
49  PW_TYPE_LONG_EXTENDED, //!< Long extended attribute space attribute.
50  PW_TYPE_EVS, //!< Extended attribute, vendor specific.
51  PW_TYPE_INTEGER64, //!< 64 Bit unsigned integer.
52  PW_TYPE_IPV4_PREFIX, //!< IPv4 Prefix.
53  PW_TYPE_VSA, //!< Vendor-Specific, for RADIUS attribute 26.
54  PW_TYPE_VENDOR, //!< Attribute that represents a vendor in the attribute tree.
55  PW_TYPE_TIMEVAL, //!< Time value (struct timeval), only for config items.
56  PW_TYPE_BOOLEAN, //!< A truth value.
57  PW_TYPE_COMBO_IP_PREFIX, //!< WiMAX IPv4 or IPv6 address prefix depending on length.
58  PW_TYPE_DECIMAL, //!< Double precision floating point.
59  PW_TYPE_MAX //!< Number of defined data types.
60 } PW_TYPE;
61 
62 #define PW_TYPE_BAD \
63  PW_TYPE_MAX: \
64  case PW_TYPE_INVALID
65 
66 /** Stupid hack for things which produce special error messages for VSAs
67  *
68  * @note This should be used for switch statements in printing and casting
69  * functions that need to deal with all types representing values
70  */
71 #define PW_TYPE_STRUCTURAL_EXCEPT_VSA \
72  PW_TYPE_EXTENDED: \
73  case PW_TYPE_LONG_EXTENDED: \
74  case PW_TYPE_EVS: \
75  case PW_TYPE_TLV
76 
77 /** Match all non value types in case statements
78  *
79  * @note This should be used for switch statements in printing and casting
80  * functions that need to deal with all types representing values
81  */
82 #define PW_TYPE_STRUCTURAL \
83  PW_TYPE_STRUCTURAL_EXCEPT_VSA: \
84  case PW_TYPE_VSA: \
85  case PW_TYPE_VENDOR
86 
87 /** RADIUS packet codes
88  *
89  */
90 typedef enum {
91  PW_CODE_UNDEFINED = 0, //!< Packet code has not been set
92  PW_CODE_ACCESS_REQUEST = 1, //!< RFC2865 - Access-Request
93  PW_CODE_ACCESS_ACCEPT = 2, //!< RFC2865 - Access-Accept
94  PW_CODE_ACCESS_REJECT = 3, //!< RFC2865 - Access-Reject
95  PW_CODE_ACCOUNTING_REQUEST = 4, //!< RFC2866 - Accounting-Request
96  PW_CODE_ACCOUNTING_RESPONSE = 5, //!< RFC2866 - Accounting-Response
97  PW_CODE_ACCOUNTING_STATUS = 6, //!< RFC3575 - Reserved
98  PW_CODE_PASSWORD_REQUEST = 7, //!< RFC3575 - Reserved
99  PW_CODE_PASSWORD_ACK = 8, //!< RFC3575 - Reserved
100  PW_CODE_PASSWORD_REJECT = 9, //!< RFC3575 - Reserved
101  PW_CODE_ACCOUNTING_MESSAGE = 10, //!< RFC3575 - Reserved
102  PW_CODE_ACCESS_CHALLENGE = 11, //!< RFC2865 - Access-Challenge
103  PW_CODE_STATUS_SERVER = 12, //!< RFC2865/RFC5997 - Status Server (request)
104  PW_CODE_STATUS_CLIENT = 13, //!< RFC2865/RFC5997 - Status Server (response)
105  PW_CODE_DISCONNECT_REQUEST = 40, //!< RFC3575/RFC5176 - Disconnect-Request
106  PW_CODE_DISCONNECT_ACK = 41, //!< RFC3575/RFC5176 - Disconnect-Ack (positive)
107  PW_CODE_DISCONNECT_NAK = 42, //!< RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
108  PW_CODE_COA_REQUEST = 43, //!< RFC3575/RFC5176 - CoA-Request
109  PW_CODE_COA_ACK = 44, //!< RFC3575/RFC5176 - CoA-Ack (positive)
110  PW_CODE_COA_NAK = 45, //!< RFC3575/RFC5176 - CoA-Nak (not willing to perform)
111  PW_CODE_MAX = 255, //!< Maximum possible code
112 } PW_CODE;
113 
114 #define PW_AUTH_UDP_PORT 1812
115 #define PW_AUTH_UDP_PORT_ALT 1645
116 #define PW_ACCT_UDP_PORT 1813
117 #define PW_ACCT_UDP_PORT_ALT 1646
118 #define PW_POD_UDP_PORT 1700
119 #define PW_RADIUS_TLS_PORT 2083
120 #define PW_COA_UDP_PORT 3799
121 
122 #include <freeradius-devel/rfc2865.h>
123 #include <freeradius-devel/rfc2866.h>
124 #include <freeradius-devel/rfc2867.h>
125 #include <freeradius-devel/rfc2868.h>
126 #include <freeradius-devel/rfc2869.h>
127 
128 #include <freeradius-devel/rfc3162.h>
129 #include <freeradius-devel/rfc3576.h>
130 #include <freeradius-devel/rfc3580.h>
131 
132 #include <freeradius-devel/rfc4072.h>
133 #include <freeradius-devel/rfc4372.h>
134 
135 #define PW_CUI PW_CHARGEABLE_USER_IDENTITY
136 
137 #include <freeradius-devel/rfc4675.h>
138 #include <freeradius-devel/rfc4818.h>
139 #include <freeradius-devel/rfc4849.h>
140 
141 #include <freeradius-devel/rfc5580.h>
142 #include <freeradius-devel/rfc5607.h>
143 #include <freeradius-devel/rfc5904.h>
144 
145 #include <freeradius-devel/rfc6572.h>
146 #include <freeradius-devel/rfc6677.h>
147 #include <freeradius-devel/rfc6911.h>
148 #include <freeradius-devel/rfc6929.h>
149 #include <freeradius-devel/rfc6930.h>
150 
151 #include <freeradius-devel/rfc7055.h>
152 #include <freeradius-devel/rfc7155.h>
153 #include <freeradius-devel/rfc7268.h>
154 
155 /*
156  * All internal attributes are now defined in this file.
157  */
158 #include <freeradius-devel/attributes.h>
159 
160 #include <freeradius-devel/freeradius.h>
161 
162 #include <freeradius-devel/vqp.h>
163 
164 #define PW_DIGEST_RESPONSE 206
165 #define PW_DIGEST_ATTRIBUTES 207
166 
167 /*
168  * Integer Translations
169  */
170 
171 /* User Types */
172 
173 #define PW_LOGIN_USER 1
174 #define PW_FRAMED_USER 2
175 #define PW_CALLBACK_LOGIN_USER 3
176 #define PW_CALLBACK_FRAMED_USER 4
177 #define PW_OUTBOUND_USER 5
178 #define PW_ADMINISTRATIVE_USER 6
179 #define PW_NAS_PROMPT_USER 7
180 #define PW_AUTHENTICATE_ONLY 8
181 #define PW_CALLBACK_NAS_PROMPT 9
182 #define PW_AUTHORIZE_ONLY 17
183 
184 /* Framed Protocols */
185 
186 #define PW_PPP 1
187 #define PW_SLIP 2
188 
189 /* Status Types */
190 
191 #define PW_STATUS_START 1
192 #define PW_STATUS_STOP 2
193 #define PW_STATUS_ALIVE 3
194 #define PW_STATUS_ACCOUNTING_ON 7
195 #define PW_STATUS_ACCOUNTING_OFF 8
196 
197 /*
198  * Vendor Private Enterprise Codes
199  */
200 #define VENDORPEC_MICROSOFT 311
201 #define VENDORPEC_FREERADIUS 11344
202 #define VENDORPEC_WIMAX 24757
203 #define VENDORPEC_UKERNA 25622
204 
205 /*
206  * Microsoft has vendor code 311.
207  */
208 #define PW_MSCHAP_RESPONSE 1
209 #define PW_MSCHAP_ERROR 2
210 #define PW_MSCHAP_CPW_1 3
211 #define PW_MSCHAP_CPW_2 4
212 #define PW_MSCHAP_NT_ENC_PW 6
213 #define PW_MSCHAP_CHALLENGE 11
214 #define PW_MSCHAP2_RESPONSE 25
215 #define PW_MSCHAP2_SUCCESS 26
216 #define PW_MSCHAP2_CPW 27
217 
218 /*
219  * JANET's code for transporting eap channel binding data over ttls
220  */
221 
222 #define PW_UKERNA_CHBIND 135
223 #define PW_UKERNA_TR_COI 136
224 #endif /* _FR_RADIUS_H */
#define RCSIDH(h, id)
Definition: build.h:136
128 Bit IPv6 Address.
Definition: radius.h:40
Time value (struct timeval), only for config items.
Definition: radius.h:55
RFC2865 - Access-Challenge.
Definition: radius.h:102
Ascend binary format a packed data structure.
Definition: radius.h:37
32 Bit signed integer.
Definition: radius.h:45
WiMAX IPv4 or IPv6 address depending on length.
Definition: radius.h:46
IPv6 Prefix.
Definition: radius.h:41
Number of defined data types.
Definition: radius.h:59
Long extended attribute space attribute.
Definition: radius.h:49
RFC3575/RFC5176 - Disconnect-Ack (positive)
Definition: radius.h:106
WiMAX IPv4 or IPv6 address prefix depending on length.
Definition: radius.h:57
RFC2866 - Accounting-Response.
Definition: radius.h:96
RFC2865 - Access-Reject.
Definition: radius.h:94
RFC3575/RFC5176 - CoA-Ack (positive)
Definition: radius.h:109
RFC2865 - Access-Request.
Definition: radius.h:92
8 Bit unsigned integer.
Definition: radius.h:42
Interface ID.
Definition: radius.h:39
RFC2866 - Accounting-Request.
Definition: radius.h:95
Double precision floating point.
Definition: radius.h:58
RFC3575/RFC5176 - CoA-Nak (not willing to perform)
Definition: radius.h:110
RFC2865 - Access-Accept.
Definition: radius.h:93
RFC3575 - Reserved.
Definition: radius.h:101
48 Bit Mac-Address.
Definition: radius.h:44
Attribute that represents a vendor in the attribute tree.
Definition: radius.h:54
RFC3575 - Reserved.
Definition: radius.h:98
Invalid (uninitialised) attribute type.
Definition: radius.h:32
A truth value.
Definition: radius.h:56
32 Bit unsigned integer.
Definition: radius.h:34
RFC3575/RFC5176 - CoA-Request.
Definition: radius.h:108
64 Bit unsigned integer.
Definition: radius.h:51
Packet code has not been set.
Definition: radius.h:91
Vendor-Specific, for RADIUS attribute 26.
Definition: radius.h:53
32 Bit Unix timestamp.
Definition: radius.h:36
Extended attribute space attribute.
Definition: radius.h:48
RFC3575 - Reserved.
Definition: radius.h:100
RFC3575 - Reserved.
Definition: radius.h:99
RFC2865/RFC5997 - Status Server (response)
Definition: radius.h:104
IPv4 Prefix.
Definition: radius.h:52
RFC2865/RFC5997 - Status Server (request)
Definition: radius.h:103
PW_CODE
RADIUS packet codes.
Definition: radius.h:90
String of printable characters.
Definition: radius.h:33
Contains nested attributes.
Definition: radius.h:47
RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
Definition: radius.h:107
32 Bit IPv4 Address.
Definition: radius.h:35
16 Bit unsigned integer.
Definition: radius.h:43
Raw octets.
Definition: radius.h:38
RFC3575 - Reserved.
Definition: radius.h:97
Maximum possible code.
Definition: radius.h:111
PW_TYPE
Internal data types used within libfreeradius.
Definition: radius.h:31
Extended attribute, vendor specific.
Definition: radius.h:50
RFC3575/RFC5176 - Disconnect-Request.
Definition: radius.h:105