1 /* ====================================================================
2 * The Kannel Software License, Version 1.0
4 * Copyright (c) 2001-2018 Kannel Group
5 * Copyright (c) 1998-2001 WapIT Ltd.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in
17 * the documentation and/or other materials provided with the
20 * 3. The end-user documentation included with the redistribution,
21 * if any, must include the following acknowledgment:
22 * "This product includes software developed by the
23 * Kannel Group (http://www.kannel.org/)."
24 * Alternately, this acknowledgment may appear in the software itself,
25 * if and wherever such third-party acknowledgments normally appear.
27 * 4. The names "Kannel" and "Kannel Group" must not be used to
28 * endorse or promote products derived from this software without
29 * prior written permission. For written permission, please
30 * contact org@kannel.org.
32 * 5. Products derived from this software may not be called "Kannel",
33 * nor may "Kannel" appear in their name, without prior written
34 * permission of the Kannel Group.
36 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39 * DISCLAIMED. IN NO EVENT SHALL THE KANNEL GROUP OR ITS CONTRIBUTORS
40 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
41 * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
42 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
43 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
44 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
45 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
46 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
47 * ====================================================================
49 * This software consists of voluntary contributions made by many
50 * individuals on behalf of the Kannel Group. For more information on
51 * the Kannel Group, please see <http://www.kannel.org/>.
53 * Portions of this software are based upon software originally written at
54 * WapIT Ltd., Helsinki, Finland for the Kannel project.
58 * RADIUS Attributes as defined by RFC2865, page 23 and RFC2866
62 #error Macro ATTRIBUTES not defined.
66 #error Macro ATTR not defined.
70 #error Macro UNASSIGNED not defined.
73 /* define the length of the undistinguised octets length */
76 /* define type mappings for attribute types */
78 #define ATTR_INT(attr, string) \
79 ATTR(attr, t_int, string, 4, 4)
80 #define ATTR_IPADDR(attr, string) \
81 ATTR(attr, t_ipaddr, string, 4, 4)
82 #define ATTR_STR(attr, string, min, max) \
83 ATTR(attr, t_string, string, min, max)
86 * defines the Attribute type, (see RFC2865, page 25 and on)
87 * syntax: ATTR(<attribute>, <value-type>, <description string>, <min len>, <max len>)
91 ATTR_STR(1, "User-Name", 1, 64)
92 ATTR_STR(2, "User-Password", 16, UMAX)
93 ATTR_STR(3, "CHAP-Password", 16, 16)
94 ATTR_IPADDR(4, "NAS-IP-Address")
95 ATTR_INT(5, "NAS-Port")
96 ATTR_INT(6, "Service-Type")
97 ATTR_INT(7, "Framed-Protocol")
98 ATTR_IPADDR(8, "Framed-IP-Address")
99 ATTR_IPADDR(9, "Framed-IP-Netmask")
100 ATTR_INT(10, "Framed-Routing")
101 ATTR_STR(11, "Filter-Id", 1, UMAX)
102 ATTR_INT(12, "Framed-MTU")
103 ATTR_INT(13, "Framed-Compression")
104 ATTR_IPADDR(14, "Login-IP-Host")
105 ATTR_INT(15, "Login-Service")
106 ATTR_INT(16, "Login-TCP-Port")
108 ATTR_STR(18, "Reply-Message", 1, UMAX)
109 ATTR_STR(19, "Callback-Number", 1, UMAX)
110 ATTR_STR(20, "Callback-Id", 1, UMAX)
112 ATTR_STR(22, "Framed-Route", 1, UMAX)
113 ATTR_IPADDR(23, "Framed-IPX-Network")
114 ATTR_STR(24, "State", 1, UMAX)
115 ATTR_STR(25, "Class", 1, UMAX)
116 ATTR_STR(26, "Vendor-Specific", 5, 256)
117 ATTR_INT(27, "Session-Timeout")
118 ATTR_INT(28, "Idle-Timeout")
119 ATTR_INT(29, "Termination-Action")
120 ATTR_STR(30, "Called-Station-Id", 1, UMAX)
121 ATTR_STR(31, "Calling-Station-Id", 1, UMAX)
122 ATTR_STR(32, "NAS-Identifier", 1, UMAX)
123 ATTR_STR(33, "Proxy-State", 1, UMAX)
124 ATTR_STR(34, "Login-LAT-Service", 1, UMAX)
125 ATTR_STR(35, "Login-LAT-Node", 1, UMAX)
126 ATTR_STR(36, "Login-LAT-Group", 32, 32)
127 ATTR_INT(37, "Framed-AppleTalk-Link")
128 ATTR_INT(38, "Framed-AppleTalk-Network")
129 ATTR_STR(39, "Framed-AppleTalk-Zone", 1, UMAX)
131 /* accounting types (RFC2866, page 10) */
132 ATTR_INT(40, "Acct-Status-Type")
133 ATTR_INT(41, "Acct-Delay-Time")
134 ATTR_INT(42, "Acct-Input-Octets")
135 ATTR_INT(43, "Acct-Output-Octets")
136 ATTR_STR(44, "Acct-Session-Id", 1, UMAX)
137 ATTR_INT(45, "Acct-Authentic")
138 ATTR_INT(46, "Acct-Session-Time")
139 ATTR_INT(47, "Acct-Input-Packets")
140 ATTR_INT(48, "Acct-Output-Packets")
141 ATTR_INT(49, "Acct-Terminate-Cause")
142 ATTR_STR(50, "Acct-Multi-Session-Id", 1, UMAX)
143 ATTR_INT(51, "Acct-Link-Count")
145 ATTR_STR(60, "CHAP-Challenge", 5, UMAX)
146 ATTR_INT(61, "NAS-Port-Type")
147 ATTR_INT(62, "Port-Limit")
148 ATTR_STR(63, "Login-LAT-Port", 1, UMAX)