The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
defs.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 
18 /**
19  * $Id: 21d3ab5f27f90e3b3e2289703513f509146f83a9 $
20  *
21  * @file protocols/radius/defs.h
22  * @brief Constants for the RADIUS protocol.
23  *
24  * @copyright 2015 The FreeRADIUS server project
25  */
26 RCSIDH(radius_h, "$Id: 21d3ab5f27f90e3b3e2289703513f509146f83a9 $")
27 
28 /** RADIUS packet codes
29  *
30  */
31 typedef enum {
32  FR_RADIUS_CODE_UNDEFINED = 0, //!< Packet code has not been set
33  FR_RADIUS_CODE_ACCESS_REQUEST = 1, //!< RFC2865 - Access-Request
34  FR_RADIUS_CODE_ACCESS_ACCEPT = 2, //!< RFC2865 - Access-Accept
35  FR_RADIUS_CODE_ACCESS_REJECT = 3, //!< RFC2865 - Access-Reject
36  FR_RADIUS_CODE_ACCOUNTING_REQUEST = 4, //!< RFC2866 - Accounting-Request
37  FR_RADIUS_CODE_ACCOUNTING_RESPONSE = 5, //!< RFC2866 - Accounting-Response
38  FR_RADIUS_CODE_ACCOUNTING_STATUS = 6, //!< RFC3575 - Reserved
39  FR_RADIUS_CODE_PASSWORD_REQUEST = 7, //!< RFC3575 - Reserved
40  FR_RADIUS_CODE_PASSWORD_ACK = 8, //!< RFC3575 - Reserved
41  FR_RADIUS_CODE_PASSWORD_REJECT = 9, //!< RFC3575 - Reserved
42  FR_RADIUS_CODE_ACCOUNTING_MESSAGE = 10, //!< RFC3575 - Reserved
43  FR_RADIUS_CODE_ACCESS_CHALLENGE = 11, //!< RFC2865 - Access-Challenge
44  FR_RADIUS_CODE_STATUS_SERVER = 12, //!< RFC2865/RFC5997 - Status Server (request)
45  FR_RADIUS_CODE_STATUS_CLIENT = 13, //!< RFC2865/RFC5997 - Status Server (response)
46  FR_RADIUS_CODE_DISCONNECT_REQUEST = 40, //!< RFC3575/RFC5176 - Disconnect-Request
47  FR_RADIUS_CODE_DISCONNECT_ACK = 41, //!< RFC3575/RFC5176 - Disconnect-Ack (positive)
48  FR_RADIUS_CODE_DISCONNECT_NAK = 42, //!< RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
49  FR_RADIUS_CODE_COA_REQUEST = 43, //!< RFC3575/RFC5176 - CoA-Request
50  FR_RADIUS_CODE_COA_ACK = 44, //!< RFC3575/RFC5176 - CoA-Ack (positive)
51  FR_RADIUS_CODE_COA_NAK = 45, //!< RFC3575/RFC5176 - CoA-Nak (not willing to perform)
52  FR_RADIUS_CODE_PROTOCOL_ERROR = 52, //!< RFC7930 - Protocol-Error (generic NAK)
53  FR_RADIUS_CODE_MAX = 53, //!< Maximum possible protocol code
54  FR_RADIUS_CODE_DO_NOT_RESPOND = 256 //!< Special rcode to indicate we will not respond.
56 
57 #define FR_AUTH_UDP_PORT 1812
58 #define FR_AUTH_UDP_PORT_ALT 1645
59 #define FR_ACCT_UDP_PORT 1813
60 #define FR_ACCT_UDP_PORT_ALT 1646
61 #define FR_POD_UDP_PORT 3799
62 #define FR_RADIUS_TLS_PORT 2083
63 #define FR_COA_UDP_PORT 3799
64 
65 /*
66  * The RFC says 4096 octets max, and most packets are less than 256.
67  */
68 #define MAX_PACKET_LEN 4096
69 
70 #include <freeradius-devel/protocol/radius/rfc2865.h>
71 #include <freeradius-devel/protocol/radius/rfc2866.h>
72 #include <freeradius-devel/protocol/radius/rfc2867.h>
73 #include <freeradius-devel/protocol/radius/rfc2868.h>
74 #include <freeradius-devel/protocol/radius/rfc2869.h>
75 
76 #include <freeradius-devel/protocol/radius/rfc3162.h>
77 #include <freeradius-devel/protocol/radius/rfc3576.h>
78 #include <freeradius-devel/protocol/radius/rfc3580.h>
79 
80 #include <freeradius-devel/protocol/radius/rfc4072.h>
81 #include <freeradius-devel/protocol/radius/rfc4372.h>
82 
83 #define FR_CUI FR_CHARGEABLE_USER_IDENTITY
84 
85 #include <freeradius-devel/protocol/radius/rfc4675.h>
86 #include <freeradius-devel/protocol/radius/rfc4818.h>
87 #include <freeradius-devel/protocol/radius/rfc4849.h>
88 
89 #include <freeradius-devel/protocol/radius/rfc5580.h>
90 #include <freeradius-devel/protocol/radius/rfc5607.h>
91 #include <freeradius-devel/protocol/radius/rfc5904.h>
92 
93 #include <freeradius-devel/protocol/radius/rfc6572.h>
94 #include <freeradius-devel/protocol/radius/rfc6677.h>
95 #include <freeradius-devel/protocol/radius/rfc6911.h>
96 #include <freeradius-devel/protocol/radius/rfc6929.h>
97 #include <freeradius-devel/protocol/radius/rfc6930.h>
98 
99 #include <freeradius-devel/protocol/radius/rfc7055.h>
100 #include <freeradius-devel/protocol/radius/rfc7155.h>
101 #include <freeradius-devel/protocol/radius/rfc7268.h>
102 #include <freeradius-devel/protocol/radius/rfc7930.h>
103 
104 /*
105  * All internal attributes are now defined in this file.
106  */
107 #include <freeradius-devel/protocol/freeradius/freeradius.internal.h>
108 
109 #define FR_DIGEST_RESPONSE 206
110 #define FR_DIGEST_ATTRIBUTES 207
111 
112 /*
113  * Integer Translations
114  */
115 
116 /* User Types */
117 
118 #define FR_LOGIN_USER 1
119 #define FR_FRAMED_USER 2
120 #define FR_CALLBACK_LOGIN_USER 3
121 #define FR_CALLBACK_FRAMED_USER 4
122 #define FR_OUTBOUND_USER 5
123 #define FR_ADMINISTRATIVE_USER 6
124 #define FR_NAS_PROMPT_USER 7
125 #define FR_AUTHENTICATE_ONLY 8
126 #define FR_CALLBACK_NAS_PROMPT 9
127 #define FR_AUTHORIZE_ONLY 17
128 
129 /* Framed Protocols */
130 
131 #define FR_PPP 1
132 #define FR_SLIP 2
133 
134 /* Status Types */
135 
136 #define FR_STATUS_START 1
137 #define FR_STATUS_STOP 2
138 #define FR_STATUS_ALIVE 3
139 #define FR_STATUS_ACCOUNTING_ON 7
140 #define FR_STATUS_ACCOUNTING_OFF 8
141 
142 /*
143  * Vendor Private Enterprise Codes
144  */
145 #define VENDORPEC_MICROSOFT 311
146 #define VENDORPEC_FREERADIUS 11344
147 #define VENDORPEC_WIMAX 24757
148 #define VENDORPEC_UKERNA 25622
149 
150 /*
151  * Microsoft has vendor code 311.
152  */
153 #define FR_MSCHAP_RESPONSE 1
154 #define FR_MSCHAP_ERROR 2
155 #define FR_MSCHAP_CFR_1 3
156 #define FR_MSCHAP_CFR_2 4
157 #define FR_MSCHAP_NT_ENC_PW 6
158 #define FR_MSCHAP_MPPE_ENCRYPTION_POLICY 7
159 #define FR_MSCHAP_MPPE_ENCRYPTION_TYPES 8
160 #define FR_MSCHAP_CHALLENGE 11
161 #define FR_MSCHAP_MPPE_SEND_KEY 16
162 #define FR_MSCHAP_MPPE_RECV_KEY 17
163 #define FR_MSCHAP2_RESPONSE 25
164 #define FR_MSCHAP2_SUCCESS 26
165 #define FR_MSCHAP2_CPW 27
166 #define FR_MS_QUARANTINE_SOH 55
167 
168 /*
169  * JANET's code for transporting eap channel binding data over ttls
170  */
171 
172 #define FR_UKERNA_CHBIND 135
173 #define FR_UKERNA_TR_COI 136
#define RCSIDH(h, id)
Definition: build.h:482
fr_radius_packet_code_t
RADIUS packet codes.
Definition: defs.h:31
@ FR_RADIUS_CODE_ACCESS_CHALLENGE
RFC2865 - Access-Challenge.
Definition: defs.h:43
@ FR_RADIUS_CODE_ACCESS_REQUEST
RFC2865 - Access-Request.
Definition: defs.h:33
@ FR_RADIUS_CODE_DISCONNECT_REQUEST
RFC3575/RFC5176 - Disconnect-Request.
Definition: defs.h:46
@ FR_RADIUS_CODE_DO_NOT_RESPOND
Special rcode to indicate we will not respond.
Definition: defs.h:54
@ FR_RADIUS_CODE_PASSWORD_ACK
RFC3575 - Reserved.
Definition: defs.h:40
@ FR_RADIUS_CODE_PASSWORD_REJECT
RFC3575 - Reserved.
Definition: defs.h:41
@ FR_RADIUS_CODE_MAX
Maximum possible protocol code.
Definition: defs.h:53
@ FR_RADIUS_CODE_DISCONNECT_ACK
RFC3575/RFC5176 - Disconnect-Ack (positive)
Definition: defs.h:47
@ FR_RADIUS_CODE_STATUS_SERVER
RFC2865/RFC5997 - Status Server (request)
Definition: defs.h:44
@ FR_RADIUS_CODE_COA_REQUEST
RFC3575/RFC5176 - CoA-Request.
Definition: defs.h:49
@ FR_RADIUS_CODE_STATUS_CLIENT
RFC2865/RFC5997 - Status Server (response)
Definition: defs.h:45
@ FR_RADIUS_CODE_ACCESS_ACCEPT
RFC2865 - Access-Accept.
Definition: defs.h:34
@ FR_RADIUS_CODE_PASSWORD_REQUEST
RFC3575 - Reserved.
Definition: defs.h:39
@ FR_RADIUS_CODE_ACCOUNTING_RESPONSE
RFC2866 - Accounting-Response.
Definition: defs.h:37
@ FR_RADIUS_CODE_COA_NAK
RFC3575/RFC5176 - CoA-Nak (not willing to perform)
Definition: defs.h:51
@ FR_RADIUS_CODE_ACCOUNTING_STATUS
RFC3575 - Reserved.
Definition: defs.h:38
@ FR_RADIUS_CODE_UNDEFINED
Packet code has not been set.
Definition: defs.h:32
@ FR_RADIUS_CODE_COA_ACK
RFC3575/RFC5176 - CoA-Ack (positive)
Definition: defs.h:50
@ FR_RADIUS_CODE_DISCONNECT_NAK
RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
Definition: defs.h:48
@ FR_RADIUS_CODE_PROTOCOL_ERROR
RFC7930 - Protocol-Error (generic NAK)
Definition: defs.h:52
@ FR_RADIUS_CODE_ACCOUNTING_MESSAGE
RFC3575 - Reserved.
Definition: defs.h:42
@ FR_RADIUS_CODE_ACCOUNTING_REQUEST
RFC2866 - Accounting-Request.
Definition: defs.h:36
@ FR_RADIUS_CODE_ACCESS_REJECT
RFC2865 - Access-Reject.
Definition: defs.h:35