1 /*
2  * radius.h  Constants of the radius protocol.
3  *
4  * Version:  $Id: 473528d65dbe552dee8f42315d30dc2c13e6ab14 $
5  *
6  */
7 
8 /** Internal data types used within libfreeradius
9  *
10  */
11 typedef enum {
12 	PW_TYPE_INVALID = 0,			//!< Invalid (uninitialised) attribute type.
13 	PW_TYPE_STRING,				//!< String of printable characters.
14 	PW_TYPE_INTEGER,			//!< 32 Bit unsigned integer.
15 	PW_TYPE_IPV4_ADDR,			//!< 32 Bit IPv4 Address.
16 	PW_TYPE_DATE,				//!< 32 Bit Unix timestamp.
17 	PW_TYPE_ABINARY,			//!< Ascend binary format a packed data structure.
18 	PW_TYPE_OCTETS,				//!< Raw octets.
19 	PW_TYPE_IFID,				//!< Interface ID.
20 	PW_TYPE_IPV6_ADDR,			//!< 128 Bit IPv6 Address.
21 	PW_TYPE_IPV6_PREFIX,			//!< IPv6 Prefix.
22 	PW_TYPE_BYTE,				//!< 8 Bit unsigned integer.
23 	PW_TYPE_SHORT,				//!< 16 Bit unsigned integer.
24 	PW_TYPE_ETHERNET,			//!< 48 Bit Mac-Address.
25 	PW_TYPE_SIGNED,				//!< 32 Bit signed integer.
26 	PW_TYPE_COMBO_IP_ADDR,			//!< WiMAX IPv4 or IPv6 address depending on length.
27 	PW_TYPE_TLV,				//!< Contains nested attributes.
28 	PW_TYPE_EXTENDED,			//!< Extended attribute space attribute.
29 	PW_TYPE_LONG_EXTENDED,			//!< Long extended attribute space attribute.
30 	PW_TYPE_EVS,				//!< Extended attribute, vendor specific.
31 	PW_TYPE_INTEGER64,			//!< 64 Bit unsigned integer.
32 	PW_TYPE_IPV4_PREFIX,			//!< IPv4 Prefix.
33 	PW_TYPE_VSA,				//!< Vendor-Specific, for RADIUS attribute 26.
34 	PW_TYPE_TIMEVAL,			//!< Time value (struct timeval), only for config items.
35 	PW_TYPE_BOOLEAN,			//!< A truth value.
36 	PW_TYPE_COMBO_IP_PREFIX,		//!< WiMAX IPv4 or IPv6 address prefix depending on length.
37 	PW_TYPE_MAX				//!< Number of defined data types.
38 } PW_TYPE;
39 
40 /** RADIUS packet codes
41  *
42  */
43 typedef enum {
44 	PW_CODE_UNDEFINED		= 0,	//!< Packet code has not been set
45 	PW_CODE_ACCESS_REQUEST		= 1,	//!< RFC2865 - Access-Request
46 	PW_CODE_ACCESS_ACCEPT		= 2,	//!< RFC2865 - Access-Accept
47 	PW_CODE_ACCESS_REJECT		= 3,	//!< RFC2865 - Access-Reject
48 	PW_CODE_ACCOUNTING_REQUEST	= 4,	//!< RFC2866 - Accounting-Request
49 	PW_CODE_ACCOUNTING_RESPONSE	= 5,	//!< RFC2866 - Accounting-Response
50 	PW_CODE_ACCOUNTING_STATUS	= 6,	//!< RFC3575 - Reserved
51 	PW_CODE_PASSWORD_REQUEST	= 7,	//!< RFC3575 - Reserved
52 	PW_CODE_PASSWORD_ACK		= 8,	//!< RFC3575 - Reserved
53 	PW_CODE_PASSWORD_REJECT		= 9,	//!< RFC3575 - Reserved
54 	PW_CODE_ACCOUNTING_MESSAGE	= 10,	//!< RFC3575 - Reserved
55 	PW_CODE_ACCESS_CHALLENGE	= 11,	//!< RFC2865 - Access-Challenge
56 	PW_CODE_STATUS_SERVER	 	= 12,	//!< RFC2865/RFC5997 - Status Server (request)
57 	PW_CODE_STATUS_CLIENT		= 13,	//!< RFC2865/RFC5997 - Status Server (response)
58 	PW_CODE_DISCONNECT_REQUEST	= 40,	//!< RFC3575/RFC5176 - Disconnect-Request
59 	PW_CODE_DISCONNECT_ACK		= 41,	//!< RFC3575/RFC5176 - Disconnect-Ack (positive)
60 	PW_CODE_DISCONNECT_NAK		= 42,	//!< RFC3575/RFC5176 - Disconnect-Nak (not willing to perform)
61 	PW_CODE_COA_REQUEST		= 43,	//!< RFC3575/RFC5176 - CoA-Request
62 	PW_CODE_COA_ACK			= 44,	//!< RFC3575/RFC5176 - CoA-Ack (positive)
63 	PW_CODE_COA_NAK			= 45,	//!< RFC3575/RFC5176 - CoA-Nak (not willing to perform)
64 	PW_CODE_MAX			= 255,	//!< Maximum possible code
65 } PW_CODE;
66 
67 #define PW_AUTH_UDP_PORT		1812
68 #define PW_AUTH_UDP_PORT_ALT		1645
69 #define PW_ACCT_UDP_PORT		1813
70 #define PW_ACCT_UDP_PORT_ALT		1646
71 #define PW_POD_UDP_PORT			3799
72 #define PW_RADIUS_TLS_PORT	       	2083
73 #define PW_COA_UDP_PORT			3799
74 
75 /*
76  *  The RFC says 4096 octets max, and most packets are less than 256.
77  */
78 #define MAX_PACKET_LEN 4096
79 
80 #include <freeradius-devel/rfc2865.h>
81 #include <freeradius-devel/rfc2866.h>
82 #include <freeradius-devel/rfc2867.h>
83 #include <freeradius-devel/rfc2868.h>
84 #include <freeradius-devel/rfc2869.h>
85 
86 #include <freeradius-devel/rfc3162.h>
87 #include <freeradius-devel/rfc3576.h>
88 #include <freeradius-devel/rfc3580.h>
89 
90 #include <freeradius-devel/rfc4072.h>
91 #include <freeradius-devel/rfc4372.h>
92 
93 #define PW_CUI	PW_CHARGEABLE_USER_IDENTITY
94 
95 #include <freeradius-devel/rfc4675.h>
96 #include <freeradius-devel/rfc4818.h>
97 #include <freeradius-devel/rfc4849.h>
98 
99 #include <freeradius-devel/rfc5580.h>
100 #include <freeradius-devel/rfc5607.h>
101 #include <freeradius-devel/rfc5904.h>
102 
103 #include <freeradius-devel/rfc6572.h>
104 #include <freeradius-devel/rfc6677.h>
105 #include <freeradius-devel/rfc6911.h>
106 #include <freeradius-devel/rfc6929.h>
107 #include <freeradius-devel/rfc6930.h>
108 
109 #include <freeradius-devel/rfc7055.h>
110 #include <freeradius-devel/rfc7155.h>
111 #include <freeradius-devel/rfc7268.h>
112 
113 /*
114  *	All internal attributes are now defined in this file.
115  */
116 #include <freeradius-devel/attributes.h>
117 
118 #include <freeradius-devel/freeradius.h>
119 
120 #include <freeradius-devel/vqp.h>
121 
122 #define PW_DIGEST_RESPONSE		206
123 #define PW_DIGEST_ATTRIBUTES		207
124 
125 /*
126  *	Integer Translations
127  */
128 
129 /*	User Types	*/
130 
131 #define PW_LOGIN_USER			1
132 #define PW_FRAMED_USER			2
133 #define PW_CALLBACK_LOGIN_USER		3
134 #define PW_CALLBACK_FRAMED_USER		4
135 #define PW_OUTBOUND_USER		5
136 #define PW_ADMINISTRATIVE_USER		6
137 #define PW_NAS_PROMPT_USER		7
138 #define PW_AUTHENTICATE_ONLY		8
139 #define PW_CALLBACK_NAS_PROMPT		9
140 #define PW_AUTHORIZE_ONLY		17
141 
142 /*	Framed Protocols	*/
143 
144 #define PW_PPP				1
145 #define PW_SLIP				2
146 
147 /*	Status Types	*/
148 
149 #define PW_STATUS_START			1
150 #define PW_STATUS_STOP			2
151 #define PW_STATUS_ALIVE			3
152 #define PW_STATUS_ACCOUNTING_ON		7
153 #define PW_STATUS_ACCOUNTING_OFF	8
154 
155 /*
156  *	Vendor Private Enterprise Codes
157  */
158 #define VENDORPEC_MICROSOFT		311
159 #define VENDORPEC_FREERADIUS		11344
160 #define VENDORPEC_WIMAX			24757
161 #define VENDORPEC_UKERNA		25622
162 
163 /*
164  *	Microsoft has vendor code 311.
165  */
166 #define PW_MSCHAP_RESPONSE			1
167 #define PW_MSCHAP_ERROR				2
168 #define PW_MSCHAP_CPW_1				3
169 #define PW_MSCHAP_CPW_2				4
170 #define PW_MSCHAP_NT_ENC_PW			6
171 #define PW_MSCHAP_MPPE_ENCRYPTION_POLICY	7
172 #define PW_MSCHAP_MPPE_ENCRYPTION_TYPES		8
173 #define PW_MSCHAP_CHALLENGE			11
174 #define PW_MSCHAP_MPPE_SEND_KEY			16
175 #define PW_MSCHAP_MPPE_RECV_KEY			17
176 #define PW_MSCHAP2_RESPONSE			25
177 #define PW_MSCHAP2_SUCCESS			26
178 #define PW_MSCHAP2_CPW				27
179 #define PW_MS_QUARANTINE_SOH			55
180 
181 /*
182  * JANET's code for transporting eap channel binding data over ttls
183  */
184 
185 #define PW_UKERNA_CHBIND		135
186 #define PW_UKERNA_TR_COI 136
187