Use sane macro names for codes. PW_CODE_AUTHENTICATION_ACK, PW_CODE_AUTHENTICATION_RE...
[freeradius.git] / src / include / radius.h
1 /*
2  * radius.h  Constants of the radius protocol.
3  *
4  * Version:  $Id$
5  *
6  */
7
8 typedef enum {
9         PW_TYPE_INVALID = 0,                    //!< Invalid (uninitialised) attribute type.
10         PW_TYPE_STRING,                         //!< String of printable characters.
11         PW_TYPE_INTEGER,                        //!< 32 Bit unsigned integer.
12         PW_TYPE_IPV4_ADDR,                      //!< 32 Bit IPv4 Address.
13         PW_TYPE_DATE,                           //!< 32 Bit Unix timestamp.
14         PW_TYPE_ABINARY,                        //!< Ascend binary format a packed data structure.
15         PW_TYPE_OCTETS,                         //!< Raw octets.
16         PW_TYPE_IFID,                           //!< Interface ID.
17         PW_TYPE_IPV6_ADDR,                      //!< 128 Bit IPv6 Address.
18         PW_TYPE_IPV6_PREFIX,                    //!< IPv6 Prefix.
19         PW_TYPE_BYTE,                           //!< 8 Bit unsigned integer.
20         PW_TYPE_SHORT,                          //!< 16 Bit unsigned integer.
21         PW_TYPE_ETHERNET,                       //!< 48 Bit Mac-Address.
22         PW_TYPE_SIGNED,                         //!< 32 Bit signed integer.
23         PW_TYPE_IP_ADDR,                        //!< WiMAX IPv4 or IPv6 address depending on length.
24         PW_TYPE_TLV,                            //!< Contains nested attributes.
25         PW_TYPE_EXTENDED,                       //!< Extended attribute space attribute.
26         PW_TYPE_LONG_EXTENDED,                  //!< Long extended attribute space attribute.
27         PW_TYPE_EVS,                            //!< Extended attribute, vendor specific.
28         PW_TYPE_INTEGER64,                      //!< 64 Bit unsigned integer.
29         PW_TYPE_IPV4_PREFIX,                    //!< IPv4 Prefix.
30         PW_TYPE_VSA,                            //!< Vendor-Specific, for RADIUS attribute 26.
31         PW_TYPE_TIMEVAL,                        //!< Time value (struct timeval), only for config items.
32         PW_TYPE_BOOLEAN,                        //!< A truth value.
33         PW_TYPE_IP_PREFIX,                      //!< WiMAX IPv4 or IPv6 address prefix depending on length.
34         PW_TYPE_MAX                             //!< Number of defined data types.
35 } PW_TYPE;
36
37 typedef enum {
38         PW_CODE_UNDEFINED               = 0,    //!< Packet code has not been set
39         PW_CODE_ACCESS_REQUEST  = 1,    //!< RFC2865 - Access-Request
40         PW_CODE_ACCESS_ACCEPT   = 2,    //!< RFC2865 - Access-Accept
41         PW_CODE_ACCESS_REJECT   = 3,    //!< RFC2865 - Access-Reject
42         PW_CODE_ACCOUNTING_REQUEST      = 4,    //!< RFC2866 - Accounting-Request
43         PW_CODE_ACCOUNTING_RESPONSE     = 5,    //!< RFC2866 - Accounting-Response
44         PW_CODE_ACCOUNTING_STATUS       = 6,    //!< RFC3575 - Reserved
45         PW_CODE_PASSWORD_REQUEST        = 7,    //!< RFC3575 - Reserved
46         PW_CODE_PASSWORD_ACK            = 8,    //!< RFC3575 - Reserved
47         PW_CODE_PASSWORD_REJECT         = 9,    //!< RFC3575 - Reserved
48         PW_CODE_ACCOUNTING_MESSAGE      = 10,   //!< RFC3575 - Reserved
49         PW_CODE_ACCESS_CHALLENGE        = 11,   //!< RFC2865 - Access-Challenge
50         PW_CODE_STATUS_SERVER           = 12,   //!< RFC2865/RFC5997 - Status Server (request)
51         PW_CODE_STATUS_CLIENT           = 13,   //!< RFC2865/RFC5997 - Status Server (response)
52         PW_CODE_DISCONNECT_REQUEST      = 40,   //!< RFC3575/RFC5176 - Disconnect-Request
53         PW_CODE_DISCONNECT_ACK          = 41,   //!< RFC3575/RFC5176 - Disconnect-Ack (positive)
54         PW_CODE_DISCONNECT_NAK          = 42,   //!< RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
55         PW_CODE_COA_REQUEST             = 43,   //!< RFC3575/RFC5176 - CoA-Request
56         PW_CODE_COA_ACK                 = 44,   //!< RFC3575/RFC5176 - CoA-Ack (positive)
57         PW_CODE_COA_NAK                 = 45,   //!< RFC3575/RFC5176 - CoA-Nak (not willing to perform)
58         PW_CODE_MAX                     = 255,  //!< Maximum possible code
59 } PW_CODE;
60
61 #define PW_AUTH_UDP_PORT                1812
62 #define PW_AUTH_UDP_PORT_ALT            1645
63 #define PW_ACCT_UDP_PORT                1813
64 #define PW_ACCT_UDP_PORT_ALT            1646
65 #define PW_POD_UDP_PORT                 1700
66 #define PW_RADIUS_TLS_PORT              2083
67 #define PW_COA_UDP_PORT                 3799
68
69 #define PW_USER_NAME                    1
70 #define PW_USER_PASSWORD                2
71 #define PW_PASSWORD                     2
72 #define PW_CHAP_PASSWORD                3
73 #define PW_NAS_IP_ADDRESS               4
74 #define PW_NAS_PORT                     5
75 #define PW_SERVICE_TYPE                 6
76 #define PW_FRAMED_PROTOCOL              7
77 #define PW_FRAMED_IP_ADDRESS            8
78 #define PW_FRAMED_IP_NETMASK            9
79 #define PW_FRAMED_ROUTING               10
80 #define PW_FILTER_ID                    11
81 #define PW_FRAMED_MTU                   12
82 #define PW_FRAMED_COMPRESSION           13
83 #define PW_LOGIN_IP_HOST                14
84 #define PW_LOGIN_SERVICE                15
85 #define PW_LOGIN_TCP_PORT               16
86 #define PW_OLD_PASSWORD                 17
87 #define PW_REPLY_MESSAGE                18
88 #define PW_CALLBACK_NUMBER              19
89 #define PW_CALLBACK_ID                  20
90 #if 0
91 /*
92  *      Deprecated, and no longer used.
93  */
94 #define PW_EXPIRATION                   21
95 #endif
96 #define PW_FRAMED_ROUTE                 22
97 #define PW_FRAMED_IPXNET                23
98 #define PW_STATE                        24
99 #define PW_CLASS                        25
100 #define PW_VENDOR_SPECIFIC              26
101 #define PW_SESSION_TIMEOUT              27
102 #define PW_IDLE_TIMEOUT                 28
103 #define PW_CALLED_STATION_ID            30
104 #define PW_CALLING_STATION_ID           31
105 #define PW_NAS_IDENTIFIER               32
106 #define PW_PROXY_STATE                  33
107
108 #define PW_ACCT_STATUS_TYPE             40
109 #define PW_ACCT_DELAY_TIME              41
110 #define PW_ACCT_INPUT_OCTETS            42
111 #define PW_ACCT_OUTPUT_OCTETS           43
112 #define PW_ACCT_SESSION_ID              44
113 #define PW_ACCT_AUTHENTIC               45
114 #define PW_ACCT_SESSION_TIME            46
115 #define PW_ACCT_INPUT_PACKETS           47
116 #define PW_ACCT_OUTPUT_PACKETS          48
117 #define PW_ACCT_TERMINATE_CAUSE         49
118
119 #define PW_EVENT_TIMESTAMP              55
120
121 #define PW_CHAP_CHALLENGE               60
122 #define PW_NAS_PORT_TYPE                61
123 #define PW_PORT_LIMIT                   62
124
125 #define PW_ARAP_PASSWORD                70
126 #define PW_ARAP_FEATURES                71
127 #define PW_ARAP_ZONE_ACCESS             72
128 #define PW_ARAP_SECURITY                73
129 #define PW_ARAP_SECURITY_DATA           74
130 #define PW_PASSWORD_RETRY               75
131 #define PW_PROMPT                       76
132 #define PW_CONNECT_INFO                 77
133 #define PW_CONFIGURATION_TOKEN          78
134 #define PW_EAP_MESSAGE                  79
135 #define PW_MESSAGE_AUTHENTICATOR        80
136
137 #define PW_ARAP_CHALLENGE_RESPONSE      84
138 #define PW_NAS_PORT_ID_STRING           87
139 #define PW_FRAMED_POOL                  88
140 #define PW_CHARGEABLE_USER_IDENTITY     89
141 #define PW_NAS_IPV6_ADDRESS             95
142 #define PW_OPERATOR_NAME                126
143
144 #define PW_EXTENDED_ATTRIBUTE           192
145
146 #define PW_DIGEST_RESPONSE              206
147 #define PW_DIGEST_ATTRIBUTES            207
148
149 /*
150  *      All internal attributes are now defined in this file.
151  */
152 #include <freeradius-devel/attributes.h>
153
154 /*
155  *      Integer Translations
156  */
157
158 /*      User Types      */
159
160 #define PW_LOGIN_USER                   1
161 #define PW_FRAMED_USER                  2
162 #define PW_CALLBACK_LOGIN_USER          3
163 #define PW_CALLBACK_FRAMED_USER         4
164 #define PW_OUTBOUND_USER                5
165 #define PW_ADMINISTRATIVE_USER          6
166 #define PW_NAS_PROMPT_USER              7
167 #define PW_AUTHENTICATE_ONLY            8
168 #define PW_CALLBACK_NAS_PROMPT          9
169
170 /*      Framed Protocols        */
171
172 #define PW_PPP                          1
173 #define PW_SLIP                         2
174
175 /*      Framed Routing Values   */
176
177 #define PW_NONE                         0
178 #define PW_BROADCAST                    1
179 #define PW_LISTEN                       2
180 #define PW_BROADCAST_LISTEN             3
181
182 /*      Framed Compression Types        */
183
184 #define PW_VAN_JACOBSEN_TCP_IP          1
185
186 /*      Login Services  */
187
188 #define PW_TELNET                       0
189 #define PW_RLOGIN                       1
190 #define PW_TCP_CLEAR                    2
191 #define PW_PORTMASTER                   3
192
193 /*      Authentication Level    */
194
195 #define PW_AUTHTYPE_LOCAL               0
196 #define PW_AUTHTYPE_SYSTEM              1
197 #define PW_AUTHTYPE_SECURID             2
198 #define PW_AUTHTYPE_CRYPT               3
199 #define PW_AUTHTYPE_REJECT              4
200 #define PW_AUTHTYPE_ACTIVCARD           5
201 #define PW_AUTHTYPE_EAP                 6
202 #define PW_AUTHTYPE_ACCEPT              254
203 #define PW_AUTHTYPE_MS_CHAP             1028
204
205 /* Post-auth types */
206 #define PW_POSTAUTHTYPE_LOCAL           0
207 #define PW_POSTAUTHTYPE_REJECT          1
208
209 /*      Port Types              */
210
211 #define PW_NAS_PORT_ASYNC               0
212 #define PW_NAS_PORT_SYNC                1
213 #define PW_NAS_PORT_ISDN                2
214 #define PW_NAS_PORT_ISDN_V120           3
215 #define PW_NAS_PORT_ISDN_V110           4
216
217 /*      Status Types    */
218
219 #define PW_STATUS_START                 1
220 #define PW_STATUS_STOP                  2
221 #define PW_STATUS_ALIVE                 3
222 #define PW_STATUS_ACCOUNTING_ON         7
223 #define PW_STATUS_ACCOUNTING_OFF        8
224
225 /*
226  *      Vendor Private Enterprise Codes
227  */
228 #define VENDORPEC_MICROSOFT             311
229 #define VENDORPEC_FREERADIUS            11344
230 #define VENDORPEC_WIMAX                 24757
231
232 /*
233  * Vendor specific attributes
234  */
235 #define PW_FREERADIUS_PROXIED_TO        1
236
237 /*
238  *      Microsoft has vendor code 311.
239  */
240 #define PW_MSCHAP_RESPONSE              1
241 #define PW_MSCHAP_ERROR                 2
242 #define PW_MSCHAP_CPW_1                 3
243 #define PW_MSCHAP_CPW_2                 4
244 #define PW_MSCHAP_NT_ENC_PW             6
245 #define PW_MSCHAP_CHALLENGE             11
246 #define PW_MSCHAP2_RESPONSE             25
247 #define PW_MSCHAP2_SUCCESS              26
248 #define PW_MSCHAP2_CPW                  27
249
250 /*
251  *      Old nonsense.   Will be deleted ASAP
252  */
253 #define PW_AUTHTYPE                     1000
254 #define PW_AUTZTYPE                     1011
255 #define PW_ACCTTYPE                     1012
256 #define PW_SESSTYPE                     1013
257 #define PW_POSTAUTHTYPE                 1014
258
259 /*
260  *      Cisco's VLAN Query Protocol.
261  */
262 #define PW_VQP_PACKET_TYPE              0x2b00
263 #define PW_VQP_ERROR_CODE               0x2b01
264 #define PW_VQP_SEQUENCE_NUMBER          0x2b02
265
266 #define PW_VQP_CLIENT_IP_ADDRESS        0x2c01
267 #define PW_VQP_PORT_NAME                0x2c02
268 #define PW_VQP_VLAN_NAME                0x2c03
269 #define PW_VQP_DOMAIN_NAME              0x2c04
270 #define PW_VQP_ETHERNET_FRAME           0x2c05
271 #define PW_VQP_MAC                      0x2c06
272 #define PW_VQP_UNKNOWN                  0x2c07
273 #define PW_VQP_COOKIE                   0x2c08