From Lars Roland: add support for building a libethereal.dll with MSVC:
[obnox/wireshark/wip.git] / packet-radius.c
1 /* packet-radius.c
2  *
3  * Routines for RADIUS packet disassembly
4  * Copyright 1999 Johan Feyaerts
5  * Changed 03/12/2003 Rui Carmo (http://the.taoofmac.com - added all 3GPP VSAs, some parsing)
6  *
7  * RFC 2865, RFC 2866, RFC 2867, RFC 2868, RFC 2869
8  *
9  * $Id: packet-radius.c,v 1.103 2004/03/31 20:57:42 guy Exp $
10  *
11  * Ethereal - Network traffic analyzer
12  * By Gerald Combs <gerald@ethereal.com>
13  * Copyright 1998 Gerald Combs
14  *
15  * This program is free software; you can redistribute it and/or
16  * modify it under the terms of the GNU General Public License
17  * as published by the Free Software Foundation; either version 2
18  * of the License, or (at your option) any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23  * GNU General Public License for more details.
24  *
25  * You should have received a copy of the GNU General Public License
26  * along with this program; if not, write to the Free Software
27  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
28  */
29
30 #ifdef HAVE_CONFIG_H
31 #include "config.h"
32 #endif
33
34 #include <stdio.h>
35 #include <stdlib.h>
36 #include <string.h>
37 #include <ctype.h>
38 #include <glib.h>
39 #include <time.h>
40 #include <epan/packet.h>
41 #include <epan/resolv.h>
42
43 #include "packet-q931.h"
44 #include "packet-gtp.h"
45 #include "prefs.h"
46 #include "crypt-md5.h"
47
48 static int proto_radius = -1;
49 static int hf_radius_length = -1;
50 static int hf_radius_code = -1;
51 static int hf_radius_id =-1;
52
53 static char *shared_secret = NULL;
54 static gpointer authenticator = NULL;
55
56 static gint ett_radius = -1;
57 static gint ett_radius_avp = -1;
58 static gint ett_radius_eap = -1;
59 static gint ett_radius_vsa = -1;
60
61 static dissector_handle_t eap_fragment_handle;
62
63 #define UDP_PORT_RADIUS         1645
64 #define UDP_PORT_RADIUS_NEW     1812
65 #define UDP_PORT_RADACCT        1646
66 #define UDP_PORT_RADACCT_NEW    1813
67
68 #define TEXTBUFFER              2000
69 #define VSABUFFER               10
70
71 typedef struct _e_radiushdr {
72         guint8 rh_code;
73         guint8 rh_ident;
74         guint16 rh_pktlength;
75 } e_radiushdr;
76
77 typedef struct _e_avphdr {
78         guint8 avp_type;
79         guint8 avp_length;
80 } e_avphdr;
81
82 typedef struct _radius_attr_info {
83         guint16 attr_type;
84         guint16 value_type;
85         gchar *str;
86         const value_string *vs;
87 } radius_attr_info;
88
89 typedef struct _rd_vsa_table {
90         guint32 vendor;
91         const radius_attr_info *attrib;
92 } rd_vsa_table;
93
94 typedef struct _rd_vsa_buffer {
95         gchar *str;
96         int offset;
97         guint8 length;
98 } rd_vsa_buffer;
99
100 #define AUTHENTICATOR_LENGTH    16
101 #define RD_HDR_LENGTH           4
102
103 #define RADIUS_ACCESS_REQUEST                   1
104 #define RADIUS_ACCESS_ACCEPT                    2
105 #define RADIUS_ACCESS_REJECT                    3
106 #define RADIUS_ACCOUNTING_REQUEST               4
107 #define RADIUS_ACCOUNTING_RESPONSE              5
108 #define RADIUS_ACCOUNTING_STATUS                6
109 #define RADIUS_ACCESS_PASSWORD_REQUEST          7
110 #define RADIUS_ACCESS_PASSWORD_ACK              8
111 #define RADIUS_ACCESS_PASSWORD_REJECT           9
112 #define RADIUS_ACCOUNTING_MESSAGE               10
113 #define RADIUS_ACCESS_CHALLENGE                 11
114 #define RADIUS_STATUS_SERVER                    12
115 #define RADIUS_STATUS_CLIENT                    13
116
117 #define RADIUS_VENDOR_SPECIFIC_CODE             26
118 #define RADIUS_ASCEND_ACCESS_NEXT_CODE          29
119 #define RADIUS_ASCEND_ACCESS_NEW_PIN            30
120 #define RADIUS_ASCEND_PASSWORD_EXPIRED          32
121 #define RADIUS_ASCEND_ACCESS_EVENT_REQUEST      33
122 #define RADIUS_ASCEND_ACCESS_EVENT_RESPONSE     34
123 #define RADIUS_DISCONNECT_REQUEST               40
124 #define RADIUS_DISCONNECT_REQUEST_ACK           41
125 #define RADIUS_DISCONNECT_REQUEST_NAK           42
126 #define RADIUS_CHANGE_FILTER_REQUEST            43
127 #define RADIUS_CHANGE_FILTER_REQUEST_ACK        44
128 #define RADIUS_CHANGE_FILTER_REQUEST_NAK        45
129 #define RADIUS_RESERVED                         255
130
131 /*
132  * List of types for RADIUS attributes.  "Type" refers to how it's
133  * formatted for display in Ethereal.
134  *
135  * Not every RADIUS attribute gets its own type.  If an attribute is
136  * an integer or a tagged integer, but happens to have particular strings
137  * associated with particular values, it doesn't get its own type -
138  * you just put a pointer to the appropriate value_string table in
139  * the entry for that attribute in the appropriate radius_attr_info
140  * table.  Only if it has to get formatted in some non-standard fashion
141  * (as is the case for the CoSine VPI/VCI attribute) does it get a type
142  * of its own.
143  */
144 enum {
145     RADIUS_STRING,
146     RADIUS_BINSTRING,
147     RADIUS_USERPASSWORD,
148     RADIUS_INTEGER4,
149     RADIUS_IP_ADDRESS,
150     RADIUS_IP6_ADDRESS,
151     RADIUS_IP6_PREFIX,
152     RADIUS_IP6_INTF_ID,
153     RADIUS_UNKNOWN,
154     RADIUS_IPX_ADDRESS,
155     RADIUS_STRING_TAGGED,
156     RADIUS_VENDOR_SPECIFIC,
157     RADIUS_TIMESTAMP,
158     RADIUS_INTEGER4_TAGGED,
159     RADIUS_EAP_MESSAGE,
160
161     COSINE_VPI_VCI,
162
163     THE3GPP_IMSI,
164     THE3GPP_QOS,
165     THE3GPP_IMSI_MCC_MNC,
166     THE3GPP_GGSN_MCC_MNC,
167     THE3GPP_NSAPI,
168     THE3GPP_SESSION_STOP_INDICATOR,
169     THE3GPP_SELECTION_MODE,
170     THE3GPP_CHARGING_CHARACTERISTICS,
171     THE3GPP_IPV6_DNS_SERVERS,
172     THE3GPP_SGSN_MCC_MNC
173 };
174
175 static const value_string radius_vals[] =
176 {
177   {RADIUS_ACCESS_REQUEST,               "Access Request"},
178   {RADIUS_ACCESS_ACCEPT,                "Access Accept"},
179   {RADIUS_ACCESS_REJECT,                "Access Reject"},
180   {RADIUS_ACCOUNTING_REQUEST,           "Accounting Request"},
181   {RADIUS_ACCOUNTING_RESPONSE,          "Accounting Response"},
182   {RADIUS_ACCOUNTING_STATUS,            "Accounting Status"},
183   {RADIUS_ACCESS_PASSWORD_REQUEST,      "Access Password Request"},
184   {RADIUS_ACCESS_PASSWORD_ACK,          "Access Password Ack"},
185   {RADIUS_ACCESS_PASSWORD_REJECT,       "Access Password Reject"},
186   {RADIUS_ACCOUNTING_MESSAGE,           "Accounting Message"},
187   {RADIUS_ACCESS_CHALLENGE,             "Access challenge"},
188   {RADIUS_STATUS_SERVER,                "StatusServer"},
189   {RADIUS_STATUS_CLIENT,                "StatusClient"},
190   {RADIUS_VENDOR_SPECIFIC_CODE,         "Vendor Specific"},
191   {RADIUS_ASCEND_ACCESS_NEXT_CODE,      "Ascend Access Next Code"},
192   {RADIUS_ASCEND_ACCESS_NEW_PIN,        "Ascend Access New Pin"},
193   {RADIUS_ASCEND_PASSWORD_EXPIRED,      "Ascend Password Expired"},
194   {RADIUS_ASCEND_ACCESS_EVENT_REQUEST,  "Ascend Access Event Request"},
195   {RADIUS_ASCEND_ACCESS_EVENT_RESPONSE, "Ascend Access Event Response"},
196   {RADIUS_DISCONNECT_REQUEST,           "Disconnect Request"},
197   {RADIUS_DISCONNECT_REQUEST_ACK,       "Disconnect Request ACK"},
198   {RADIUS_DISCONNECT_REQUEST_NAK,       "Disconnect Request NAK"},
199   {RADIUS_CHANGE_FILTER_REQUEST,        "Change Filter Request"},
200   {RADIUS_CHANGE_FILTER_REQUEST_ACK,    "Change Filter Request ACK"},
201   {RADIUS_CHANGE_FILTER_REQUEST_NAK,    "Change Filter Request NAK"},
202   {RADIUS_RESERVED,                     "Reserved"},
203   {0, NULL}
204 };
205
206 /*
207  * These are SMI Network Management Private Enterprise Codes for
208  * organizations; see
209  *
210  *      http://www.iana.org/assignments/enterprise-numbers
211  *
212  * for a list.
213  *
214  * XXX - these also appear in FreeRadius dictionary files, with items such
215  * as
216  *
217  *      VENDOR          Cisco           9
218  */
219 #define VENDOR_ACC                      5
220 #define VENDOR_CISCO                    9
221 #define VENDOR_MERIT                    61
222 #define VENDOR_SHIVA                    166
223 #define VENDOR_CISCO_VPN5000            255
224 #define VENDOR_LIVINGSTON               307
225 #define VENDOR_MICROSOFT                311
226 #define VENDOR_3COM                     429
227 #define VENDOR_ASCEND                   529
228 #define VENDOR_BAY                      1584
229 #define VENDOR_FOUNDRY                  1991
230 #define VENDOR_VERSANET                 2180
231 #define VENDOR_REDBACK                  2352
232 #define VENDOR_JUNIPER                  2636
233 #define VENDOR_APTIS                    2637
234 #define VENDOR_CISCO_VPN3000            3076
235 #define VENDOR_COSINE                   3085
236 #define VENDOR_SHASTA                   3199
237 #define VENDOR_NOMADIX                  3309
238 #define VENDOR_SIEMENS                  4329
239 #define VENDOR_UNISPHERE                4874
240 #define VENDOR_CISCO_BBSM               5263
241 #define VENDOR_ISSANNI                  5948
242 #define VENDOR_QUINTUM                  6618
243 #define VENDOR_INTERLINK                6728
244 #define VENDOR_COLUBRIS                 8744
245 #define VENDOR_COLUMBIA_UNIVERSITY      11862
246 #define VENDOR_THE3GPP                  10415
247
248 static const value_string radius_vendor_specific_vendors[] =
249 {
250   {VENDOR_ACC,                  "ACC"},
251   {VENDOR_CISCO,                "Cisco"},
252   {VENDOR_MERIT,                "Merit"},
253   {VENDOR_SHIVA,                "Shiva"},
254   {VENDOR_CISCO_VPN5000,        "Cisco VPN 5000"},
255   {VENDOR_MICROSOFT,            "Microsoft"},
256   {VENDOR_LIVINGSTON,           "Livingston"},
257   {VENDOR_3COM,                 "3Com"},
258   {VENDOR_ASCEND,               "Ascend"},
259   {VENDOR_BAY,                  "Bay Networks"},
260   {VENDOR_FOUNDRY,              "Foundry"},
261   {VENDOR_VERSANET,             "Versanet"},
262   {VENDOR_REDBACK,              "Redback"},
263   {VENDOR_JUNIPER,              "Juniper Networks"},
264   {VENDOR_APTIS,                "Aptis"},
265   {VENDOR_CISCO_VPN3000,        "Cisco VPN 3000"},
266   {VENDOR_COSINE,               "CoSine Communications"},
267   {VENDOR_SHASTA,               "Shasta"},
268   {VENDOR_NOMADIX,              "Nomadix"},
269   {VENDOR_SIEMENS,              "SIEMENS"},
270   {VENDOR_UNISPHERE,            "Unisphere Networks"},
271   {VENDOR_CISCO_BBSM,           "Cisco BBSM"},
272   {VENDOR_ISSANNI,              "Issanni Communications"},
273   {VENDOR_QUINTUM,              "Quintum"},
274   {VENDOR_INTERLINK,    "Interlink"},
275   {VENDOR_COLUBRIS,             "Colubris"},
276   {VENDOR_COLUMBIA_UNIVERSITY,  "Columbia University"},
277   {VENDOR_THE3GPP,              "3GPP"},
278   {0, NULL}
279 };
280
281 /*
282  * XXX - should we construct these tables in Ethereal at start-up time by
283  * reading files such as FreeRadius dictionary files?  For example,
284  * the FreeRadius "dictionary" file has
285  *
286  *      ATTRIBUTE       User-Name               1       string
287  *
288  * for the attribute that's
289  *
290  *      {1,     RADIUS_STRING,                  "User Name"},
291  *
292  * In our tables:
293  *
294  *      "string" -> RADIUS_STRING
295  *      "octets" -> RADIUS_BINSTRING
296  *      "integer" -> RADIUS_INTEGER4
297  *      "ipaddr" -> RADIUS_IP_ADDRESS
298  *
299  * In addition, it has entries such as
300  *
301  *      VALUE           Service-Type            Login-User              1
302  *
303  * to handle translation of integral values to strings, which we'd use to
304  * construct value_string tables.
305  */
306 static const value_string radius_service_type_vals[] =
307 {
308   {1,   "Login"},
309   {2,   "Framed"},
310   {3,   "Callback Login"},
311   {4,   "Callback Framed"},
312   {5,   "Outbound"},
313   {6,   "Administrative"},
314   {7,   "NAS Prompt"},
315   {8,   "Authenticate Only"},
316   {9,   "Callback NAS Prompt"},
317   {10,  "Call Check"},
318   {0, NULL}
319 };
320
321 static const value_string radius_framed_protocol_vals[] =
322 {
323   {1,   "PPP"},
324   {2,   "SLIP"},
325   {3,   "Appletalk Remote Access Protocol (ARAP)"},
326   {4,   "Gandalf proprietary Singlelink/Multilink Protocol"},
327   {5,   "Xylogics proprietary IPX/SLIP"},
328   {6,   "X.75 Synchronous"},
329   {255, "Ascend ARA"},
330   {256, "Ascend MPP"},
331   {257, "Ascend EURAW"},
332   {258, "Ascend EUUI"},
333   {259, "Ascend X25"},
334   {260, "Ascend COMB"},
335   {261, "Ascend FR"},
336   {262, "Ascend MP"},
337   {263, "Ascend FR-CIR"},
338   {264, "Ascend ATM-1483"},
339   {265, "Ascend ATM-FR-CIR"},
340   {0, NULL}
341 };
342
343 static const value_string radius_framed_routing_vals[] =
344 {
345   {1,   "Send Routing Packets"},
346   {2,   "Listen for routing packets"},
347   {3,   "Send and Listen"},
348   {0,   "None"},
349   {0, NULL}
350 };
351
352 static const value_string radius_framed_compression_vals[] =
353 {
354   {1,   "VJ TCP/IP Header Compression"},
355   {2,   "IPX Header Compression"},
356   {3,   "Stac-LZS compression"},
357   {0,   "None"},
358   {0, NULL}
359 };
360
361 static const value_string radius_login_service_vals[] =
362 {
363   {1,   "Rlogin"},
364   {2,   "TCP Clear"},
365   {3,   "Portmaster"},
366   {4,   "LAT"},
367   {5,   "X.25 PAD"},
368   {6,   "X.25 T3POS"},
369   {8,   "TCP Clear Quit"},
370   {0,   "Telnet"},
371   {0, NULL}
372 };
373
374 static const value_string radius_terminating_action_vals[] =
375 {
376   {1,   "RADIUS Request"},
377   {0,   "Default"},
378   {0, NULL}
379 };
380
381 static const value_string radius_accounting_status_type_vals[] =
382 {
383   {1,   "Start"},
384   {2,   "Stop"},
385   {3,   "Interim Update"},
386   {7,   "Accounting On"},
387   {8,   "Accounting Off"},
388   {9,   "Tunnel Start"},        /* Tunnel accounting */
389   {10,  "Tunnel Stop"},         /* Tunnel accounting */
390   {11,  "Tunnel Reject"},       /* Tunnel accounting */
391   {12,  "Tunnel Link Start"},   /* Tunnel accounting */
392   {13,  "Tunnel Link Stop"},    /* Tunnel accounting */
393   {14,  "Tunnel Link Reject"},  /* Tunnel accounting */
394   {0, NULL}
395 };
396
397 static const value_string radius_accounting_authentication_vals[] =
398 {
399   {1,   "Radius"},
400   {2,   "Local"},
401   {3,   "Remote"},
402   /* RFC 2866 says 3 is Remote. Is 7 a mistake? */
403   {7,   "Remote"},
404   {0, NULL}
405 };
406
407 static const value_string radius_acct_terminate_cause_vals[] =
408 {
409   {1,   "User Request"},
410   {2,   "Lost Carrier"},
411   {3,   "Lost Service"},
412   {4,   "Idle Timeout"},
413   {5,   "Session Timeout"},
414   {6,   "Admin Reset"},
415   {7,   "Admin Reboot"},
416   {8,   "Port Error"},
417   {9,   "NAS Error"},
418   {10,  "NAS Request"},
419   {11,  "NAS Reboot"},
420   {12,  "Port Unneeded"},
421   {13,  "Port Preempted"},
422   {14,  "Port Suspended"},
423   {15,  "Service Unavailable"},
424   {16,  "Callback"},
425   {17,  "User Error"},
426   {18,  "Host Request"},
427   {0, NULL}
428 };
429
430 static const value_string radius_tunnel_type_vals[] =
431 {
432   {1,   "PPTP"},
433   {2,   "L2F"},
434   {3,   "L2TP"},
435   {4,   "ATMP"},
436   {5,   "VTP"},
437   {6,   "AH"},
438   {7,   "IP-IP-Encap"},
439   {8,   "MIN-IP-IP"},
440   {9,   "ESP"},
441   {10,  "GRE"},
442   {11,  "DVS"},
443   {12,  "IP-IP"},
444   {0, NULL}
445 };
446
447 static const value_string radius_tunnel_medium_type_vals[] =
448 {
449   {1,   "IPv4"},
450   {2,   "IPv6"},
451   {3,   "NSAP"},
452   {4,   "HDLC"},
453   {5,   "BBN"},
454   {6,   "IEEE 802"},
455   {7,   "E.163"},
456   {8,   "E.164"},
457   {9,   "F.69"},
458   {10,  "X.121"},
459   {11,  "IPX"},
460   {12,  "Appletalk"},
461   {13,  "Decnet4"},
462   {14,  "Vines"},
463   {15,  "E.164 NSAP"},
464   {0, NULL}
465 };
466
467 static const value_string radius_nas_port_type_vals[] =
468 {
469   {0,   "Async"},
470   {1,   "Sync"},
471   {2,   "ISDN Sync"},
472   {3,   "ISDN Async V.120"},
473   {4,   "ISDN Async V.110"},
474   {5,   "Virtual"},
475   {6,   "PIAFS"},
476   {7,   "HDLC Clear Channel"},
477   {8,   "X.25"},
478   {9,   "X.75"},
479   {10,  "G.3 Fax"},
480   {11,  "SDSL"},
481   {12,  "ADSL CAP"},
482   {13,  "ADSL DMT"},
483   {14,  "IDSL ISDN"},
484   {15,  "Ethernet"},
485   {16,  "xDSL"},
486   {17,  "Cable"},
487   {18,  "Wireless Other"},
488   {19,  "Wireless IEEE 802.11"},
489   {0, NULL}
490 };
491 /*
492  *Values for RADIUS Attribute 101, Error-Cause Attribute [RFC3576]:
493  */
494 static const value_string radius_error_cause_attribute_vals[]= {
495         {201,"Residual Session Context Removed"},
496         {202,"Invalid EAP Packet (Ignored)"},
497         {401,"Unsupported Attribute"},
498         {402,"Missing Attribute"},
499         {403,"NAS Identification Mismatch"},
500         {404,"Invalid Request"},
501         {405,"Unsupported Service"},
502         {406,"Unsupported Extension"},
503         {501,"Administratively Prohibited"},
504         {502,"Request Not Routable (Proxy)"},
505         {503,"Session Context Not Found"},
506         {504,"Session Context Not Removable"},
507         {505,"Other Proxy Processing Error"},
508         {506,"Resources Unavailable"},
509         {507,"Request Initiated"},
510                 {0,NULL}
511 };
512
513 static const radius_attr_info radius_attrib[] =
514 {
515   {1,   RADIUS_STRING,          "User Name", NULL},
516   {2,   RADIUS_USERPASSWORD,    "User Password", NULL},
517   {3,   RADIUS_BINSTRING,       "CHAP Password", NULL},
518   {4,   RADIUS_IP_ADDRESS,      "NAS IP Address", NULL},
519   {5,   RADIUS_INTEGER4,        "NAS Port", NULL},
520   {6,   RADIUS_INTEGER4,        "Service Type", radius_service_type_vals},
521   {7,   RADIUS_INTEGER4,        "Framed Protocol", radius_framed_protocol_vals},
522   {8,   RADIUS_IP_ADDRESS,      "Framed IP Address", NULL},
523   {9,   RADIUS_IP_ADDRESS,      "Framed IP Netmask", NULL},
524   {10,  RADIUS_INTEGER4,        "Framed Routing", radius_framed_routing_vals},
525   {11,  RADIUS_STRING,          "Filter Id", NULL},
526   {12,  RADIUS_INTEGER4,        "Framed MTU", NULL},
527   {13,  RADIUS_INTEGER4,        "Framed Compression", radius_framed_compression_vals},
528   {14,  RADIUS_IP_ADDRESS,      "Login IP Host", NULL},
529   {15,  RADIUS_INTEGER4,        "Login Service", radius_login_service_vals},
530   {16,  RADIUS_INTEGER4,        "Login TCP Port", NULL},
531   {17,  RADIUS_UNKNOWN,         "Unassigned", NULL},
532   {18,  RADIUS_STRING,          "Reply Message", NULL},
533   {19,  RADIUS_STRING,          "Callback Number", NULL},
534   {20,  RADIUS_STRING,          "Callback Id", NULL},
535   {21,  RADIUS_UNKNOWN,         "Unassigned", NULL},
536   {22,  RADIUS_STRING,          "Framed Route", NULL},
537   {23,  RADIUS_IPX_ADDRESS,     "Framed IPX network", NULL},
538   {24,  RADIUS_BINSTRING,       "State", NULL},
539   {25,  RADIUS_BINSTRING,       "Class", NULL},
540   {26,  RADIUS_VENDOR_SPECIFIC, "Vendor Specific", NULL},
541   {27,  RADIUS_INTEGER4,        "Session Timeout", NULL},
542   {28,  RADIUS_INTEGER4,        "Idle Timeout", NULL},
543   {29,  RADIUS_INTEGER4,        "Terminating Action", radius_terminating_action_vals},
544   {30,  RADIUS_STRING,          "Called Station Id", NULL},
545   {31,  RADIUS_STRING,          "Calling Station Id", NULL},
546   {32,  RADIUS_STRING,          "NAS identifier", NULL},
547   {33,  RADIUS_BINSTRING,       "Proxy State", NULL},
548   {34,  RADIUS_STRING,          "Login LAT Service", NULL},
549   {35,  RADIUS_STRING,          "Login LAT Node", NULL},
550   {36,  RADIUS_BINSTRING,       "Login LAT Group", NULL},
551   {37,  RADIUS_INTEGER4,        "Framed AppleTalk Link", NULL},
552   {38,  RADIUS_INTEGER4,        "Framed AppleTalk Network", NULL},
553   {39,  RADIUS_STRING,          "Framed AppleTalk Zone", NULL},
554   {40,  RADIUS_INTEGER4,        "Acct Status Type", radius_accounting_status_type_vals},
555   {41,  RADIUS_INTEGER4,        "Acct Delay Time", NULL},
556   {42,  RADIUS_INTEGER4,        "Acct Input Octets", NULL},
557   {43,  RADIUS_INTEGER4,        "Acct Output Octets", NULL},
558   {44,  RADIUS_STRING,          "Acct Session Id", NULL},
559   {45,  RADIUS_INTEGER4,        "Acct Authentic", radius_accounting_authentication_vals},
560   {46,  RADIUS_INTEGER4,        "Acct Session Time", NULL},
561   {47,  RADIUS_INTEGER4,        "Acct Input Packets", NULL},
562   {48,  RADIUS_INTEGER4,        "Acct Output Packets", NULL},
563   {49,  RADIUS_INTEGER4,        "Acct Terminate Cause", radius_acct_terminate_cause_vals},
564   {50,  RADIUS_STRING,          "Acct Multi Session Id", NULL},
565   {51,  RADIUS_INTEGER4,        "Acct Link Count", NULL},
566   {52,  RADIUS_INTEGER4,        "Acct Input Gigawords", NULL},
567   {53,  RADIUS_INTEGER4,        "Acct Output Gigawords", NULL},
568   /* 54 Unused */
569   {55,  RADIUS_TIMESTAMP,       "Event Timestamp", NULL},
570   /* 56-59 Unused */
571   {60,  RADIUS_BINSTRING,       "CHAP Challenge", NULL},
572   {61,  RADIUS_INTEGER4,        "NAS Port Type", radius_nas_port_type_vals},
573   {62,  RADIUS_INTEGER4,        "Port Limit", NULL},
574   {63,  RADIUS_BINSTRING,       "Login LAT Port", NULL},
575   {64,  RADIUS_INTEGER4_TAGGED, "Tunnel Type", radius_tunnel_type_vals},
576   {65,  RADIUS_INTEGER4_TAGGED, "Tunnel Medium Type", radius_tunnel_medium_type_vals},
577   {66,  RADIUS_STRING_TAGGED,   "Tunnel Client Endpoint", NULL},
578   {67,  RADIUS_STRING_TAGGED,   "Tunnel Server Endpoint", NULL},
579   {68,  RADIUS_STRING,          "Tunnel Connection", NULL},
580   {69,  RADIUS_STRING_TAGGED,   "Tunnel Password", NULL},
581   {70,  RADIUS_STRING,          "ARAP Password", NULL},
582   {71,  RADIUS_STRING,          "ARAP Features", NULL},
583   {72,  RADIUS_INTEGER4,        "ARAP Zone-Access", NULL},
584   {73,  RADIUS_INTEGER4,        "ARAP Security", NULL},
585   {74,  RADIUS_STRING,          "ARAP Security Data", NULL},
586   {75,  RADIUS_INTEGER4,        "Password Retry", NULL},
587   {76,  RADIUS_INTEGER4,        "Prompt", NULL},
588   {77,  RADIUS_STRING,          "Connect Info", NULL},
589   {78,  RADIUS_STRING,          "Configuration Token", NULL},
590   {79,  RADIUS_EAP_MESSAGE,     "EAP Message", NULL},
591   {80,  RADIUS_BINSTRING,       "Message Authenticator", NULL},
592   {81,  RADIUS_STRING_TAGGED,   "Tunnel Private Group ID", NULL},
593   {82,  RADIUS_STRING_TAGGED,   "Tunnel Assignment ID", NULL},
594   {83,  RADIUS_INTEGER4_TAGGED, "Tunnel Preference", NULL},
595   {84,  RADIUS_STRING,          "ARAP Challenge Response", NULL},
596   {85,  RADIUS_INTEGER4,        "Acct Interim Interval", NULL},
597   {86,  RADIUS_INTEGER4,        "Tunnel Packets Lost", NULL},
598   {87,  RADIUS_STRING,          "NAS Port ID", NULL},
599   {88,  RADIUS_STRING,          "Framed Pool", NULL},
600   {90,  RADIUS_STRING_TAGGED,   "Tunnel Client Auth ID", NULL},
601   {91,  RADIUS_STRING_TAGGED,   "Tunnel Server Auth ID", NULL},
602   {95,  RADIUS_IP6_ADDRESS,     "NAS IPv6 Address", NULL},
603   {96,  RADIUS_IP6_INTF_ID,     "Framed Interface Id", NULL},
604   {97,  RADIUS_IP6_PREFIX,      "Framed IPv6 Prefix", NULL},
605   {98,  RADIUS_IP6_ADDRESS,     "Login IPv6 Host", NULL},
606   {99,  RADIUS_STRING,          "Framed IPV6 Route", NULL},
607   {100, RADIUS_STRING,          "Framed IPV6 Pool", NULL},
608   {101, RADIUS_INTEGER4,        "Error-Cause Attribute",radius_error_cause_attribute_vals},/*[RFC3576]*/ 
609   {120, RADIUS_INTEGER4,        "Ascend Modem Port No", NULL},
610   {121, RADIUS_INTEGER4,        "Ascend Modem Slot No", NULL},
611   {187, RADIUS_INTEGER4,        "Ascend Multilink ID", NULL},
612   {188, RADIUS_INTEGER4,        "Ascend Num In Multilink", NULL},
613   {189, RADIUS_IP_ADDRESS,      "Ascend First Dest", NULL},
614   {190, RADIUS_INTEGER4,        "Ascend Pre Input Octets", NULL},
615   {191, RADIUS_INTEGER4,        "Ascend Pre Output Octets", NULL},
616   {192, RADIUS_INTEGER4,        "Ascend Pre Input Packets", NULL},
617   {193, RADIUS_INTEGER4,        "Ascend Pre Output Packets", NULL},
618   {194, RADIUS_INTEGER4,        "Ascend Maximum Time", NULL},
619   {195, RADIUS_INTEGER4,        "Ascend Disconnect Cause", NULL},
620   {196, RADIUS_INTEGER4,        "Ascend Connect Progress", NULL},
621   {197, RADIUS_INTEGER4,        "Ascend Data Rate", NULL},
622   {198, RADIUS_INTEGER4,        "Ascend PreSession Time", NULL},
623   {211, RADIUS_STRING,          "Merit Proxy-Action", NULL},
624   {218, RADIUS_INTEGER4,        "Ascend Assign IP Pool", NULL},
625   {222, RADIUS_STRING,          "Merit User-Id", NULL},
626   {223, RADIUS_STRING,          "Merit User-Realm", NULL},
627   {255, RADIUS_INTEGER4,        "Ascend Xmit Rate", NULL},
628   {0, 0, NULL, NULL}
629 };
630
631 /*
632 reference:
633         'dictionary.acc' file from FreeRADIUS
634                 http://www.freeradius.org/radiusd/raddb/dictionary.acc
635 */
636 static const value_string radius_vendor_acc_reason_code_vals[] =
637 {
638   {0,   "No reason No Failure"},
639   {1,   "Resource shortage"},
640   {2,   "Session already open"},
641   {3,   "Too many RADIUS users"},
642   {4,   "No authentification server"},
643   {5,   "No authentification response"},
644   {6,   "No accounting server"},
645   {7,   "No accounting response"},
646   {8,   "Access Denied"},
647   {9,   "Temporary buffer shortage"},
648   {10,  "Protocol error"},
649   {11,  "Invalid attribute"},
650   {12,  "Invalid service type"},
651   {13,  "Invalid framed protocol"},
652   {14,  "Invalid attribute value"},
653   {15,  "Invalid user information"},
654   {16,  "Invalid IP address"},
655   {17,  "Invalid integer syntax"},
656   {18,  "Invalid NAS port"},
657   {19,  "Requested by user"},
658   {20,  "Network disconnect"},
659   {21,  "Service interruption"},
660   {22,  "Physical port error"},
661   {23,  "Idle timeout"},
662   {24,  "Session timeout"},
663   {25,  "Administrative reset"},
664   {26,  "NAS reload or reset"},
665   {27,  "NAS error"},
666   {28,  "NAS request"},
667   {29,  "Undefined reason given"},
668   {30,  "Conflicting attributes"},
669   {31,  "Port limit exceeded"},
670   {32,  "Facility not available"},
671   {33,  "Internal config error"},
672   {34,  "Bad route specification"},
673   {35,  "Access Partition bind failure"},
674   {36,  "Security violation"},
675   {37,  "Request type conflict"},
676   {38,  "Configuration disallowed"},
677   {39,  "Missing attribute"},
678   {40,  "Invalid request"},
679   {41,  "Missing parameter"},
680   {42,  "Invalid parameter"},
681   {43,  "Call cleared with cause"},
682   {44,  "Inopportune config request"},
683   {45,  "Invalid config parameter"},
684   {46,  "Missing config parameter"},
685   {47,  "Incompatible service profile"},
686   {48,  "Administrative reset"},
687   {49,  "Administrative reload"},
688   {50,  "Port unneeded"},
689   {51,  "Port preempted"},
690   {52,  "Port suspended"},
691   {53,  "Service unavailable"},
692   {54,  "Callback"},
693   {55,  "User error"},
694   {56,  "Host request"},
695   {0, NULL}
696 };
697
698 static const value_string radius_vendor_acc_ccp_option_vals[] =
699 {
700   {1,   "Disabled"},
701   {2,   "Enabled"},
702   {0, NULL}
703 };
704
705 static const value_string radius_vendor_acc_route_policy_vals[] =
706 {
707   {1,   "Funnel"},
708   {2,   "Direct"},
709   {0, NULL}
710 };
711
712 static const value_string radius_vendor_acc_ml_mlx_admin_state_vals[] =
713 {
714   {1,   "Enabled"},
715   {2,   "Disabled"},
716   {0, NULL}
717 };
718
719 static const value_string radius_vendor_acc_request_type_vals[] =
720 {
721   {1,   "Ring Indication"},
722   {2,   "Dial Request"},
723   {3,   "User Authentification"},
724   {4,   "Tunnel Authentification"},
725   {0, NULL}
726 };
727
728 static const value_string radius_vendor_acc_bridging_support_vals[] =
729 {
730   {1,   "Disabled"},
731   {2,   "Enabled"},
732   {0, NULL}
733 };
734
735 static const value_string radius_vendor_acc_apsm_oversubscribed_vals[] =
736 {
737   {1,   "False"},
738   {2,   "True"},
739   {0, NULL}
740 };
741
742 static const value_string radius_vendor_acc_acct_on_off_reason_vals[] =
743 {
744   {0,   "NAS Reset"},
745   {1,   "NAS Reload"},
746   {2,   "Configuration Reset"},
747   {3,   "Configuration Reload"},
748   {4,   "Enabled"},
749   {5,   "Disabled"},
750   {0, NULL}
751 };
752
753 static const value_string radius_vendor_acc_ip_compression_vals[] =
754 {
755   {1,   "Disabled"},
756   {2,   "Enabled"},
757   {0, NULL}
758 };
759
760 static const value_string radius_vendor_acc_ipx_compression_vals[] =
761 {
762   {1,   "Disabled"},
763   {2,   "Enabled"},
764   {0, NULL}
765 };
766
767 static const value_string radius_vendor_acc_callback_mode_vals[] =
768 {
769   {0,   "User Auth"},
770   {3,   "User Specified E.164"},
771   {6,   "CBCP Callback"},
772   {7,   "CLI Callback"},
773   {0, NULL}
774 };
775
776 static const value_string radius_vendor_acc_callback_cbcp_type_vals[] =
777 {
778   {1,   "CBCP None"},
779   {2,   "CBCP User Specified"},
780   {3,   "CBCP Pre Specified"},
781   {0, NULL}
782 };
783
784 static const value_string radius_vendor_acc_dialout_auth_mode_vals[] =
785 {
786   {1,   "PAP"},
787   {2,   "CHAP"},
788   {3,   "CHAP PAP"},
789   {4,   "NONE"},
790   {0, NULL}
791 };
792
793 static const value_string radius_vendor_acc_access_community_vals[] =
794 {
795   {1,   "PUBLIC"},
796   {2,   "NETMAN"},
797   {0, NULL}
798 };
799
800 static const radius_attr_info radius_vendor_acc_attrib[] =
801 {
802   {1,   RADIUS_INTEGER4,        "Acc Reason Code", radius_vendor_acc_reason_code_vals},
803   {2,   RADIUS_INTEGER4,        "Acc Ccp Option", radius_vendor_acc_ccp_option_vals},
804   {3,   RADIUS_INTEGER4,        "Acc Input Errors", NULL},
805   {4,   RADIUS_INTEGER4,        "Acc Output Errors", NULL},
806   {5,   RADIUS_STRING,          "Acc Access Partition", NULL},
807   {6,   RADIUS_STRING,          "Acc Customer Id", NULL},
808   {7,   RADIUS_IP_ADDRESS,      "Acc Ip Gateway Pri", NULL},
809   {8,   RADIUS_IP_ADDRESS,      "Acc Ip Gateway Sec", NULL},
810   {9,   RADIUS_INTEGER4,        "Acc Route Policy", radius_vendor_acc_route_policy_vals},
811   {10,  RADIUS_INTEGER4,        "Acc ML MLX Admin State", radius_vendor_acc_ml_mlx_admin_state_vals},
812   {11,  RADIUS_INTEGER4,        "Acc ML Call Threshold", NULL},
813   {12,  RADIUS_INTEGER4,        "Acc ML Clear Threshold", NULL},
814   {13,  RADIUS_INTEGER4,        "Acc ML Damping Factor", NULL},
815   {14,  RADIUS_STRING,          "Acc Tunnel Secret", NULL},
816   {15,  RADIUS_INTEGER4,        "Acc Clearing Cause", q931_cause_code_vals},
817   {16,  RADIUS_INTEGER4,        "Acc Clearing Location", q931_cause_location_vals},
818   {17,  RADIUS_STRING,          "Acc Service Profile", NULL},
819   {18,  RADIUS_INTEGER4,        "Acc Request Type", radius_vendor_acc_request_type_vals},
820   {19,  RADIUS_INTEGER4,        "Acc Bridging Support", radius_vendor_acc_bridging_support_vals},
821   {20,  RADIUS_INTEGER4,        "Acc Apsm Oversubscribed", radius_vendor_acc_apsm_oversubscribed_vals},
822   {21,  RADIUS_INTEGER4,        "Acc Acct On Off Reason", radius_vendor_acc_acct_on_off_reason_vals},
823   {22,  RADIUS_INTEGER4,        "Acc Tunnel Port", NULL},
824   {23,  RADIUS_IP_ADDRESS,      "Acc Dns Server Pri", NULL},
825   {24,  RADIUS_IP_ADDRESS,      "Acc Dns Server Sec", NULL},
826   {25,  RADIUS_IP_ADDRESS,      "Acc Nbns Server Pri", NULL},
827   {26,  RADIUS_IP_ADDRESS,      "Acc Nbns Server Sec", NULL},
828   {27,  RADIUS_INTEGER4,        "Acc Dial Port Index", NULL},
829   {28,  RADIUS_INTEGER4,        "Acc Ip Compression", radius_vendor_acc_ip_compression_vals},
830   {29,  RADIUS_INTEGER4,        "Acc Ipx Compression", radius_vendor_acc_ipx_compression_vals},
831   {30,  RADIUS_INTEGER4,        "Acc Connect Tx Speed", NULL},
832   {31,  RADIUS_INTEGER4,        "Acc Connect Rx Speed", NULL},
833   {32,  RADIUS_STRING,          "Acc Modem Modulation Type", NULL},
834   {33,  RADIUS_STRING,          "Acc Modem Error Protocol", NULL},
835   {34,  RADIUS_INTEGER4,        "Acc Callback Delay", NULL},
836   {35,  RADIUS_STRING,          "Acc Callback Num Valid", NULL},
837   {36,  RADIUS_INTEGER4,        "Acc Callback Mode", radius_vendor_acc_callback_mode_vals},
838   {37,  RADIUS_INTEGER4,        "Acc Callback CBCP Type", radius_vendor_acc_callback_cbcp_type_vals},
839   {38,  RADIUS_INTEGER4,        "Acc Dialout Auth Mode", radius_vendor_acc_dialout_auth_mode_vals},
840   {39,  RADIUS_STRING,          "Acc Dialout Auth Password", NULL},
841   {40,  RADIUS_STRING,          "Acc Dialout Auth Username", NULL},
842   {42,  RADIUS_INTEGER4,        "Acc Access Community", radius_vendor_acc_access_community_vals},
843   {43,  RADIUS_INTEGER4,        "Acc Vpsm Reject Cause", NULL},
844   {44,  RADIUS_STRING,          "Acc Ace Token", NULL},
845   {45,  RADIUS_INTEGER4,        "Acc Ace Token-Ttl", NULL},
846   {46,  RADIUS_STRING,          "Acc Ip Pool Name", NULL},
847   {47,  RADIUS_INTEGER4,        "Acc Igmp Admin State", NULL},
848   {48,  RADIUS_INTEGER4,        "Acc Igmp Version", NULL},
849
850
851   {0, 0, NULL, NULL},
852 };
853
854 /*
855 references:
856         'dictionary.cisco' file from FreeRADIUS
857                 http://www.freeradius.org/radiusd/raddb/dictionary.cisco
858
859         http://www.cisco.com/univercd/cc/td/doc/product/access/acs_serv/vapp_dev/vsaig3.htm
860
861         http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122cgcr/fsecur_c/fappendx/fradattr/scfrdat3.pdf
862         http://www.missl.cs.umd.edu/wireless/ethereal/cisco-vsa.pdf
863
864 */
865 static const value_string radius_vendor_cisco_disconnect_cause_vals[] =
866 {
867   {2,   "Unknown"},
868   {4,   "CLID Authentication Failure"},
869   {10,  "No Carrier"},
870   {11,  "Lost Carrier"},
871   {12,  "No Detected Result Codes"},
872   {20,  "User Ends Session"},
873   {21,  "Idle Timeout"},
874   {22,  "Exit Telnet Session"},
875   {23,  "No Remote IP Addr"},
876   {24,  "Exit Raw TCP"},
877   {25,  "Password Fail"},
878   {26,  "Raw TCP Disabled"},
879   {27,  "Control C Detected"},
880   {28,  "EXEC Program Destroyed"},
881   {40,  "Timeout PPP LCP"},
882   {41,  "Failed PPP LCP Negotiation"},
883   {42,  "Failed PPP PAP Auth Fail"},
884   {43,  "Failed PPP CHAP Auth"},
885   {44,  "Failed PPP Remote Auth"},
886   {45,  "PPP Remote Terminate"},
887   {46,  "PPP Closed Event"},
888   {100, "Session Timeout"},
889   {101, "Session Failed Security"},
890   {102, "Session End Callback"},
891   {120, "Invalid Protocol"},
892   {0, NULL}
893 };
894
895 static const radius_attr_info radius_vendor_cisco_attrib[] =
896 {
897   /* stanard attributes */
898   {1,   RADIUS_STRING,          "Cisco AV Pair", NULL},
899   {2,   RADIUS_STRING,          "Cisco NAS Port", NULL},
900   /* fax */
901   {3,   RADIUS_STRING,          "Fax Account Id Origin", NULL},
902   {4,   RADIUS_STRING,          "Fax Msg Id", NULL},
903   {5,   RADIUS_STRING,          "Fax Pages", NULL},
904   {6,   RADIUS_STRING,          "Fax Cover Page Flag", NULL},
905   {7,   RADIUS_STRING,          "Fax Modem Time", NULL},
906   {8,   RADIUS_STRING,          "Fax Connect Speed", NULL},
907   {9,   RADIUS_STRING,          "Fax Recipent Count", NULL},
908   {10,  RADIUS_STRING,          "Fax Process Abort Flag", NULL},
909   {11,  RADIUS_STRING,          "Fax DSN Address", NULL},
910   {12,  RADIUS_STRING,          "Fax DSN Flag", NULL},
911   {13,  RADIUS_STRING,          "Fax MDN Address", NULL},
912   {14,  RADIUS_STRING,          "Fax MDN Flag", NULL},
913   {15,  RADIUS_STRING,          "Fax Auth Status", NULL},
914   {16,  RADIUS_STRING,          "Email Server Address", NULL},
915   {17,  RADIUS_STRING,          "Email Server Ack Flag", NULL},
916   {18,  RADIUS_STRING,          "Gateway Id", NULL},
917   {19,  RADIUS_STRING,          "Call Type", NULL},
918   {20,  RADIUS_STRING,          "Port Used", NULL},
919   {21,  RADIUS_STRING,          "Abort Cause", NULL},
920   /* #22 */
921   /* H323 - Voice over IP attributes. */
922   {23,  RADIUS_STRING,          "H323 Remote Address", NULL},
923   {24,  RADIUS_STRING,          "H323 Conf Id", NULL},
924   {25,  RADIUS_STRING,          "H323 Setup Time", NULL},
925   {26,  RADIUS_STRING,          "H323 Call Origin", NULL},
926   {27,  RADIUS_STRING,          "H323 Call Type", NULL},
927   {28,  RADIUS_STRING,          "H323 Connect Time", NULL},
928   {29,  RADIUS_STRING,          "H323 Disconnect Time", NULL},
929   {30,  RADIUS_STRING,          "H323 Disconnect Cause", NULL},
930   {31,  RADIUS_STRING,          "H323 Voice Quality", NULL},
931   /* #32 */
932   {33,  RADIUS_STRING,          "H323 GW Id", NULL},
933   /* #34 */
934   {35,  RADIUS_STRING,          "H323 Incoming Conf Id", NULL},
935   /* #36-#100 */
936   {101, RADIUS_STRING,          "H323 Credit Amount", NULL},
937   {102, RADIUS_STRING,          "H323 Credit Time", NULL},
938   {103, RADIUS_STRING,          "H323 Return Code", NULL},
939   {104, RADIUS_STRING,          "H323 Prompt Id", NULL},
940   {105, RADIUS_STRING,          "H323 Time And Day", NULL},
941   {106, RADIUS_STRING,          "H323 Redirect Number", NULL},
942   {107, RADIUS_STRING,          "H323 Preferred Lang", NULL},
943   {108, RADIUS_STRING,          "H323 Redirect Ip Address", NULL},
944   {109, RADIUS_STRING,          "H323 Billing Model", NULL},
945   {110, RADIUS_STRING,          "H323 Currency Type", NULL},
946   /* #111-#186 */
947 /*
948        Extra attributes sent by the Cisco, if you configure
949        "radius-server vsa accounting" (requires IOS11.2+).
950 */
951   {187, RADIUS_INTEGER4,        "Cisco Multilink ID", NULL},
952   {188, RADIUS_INTEGER4,        "Cisco Num In Multilink", NULL},
953   /* #189 */
954   {190, RADIUS_INTEGER4,        "Cisco Pre Input Octets", NULL},
955   {191, RADIUS_INTEGER4,        "Cisco Pre Output Octets", NULL},
956   {192, RADIUS_INTEGER4,        "Cisco Pre Input Packets", NULL},
957   {193, RADIUS_INTEGER4,        "Cisco Pre Output Packets", NULL},
958   {194, RADIUS_INTEGER4,        "Cisco Maximum Time", NULL},
959   {195, RADIUS_INTEGER4,        "Cisco Disconnect Cause", radius_vendor_cisco_disconnect_cause_vals},
960   /* #196 */
961   {197, RADIUS_INTEGER4,        "Cisco Data Rate", NULL},
962   {198, RADIUS_INTEGER4,        "Cisco PreSession Time", NULL},
963   /* #199-#207 */
964   {208, RADIUS_INTEGER4,        "Cisco PW Lifetime", NULL},
965   {209, RADIUS_INTEGER4,        "Cisco IP Direct", NULL},
966   {210, RADIUS_INTEGER4,        "Cisco PPP VJ Slot Comp", NULL},
967   /* #211 */
968   {212, RADIUS_INTEGER4,        "Cisco PPP Async Map", NULL},
969   /* #213-#216 */
970   {217, RADIUS_INTEGER4,        "Cisco IP Pool Definition", NULL},
971   {218, RADIUS_INTEGER4,        "Cisco Asing IP Pool", NULL},
972   /* #219-#227 */
973   {228, RADIUS_INTEGER4,        "Cisco Route IP", NULL},
974   /* #229-#232 */
975   {233, RADIUS_INTEGER4,        "Cisco Link Compression", NULL},
976   {234, RADIUS_INTEGER4,        "Cisco Target Util", NULL},
977   {235, RADIUS_INTEGER4,        "Cisco Maximum Channels", NULL},
978   /* #236-#241 */
979   {242, RADIUS_INTEGER4,        "Cisco Data Filter", NULL},
980   {243, RADIUS_INTEGER4,        "Cisco Call Filter", NULL},
981   {244, RADIUS_INTEGER4,        "Cisco Idle Limit", NULL},
982   /* Cisco SSG Service Selection Gateway Attributes */
983   {250, RADIUS_STRING,          "Cisco Account Info", NULL},
984   {251, RADIUS_STRING,          "Cisco Service Info", NULL},
985   {252, RADIUS_BINSTRING,       "Cisco Command Info", NULL},
986   {253, RADIUS_STRING,          "Cisco Control Info", NULL},
987   {255, RADIUS_INTEGER4,        "Cisco Xmit Rate", NULL},
988   {0, 0, NULL, NULL}
989 };
990
991 /*
992 reference:
993         'dictionary.shiva' file from FreeRADIUS
994                 http://www.freeradius.org/radiusd/raddb/dictionary.shiva
995 */
996 static const value_string radius_vendor_shiva_type_of_service_vals[] =
997 {
998   {1,   "Analog"},
999   {2,   "Digitized Analog"},
1000   {3,   "Digital"},
1001   {4,   "Digital V.110"},
1002   {5,   "Digital V.120"},
1003   {6,   "Digital Leased Line"},
1004   {0, NULL}
1005 };
1006
1007 static const value_string radius_vendor_shiva_link_protocol_vals[] =
1008 {
1009   {1,   "HDLC"},
1010   {2,   "ARAV1"},
1011   {3,   "ARAV2"},
1012   {4,   "SHELL"},
1013   {5,   "AALAP"},
1014   {6,   "SLIP"},
1015   {0, NULL}
1016 };
1017
1018 static const value_string radius_vendor_shiva_disconnect_reason_vals[] =
1019 {
1020   {1,   "Remote"},
1021   {2,   "Error"},
1022   {3,   "Idle Timeout"},
1023   {4,   "Session Timeout"},
1024   {5,   "Admin Disconnect"},
1025   {6,   "Dialback"},
1026   {7,   "Virtual Connection"},
1027   {8,   "Bandwidth On Demand"},
1028   {9,   "Failed Authentication"},
1029   {10,  "Preempted"},
1030   {11,  "Blocked"},
1031   {12,  "Tariff Management"},
1032   {13,  "Backup"},
1033   {0, NULL}
1034 };
1035
1036 static const value_string radius_vendor_shiva_function_vals[] =
1037 {
1038   {0,   "Unknown"},
1039   {1,   "Dialin"},
1040   {2,   "Dialout"},
1041   {3,   "Lan To Lan"},
1042   {0, NULL}
1043 };
1044
1045 static const value_string radius_vendor_shiva_connect_reason_vals[] =
1046 {
1047   {1,   "Remote"},
1048   {2,   "Dialback"},
1049   {3,   "Virtual Connection"},
1050   {4,   "Bandwidth On Demand"},
1051   {0, NULL}
1052 };
1053
1054 static const radius_attr_info radius_vendor_shiva_attrib[] =
1055 {
1056   {1,   RADIUS_STRING,          "Shiva User Attributes", NULL},
1057   {90,  RADIUS_STRING,          "Shiva Called Number", NULL},
1058   {91,  RADIUS_STRING,          "Shiva Calling Number", NULL},
1059   {92,  RADIUS_STRING,          "Shiva Customer Id", NULL},
1060   {93,  RADIUS_INTEGER4,        "Shiva Type Of Service", radius_vendor_shiva_type_of_service_vals},
1061   {94,  RADIUS_INTEGER4,        "Shiva Link Speed", NULL},
1062   {95,  RADIUS_INTEGER4,        "Shiva Links In Bundle", NULL},
1063   {96,  RADIUS_INTEGER4,        "Shiva Compression Type", NULL},
1064   {97,  RADIUS_INTEGER4,        "Shiva Link Protocol", radius_vendor_shiva_link_protocol_vals},
1065   {98,  RADIUS_INTEGER4,        "Shiva Network Protocols", NULL},
1066   {99,  RADIUS_INTEGER4,        "Shiva Session Id", NULL},
1067   {100, RADIUS_INTEGER4,        "Shiva Disconnect Reason", radius_vendor_shiva_disconnect_reason_vals},
1068   {101, RADIUS_IP_ADDRESS,      "Shiva Acct Serv Switch", NULL},
1069   {102, RADIUS_INTEGER4,        "Shiva Event Flags", NULL},
1070   {103, RADIUS_INTEGER4,        "Shiva Function", radius_vendor_shiva_function_vals},
1071   {104, RADIUS_INTEGER4,        "Shiva Connect Reason", radius_vendor_shiva_connect_reason_vals},
1072   {0, 0, NULL, NULL},
1073 };
1074
1075 /*
1076 reference:
1077         Cisco ACS 3.2 User Guide - Appendix D
1078         http://www.cisco.com/univercd/cc/td/doc/product/access/acs_soft/csacs4nt/acs32/user02/ad.htm#wp473517
1079 */
1080
1081
1082 static const radius_attr_info radius_vendor_cisco_vpn5000_attrib[] =
1083 {
1084   {1,   RADIUS_INTEGER4,                "CVPN5000-Tunnel-Throughput", NULL},
1085   {2,   RADIUS_IP_ADDRESS,      "CVPN5000-Client-Assigned-IP", NULL},
1086   {3,   RADIUS_IP_ADDRESS,      "CVPN5000-Client-Real-IP", NULL},
1087   {4,   RADIUS_STRING,          "CVPN5000-VPN-GroupInfo", NULL},
1088   {5,   RADIUS_STRING,          "CVPN5000-VPN-Password", NULL},
1089   {6,   RADIUS_INTEGER4,                "CVPN5000-Echo", NULL},
1090   {7,   RADIUS_INTEGER4,                "CVPN5000-Client-Assigned-IPX", NULL},
1091   {0, 0, NULL, NULL},
1092 };
1093
1094 /*
1095 reference:
1096         'dictionary.livingston' file from FreeRADIUS
1097                 http://www.freeradius.org/radiusd/raddb/dictionary.livingston
1098 */
1099 static const value_string radius_vendor_livingston_ipsec_log_options_vals[] =
1100 {
1101   {1,   "SA Success On"},
1102   {2,   "SA Failure On"},
1103   {3,   "Console On"},
1104   {4,   "Syslog On"},
1105   {5,   "SA Success Off"},
1106   {6,   "SA Failure Off"},
1107   {7,   "Console Off"},
1108   {8,   "Syslog Off"},
1109   {0, NULL}
1110 };
1111
1112 static const value_string radius_vendor_livingston_ipsec_deny_action_vals[] =
1113 {
1114   {1,   "Drop"},
1115   {2,   "ICMP Reject"},
1116   {3,   "Pass Through"},
1117   {0, NULL}
1118 };
1119
1120 static const value_string radius_vendor_livingston_nat_log_options_vals[] =
1121 {
1122   {1,   "Session Success On"},
1123   {2,   "Session Failure On"},
1124   {3,   "Console On"},
1125   {4,   "Syslog On"},
1126   {5,   "Success Off"},
1127   {6,   "Failure Off"},
1128   {7,   "Console Off"},
1129   {8,   "Syslog Off"},
1130   {0, NULL}
1131 };
1132
1133 static const value_string radius_vendor_livingston_nat_sess_dir_fail_action_vals[] =
1134 {
1135   {1,   "Drop"},
1136   {2,   "ICMP Reject"},
1137   {3,   "Pass Through"},
1138   {0, NULL}
1139 };
1140
1141 static const value_string radius_vendor_livingston_multicast_client_vals[] =
1142 {
1143   {1,   "On"},
1144   {0, NULL}
1145 };
1146
1147 static const radius_attr_info radius_vendor_livingston_attrib[] =
1148 {
1149   {2,   RADIUS_STRING,          "LE Terminate Detail", NULL},
1150   {3,   RADIUS_STRING,          "LE Advice of Charge", NULL},
1151   {4,   RADIUS_STRING,          "LE Connect Detail", NULL},
1152   {6,   RADIUS_STRING,          "LE IP Pool", NULL},
1153   {7,   RADIUS_IP_ADDRESS,      "LE IP Gateway", NULL},
1154   {8,   RADIUS_STRING,          "LE Modem Info", NULL},
1155   {9,   RADIUS_INTEGER4,        "LE IPSec Log Options", radius_vendor_livingston_ipsec_log_options_vals},
1156   {10,  RADIUS_INTEGER4,        "LE IPSec Deny Action", radius_vendor_livingston_ipsec_deny_action_vals},
1157   {11,  RADIUS_STRING,          "LE IPSec Active Profile", NULL},
1158   {12,  RADIUS_STRING,          "LE IPSec Outsource Profile", NULL},
1159   {13,  RADIUS_STRING,          "LE IPSec Passive Profile", NULL},
1160   {14,  RADIUS_INTEGER4,        "LE NAT TCP Session Timeout", NULL},
1161   {15,  RADIUS_INTEGER4,        "LE NAT Other Session Timeout", NULL},
1162   {16,  RADIUS_INTEGER4,        "LE NAT Log Options", radius_vendor_livingston_nat_log_options_vals},
1163   {17,  RADIUS_INTEGER4,        "LE NAT Sess Dir Fail Action", radius_vendor_livingston_nat_sess_dir_fail_action_vals},
1164   {18,  RADIUS_STRING,          "LE NAT Inmap", NULL},
1165   {19,  RADIUS_STRING,          "LE NAT Outmap", NULL},
1166   {20,  RADIUS_STRING,          "LE NAT Outsource Inmap", NULL},
1167   {21,  RADIUS_STRING,          "LE NAT Outsource Outmap", NULL},
1168   {22,  RADIUS_STRING,          "LE Admin Group", NULL},
1169   {23,  RADIUS_INTEGER4,        "LE Multicast Client", radius_vendor_livingston_multicast_client_vals},
1170   {0, 0, NULL, NULL},
1171 };
1172
1173 static const value_string radius_vendor_microsoft_bap_usage_vals[] =
1174 {
1175   {0,   "Not Allowed"},
1176   {1,   "Allowed"},
1177   {2,   "Required"},
1178   {0, NULL}
1179 };
1180
1181 static const value_string radius_vendor_microsoft_arap_pw_change_reason_vals[] =
1182 {
1183   {1,   "Just Change Password"},
1184   {2,   "Expired Password"},
1185   {3,   "Admin Required Password Change"},
1186   {4,   "Password Too Short"},
1187   {0, NULL}
1188 };
1189
1190 static const value_string radius_vendor_microsoft_acct_auth_type_vals[] =
1191 {
1192   {1,   "PAP"},
1193   {2,   "CHAP"},
1194   {3,   "MS CHAP 1"},
1195   {4,   "MS CHAP 2"},
1196   {5,   "EAP"},
1197   {0, NULL}
1198 };
1199
1200 static const value_string radius_vendor_microsoft_acct_eap_type_vals[] =
1201 {
1202   {4,   "MD5"},
1203   {5,   "OTP"},
1204   {6,   "Generic Token Card"},
1205   {13,  "TLS"},
1206   {0, NULL}
1207 };
1208
1209 static const radius_attr_info radius_vendor_microsoft_attrib[] =
1210 {
1211   {1,   RADIUS_BINSTRING,       "MS CHAP Response", NULL},
1212   {2,   RADIUS_STRING,          "MS CHAP Error", NULL},
1213   {3,   RADIUS_BINSTRING,       "MS CHAP CPW 1", NULL},
1214   {4,   RADIUS_BINSTRING,       "MS CHAP CPW 2", NULL},
1215   {5,   RADIUS_BINSTRING,       "MS CHAP LM Enc PW", NULL},
1216   {6,   RADIUS_BINSTRING,       "MS CHAP NT Enc PW", NULL},
1217   {7,   RADIUS_BINSTRING,       "MS MPPE Encryption Policy", NULL},
1218   {8,   RADIUS_BINSTRING,       "MS MPPE Encryption Type", NULL},
1219   {9,   RADIUS_INTEGER4,        "MS RAS Vendor", NULL},
1220   {10,  RADIUS_STRING,          "MS CHAP Domain", NULL},
1221   {11,  RADIUS_BINSTRING,       "MS CHAP Challenge", NULL},
1222   {12,  RADIUS_BINSTRING,       "MS CHAP MPPE Keys", NULL},
1223   {13,  RADIUS_INTEGER4,        "MS BAP Usage", radius_vendor_microsoft_bap_usage_vals},
1224   {14,  RADIUS_INTEGER4,        "MS Link Utilization Threshold", NULL},
1225   {15,  RADIUS_INTEGER4,        "MS Link Drop Time Limit", NULL},
1226   {16,  RADIUS_BINSTRING,       "MS MPPE Send Key", NULL},
1227   {17,  RADIUS_BINSTRING,       "MS MPPE Recv Key", NULL},
1228   {18,  RADIUS_STRING,          "MS RAS Version", NULL},
1229   {19,  RADIUS_BINSTRING,       "MS Old ARAP Password", NULL},
1230   {20,  RADIUS_BINSTRING,       "MS New ARAP Password", NULL},
1231   {21,  RADIUS_INTEGER4,        "MS ARAP PW Change Reason", radius_vendor_microsoft_arap_pw_change_reason_vals},
1232   {22,  RADIUS_BINSTRING,       "MS Filter", NULL},
1233   {23,  RADIUS_INTEGER4,        "MS Acct Auth Type", radius_vendor_microsoft_acct_auth_type_vals},
1234   {24,  RADIUS_INTEGER4,        "MS Acct EAP Type", radius_vendor_microsoft_acct_eap_type_vals},
1235   {25,  RADIUS_BINSTRING,       "MS CHAP2 Response", NULL},
1236   {26,  RADIUS_BINSTRING,       "MS CHAP2 Success", NULL},
1237   {27,  RADIUS_BINSTRING,       "MS CHAP2 CPW", NULL},
1238   {28,  RADIUS_IP_ADDRESS,      "MS Primary DNS Server", NULL},
1239   {29,  RADIUS_IP_ADDRESS,      "MS Secondary DNS Server", NULL},
1240   {30,  RADIUS_IP_ADDRESS,      "MS Primary NBNS Server", NULL},
1241   {31,  RADIUS_IP_ADDRESS,      "MS Secondary NBNS Server", NULL},
1242   {0, 0, NULL, NULL}
1243 };
1244
1245 static const value_string radius_vendor_ascend_calling_id_type_of_number_vals[] =
1246 {
1247   {0,   "Unknown"},
1248   {1,   "International Number"},
1249   {2,   "National Number"},
1250   {3,   "Network Specific"},
1251   {4,   "Subscriber Number"},
1252   {6,   "Abbreviated Number"},
1253   {0, NULL}
1254 };
1255
1256 static const value_string radius_vendor_ascend_calling_id_numbering_plan_vals[] =
1257 {
1258   {0,   "Unknown"},
1259   {1,   "ISDN Telephony"},
1260   {3,   "Data"},
1261   {4,   "Telex"},
1262   {8,   "National"},
1263   {9,   "Private"},
1264   {0, NULL}
1265 };
1266
1267 static const value_string radius_vendor_ascend_calling_id_presentation_vals[] =
1268 {
1269   {0,   "Allowed"},
1270   {1,   "Restricted"},
1271   {2,   "Number Not Available"},
1272   {0, NULL}
1273 };
1274
1275 static const value_string radius_vendor_ascend_calling_id_screening_vals[] =
1276 {
1277   {0,   "User Not Screened"},
1278   {1,   "User Provided Passed"},
1279   {2,   "User Provided Failed"},
1280   {3,   "Network Provided"},
1281   {0, NULL}
1282 };
1283
1284 static const radius_attr_info radius_vendor_ascend_attrib[] =
1285 {
1286   {7,   RADIUS_STRING,          "Ascend UU Info", NULL},
1287   {9,   RADIUS_INTEGER4,        "Ascend CIR Timer", NULL},
1288   {10,  RADIUS_INTEGER4,        "Ascend FR 08 Mode", NULL},
1289   {11,  RADIUS_INTEGER4,        "Ascend Destination Nas Port", NULL},
1290   {12,  RADIUS_STRING,          "Ascend FR SVC Addr", NULL},
1291   {13,  RADIUS_INTEGER4,        "Ascend NAS Port Format", NULL},
1292   {14,  RADIUS_INTEGER4,        "Ascend ATM Fault Management", NULL},
1293   {15,  RADIUS_INTEGER4,        "Ascend ATM Loopback Cell Loss", NULL},
1294   {16,  RADIUS_INTEGER4,        "Ascend Ckt Type", NULL},
1295   {17,  RADIUS_INTEGER4,        "Ascend SVC Enabled", NULL},
1296   {18,  RADIUS_INTEGER4,        "Ascend Session Type", NULL},
1297   {19,  RADIUS_IP_ADDRESS,      "Ascend H323 Gatekeeper", NULL},
1298   {20,  RADIUS_STRING,          "Ascend Global Call Id", NULL},
1299   {21,  RADIUS_INTEGER4,        "Ascend H323 Conference Id", NULL},
1300   {22,  RADIUS_IP_ADDRESS,      "Ascend H323 Fegw Address", NULL},
1301   {23,  RADIUS_INTEGER4,        "Ascend H323 Dialed Time", NULL},
1302   {24,  RADIUS_STRING,          "Ascend Dialed Number", NULL},
1303   {25,  RADIUS_INTEGER4,        "Ascend Inter Arrival Jitter", NULL},
1304   {26,  RADIUS_INTEGER4,        "Ascend Dropped Octets", NULL},
1305   {27,  RADIUS_INTEGER4,        "Ascend Dropped Packets", NULL},
1306   {29,  RADIUS_INTEGER4,        "Ascend X25 Pad X3 Profile", NULL},
1307   {30,  RADIUS_STRING,          "Ascend X25 Pad X3 Parameters", NULL},
1308   {31,  RADIUS_STRING,          "Ascend Tunnel VRouter Name", NULL},
1309   {32,  RADIUS_INTEGER4,        "Ascend X25 Reverse Charging", NULL},
1310   {33,  RADIUS_STRING,          "Ascend X25 Nui Prompt", NULL},
1311   {34,  RADIUS_STRING,          "Ascend X25 Nui Password Prompt", NULL},
1312   {35,  RADIUS_STRING,          "Ascend X25 Cug", NULL},
1313   {36,  RADIUS_STRING,          "Ascend X25 Pad Alias 1", NULL},
1314   {37,  RADIUS_STRING,          "Ascend X25 Pad Alias 2", NULL},
1315   {38,  RADIUS_STRING,          "Ascend X25 Pad Alias 3", NULL},
1316   {39,  RADIUS_STRING,          "Ascend X25 X121 Address", NULL},
1317   {40,  RADIUS_STRING,          "Ascend X25 Nui", NULL},
1318   {41,  RADIUS_STRING,          "Ascend X25 Rpoa", NULL},
1319   {42,  RADIUS_STRING,          "Ascend X25 Pad Prompt", NULL},
1320   {43,  RADIUS_STRING,          "Ascend X25 Pad Banner", NULL},
1321   {44,  RADIUS_STRING,          "Ascend X25 Profile Name", NULL},
1322   {45,  RADIUS_STRING,          "Ascend Recv Name", NULL},
1323   {46,  RADIUS_INTEGER4,        "Ascend Bi Directional Auth", NULL},
1324   {47,  RADIUS_INTEGER4,        "Ascend MTU", NULL},
1325   {48,  RADIUS_INTEGER4,        "Ascend Call Direction", NULL},
1326   {49,  RADIUS_INTEGER4,        "Ascend Service Type", NULL},
1327   {50,  RADIUS_INTEGER4,        "Ascend Filter Required", NULL},
1328   {51,  RADIUS_INTEGER4,        "Ascend Traffic Shaper", NULL},
1329   {52,  RADIUS_STRING,          "Ascend Access Intercept LEA", NULL},
1330   {53,  RADIUS_STRING,          "Ascend Access Intercept Log", NULL},
1331   {54,  RADIUS_STRING,          "Ascend Private Route Table ID", NULL},
1332   {55,  RADIUS_INTEGER4,        "Ascend Private Route Required", NULL},
1333   {56,  RADIUS_INTEGER4,        "Ascend Cache Refresh", NULL},
1334   {57,  RADIUS_INTEGER4,        "Ascend Cache Time", NULL},
1335   {58,  RADIUS_INTEGER4,        "Ascend Egress Enabled", NULL},
1336   {59,  RADIUS_STRING,          "Ascend QOS Upstream", NULL},
1337   {60,  RADIUS_STRING,          "Ascend QOS Downstream", NULL},
1338   {61,  RADIUS_INTEGER4,        "Ascend ATM Connect Vpi", NULL},
1339   {62,  RADIUS_INTEGER4,        "Ascend ATM Connect Vci", NULL},
1340   {63,  RADIUS_INTEGER4,        "Ascend ATM Connect Group", NULL},
1341   {64,  RADIUS_INTEGER4,        "Ascend ATM Group", NULL},
1342   {65,  RADIUS_INTEGER4,        "Ascend IPX Header Compression", NULL},
1343   {66,  RADIUS_INTEGER4,        "Ascend Calling Id Type Of Number", radius_vendor_ascend_calling_id_type_of_number_vals},
1344   {67,  RADIUS_INTEGER4,        "Ascend Calling Id Numbering Plan", radius_vendor_ascend_calling_id_numbering_plan_vals},
1345   {68,  RADIUS_INTEGER4,        "Ascend Calling Id Presentation", radius_vendor_ascend_calling_id_presentation_vals},
1346   {69,  RADIUS_INTEGER4,        "Ascend Calling Id Screening", radius_vendor_ascend_calling_id_screening_vals},
1347   {70,  RADIUS_INTEGER4,        "Ascend BIR Enable", NULL},
1348   {71,  RADIUS_INTEGER4,        "Ascend BIR Proxy", NULL},
1349   {72,  RADIUS_INTEGER4,        "Ascend BIR Bridge Group", NULL},
1350   {73,  RADIUS_STRING,          "Ascend IPSEC Profile", NULL},
1351   {74,  RADIUS_INTEGER4,        "Ascend PPPoE Enable", NULL},
1352   {75,  RADIUS_INTEGER4,        "Ascend Bridge Non PPPoE", NULL},
1353   {76,  RADIUS_INTEGER4,        "Ascend ATM Direct", NULL},
1354   {77,  RADIUS_STRING,          "Ascend ATM Direct Profile", NULL},
1355   {78,  RADIUS_IP_ADDRESS,      "Ascend Client Primary WINS", NULL},
1356   {79,  RADIUS_IP_ADDRESS,      "Ascend Client Secondary WINS", NULL},
1357   {80,  RADIUS_INTEGER4,        "Ascend Client Assign WINS", NULL},
1358   {81,  RADIUS_INTEGER4,        "Ascend Auth Type", NULL},
1359   {82,  RADIUS_INTEGER4,        "Ascend Port Redir Protocol", NULL},
1360   {83,  RADIUS_INTEGER4,        "Ascend Port Redir Portnum", NULL},
1361   {84,  RADIUS_IP_ADDRESS,      "Ascend Port Redir Server", NULL},
1362   {85,  RADIUS_INTEGER4,        "Ascend IP Pool Chaining", NULL},
1363   {86,  RADIUS_IP_ADDRESS,      "Ascend Owner IP Addr", NULL},
1364   {87,  RADIUS_INTEGER4,        "Ascend IP TOS", NULL},
1365   {88,  RADIUS_INTEGER4,        "Ascend IP TOS Precedence", NULL},
1366   {89,  RADIUS_INTEGER4,        "Ascend IP TOS Apply To", NULL},
1367   {90,  RADIUS_STRING,          "Ascend Filter", NULL},
1368   {91,  RADIUS_STRING,          "Ascend Telnet Profile", NULL},
1369   {92,  RADIUS_INTEGER4,        "Ascend Dsl Rate Type", NULL},
1370   {93,  RADIUS_STRING,          "Ascend Redirect Number", NULL},
1371   {94,  RADIUS_INTEGER4,        "Ascend ATM Vpi", NULL},
1372   {95,  RADIUS_INTEGER4,        "Ascend ATM Vci", NULL},
1373   {96,  RADIUS_INTEGER4,        "Ascend Source IP Check", NULL},
1374   {97,  RADIUS_INTEGER4,        "Ascend Dsl Rate Mode", NULL},
1375   {98,  RADIUS_INTEGER4,        "Ascend Dsl Upstream Limit", NULL},
1376   {99,  RADIUS_INTEGER4,        "Ascend Dsl Downstream Limit", NULL},
1377   {100, RADIUS_INTEGER4,        "Ascend Dsl CIR Recv Limit", NULL},
1378   {101, RADIUS_INTEGER4,        "Ascend Dsl CIR Xmit Limit", NULL},
1379   {102, RADIUS_STRING,          "Ascend VRouter Name", NULL},
1380   {103, RADIUS_STRING,          "Ascend Source Auth", NULL},
1381   {104, RADIUS_STRING,          "Ascend Private Route", NULL},
1382   {105, RADIUS_INTEGER4,        "Ascend Numbering Plan ID", NULL},
1383   {106, RADIUS_INTEGER4,        "Ascend FR Link Status DLCI", NULL},
1384   {107, RADIUS_STRING,          "Ascend Calling Subaddress", NULL},
1385   {108, RADIUS_INTEGER4,        "Ascend Callback Delay", NULL},
1386   {109, RADIUS_STRING,          "Ascend Endpoint Disc", NULL},
1387   {110, RADIUS_STRING,          "Ascend Remote FW", NULL},
1388   {111, RADIUS_INTEGER4,        "Ascend Multicast GLeave Delay", NULL},
1389   {112, RADIUS_INTEGER4,        "Ascend CBCP Enable", NULL},
1390   {113, RADIUS_INTEGER4,        "Ascend CBCP Mode", NULL},
1391   {114, RADIUS_INTEGER4,        "Ascend CBCP Delay", NULL},
1392   {115, RADIUS_INTEGER4,        "Ascend CBCP Trunk Group", NULL},
1393   {116, RADIUS_STRING,          "Ascend Appletalk Route", NULL},
1394   {117, RADIUS_INTEGER4,        "Ascend Appletalk Peer Mode", NULL},
1395   {118, RADIUS_INTEGER4,        "Ascend Route Appletalk", NULL},
1396   {119, RADIUS_STRING,          "Ascend FCP Parameter", NULL},
1397   {120, RADIUS_INTEGER4,        "Ascend Modem Port No", NULL},
1398   {121, RADIUS_INTEGER4,        "Ascend Modem Slot No", NULL},
1399   {122, RADIUS_INTEGER4,        "Ascend Modem Shelf No", NULL},
1400   {123, RADIUS_INTEGER4,        "Ascend Call Attempt Limit", NULL},
1401   {124, RADIUS_INTEGER4,        "Ascend Call Block Duration", NULL},
1402   {125, RADIUS_INTEGER4,        "Ascend Maximum Call Duration", NULL},
1403   {126, RADIUS_INTEGER4,        "Ascend Temporary Rtes", NULL},
1404   {127, RADIUS_INTEGER4,        "Ascend Tunneling Protocol", NULL},
1405   {128, RADIUS_INTEGER4,        "Ascend Shared Profile Enable", NULL},
1406   {129, RADIUS_STRING,          "Ascend Primary Home Agent", NULL},
1407   {130, RADIUS_STRING,          "Ascend Secondary Home Agent", NULL},
1408   {131, RADIUS_INTEGER4,        "Ascend Dialout Allowed", NULL},
1409   {132, RADIUS_IP_ADDRESS,      "Ascend Client Gateway", NULL},
1410   {133, RADIUS_INTEGER4,        "Ascend BACP Enable", NULL},
1411   {134, RADIUS_INTEGER4,        "Ascend DHCP Maximum Leases", NULL},
1412   {135, RADIUS_IP_ADDRESS,      "Ascend Client Primary DNS", NULL},
1413   {136, RADIUS_IP_ADDRESS,      "Ascend Client Secondary DNS", NULL},
1414   {137, RADIUS_INTEGER4,        "Ascend Client Assign DNS", NULL},
1415   {138, RADIUS_INTEGER4,        "Ascend User Acct Type", NULL},
1416   {139, RADIUS_IP_ADDRESS,      "Ascend User Acct Host", NULL},
1417   {140, RADIUS_INTEGER4,        "Ascend User Acct Port", NULL},
1418   {141, RADIUS_STRING,          "Ascend User Acct Key", NULL},
1419   {142, RADIUS_INTEGER4,        "Ascend User Acct Base", NULL},
1420   {143, RADIUS_INTEGER4,        "Ascend User Acct Time", NULL},
1421   {144, RADIUS_IP_ADDRESS,      "Ascend Assign IP Client", NULL},
1422   {145, RADIUS_IP_ADDRESS,      "Ascend Assign IP Server", NULL},
1423   {146, RADIUS_STRING,          "Ascend Assign IP Global Pool", NULL},
1424   {147, RADIUS_INTEGER4,        "Ascend DHCP Reply", NULL},
1425   {148, RADIUS_INTEGER4,        "Ascend DHCP Pool Number", NULL},
1426   {149, RADIUS_INTEGER4,        "Ascend Expect Callback", NULL},
1427   {150, RADIUS_INTEGER4,        "Ascend Event Type", NULL},
1428   {151, RADIUS_STRING,          "Ascend Session Svr Key", NULL},
1429   {152, RADIUS_INTEGER4,        "Ascend Multicast Rate Limit", NULL},
1430   {153, RADIUS_IP_ADDRESS,      "Ascend IF Netmask", NULL},
1431   {154, RADIUS_IP_ADDRESS,      "Ascend Remote Addr", NULL},
1432   {155, RADIUS_INTEGER4,        "Ascend Multicast Client", NULL},
1433   {156, RADIUS_STRING,          "Ascend FR Circuit Name", NULL},
1434   {157, RADIUS_INTEGER4,        "Ascend FR LinkUp", NULL},
1435   {158, RADIUS_INTEGER4,        "Ascend FR Nailed Grp", NULL},
1436   {159, RADIUS_INTEGER4,        "Ascend FR Type", NULL},
1437   {160, RADIUS_INTEGER4,        "Ascend FR Link Mgt", NULL},
1438   {161, RADIUS_INTEGER4,        "Ascend FR N391", NULL},
1439   {162, RADIUS_INTEGER4,        "Ascend FR DCE N392", NULL},
1440   {163, RADIUS_INTEGER4,        "Ascend FR DTE N392", NULL},
1441   {164, RADIUS_INTEGER4,        "Ascend FR DCE N393", NULL},
1442   {165, RADIUS_INTEGER4,        "Ascend FR DTE N393", NULL},
1443   {166, RADIUS_INTEGER4,        "Ascend FR T391", NULL},
1444   {167, RADIUS_INTEGER4,        "Ascend FR T392", NULL},
1445   {168, RADIUS_STRING,          "Ascend Bridge Address", NULL},
1446   {169, RADIUS_INTEGER4,        "Ascend TS Idle Limit", NULL},
1447   {170, RADIUS_INTEGER4,        "Ascend TS Idle Mode", NULL},
1448   {171, RADIUS_INTEGER4,        "Ascend DBA Monitor", NULL},
1449   {172, RADIUS_INTEGER4,        "Ascend Base Channel Count", NULL},
1450   {173, RADIUS_INTEGER4,        "Ascend Minimum Channels", NULL},
1451   {174, RADIUS_STRING,          "Ascend IPX Route", NULL},
1452   {175, RADIUS_INTEGER4,        "Ascend FT1 Caller", NULL},
1453   {176, RADIUS_STRING,          "Ascend Backup", NULL},
1454   {177, RADIUS_INTEGER4,        "Ascend Call Type", NULL},
1455   {178, RADIUS_STRING,          "Ascend Group", NULL},
1456   {179, RADIUS_INTEGER4,        "Ascend FR DLCI", NULL},
1457   {180, RADIUS_STRING,          "Ascend FR Profile Name", NULL},
1458   {181, RADIUS_STRING,          "Ascend Ara PW", NULL},
1459   {182, RADIUS_STRING,          "Ascend IPX Node Addr", NULL},
1460   {183, RADIUS_IP_ADDRESS,      "Ascend Home Agent IP Addr", NULL},
1461   {184, RADIUS_STRING,          "Ascend Home Agent Password", NULL},
1462   {185, RADIUS_STRING,          "Ascend Home Network Name", NULL},
1463   {186, RADIUS_INTEGER4,        "Ascend Home Agent UDP Port", NULL},
1464   {187, RADIUS_INTEGER4,        "Ascend Multilink ID", NULL},
1465   {188, RADIUS_INTEGER4,        "Ascend Num In Multilink", NULL},
1466   {189, RADIUS_IP_ADDRESS,      "Ascend First Dest", NULL},
1467   {190, RADIUS_INTEGER4,        "Ascend Pre Input Octets", NULL},
1468   {191, RADIUS_INTEGER4,        "Ascend Pre Output Octets", NULL},
1469   {192, RADIUS_INTEGER4,        "Ascend Pre Input Packets", NULL},
1470   {193, RADIUS_INTEGER4,        "Ascend Pre Output Packets", NULL},
1471   {194, RADIUS_INTEGER4,        "Ascend Maximum Time", NULL},
1472   {195, RADIUS_INTEGER4,        "Ascend Disconnect Cause", NULL},
1473   {196, RADIUS_INTEGER4,        "Ascend Connect Progress", NULL},
1474   {197, RADIUS_INTEGER4,        "Ascend Data Rate", NULL},
1475   {198, RADIUS_INTEGER4,        "Ascend PreSession Time", NULL},
1476   {199, RADIUS_INTEGER4,        "Ascend Token Idle", NULL},
1477   {200, RADIUS_INTEGER4,        "Ascend Token Immediate", NULL},
1478   {201, RADIUS_INTEGER4,        "Ascend Require Auth", NULL},
1479   {202, RADIUS_STRING,          "Ascend Number Sessions", NULL},
1480   {203, RADIUS_STRING,          "Ascend Authen Alias", NULL},
1481   {204, RADIUS_INTEGER4,        "Ascend Token Expiry", NULL},
1482   {205, RADIUS_STRING,          "Ascend Menu Selector", NULL},
1483   {206, RADIUS_STRING,          "Ascend Menu Item", NULL},
1484   {207, RADIUS_INTEGER4,        "Ascend PW Warntime", NULL},
1485   {208, RADIUS_INTEGER4,        "Ascend PW Lifetime", NULL},
1486   {209, RADIUS_IP_ADDRESS,      "Ascend IP Direct", NULL},
1487   {210, RADIUS_INTEGER4,        "Ascend PPP VJ Slot Comp", NULL},
1488   {211, RADIUS_INTEGER4,        "Ascend PPP VJ 1172", NULL},
1489   {212, RADIUS_INTEGER4,        "Ascend PPP Async Map", NULL},
1490   {213, RADIUS_STRING,          "Ascend Third Prompt", NULL},
1491   {214, RADIUS_STRING,          "Ascend Send Secret", NULL},
1492   {215, RADIUS_STRING,          "Ascend Receive Secret", NULL},
1493   {216, RADIUS_INTEGER4,        "Ascend IPX Peer Mode", NULL},
1494   {217, RADIUS_STRING,          "Ascend IP Pool Definition", NULL},
1495   {218, RADIUS_INTEGER4,        "Ascend Assign IP Pool", NULL},
1496   {219, RADIUS_INTEGER4,        "Ascend FR Direct", NULL},
1497   {220, RADIUS_STRING,          "Ascend FR Direct Profile", NULL},
1498   {221, RADIUS_INTEGER4,        "Ascend FR Direct DLCI", NULL},
1499   {222, RADIUS_INTEGER4,        "Ascend Handle IPX", NULL},
1500   {223, RADIUS_INTEGER4,        "Ascend Netware timeout", NULL},
1501   {224, RADIUS_INTEGER4,        "Ascend IPX Alias", NULL},
1502   {225, RADIUS_INTEGER4,        "Ascend Metric", NULL},
1503   {226, RADIUS_INTEGER4,        "Ascend PRI Number Type", NULL},
1504   {227, RADIUS_STRING,          "Ascend Dial Number", NULL},
1505   {228, RADIUS_INTEGER4,        "Ascend Route IP", NULL},
1506   {229, RADIUS_INTEGER4,        "Ascend Route IPX", NULL},
1507   {230, RADIUS_INTEGER4,        "Ascend Bridge", NULL},
1508   {231, RADIUS_INTEGER4,        "Ascend Send Auth", NULL},
1509   {232, RADIUS_STRING,          "Ascend Send Passwd", NULL},
1510   {233, RADIUS_INTEGER4,        "Ascend Link Compression", NULL},
1511   {234, RADIUS_INTEGER4,        "Ascend Target Util", NULL},
1512   {235, RADIUS_INTEGER4,        "Ascend Maximum Channels", NULL},
1513   {236, RADIUS_INTEGER4,        "Ascend Inc Channel Count", NULL},
1514   {237, RADIUS_INTEGER4,        "Ascend Dec Channel Count", NULL},
1515   {238, RADIUS_INTEGER4,        "Ascend Seconds Of History", NULL},
1516   {239, RADIUS_INTEGER4,        "Ascend History Weigh Type", NULL},
1517   {240, RADIUS_INTEGER4,        "Ascend Add Seconds", NULL},
1518   {241, RADIUS_INTEGER4,        "Ascend Remove Seconds", NULL},
1519   {242, RADIUS_BINSTRING,       "Ascend Data Filter", NULL},
1520   {243, RADIUS_BINSTRING,       "Ascend Call Filter", NULL},
1521   {244, RADIUS_INTEGER4,        "Ascend Idle Limit", NULL},
1522   {245, RADIUS_INTEGER4,        "Ascend Preempt Limit", NULL},
1523   {246, RADIUS_INTEGER4,        "Ascend Callback", NULL},
1524   {247, RADIUS_INTEGER4,        "Ascend Data Svc", NULL},
1525   {248, RADIUS_INTEGER4,        "Ascend Force 56", NULL},
1526   {249, RADIUS_STRING,          "Ascend Billing Number", NULL},
1527   {250, RADIUS_INTEGER4,        "Ascend Call By Call", NULL},
1528   {251, RADIUS_STRING,          "Ascend Transit Number", NULL},
1529   {252, RADIUS_STRING,          "Ascend Host Info", NULL},
1530   {253, RADIUS_IP_ADDRESS,      "Ascend PPP Address", NULL},
1531   {254, RADIUS_INTEGER4,        "Ascend MPP Idle Percent", NULL},
1532   {255, RADIUS_INTEGER4,        "Ascend Xmit Rate", NULL},
1533   {0, 0, NULL, NULL}
1534 };
1535
1536 /*
1537 reference:
1538         'dictionary.bay' file from FreeRADIUS
1539                 http://www.freeradius.org/radiusd/raddb/dictionary.bay
1540 */
1541 static const value_string radius_vendor_bay_tunnel_authen_type_vals[] =
1542 {
1543   {0,   "none"},
1544   {1,   "kmd5 128"},
1545   {0, NULL}
1546 };
1547
1548 static const value_string radius_vendor_bay_tunnel_authen_mode_vals[] =
1549 {
1550   {0,   "none"},
1551   {1,   "prefix suffix"},
1552   {0, NULL}
1553 };
1554
1555 static const value_string radius_vendor_bay_user_server_location_vals[] =
1556 {
1557   {1,   "local"},
1558   {2,   "remote"},
1559   {0, NULL}
1560 };
1561
1562 static const value_string radius_vendor_bay_system_disc_reason_vals[] =
1563 {
1564   {0,   "Unknown"},
1565   {1,   "Line disconnected"},
1566   {2,   "Dial failed"},
1567   {3,   "WAN manager error"},
1568   {4,   "Disconnect reset"},
1569   {5,   "Error from adm_notify"},
1570   {6,   "Modem down adm_notify"},
1571   {7,   "PPP protocol disconnect"},
1572   {8,   "Inactivity timer"},
1573   {9,   "CLI Hangup command"},
1574   {10,  "CLI last job"},
1575   {11,  "Session timeout"},
1576   {12,  "Slave termination"},
1577   {13,  "Abnormal termination"},
1578   {14,  "DCD wait failed"},
1579   {15,  "CLI inactivity"},
1580   {16,  "Admin port reset"},
1581   {17,  "CLI auth failed"},
1582   {18,  "Slave auth failed"},
1583   {19,  "PAP auth failed"},
1584   {20,  "CHAP auth failed"},
1585   {21,  "Local modem reset"},
1586   {22,  "Modem dead"},
1587   {23,  "PPP LCP failure"},
1588   {24,  "PPP IPCP failure"},
1589   {25,  "PPP IPXCP failure"},
1590   {26,  "PPP ATCP failure"},
1591   {27,  "PPP CCP failure"},
1592   {28,  "PPP MP failure"},
1593   {29,  "PPP IPCP timeout"},
1594   {30,  "PPP IPXCP timeout"},
1595   {31,  "PPP ATCP timeout"},
1596   {32,  "PPP CCP timeout"},
1597   {33,  "PPP MP timeout"},
1598   {34,  "PPP init failure"},
1599   {35,  "PPP Unknown"},
1600   {36,  "PPP Dialback failed"},
1601   {37,  "PPP Address In Use"},
1602   {38,  "PPP No device"},
1603   {39,  "PPP Modem hangup rcvd"},
1604   {40,  "PPP Hangup rcvd"},
1605   {41,  "PPP Termination rcvd"},
1606   {42,  "PPP Kill rcvd"},
1607   {43,  "PPP Time rcvd"},
1608   {44,  "PPP No memory"},
1609   {45,  "PPP Connection Abort"},
1610   {46,  "PPP VPN LCP failure"},
1611   {47,  "PPP VPN Auth failure"},
1612   {48,  "PPP MP invalid port"},
1613   {49,  "PPP Invalid device"},
1614   {50,  "PPP MMP bundle failure"},
1615   {51,  "DVS Registration failure"},
1616   {52,  "DVS Home agent dereg"},
1617   {53,  "DVS Tunnel no renew"},
1618   {54,  "DVS Tunnel expired"},
1619   {0, NULL}
1620 };
1621
1622 static const value_string radius_vendor_bay_modem_disc_reason_vals[] =
1623 {
1624   {0,   "Unknown"},
1625   {1,   "Local disconnect"},
1626   {2,   "CD Timer Expired"},
1627   {4,   "Remote protocol disc"},
1628   {5,   "Clear down"},
1629   {6,   "Long Space disconnect"},
1630   {7,   "Carrier Lost"},
1631   {8,   "Modem Retrain Timeout"},
1632   {0, NULL}
1633 };
1634
1635 static const value_string radius_vendor_bay_addr_resolution_protocol_vals[] =
1636 {
1637   {0,   "none"},
1638   {1,   "DHCP"},
1639   {0, NULL}
1640 };
1641
1642 static const value_string radius_vendor_bay_user_level_vals[] =
1643 {
1644   {2,   "Manager"},
1645   {4,   "User"},
1646   {8,   "Operator"},
1647   {0, NULL}
1648 };
1649
1650 static const value_string radius_vendor_bay_audit_level_vals[] =
1651 {
1652   {2,   "Manager"},
1653   {4,   "User"},
1654   {8,   "Operator"},
1655   {0, NULL}
1656 };
1657
1658 static const radius_attr_info radius_vendor_bay_attrib[] =
1659 {
1660   {28,  RADIUS_STRING,          "Annex Filter", NULL},
1661   {29,  RADIUS_STRING,          "Annex CLI Command", NULL},
1662   {30,  RADIUS_STRING,          "Annex CLI Filter", NULL},
1663   {31,  RADIUS_STRING,          "Annex Host Restrict", NULL},
1664   {32,  RADIUS_STRING,          "Annex Host Allow", NULL},
1665   {33,  RADIUS_STRING,          "Annex Product Name", NULL},
1666   {34,  RADIUS_STRING,          "Annex SW Version", NULL},
1667   {35,  RADIUS_IP_ADDRESS,      "Annex Local IP Address", NULL},
1668   {36,  RADIUS_INTEGER4,        "Annex Callback Portlist", NULL},
1669   {37,  RADIUS_INTEGER4,        "Annex Sec Profile Index", NULL},
1670   {38,  RADIUS_INTEGER4,        "Annex Tunnel Authen Type", radius_vendor_bay_tunnel_authen_type_vals},
1671   {39,  RADIUS_INTEGER4,        "Annex Tunnel Authen Mode", radius_vendor_bay_tunnel_authen_mode_vals},
1672   {40,  RADIUS_STRING,          "Annex Authen Servers", NULL},
1673   {41,  RADIUS_STRING,          "Annex Acct Servers", NULL},
1674   {42,  RADIUS_INTEGER4,        "Annex User Server Location", radius_vendor_bay_user_server_location_vals},
1675   {43,  RADIUS_STRING,          "Annex Local Username", NULL},
1676   {44,  RADIUS_INTEGER4,        "Annex System Disc Reason", radius_vendor_bay_system_disc_reason_vals},
1677   {45,  RADIUS_INTEGER4,        "Annex Modem Disc Reason", radius_vendor_bay_modem_disc_reason_vals},
1678   {46,  RADIUS_INTEGER4,        "Annex Disconnect Reason", NULL},
1679   {47,  RADIUS_INTEGER4,        "Annex Addr Resolution Protocol", radius_vendor_bay_addr_resolution_protocol_vals},
1680   {48,  RADIUS_STRING,          "Annex Addr Resolution Servers", NULL},
1681   {49,  RADIUS_STRING,          "Annex Domain Name", NULL},
1682   {50,  RADIUS_INTEGER4,        "Annex Transmit Speed", NULL},
1683   {51,  RADIUS_INTEGER4,        "Annex Receive Speed", NULL},
1684   {52,  RADIUS_STRING,          "Annex Input Filter", NULL},
1685   {53,  RADIUS_STRING,          "Annex Output Filter", NULL},
1686   {54,  RADIUS_IP_ADDRESS,      "Annex Primary DNS Server", NULL},
1687   {55,  RADIUS_IP_ADDRESS,      "Annex Secondary DNS Server", NULL},
1688   {56,  RADIUS_IP_ADDRESS,      "Annex Primary NBNS Server", NULL},
1689   {57,  RADIUS_IP_ADDRESS,      "Annex Secondary NBNS Server", NULL},
1690   {58,  RADIUS_INTEGER4,        "Annex Syslog Tap", NULL},
1691   {59,  RADIUS_INTEGER4,        "Annex Keypress Timeout", NULL},
1692   {60,  RADIUS_INTEGER4,        "Annex Unauthenticated Time", NULL},
1693   {61,  RADIUS_INTEGER4,        "Annex Re CHAP Timeout", NULL},
1694   {62,  RADIUS_INTEGER4,        "Annex MRRU", NULL},
1695   {63,  RADIUS_STRING,          "Annex EDO", NULL},
1696   {64,  RADIUS_INTEGER4,        "Annex PPP Trace Level", NULL},
1697   {65,  RADIUS_INTEGER4,        "Annex Pre Input Octets", NULL},
1698   {66,  RADIUS_INTEGER4,        "Annex Pre Output Octets", NULL},
1699   {67,  RADIUS_INTEGER4,        "Annex Pre Input Packets", NULL},
1700   {68,  RADIUS_INTEGER4,        "Annex Pre Output Packets", NULL},
1701   {69,  RADIUS_INTEGER4,        "Annex Connect Progress", NULL},
1702   {73,  RADIUS_INTEGER4,        "Annex Multicast Rate Limit", NULL},
1703   {74,  RADIUS_INTEGER4,        "Annex Maximum Call Duration", NULL},
1704   {75,  RADIUS_INTEGER4,        "Annex Multilink Id", NULL},
1705   {76,  RADIUS_INTEGER4,        "Annex Num In Multilink", NULL},
1706   {81,  RADIUS_INTEGER4,        "Annex Logical Channel Number", NULL},
1707   {82,  RADIUS_INTEGER4,        "Annex Wan Number", NULL},
1708   {83,  RADIUS_INTEGER4,        "Annex Port", NULL},
1709   {85,  RADIUS_INTEGER4,        "Annex Pool Id", NULL},
1710   {86,  RADIUS_STRING,          "Annex Compression Protocol", NULL},
1711   {87,  RADIUS_INTEGER4,        "Annex Transmitted Packets", NULL},
1712   {88,  RADIUS_INTEGER4,        "Annex Retransmitted Packets", NULL},
1713   {89,  RADIUS_INTEGER4,        "Annex Signal to Noise Ratio", NULL},
1714   {90,  RADIUS_INTEGER4,        "Annex Retrain Requests Sent", NULL},
1715   {91,  RADIUS_INTEGER4,        "Annex Retrain Requests Rcvd", NULL},
1716   {92,  RADIUS_INTEGER4,        "Annex Rate Reneg Req Sent", NULL},
1717   {93,  RADIUS_INTEGER4,        "Annex Rate Reneg Req Rcvd", NULL},
1718   {94,  RADIUS_INTEGER4,        "Annex Begin Receive Line Level", NULL},
1719   {95,  RADIUS_INTEGER4,        "Annex End Receive Line Level", NULL},
1720   {96,  RADIUS_STRING,          "Annex Begin Modulation", NULL},
1721   {97,  RADIUS_STRING,          "Annex Error Correction Prot", NULL},
1722   {98,  RADIUS_STRING,          "Annex End Modulation", NULL},
1723   {100, RADIUS_INTEGER4,        "Annex User Level", radius_vendor_bay_user_level_vals},
1724   {101, RADIUS_INTEGER4,        "Annex Audit Level", radius_vendor_bay_audit_level_vals},
1725   {0, 0, NULL, NULL},
1726 };
1727
1728 /*
1729 reference:
1730         'dictionary.foundry' file from FreeRADIUS
1731                 http://www.freeradius.org/radiusd/raddb/dictionary.foundry
1732 */
1733 static const radius_attr_info radius_vendor_foundry_attrib[] =
1734 {
1735   {1,   RADIUS_INTEGER4,        "Foundry Privilege Level", NULL},
1736   {2,   RADIUS_STRING,          "Foundry Command String", NULL},
1737   {3,   RADIUS_INTEGER4,        "Foundry Command Exception Flag", NULL},
1738   {0, 0, NULL, NULL},
1739 };
1740
1741 /*
1742 reference:
1743         'dictionary.versanet' file from FreeRADIUS
1744                 http://www.freeradius.org/radiusd/raddb/dictionary.versanet
1745 */
1746 static const value_string radius_vendor_versanet_termination_cause_vals[] =
1747 {
1748   {0,   "Normal Hangup No Error Occurred"},
1749   {3,   "Call Waiting Caused Disconnect"},
1750   {4,   "Physical Carrier Loss"},
1751   {5,   "No err correction at other end"},
1752   {6,   "No resp to feature negotiation"},
1753   {7,   "1st modem async only 2nd sync"},
1754   {8,   "No framing technique in common"},
1755   {9,   "No protocol in common"},
1756   {10,  "Bad resp to feature negotiation"},
1757   {11,  "No sync info from remote modem"},
1758   {12,  "Normal Hangup by Remote modem"},
1759   {13,  "Retransmission limit reached"},
1760   {14,  "Protocol violation occurred"},
1761   {15,  "Lost DTR"},
1762   {16,  "Received GSTN cleardown"},
1763   {17,  "Inactivity timeout"},
1764   {18,  "Speed not supported"},
1765   {19,  "Long space disconnect"},
1766   {20,  "Key abort disconnect"},
1767   {21,  "Clears previous disc reason"},
1768   {22,  "No connection established"},
1769   {23,  "Disconnect after three retrains"},
1770   {0, NULL}
1771 };
1772
1773 static const radius_attr_info radius_vendor_versanet_attrib[] =
1774 {
1775   {1,   RADIUS_INTEGER4,        "Versanet Termination Cause", radius_vendor_versanet_termination_cause_vals},
1776   {0, 0, NULL, NULL},
1777 };
1778
1779 /*
1780 reference:
1781         'dictionary.redback' file from FreeRADIUS
1782                 http://www.freeradius.org/radiusd/raddb/dictionary.redback
1783 */
1784 static const value_string radius_vendor_redback_tunnel_function_vals[] =
1785 {
1786   {1,   "LAC Only"},
1787   {2,   "LNS Only"},
1788   {3,   "LAC LNS"},
1789   {0, NULL}
1790 };
1791
1792 static const value_string radius_vendor_redback_mcast_send_vals[] =
1793 {
1794   {1,   "NO SEND"},
1795   {2,   "SEND"},
1796   {3,   "UNSOLICITED SEND"},
1797   {0, NULL}
1798 };
1799
1800 static const value_string radius_vendor_redback_mcast_receive_vals[] =
1801 {
1802   {1,   "NO RECEIVE"},
1803   {2,   "RECEIVE"},
1804   {0, NULL}
1805 };
1806
1807 static const value_string radius_vendor_redback_tunnel_dnis_vals[] =
1808 {
1809   {1,   "DNIS"},
1810   {2,   "DNIS Only"},
1811   {0, NULL}
1812 };
1813
1814 static const value_string radius_vendor_redback_pvc_encapsulation_type_vals[] =
1815 {
1816   {1,   "AAA ENCAPS ATM RAW"},
1817   {2,   "AAA ENCAPS ATM ROUTE1483"},
1818   {3,   "AAA ENCAPS ATM AUTO1483"},
1819   {4,   "AAA ENCAPS ATM MULTI"},
1820   {5,   "AAA ENCAPS ATM BRIDGE1483"},
1821   {6,   "AAA ENCAPS ATM PPP"},
1822   {7,   "AAA ENCAPS ATM PPP SERIAL"},
1823   {8,   "AAA ENCAPS ATM PPP NLPID"},
1824   {9,   "AAA ENCAPS ATM PPP AUTO"},
1825   {10,  "AAA ENCAPS ATM PPPOE"},
1826   {11,  "AAA ENCAPS ATM L2TP"},
1827   {12,  "AAA ENCAPS ATM PPP LLC"},
1828   {13,  "AAA ENCAPS FRAME AUTO1490"},
1829   {14,  "AAA ENCAPS FRAME MULTI"},
1830   {15,  "AAA ENCAPS FRAME BRIDGE1490"},
1831   {16,  "AAA ENCAPS FRAME PPP"},
1832   {17,  "AAA ENCAPS FRAME PPP AUTO"},
1833   {18,  "AAA ENCAPS FRAME PPPOE"},
1834   {19,  "AAA ENCAPS FRAME ROUTE1490"},
1835   {20,  "AAA ENCAPS FRAME L2TP"},
1836   {21,  "AAA ENCAPS L2TP VC MUXED"},
1837   {22,  "AAA ENCAPS ETH"},
1838   {23,  "AAA ENCAPS ETH PPPOE"},
1839   {24,  "AAA ENCAPS ETH MULTI"},
1840   {0, NULL}
1841 };
1842
1843 static const value_string radius_vendor_redback_pvc_circuit_padding_vals[] =
1844 {
1845   {1,   "AAA CIRCUIT PADDING"},
1846   {2,   "AAA CIRCUIT NO PADDING"},
1847   {0, NULL}
1848 };
1849
1850 static const value_string radius_vendor_redback_bind_type_vals[] =
1851 {
1852   {1,   "AAA AUTH BIND"},
1853   {2,   "AAA BYPASS BIND"},
1854   {3,   "AAA INTERFACE BIND"},
1855   {4,   "AAA SUBSCRIBE BIND"},
1856   {5,   "AAA TUNNEL BIND"},
1857   {6,   "AAA SESSION BIND"},
1858   {7,   "AAA Q8021 BIND"},
1859   {8,   "AAA MULTI BIND"},
1860   {0, NULL}
1861 };
1862
1863 static const value_string radius_vendor_redback_bind_auth_protocol_vals[] =
1864 {
1865   {1,   "AAA PPP PAP"},
1866   {2,   "AAA PPP CHAP"},
1867   {3,   "AAA PPP CHAP WAIT"},
1868   {4,   "AAA PPP CHAP PAP"},
1869   {5,   "AAA PPP CHAP WAIT PAP"},
1870   {0, NULL}
1871 };
1872
1873 static const value_string radius_vendor_redback_lac_port_type_vals[] =
1874 {
1875   {40,  "NAS PORT TYPE 10BT"},
1876   {41,  "NAS PORT TYPE 100BT"},
1877   {42,  "NAS PORT TYPE DS3 FR"},
1878   {43,  "NAS PORT TYPE DS3 ATM"},
1879   {44,  "NAS PORT TYPE OC3"},
1880   {45,  "NAS PORT TYPE HSSI"},
1881   {46,  "NAS PORT TYPE EIA530"},
1882   {47,  "NAS PORT TYPE T1"},
1883   {48,  "NAS PORT TYPE CHAN T3"},
1884   {49,  "NAS PORT TYPE DS1 FR"},
1885   {50,  "NAS PORT TYPE E3 ATM"},
1886   {51,  "NAS PORT TYPE IMA ATM"},
1887   {52,  "NAS PORT TYPE DS3 ATM 2"},
1888   {53,  "NAS PORT TYPE OC3 ATM 2"},
1889   {54,  "NAS PORT TYPE 1000BSX"},
1890   {55,  "NAS PORT TYPE E1 FR"},
1891   {56,  "NAS PORT TYPE E1 ATM"},
1892   {57,  "NAS PORT TYPE E3 FR"},
1893   {58,  "NAS PORT TYPE OC3 POS"},
1894   {59,  "NAS PORT TYPE OC12 POS"},
1895   {60,  "NAS PORT TYPE PPPOE"},
1896   {0, NULL}
1897 };
1898
1899 static const value_string radius_vendor_redback_lac_real_port_type_vals[] =
1900 {
1901   {40,  "NAS PORT TYPE 10BT"},
1902   {41,  "NAS PORT TYPE 100BT"},
1903   {42,  "NAS PORT TYPE DS3 FR"},
1904   {43,  "NAS PORT TYPE DS3 ATM"},
1905   {44,  "NAS PORT TYPE OC3"},
1906   {45,  "NAS PORT TYPE HSSI"},
1907   {46,  "NAS PORT TYPE EIA530"},
1908   {47,  "NAS PORT TYPE T1"},
1909   {48,  "NAS PORT TYPE CHAN T3"},
1910   {49,  "NAS PORT TYPE DS1 FR"},
1911   {50,  "NAS PORT TYPE E3 ATM"},
1912   {51,  "NAS PORT TYPE IMA ATM"},
1913   {52,  "NAS PORT TYPE DS3 ATM 2"},
1914   {53,  "NAS PORT TYPE OC3 ATM 2"},
1915   {54,  "NAS PORT TYPE 1000BSX"},
1916   {55,  "NAS PORT TYPE E1 FR"},
1917   {56,  "NAS PORT TYPE E1 ATM"},
1918   {57,  "NAS PORT TYPE E3 FR"},
1919   {58,  "NAS PORT TYPE OC3 POS"},
1920   {59,  "NAS PORT TYPE OC12 POS"},
1921   {60,  "NAS PORT TYPE PPPOE"},
1922   {0, NULL}
1923 };
1924
1925 static const radius_attr_info radius_vendor_redback_attrib[] =
1926 {
1927   {1,   RADIUS_IP_ADDRESS,      "Client DNS Pri", NULL},
1928   {2,   RADIUS_IP_ADDRESS,      "Client DNS Sec", NULL},
1929   {3,   RADIUS_INTEGER4,        "DHCP Max Leases", NULL},
1930   {4,   RADIUS_STRING,          "Context Name", NULL},
1931   {5,   RADIUS_STRING,          "Bridge Group", NULL},
1932   {6,   RADIUS_STRING,          "BG Aging Time", NULL},
1933   {7,   RADIUS_STRING,          "BG Path Cost", NULL},
1934   {8,   RADIUS_STRING,          "BG Span Dis", NULL},
1935   {9,   RADIUS_STRING,          "BG Trans BPDU", NULL},
1936   {10,  RADIUS_INTEGER4,        "Rate Limit Rate", NULL},
1937   {11,  RADIUS_INTEGER4,        "Rate Limit Burst", NULL},
1938   {12,  RADIUS_INTEGER4,        "Police Rate", NULL},
1939   {13,  RADIUS_INTEGER4,        "Police Burst", NULL},
1940   {14,  RADIUS_INTEGER4,        "Source Validation", NULL},
1941   {15,  RADIUS_INTEGER4,        "Tunnel Domain", NULL},
1942   {16,  RADIUS_STRING,          "Tunnel Local Name", NULL},
1943   {17,  RADIUS_STRING,          "Tunnel Remote Name", NULL},
1944   {18,  RADIUS_INTEGER4,        "Tunnel Function", radius_vendor_redback_tunnel_function_vals},
1945   {21,  RADIUS_INTEGER4,        "Tunnel Max Sessions", NULL},
1946   {22,  RADIUS_INTEGER4,        "Tunnel Max Tunnels", NULL},
1947   {23,  RADIUS_INTEGER4,        "Tunnel Session Auth", NULL},
1948   {24,  RADIUS_INTEGER4,        "Tunnel Window", NULL},
1949   {25,  RADIUS_INTEGER4,        "Tunnel Retransmit", NULL},
1950   {26,  RADIUS_INTEGER4,        "Tunnel Cmd Timeout", NULL},
1951   {27,  RADIUS_STRING,          "PPPOE URL", NULL},
1952   {28,  RADIUS_STRING,          "PPPOE MOTM", NULL},
1953   {29,  RADIUS_INTEGER4,        "Tunnel Group", NULL},
1954   {30,  RADIUS_STRING,          "Tunnel Context", NULL},
1955   {31,  RADIUS_INTEGER4,        "Tunnel Algorithm", NULL},
1956   {32,  RADIUS_INTEGER4,        "Tunnel Deadtime", NULL},
1957   {33,  RADIUS_INTEGER4,        "Mcast Send", radius_vendor_redback_mcast_send_vals},
1958   {34,  RADIUS_INTEGER4,        "Mcast Receive", radius_vendor_redback_mcast_receive_vals},
1959   {35,  RADIUS_INTEGER4,        "Mcast MaxGroups", NULL},
1960   {36,  RADIUS_STRING,          "Ip Address Pool Name", NULL},
1961   {37,  RADIUS_INTEGER4,        "Tunnel DNIS", radius_vendor_redback_tunnel_dnis_vals},
1962   {38,  RADIUS_INTEGER4,        "Medium Type", NULL},
1963   {39,  RADIUS_INTEGER4,        "PVC Encapsulation Type", radius_vendor_redback_pvc_encapsulation_type_vals},
1964   {40,  RADIUS_STRING,          "PVC Profile Name", NULL},
1965   {41,  RADIUS_INTEGER4,        "PVC Circuit Padding", radius_vendor_redback_pvc_circuit_padding_vals},
1966   {42,  RADIUS_INTEGER4,        "Bind Type", radius_vendor_redback_bind_type_vals},
1967   {43,  RADIUS_INTEGER4,        "Bind Auth Protocol", radius_vendor_redback_bind_auth_protocol_vals},
1968   {44,  RADIUS_INTEGER4,        "Bind Auth Max Sessions", NULL},
1969   {45,  RADIUS_STRING,          "Bind Bypass Bypass", NULL},
1970   {46,  RADIUS_STRING,          "Bind Auth Context", NULL},
1971   {47,  RADIUS_STRING,          "Bind Auth Service Grp", NULL},
1972   {48,  RADIUS_STRING,          "Bind Bypass Context", NULL},
1973   {49,  RADIUS_STRING,          "Bind Int Context", NULL},
1974   {50,  RADIUS_STRING,          "Bind Tun Context", NULL},
1975   {51,  RADIUS_STRING,          "Bind Ses Context", NULL},
1976   {52,  RADIUS_INTEGER4,        "Bind Dot1q Slot", NULL},
1977   {53,  RADIUS_INTEGER4,        "Bind Dot1q Port", NULL},
1978   {54,  RADIUS_INTEGER4,        "Bind Dot1q Vlan Tag Id", NULL},
1979   {55,  RADIUS_STRING,          "Bind Int Interface Name", NULL},
1980   {56,  RADIUS_STRING,          "Bind L2TP Tunnel Name", NULL},
1981   {57,  RADIUS_INTEGER4,        "Bind L2TP Flow Control", NULL},
1982   {58,  RADIUS_STRING,          "Bind Sub User At Context", NULL},
1983   {59,  RADIUS_STRING,          "Bind Sub Password", NULL},
1984   {60,  RADIUS_STRING,          "Ip Host Addr", NULL},
1985   {61,  RADIUS_INTEGER4,        "IP TOS Field", NULL},
1986   {62,  RADIUS_INTEGER4,        "NAS Real Port", NULL},
1987   {63,  RADIUS_STRING,          "Tunnel Session Auth Ctx", NULL},
1988   {64,  RADIUS_STRING,          "Tunnel Session Auth Service Grp", NULL},
1989   {65,  RADIUS_INTEGER4,        "Tunnel Rate Limit Rate", NULL},
1990   {66,  RADIUS_INTEGER4,        "Tunnel Rate Limit Burst", NULL},
1991   {67,  RADIUS_INTEGER4,        "Tunnel Police Rate", NULL},
1992   {68,  RADIUS_INTEGER4,        "Tunnel Police Burst", NULL},
1993   {69,  RADIUS_STRING,          "Tunnel L2F Second Password", NULL},
1994   {128, RADIUS_INTEGER4,        "Acct Input Octets 64", NULL},
1995   {129, RADIUS_INTEGER4,        "Acct Output Octets 64", NULL},
1996   {130, RADIUS_INTEGER4,        "Acct Input Packets 64", NULL},
1997   {131, RADIUS_INTEGER4,        "Acct Output Packets 64", NULL},
1998   {132, RADIUS_IP_ADDRESS,      "Assigned IP Address", NULL},
1999   {133, RADIUS_INTEGER4,        "Acct Mcast In Octets", NULL},
2000   {134, RADIUS_INTEGER4,        "Acct Mcast Out Octets", NULL},
2001   {135, RADIUS_INTEGER4,        "Acct Mcast In Packets", NULL},
2002   {136, RADIUS_INTEGER4,        "Acct Mcast Out Packets", NULL},
2003   {137, RADIUS_INTEGER4,        "LAC Port", NULL},
2004   {138, RADIUS_INTEGER4,        "LAC Real Port", NULL},
2005   {139, RADIUS_INTEGER4,        "LAC Port Type", radius_vendor_redback_lac_port_type_vals},
2006   {140, RADIUS_INTEGER4,        "LAC Real Port Type", radius_vendor_redback_lac_real_port_type_vals},
2007   {141, RADIUS_STRING,          "Acct Dyn Ac Ent", NULL},
2008   {142, RADIUS_INTEGER4,        "Session Error Code", NULL},
2009   {143, RADIUS_STRING,          "Session Error Msg", NULL},
2010   {0, 0, NULL, NULL},
2011 };
2012
2013 /*
2014 reference:
2015         http://www.juniper.net/techpubs/software/junos53/swconfig53-getting-started/html/sys-mgmt-authentication2.html
2016 */
2017 static const radius_attr_info radius_vendor_juniper_attrib[] =
2018 {
2019   {1,   RADIUS_STRING,          "Juniper Local User Name", NULL},
2020   {2,   RADIUS_STRING,          "Juniper Allow Commands", NULL},
2021   {3,   RADIUS_STRING,          "Juniper Deny Commands", NULL},
2022   {0, 0, NULL, NULL}
2023 };
2024
2025 /*
2026 reference:
2027         'dictionary.aptis' file from FreeRADIUS
2028                 http://www.freeradius.org/radiusd/raddb/dictionary.aptis
2029 */
2030 static const radius_attr_info radius_vendor_aptis_attrib[] =
2031 {
2032   {1,   RADIUS_STRING,          "CVX Identification", NULL},
2033   {2,   RADIUS_INTEGER4,        "CVX VPOP ID", NULL},
2034   {3,   RADIUS_INTEGER4,        "CVX SS7 Session ID Type", NULL},
2035   {4,   RADIUS_INTEGER4,        "CVX Radius Redirect", NULL},
2036   {5,   RADIUS_INTEGER4,        "CVX IPSVC AZNLVL", NULL},
2037   {6,   RADIUS_INTEGER4,        "CVX IPSVC Mask", NULL},
2038   {7,   RADIUS_INTEGER4,        "CVX Multilink Match Info", NULL},
2039   {8,   RADIUS_INTEGER4,        "CVX Multilink Group Number", NULL},
2040   {9,   RADIUS_INTEGER4,        "CVX PPP Log Mask", NULL},
2041   {10,  RADIUS_STRING,          "CVX Modem Begin Modulation", NULL},
2042   {11,  RADIUS_STRING,          "CVX Modem End Modulation", NULL},
2043   {12,  RADIUS_STRING,          "CVX Modem Error Correction", NULL},
2044   {13,  RADIUS_STRING,          "CVX Modem Data Compression", NULL},
2045   {14,  RADIUS_INTEGER4,        "CVX Modem Tx Packets", NULL},
2046   {15,  RADIUS_INTEGER4,        "CVX Modem ReTx Packets", NULL},
2047   {16,  RADIUS_INTEGER4,        "CVX Modem SNR", NULL},
2048   {17,  RADIUS_INTEGER4,        "CVX Modem Local Retrains", NULL},
2049   {18,  RADIUS_INTEGER4,        "CVX Modem Remote Retrains", NULL},
2050   {19,  RADIUS_INTEGER4,        "CVX Modem Local Rate Negs", NULL},
2051   {20,  RADIUS_INTEGER4,        "CVX Modem Remote Rate Negs", NULL},
2052   {21,  RADIUS_INTEGER4,        "CVX Modem Begin Recv Line Lvl", NULL},
2053   {22,  RADIUS_INTEGER4,        "CVX Modem End Recv Line Lvl", NULL},
2054   {0, 0, NULL, NULL},
2055 };
2056
2057 /*
2058 reference:
2059         Dictonary of Cisco ACS 3.1
2060         http://www.cisco.com/en/US/products/sw/secursw/ps2086/products_user_guide_chapter09186a0080102172.html#984410
2061 */
2062
2063
2064 static const value_string radius_vendor_cisco_vpn3000_sep_card_assignment_vals[] =
2065 {
2066   {1,   "SEP 1"},
2067   {2,   "SEP 2"},
2068   {3,   "SEP 1 + SEP 2"},
2069   {4,   "SEP 3"},
2070   {5,           "SEP 1 + SEP 3"},
2071   {6,           "SEP 2 + SEP 3"},
2072   {7,           "SEP 1 + SEP 2 + SEP 3"},
2073   {8,           "SEP 4"},
2074   {9,   "SEP 1 + SEP 4"}, 
2075   {10,          "SEP 2 + SEP 4"},
2076   {11,          "SEP 1 + SEP 2 + SEP 4"},
2077   {12,          "SEP 3 + SEP 4"},
2078   {13,          "SEP 1 + SEP 3 + SEP 4"},
2079   {14,          "SEP 2 + SEP 3 + SEP 4"},
2080   {15,  "Any SEP"},
2081   {0, NULL}
2082 };
2083
2084 static const value_string radius_vendor_cisco_vpn3000_tunneling_protocols_vals[] =
2085 {
2086   {1,   "PPTP"},
2087   {2,   "L2TP"},
2088   {3,   "PPTP and L2TP"},
2089   {4,   "IPSec"},
2090   {5,   "PPTP and IPSec"},
2091   {6,   "L2TP and IPSec"},
2092   {7,   "PPTP - L2TP - IPSec"},
2093   {8,   "L2TP/IPSec"},
2094   {9,   "PPTP and L2TP/IPSec"},
2095   {10,  "L2TP and L2TP/IPSec"},
2096   {11,  "PPTP - L2TP - L2TP/IPSec"},
2097   {0, NULL}
2098 };
2099
2100 static const value_string radius_vendor_cisco_vpn3000_ipsec_authentication_vals[] =
2101 {
2102   {0,   "None"},
2103   {1,   "RADIUS"},
2104   {3,   "NT Domain"},
2105   {4,   "SDI"},
2106   {5,   "Internal"},
2107   {6,   "Radius with Expiry"},
2108   {7,   "KERBEROS / Active Directory"},
2109   {0, NULL}
2110 };
2111
2112 static const value_string radius_vendor_cisco_vpn3000_allow_pw_store_vals[] =
2113 {
2114   {0,   "False"},
2115   {1,   "True"},
2116   {0, NULL}
2117 };
2118
2119 static const value_string radius_vendor_cisco_vpn3000_use_client_address_vals[] =
2120 {
2121   {0,   "False"},
2122   {1,   "True"},
2123   {0, NULL}
2124 };
2125
2126 static const value_string radius_vendor_cisco_vpn3000_pptp_encryption_vals[] =
2127 {
2128   {1,   "Encryption required"},
2129   {2,   "40 Bits"},
2130   {3,   "40 Bits - Encryption required"},
2131   {4,   "128 Bits"},
2132   {5,   "128 Bits - Encryption required"},
2133   {6,   "40 or 128 Bits"},
2134   {7,   "40 or 128 Bits - Encryption required"},
2135   {8,   "Stateless Required"},
2136   {9,   "Encryption / Stateless required"},
2137   {10,  "40 Bits - Stateless required"},
2138   {11,  "40 Bits Encryption / Stateless required"},
2139   {12,  "128 Bits - Stateless required"},
2140   {13,  "128 Bits - Encryption / Stateless required"},
2141   {14,  "40/128 Bits - Stateless required"},
2142   {15,  "40/128 Bits - Encryption / Stateless required"},
2143   {0, NULL}
2144 };
2145
2146
2147 static const value_string radius_vendor_cisco_vpn3000_l2tp_encryption_vals[] =
2148 {
2149   {1,   "Encryption required"}, 
2150   {2,   "40 Bits"},
2151   {3,   "40 Bits - Encryption required"},
2152   {4,   "128 Bits"},
2153   {5,   "128 Bits - Encryption required"},
2154   {6,   "40 or 128 Bits"},
2155   {7,   "40 or 128 Bits - Encryption required"},
2156   {8,   "Stateless Required"},
2157   {9,   "Encryption / Stateless required"},
2158   {10,  "40 Bits - Stateless required"},
2159   {11,  "40 Bits Encryption / Stateless required"},
2160   {12,  "128 Bits - Stateless required"},
2161   {13,  "128 Bits - Encryption / Stateless required"}, 
2162   {14,  "40/128 Bits - Stateless required"},
2163   {15,  "40/128 Bits - Encryption / Stateless required"},
2164  {0, NULL}
2165 };
2166
2167 static const value_string radius_vendor_cisco_vpn3000_tunnel_type_vals[] =
2168 {
2169   {1,   "LAN-to-LAN"},
2170   {2,   "Remote Access"},
2171  {0, NULL}
2172 };
2173
2174 static const value_string radius_vendor_cisco_vpn3000_mode_config_vals[] =
2175 {
2176   {0,   "OFF"},
2177   {1,   "ON"},
2178  {0, NULL}
2179 };
2180
2181 static const value_string radius_vendor_cisco_vpn3000_user_group_lock_vals[] =
2182 {
2183   {0,   "OFF"},
2184   {1,   "ON"},
2185  {0, NULL}
2186 };
2187
2188 static const value_string radius_vendor_cisco_vpn3000_ipsec_over_udp_vals[] =
2189 {
2190   {0,   "OFF"},
2191   {1,   "ON"},
2192  {0, NULL}
2193 };
2194
2195 static const value_string radius_vendor_cisco_vpn3000_pptp_mppc_compression_vals[] =
2196 {
2197   {1,   "ON"},
2198   {2,   "OFF"},
2199  {0, NULL}
2200 };
2201
2202 static const value_string radius_vendor_cisco_vpn3000_l2tp_mppc_compression_vals[] =
2203 {
2204   {0,   "ON"},
2205   {1,   "OFF"},
2206  {0, NULL}
2207 };
2208
2209 static const value_string radius_vendor_cisco_vpn3000_ipsec_ip_compression_vals[] =
2210 {
2211   {0,   "None"},
2212   {1,   "LZS"},
2213  {0, NULL}
2214 };
2215
2216 static const value_string radius_vendor_cisco_vpn3000_ipsec_ike_peer_idcheck_vals[] =
2217 {
2218   {1,   "Required"},
2219   {2,   "If supported by certifiate"},
2220   {3,   "Do not check"}, 
2221   {0, NULL}
2222 };
2223
2224 static const value_string radius_vendor_cisco_vpn3000_ike_keep_alives_vals[] =
2225 {
2226   {0,   "OFF"},
2227   {1,   "ON"},
2228  {0, NULL}
2229 };
2230
2231
2232 static const value_string radius_vendor_cisco_vpn3000_auth_on_rekey_vals[] =
2233 {
2234   {0,   "OFF"},
2235   {1,   "ON"},
2236  {0, NULL}
2237 };
2238
2239 static const value_string radius_vendor_cisco_vpn3000_required_client_fw_vendor_code_vals[] =
2240 {
2241   {1,   "Cisco Systems (with CIC) "},
2242   {2,   "Zone Labs"},
2243   {3,   "Network ICE"},
2244   {4,   "Sygate"},
2245   {5,   "Cisco Systems (with CSA) "},
2246  {0, NULL}
2247 };
2248
2249 static const value_string radius_vendor_cisco_vpn3000_hw_client_auth_vals[] =
2250 {
2251   {0,   "OFF"},
2252   {1,   "ON"},
2253  {0, NULL}
2254 };
2255
2256 static const value_string radius_vendor_cisco_vpn_req_user_auth_vals[] = 
2257 {
2258   {0,   "No"},
2259   {1,   "Yes"},
2260   {0, NULL}
2261 };
2262
2263 static const value_string radius_vendor_cisco_vpn3000_ip_phone_bypass_vals[] =
2264 {
2265   {0,   "No"},
2266   {1,   "Yes"},
2267  {0, NULL}
2268 };
2269
2270 static const value_string radius_vendor_cisco_vpn3000_ipsec_split_tunneling_policy_vals[] =
2271 {
2272   {0,   "Tunnel everything"},
2273   {1,   "Only tunnel networks in list"},
2274  {0, NULL}
2275 };
2276
2277 static const value_string radius_vendor_cisco_vpn3000_ipsec_required_client_fw_capability_vals[] =
2278 {
2279   {0,   "None"},
2280   {1,   "Policy defined by remote FW AYT"},
2281   {2,   "Policy pushed CPP"},
2282   {4,   "Policy from Server"},
2283  {0, NULL}
2284 };
2285
2286 static const value_string radius_vendor_cisco_vpn3000_ipsec_client_fw_filter_optional_vals[] =
2287 {
2288   {0,   "Required"},
2289   {1,   "Optional"},
2290  {0, NULL}
2291 };
2292
2293 static const value_string radius_vendor_cisco_vpn3000_ipsec_backup_servers_vals[] =
2294 {
2295   {1,   "User Client-configured list"},
2296   {2,   "Disable and clear client list"},
2297   {3,   "Use Backup server list"},
2298  {0, NULL}
2299 };
2300
2301 static const value_string radius_vendor_cisco_vpn3000_ms_client_intercept_dhcp_configure_message_vals[] =
2302 {
2303   {0,   "No"},
2304   {1,   "Yes"},
2305  {0, NULL}
2306 };
2307
2308 static const value_string radius_vendor_cisco_vpn3000_allow_network_extension_mode_vals[] =
2309 {
2310   {0,   "No"},
2311   {1,   "Yes"},
2312  {0, NULL}
2313 };
2314
2315 static const value_string radius_vendor_cisco_vpn3000_webvpn_content_filter_parameters_vals[] =
2316 {
2317   {1,   "Java & ActiveX"},
2318   {2,   "JavaScript"},
2319   {3,   "Java & ActiveX - JavaScript"},
2320   {4,   "Images"},
2321   {5,   "Java & ActiveX - Images"},
2322   {6,   "JavaScript - Images"},
2323   {7,   "Java & ActiveX - JavaScript - Images"},
2324   {8,   "Cookies"},
2325   {9,   "Cookies - Java & ActiveX"},
2326   {10,  "Cookies - Javascript"},
2327   {11,          "Cookies - Java & ActiveX - JavaScript"},
2328   {12,  "Cookies - Images"},
2329   {13,  "Cookies - Images - Java &ActiveX"},
2330   {14,  "Cookies - Images - JavaScript"},
2331   {15,  "Cookies - Images - Java &ActiveX - JavaScript"},
2332  {0, NULL}
2333 };
2334
2335 static const value_string radius_vendor_cisco_vpn3000_strip_realm_vals[] =
2336 {
2337   {0,   "No"},
2338   {1,   "Yes"},
2339  {0, NULL}
2340 };
2341
2342 static const radius_attr_info radius_vendor_cisco_vpn3000_attrib[] =
2343 {
2344   {1,   RADIUS_STRING,          "CVPN3000-Access-Hours", NULL},
2345   {2,   RADIUS_INTEGER4,                "CVPN3000-Simultaneous-Logins", NULL},
2346   {5,   RADIUS_IP_ADDRESS,      "CVPN3000-Primary-DNS", NULL},
2347   {6,   RADIUS_IP_ADDRESS,      "CVPN3000-Secondary-DNS", NULL},
2348   {7,   RADIUS_IP_ADDRESS,      "CVPN3000-Primary-WINS", NULL},
2349   {8,   RADIUS_IP_ADDRESS,      "CVPN3000-Secondary-WINS", NULL},
2350   {9,           RADIUS_INTEGER4,                "CVPN3000-SEP-Card-Assignment", radius_vendor_cisco_vpn3000_sep_card_assignment_vals},
2351   {11,          RADIUS_INTEGER4,                "CVPN3000-Tunneling-Protocols", radius_vendor_cisco_vpn3000_tunneling_protocols_vals},
2352   {12,  RADIUS_STRING,          "CVPN3000-IPSec-Sec-Association", NULL},
2353   {13,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Authentication", radius_vendor_cisco_vpn3000_ipsec_authentication_vals},
2354   {15,  RADIUS_STRING,          "CVPN3000-IPSec-Banner1", NULL},
2355   {16,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Allow-Passwd-Store", radius_vendor_cisco_vpn3000_allow_pw_store_vals},
2356   {17,  RADIUS_INTEGER4,                "CVPN3000-Use-Client-Address", radius_vendor_cisco_vpn3000_use_client_address_vals},
2357   {20,  RADIUS_INTEGER4,                "CVPN3000-PPTP-Encryption", radius_vendor_cisco_vpn3000_pptp_encryption_vals},
2358   {21,  RADIUS_INTEGER4,                "CVPN3000-L2TP-Encryption", radius_vendor_cisco_vpn3000_l2tp_encryption_vals},
2359   {27,  RADIUS_STRING,          "CVPN3000-IPSec-Split-Tunnel-List", NULL},
2360   {28,  RADIUS_STRING,          "CVPN3000-IPSec-Default-Domain", NULL},
2361   {29,  RADIUS_STRING,          "CVPN3000-IPSec-Split-DNS-Names", NULL},
2362   {30,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Tunnel-Type", radius_vendor_cisco_vpn3000_tunnel_type_vals},
2363   {31,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Mode-Config", radius_vendor_cisco_vpn3000_mode_config_vals},
2364   {33,  RADIUS_INTEGER4,                "CVPN3000-IPSec-User-Group-Lock", radius_vendor_cisco_vpn3000_user_group_lock_vals},
2365   {34,          RADIUS_INTEGER4,                "CVPN3000-IPSec-Over-UDP", radius_vendor_cisco_vpn3000_ipsec_over_udp_vals},
2366   {35,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Over-UDP-Port", NULL},
2367   {36,  RADIUS_STRING,          "CVPN3000-IPSec-Banner2", NULL},
2368   {37,  RADIUS_INTEGER4,                "CVPN3000-PPTP-MPPC-Compression", radius_vendor_cisco_vpn3000_pptp_mppc_compression_vals},
2369   {38,  RADIUS_INTEGER4,                "CVPN3000-L2TP-MPPC-Compression", radius_vendor_cisco_vpn3000_l2tp_mppc_compression_vals},
2370   {39,  RADIUS_INTEGER4,                "CVPN3000-IPSec-IP-Compression", radius_vendor_cisco_vpn3000_ipsec_ip_compression_vals},
2371   {40,  RADIUS_INTEGER4,                "CVPN3000-IPSec-IKE-Peer-IDCheck", radius_vendor_cisco_vpn3000_ipsec_ike_peer_idcheck_vals},
2372   {41,  RADIUS_INTEGER4,                "CVPN3000-IKE-Keep-Alives", radius_vendor_cisco_vpn3000_ike_keep_alives_vals},
2373   {42,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Auth-On-Rekey", radius_vendor_cisco_vpn3000_auth_on_rekey_vals},
2374   {45,  RADIUS_INTEGER4,                "CVPN3000-Required-Client-Firewall-Vendor-Code", radius_vendor_cisco_vpn3000_required_client_fw_vendor_code_vals},
2375   {46,  RADIUS_INTEGER4,                "CVPN3000-Required-Client-Firewall-Product-Code", NULL},
2376   {47,  RADIUS_STRING,          "CVPN3000-Required-Client-Firewall-Description", NULL},
2377   {48,  RADIUS_INTEGER4,                "CVPN3000-Require-HW-Client-Auth", radius_vendor_cisco_vpn3000_hw_client_auth_vals},
2378   {49,  RADIUS_INTEGER4,                "CVPN3000-Required-Individual-User-Auth", radius_vendor_cisco_vpn_req_user_auth_vals},
2379   {50,  RADIUS_INTEGER4,                "CVPN3000-Authenticated-User-Idle-Timeout", NULL},
2380   {51,  RADIUS_INTEGER4,                "CVPN3000-Cisco-IP-Phone-Bypass", radius_vendor_cisco_vpn3000_ip_phone_bypass_vals},
2381   {52,  RADIUS_STRING,          "CVPN3000-User-Auth-Server-Name", NULL},
2382   {53,  RADIUS_INTEGER4,                "CVPN3000-User-Auth-Server-Port", NULL},
2383   {54,          RADIUS_STRING,          "CVPN3000-User-Auth-Server-Secret", NULL},
2384   {55,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Split-Tunneling-Policy", radius_vendor_cisco_vpn3000_ipsec_split_tunneling_policy_vals},
2385   {56,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Required-Client-Firewall-Capability", radius_vendor_cisco_vpn3000_ipsec_required_client_fw_capability_vals},
2386   {57,  RADIUS_STRING,          "CVPN3000-IPSec-Client-Firewall-Filter-Name", NULL},
2387   {58,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Client-Firewall-Filter-Optional", radius_vendor_cisco_vpn3000_ipsec_client_fw_filter_optional_vals},
2388   {59,  RADIUS_INTEGER4,                "CVPN3000-IPSec-Backup-Servers", radius_vendor_cisco_vpn3000_ipsec_backup_servers_vals},
2389   {60,  RADIUS_STRING,          "CVPN3000-IPSec-Backup-Server-List", NULL},
2390   {62,  RADIUS_INTEGER4,                "CVPN3000-MS-Client-Intercept-DHCP-Configure-Message", radius_vendor_cisco_vpn3000_ms_client_intercept_dhcp_configure_message_vals},
2391   {63,  RADIUS_IP_ADDRESS,      "CVPN3000-MS-Client-Subnet-Mask", NULL},
2392   {64,  RADIUS_INTEGER4,                "CVPN3000-Allow-Network-Extension-Mode", radius_vendor_cisco_vpn3000_allow_network_extension_mode_vals},
2393   {68,  RADIUS_INTEGER4,                "CVPN3000-Confidence-Interval", NULL},
2394   {69,  RADIUS_INTEGER4,                "CVPN3000-WebVPN-Content-Filter-Parameters", radius_vendor_cisco_vpn3000_webvpn_content_filter_parameters_vals},
2395   {70,  RADIUS_INTEGER4,                "CVPN3000-WebVPN-Enable-functions", NULL},
2396   {74,  RADIUS_STRING,          "CVPN3000-WebVPN-Exchange-Server-Address", NULL},
2397   {75,  RADIUS_INTEGER4,                "CVPN3000-Cisco-LEAP-Bypass", NULL},
2398   {77,  RADIUS_STRING,          "CVPN3000-Client-Type-Version-Limiting", NULL},
2399   {78,  RADIUS_STRING,          "CVPN3000-WebVPN-ExchangeServer-NETBIOS-Name", NULL},
2400   {79,  RADIUS_STRING,          "CVPN3000-Port-Forwarding-Name", NULL},
2401   {135, RADIUS_INTEGER4,                "CVPN3000-Strip-Realm", radius_vendor_cisco_vpn3000_strip_realm_vals},
2402   {0,   0, NULL, NULL}
2403 };
2404
2405 static const radius_attr_info radius_vendor_cosine_attrib[] =
2406 {
2407   {1,   RADIUS_STRING,          "Connection Profile Name", NULL},
2408   {2,   RADIUS_STRING,          "Enterprise ID", NULL},
2409   {3,   RADIUS_STRING,          "Address Pool Name", NULL},
2410   {4,   RADIUS_INTEGER4,        "DS Byte", NULL},
2411   {5,   COSINE_VPI_VCI,         "VPI/VCI", NULL},
2412   {6,   RADIUS_INTEGER4,        "DLCI", NULL},
2413   {7,   RADIUS_IP_ADDRESS,      "LNS IP Address", NULL},
2414   {8,   RADIUS_STRING,          "CLI User Permission ID", NULL},
2415   {0, 0, NULL, NULL}
2416 };
2417
2418 /*
2419 reference:
2420         'dictionary.shasta' file from FreeRADIUS
2421                 http://www.freeradius.org/radiusd/raddb/dictionary.shasta
2422 */
2423 static const value_string radius_vendor_shasta_user_privilege_vals[] =
2424 {
2425   {1,   "User"},
2426   {2,   "Super User"},
2427   {3,   "SSuper User"},
2428   {0, NULL}
2429 };
2430
2431 static const radius_attr_info radius_vendor_shasta_attrib[] =
2432 {
2433   {1,   RADIUS_INTEGER4,        "Shasta User Privilege", radius_vendor_shasta_user_privilege_vals},
2434   {2,   RADIUS_STRING,          "Shasta Service Profile", NULL},
2435   {3,   RADIUS_STRING,          "Shasta VPN Name", NULL},
2436   {0, 0, NULL, NULL},
2437 };
2438
2439 /*
2440 reference:
2441         'dictionary.nomadix' file from FreeRADIUS
2442                 http://www.freeradius.org/radiusd/raddb/dictionary.nomadix
2443 */
2444 static const radius_attr_info radius_vendor_nomadix_attrib[] =
2445 {
2446   {1,   RADIUS_INTEGER4,        "Nomadix Bw Up", NULL},
2447   {2,   RADIUS_INTEGER4,        "Nomadix Bw Down", NULL},
2448   {0, 0, NULL, NULL},
2449 };
2450
2451 /*
2452 reference:
2453         'dictionary.erx' file from FreeRADIUS
2454                 http://www.freeradius.org/radiusd/raddb/dictionary.erx
2455 */
2456 static const radius_attr_info radius_vendor_unisphere_attrib[] =
2457 {
2458   {1,   RADIUS_STRING,          "ERX Virtual Router Name", NULL},
2459   {2,   RADIUS_STRING,          "ERX Address Pool Name", NULL},
2460   {3,   RADIUS_STRING,          "ERX Local Loopback Interface", NULL},
2461   {4,   RADIUS_IP_ADDRESS,      "ERX Primary Dns", NULL},
2462   {5,   RADIUS_IP_ADDRESS,      "ERX Primary Wins", NULL},
2463   {6,   RADIUS_IP_ADDRESS,      "ERX Secondary Dns", NULL},
2464   {7,   RADIUS_IP_ADDRESS,      "ERX Secondary Wins", NULL},
2465   {8,   RADIUS_STRING,          "ERX Tunnel Virtual Router", NULL},
2466   {9,   RADIUS_STRING,          "ERX Tunnel Password", NULL},
2467   {10,  RADIUS_STRING,          "ERX Ingress Policy Name", NULL},
2468   {11,  RADIUS_STRING,          "ERX Egress Policy Name", NULL},
2469   {12,  RADIUS_STRING,          "ERX Ingress Statistics", NULL},
2470   {13,  RADIUS_STRING,          "ERX Egress Statistics", NULL},
2471   {14,  RADIUS_STRING,          "ERX Atm Service Category", NULL},
2472   {15,  RADIUS_STRING,          "ERX Atm PCR", NULL},
2473   {16,  RADIUS_STRING,          "ERX Atm SCR", NULL},
2474   {17,  RADIUS_STRING,          "ERX Atm MBS", NULL},
2475   {18,  RADIUS_STRING,          "ERX Cli Initial Access Level", NULL},
2476   {19,  RADIUS_INTEGER4,        "ERX Cli Allow All VR Access", NULL},
2477   {20,  RADIUS_STRING,          "ERX Alternate Cli Access Level", NULL},
2478   {21,  RADIUS_STRING,          "ERX Alternate Cli Vrouter Name", NULL},
2479   {22,  RADIUS_INTEGER4,        "ERX Sa Validate", NULL},
2480   {23,  RADIUS_INTEGER4,        "ERX Igmp Enable", NULL},
2481   {0, 0, NULL, NULL},
2482 };
2483
2484 /*
2485 reference:
2486         Cisco ACS 3.2 User Guide - Appendix D
2487         http://www.cisco.com/univercd/cc/td/doc/product/access/acs_soft/csacs4nt/acs32/user02/ad.htm#wp473531
2488 */
2489
2490 static const radius_attr_info radius_vendor_cisco_bbsm_attrib[] =
2491 {
2492   {1,   RADIUS_INTEGER4,        "CBBSM-Bandwidth", NULL},
2493   {0, 0, NULL, NULL},
2494 };
2495
2496 static const radius_attr_info radius_vendor_issanni_attrib[] =
2497 {
2498   {1,   RADIUS_STRING,          "Softflow Template", NULL},
2499   {2,   RADIUS_STRING,          "NAT Pool", NULL},
2500   {3,   RADIUS_STRING,          "Virtual Routing Domain", NULL},
2501   {4,   RADIUS_STRING,          "Tunnel Name", NULL},
2502   {5,   RADIUS_STRING,          "IP Pool Name", NULL},
2503   {6,   RADIUS_STRING,          "PPPoE URL", NULL},
2504   {7,   RADIUS_STRING,          "PPPoE MOTM", NULL},
2505   {8,   RADIUS_STRING,          "PPPoE Service", NULL},
2506   {9,   RADIUS_IP_ADDRESS,      "Primary DNS", NULL},
2507   {10,  RADIUS_IP_ADDRESS,      "Secondary DNS", NULL},
2508   {11,  RADIUS_IP_ADDRESS,      "Primary NBNS", NULL},
2509   {12,  RADIUS_IP_ADDRESS,      "Secondary NBNS", NULL},
2510   {13,  RADIUS_STRING,          "Policing Traffic Class", NULL},
2511   {14,  RADIUS_INTEGER4,        "Tunnel Type", NULL},
2512   {15,  RADIUS_INTEGER4,        "NAT Type", NULL},
2513   {16,  RADIUS_STRING,          "QoS Traffic Class", NULL},
2514   {17,  RADIUS_STRING,          "Interface Name", NULL},
2515   {0, 0, NULL, NULL}
2516 };
2517
2518 /*
2519 reference:
2520         'dictionary.quintum' file from FreeRADIUS
2521                 http://www.freeradius.org/radiusd/raddb/dictionary.quintum
2522 */
2523 static const radius_attr_info radius_vendor_quintum_attrib[] =
2524 {
2525   {1,   RADIUS_STRING,          "Quintum AVPair", NULL},
2526   {2,   RADIUS_STRING,          "Quintum NAS Port", NULL},
2527   {23,  RADIUS_STRING,          "Quintum h323 remote address", NULL},
2528   {24,  RADIUS_STRING,          "Quintum h323 conf id", NULL},
2529   {25,  RADIUS_STRING,          "Quintum h323 setup time", NULL},
2530   {26,  RADIUS_STRING,          "Quintum h323 call origin", NULL},
2531   {27,  RADIUS_STRING,          "Quintum h323 call type", NULL},
2532   {28,  RADIUS_STRING,          "Quintum h323 connect time", NULL},
2533   {29,  RADIUS_STRING,          "Quintum h323 disconnect time", NULL},
2534   {30,  RADIUS_STRING,          "Quintum h323 disconnect cause", NULL},
2535   {31,  RADIUS_STRING,          "Quintum h323 voice quality", NULL},
2536   {33,  RADIUS_STRING,          "Quintum h323 gw id", NULL},
2537   {35,  RADIUS_STRING,          "Quintum h323 incoming conf id", NULL},
2538   {101, RADIUS_STRING,          "Quintum h323 credit amount", NULL},
2539   {102, RADIUS_STRING,          "Quintum h323 credit time", NULL},
2540   {103, RADIUS_STRING,          "Quintum h323 return code", NULL},
2541   {104, RADIUS_STRING,          "Quintum h323 prompt id", NULL},
2542   {105, RADIUS_STRING,          "Quintum h323 time and day", NULL},
2543   {106, RADIUS_STRING,          "Quintum h323 redirect number", NULL},
2544   {107, RADIUS_STRING,          "Quintum h323 preferred lang", NULL},
2545   {108, RADIUS_STRING,          "Quintum h323 redirect ip address", NULL},
2546   {109, RADIUS_STRING,          "Quintum h323 billing model", NULL},
2547   {110, RADIUS_STRING,          "Quintum h323 currency type", NULL},
2548   {0, 0, NULL, NULL},
2549 };
2550
2551 /*
2552 reference:
2553         http://download.colubris.com/library/product_doc/CN3500_AdminGuide.pdf
2554 */
2555 static const radius_attr_info radius_vendor_colubris_attrib[] =
2556 {
2557   {0,   RADIUS_STRING,          "Colubris AV Pair", NULL},
2558   {0, 0, NULL, NULL},
2559 };
2560
2561 /*
2562 reference:
2563         'dictionary.columbia_university' file from FreeRADIUS
2564                 http://www.freeradius.org/radiusd/raddb/dictionary.columbia_university
2565 */
2566 static const value_string radius_vendor_columbia_university_sip_method_vals[] =
2567 {
2568   {0,   "INVITE"},
2569   {1,   "BYE"},
2570   {2,   "REGISTER"},
2571   {3,   "OTHER"},
2572   {0, NULL}
2573 };
2574
2575 static const radius_attr_info radius_vendor_columbia_university_attrib[] =
2576 {
2577   {0,   RADIUS_INTEGER4,        "SIP Method", radius_vendor_columbia_university_sip_method_vals},
2578   {1,   RADIUS_STRING,          "SIP From", NULL},
2579   {2,   RADIUS_STRING,          "SIP To", NULL},
2580   {4,   RADIUS_STRING,          "SIP Translated Request URI", NULL},
2581   {0, 0, NULL, NULL},
2582 };
2583
2584 static const value_string the3gpp_pdp_type_vals[] = {
2585   {0,   "IP"},
2586   {1,   "PPP"},
2587   {2,   "IPv6"},
2588   {0, NULL}
2589 };
2590
2591 static const radius_attr_info radius_vendor_3gpp_attrib[] =
2592 {
2593    /* According to 3GPP TS 29.061 V4.8.0 (2003-06) */
2594    {1,  THE3GPP_IMSI,           "IMSI", NULL},
2595    {2,  RADIUS_INTEGER4,        "Charging ID", NULL},
2596    {3,  RADIUS_INTEGER4,        "PDP Type", the3gpp_pdp_type_vals},
2597    {4,  RADIUS_IP_ADDRESS,      "Charging Gateway Address", NULL},
2598    {5,  THE3GPP_QOS,            "QoS Profile", NULL},
2599    {6,  RADIUS_IP_ADDRESS,      "SGSN Address", NULL},
2600    {7,  RADIUS_IP_ADDRESS,      "GGSN Address", NULL},
2601    {8,  THE3GPP_IMSI_MCC_MNC,   "IMSI MCC-MNC", NULL},
2602    {9,  THE3GPP_GGSN_MCC_MNC,   "GGSN MCC-MNC", NULL},
2603    {10, THE3GPP_NSAPI,          "NSAPI", NULL},
2604    {11, THE3GPP_SESSION_STOP_INDICATOR, "Session Stop Indicator", NULL},
2605    {12, THE3GPP_SELECTION_MODE, "Selection Mode", NULL},
2606    {13, THE3GPP_CHARGING_CHARACTERISTICS, "Charging Characteristics", NULL},
2607    {14, RADIUS_IP6_ADDRESS,     "Charging Gateway IPv6 Address", NULL},
2608    {15, RADIUS_IP6_ADDRESS,     "SGSN IPv6 Address", NULL},
2609    {16, RADIUS_IP6_ADDRESS,     "GGSN IPv6 Address", NULL},
2610    {17, THE3GPP_IPV6_DNS_SERVERS, "IPv6 DNS Servers", NULL},
2611    {18, THE3GPP_SGSN_MCC_MNC,   "SGSN MCC-MNC", NULL},
2612    {0, 0, NULL, NULL},
2613 };
2614
2615 static rd_vsa_table radius_vsa_table[] =
2616 {
2617   {VENDOR_ACC,                  radius_vendor_acc_attrib},
2618   {VENDOR_CISCO,                radius_vendor_cisco_attrib},
2619   {VENDOR_SHIVA,                radius_vendor_shiva_attrib},
2620   {VENDOR_CISCO_VPN5000,        radius_vendor_cisco_vpn5000_attrib},
2621   {VENDOR_LIVINGSTON,           radius_vendor_livingston_attrib},
2622   {VENDOR_MICROSOFT,            radius_vendor_microsoft_attrib},
2623   {VENDOR_ASCEND,               radius_vendor_ascend_attrib},
2624   {VENDOR_BAY,                  radius_vendor_bay_attrib},
2625   {VENDOR_FOUNDRY,              radius_vendor_foundry_attrib},
2626   {VENDOR_VERSANET,             radius_vendor_versanet_attrib},
2627   {VENDOR_REDBACK,              radius_vendor_redback_attrib},
2628   {VENDOR_JUNIPER,              radius_vendor_juniper_attrib},
2629   {VENDOR_CISCO_VPN3000,        radius_vendor_cisco_vpn3000_attrib},
2630   {VENDOR_APTIS,                radius_vendor_aptis_attrib},
2631   {VENDOR_COSINE,               radius_vendor_cosine_attrib},
2632   {VENDOR_SHASTA,               radius_vendor_shasta_attrib},
2633   {VENDOR_NOMADIX,              radius_vendor_nomadix_attrib},
2634   {VENDOR_UNISPHERE,            radius_vendor_unisphere_attrib},
2635   {VENDOR_CISCO_BBSM,           radius_vendor_cisco_bbsm_attrib},
2636   {VENDOR_ISSANNI,              radius_vendor_issanni_attrib},
2637   {VENDOR_QUINTUM,              radius_vendor_quintum_attrib},
2638   {VENDOR_COLUBRIS,             radius_vendor_colubris_attrib},
2639   {VENDOR_COLUMBIA_UNIVERSITY,  radius_vendor_columbia_university_attrib},
2640   {VENDOR_THE3GPP,              radius_vendor_3gpp_attrib},
2641   {0, NULL},
2642 };
2643
2644 static const radius_attr_info *get_attr_info_table(guint32 vendor)
2645 {
2646     guint32 i;
2647
2648     for (i = 0; radius_vsa_table[i].vendor; i++)
2649         if (radius_vsa_table[i].vendor == vendor)
2650             return(radius_vsa_table[i].attrib);
2651
2652     return(NULL);
2653 }
2654
2655 static const radius_attr_info *
2656 find_radius_attr_info(guint32 attr_type, const radius_attr_info *table)
2657 {
2658     guint32 i;
2659
2660     for (i = 0; table[i].str; i++)
2661         if (table[i].attr_type == attr_type)
2662             return(&table[i]);
2663
2664     return(NULL);
2665 }
2666
2667 #if GLIB_MAJOR_VERSION >= 2
2668 /*
2669  * XXX - "isprint()" can return "true" for non-ASCII characters, but
2670  * those don't work with GTK+ 1.3 or later, as they take UTF-8 strings
2671  * as input.  Until we fix up Ethereal to properly handle non-ASCII
2672  * characters in all output (both GUI displays and text printouts)
2673  * in those versions of GTK+, we work around the problem by escaping
2674  * all characters that aren't printable ASCII.
2675  *
2676  * We don't know what version of GTK+ we're using, as dissectors don't
2677  * use any GTK+ stuff; we use GLib as a proxy for that, with GLib 2.x
2678  * implying GTK+ 1.3 or later (we don't support GLib 1.3[.x]).
2679  */
2680 #undef isprint
2681 #define isprint(c) (c >= 0x20 && c < 0x7f)
2682 #endif
2683
2684 static void
2685 rdconvertbufftostr(gchar *dest, tvbuff_t *tvb, int offset, int length)
2686 {
2687 /*converts the raw buffer into printable text */
2688         guint32 i;
2689         guint32 totlen=0;
2690         const guint8 *pd = tvb_get_ptr(tvb, offset, length);
2691
2692         dest[0]='"';
2693         dest[1]=0;
2694         totlen=1;
2695         for (i=0; i < (guint32)length; i++)
2696         {
2697                 if( isprint((int)pd[i])) {
2698                         dest[totlen]=(gchar)pd[i];
2699                         totlen++;
2700                 }
2701                 else
2702                 {
2703                         sprintf(&(dest[totlen]), "\\%03o", pd[i]);
2704                         totlen=totlen+strlen(&(dest[totlen]));
2705                 }
2706         }
2707         dest[totlen]='"';
2708         dest[totlen+1]=0;
2709 }
2710
2711 static void
2712 rdconvertbufftobinstr(gchar *dest, tvbuff_t *tvb, int offset, int length)
2713 {
2714 /*converts the raw buffer into printable hex display */
2715         guint32 i;
2716         guint32 totlen=0;
2717         const guint8 *pd = tvb_get_ptr(tvb, offset, length);
2718         static const char hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7',
2719                                       '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
2720
2721         for (i=0; i < (guint32)length; i++)
2722         {
2723                 dest[totlen] = hex[pd[i] >> 4];
2724                 totlen++;
2725                 dest[totlen] = hex[pd[i] & 0xF];
2726                 totlen++;
2727         }
2728         dest[totlen]='\0';
2729 }
2730
2731 static void
2732 rddecryptpass(gchar *dest,tvbuff_t *tvb,int offset,int length)
2733 {
2734     md5_state_t md_ctx;
2735     md5_byte_t digest[16];
2736     guint32 i;
2737     guint32 totlen;
2738     const guint8 *pd;
2739     guchar c;
2740
2741     if (shared_secret[0] == '\0' || !authenticator ) {
2742         rdconvertbufftobinstr(dest,tvb,offset,length);
2743         return;
2744     }
2745
2746     dest[0] = '"';
2747     dest[1] = '\0';
2748     totlen = 1;
2749
2750     md5_init(&md_ctx);
2751     md5_append(&md_ctx,shared_secret,strlen(shared_secret));
2752     md5_append(&md_ctx,authenticator,16);
2753     md5_finish(&md_ctx,digest);
2754
2755     pd = tvb_get_ptr(tvb,offset,length);
2756     for( i = 0 ; i < 16 && i < (guint32)length ; i++ ) {
2757         c = pd[i] ^ digest[i];
2758         if ( isprint(c)) {
2759             dest[totlen] = c;
2760             totlen++;
2761         } else {
2762             sprintf(&(dest[totlen]),"\\%03o",c);
2763             totlen += strlen(&(dest[totlen]));
2764         }
2765     }
2766     while(i<(guint32)length) {
2767         if ( isprint(pd[i]) ) {
2768             dest[totlen] = (gchar)pd[i];
2769             totlen++;
2770         } else {
2771             sprintf(&(dest[totlen]), "\\%03o", pd[i]);
2772             totlen=totlen+strlen(&(dest[totlen]));
2773         }
2774         i++;
2775     }
2776     dest[totlen]='"';
2777     dest[totlen+1] = '\0';
2778 }
2779
2780 static gchar *rd_match_strval(guint32 val, const value_string *vs) {
2781         return val_to_str(val, vs, "Undefined");
2782 }
2783
2784 /* NOTE: This function's signature has been changed with the addition of the
2785  * tree parameter at the end.
2786  *
2787  * The function behaves EXACTLY AS BEFORE for parameters which do not
2788  * imply THE3GPP_QOS; I had to change the signature because the function
2789  * decode_qos_umts() wants to write on the protocol tree :)
2790  *
2791  * If you think it is better to DUPLICATE the code copying decode_qos_umts
2792  * here, and adapting it, feel free; only keep in mind that changes will have
2793  * to be doubled if any bug is found.
2794  *
2795  * At last, forgive me if I've messed up some indentation...
2796  * */
2797 static void rd_value_to_str(gchar *dest, rd_vsa_buffer (*vsabuffer)[VSABUFFER],
2798                             const e_avphdr *avph, tvbuff_t *tvb,
2799                             int offset, const radius_attr_info *attr_info,
2800                             proto_tree *tree)
2801 {
2802   /* Variable to peek which will be the next print_type for VENDOR-SPECIFIC
2803    * RADIUS attributes
2804    * */
2805   const radius_attr_info *next_attr_info;
2806
2807   /* Temporary variable to perform some trick on the cont variable; again, this
2808    * is needed only when THE3GPP_QOS in involved.
2809    * */
2810   gchar *tmp_punt;
2811
2812   gchar *cont;
2813   guint32 intval;
2814   gint32 timeval;
2815   const guint8 *pd;
2816   guint8 tag;
2817   guint8 ipv6_prefix_length;
2818   guint8 ipv6_addr_temp[16];
2819
2820   int vsa_length;
2821   int vsa_len;
2822   int vsa_index;
2823   const radius_attr_info *vsa_attr_info_table;
2824   const e_avphdr *vsa_avph;
2825
2826   /* Default begin */
2827   strcpy(dest, "Value:");
2828   cont=&dest[strlen(dest)];
2829   if(attr_info == NULL) {
2830     strcpy(cont,"Unknown Value Type");
2831     return;
2832   }
2833   switch(attr_info->value_type)
2834   {
2835         case( RADIUS_STRING ):
2836                 rdconvertbufftostr(cont,tvb,offset+2,avph->avp_length-2);
2837                 break;
2838
2839         case( RADIUS_BINSTRING ):
2840                 rdconvertbufftobinstr(cont,tvb,offset+2,avph->avp_length-2);
2841                 break;
2842
2843         case( RADIUS_USERPASSWORD ):
2844                 rddecryptpass(cont,tvb,offset+2,avph->avp_length-2);
2845                 break;
2846
2847         case( RADIUS_INTEGER4 ):
2848                 intval = tvb_get_ntohl(tvb,offset+2);
2849                 if (attr_info->vs != NULL)
2850                         sprintf(cont, "%s(%u)", rd_match_strval(intval, attr_info->vs), intval);
2851                 else
2852                         sprintf(cont,"%u", intval);
2853                 break;
2854
2855         case( RADIUS_IP_ADDRESS ):
2856                 ip_to_str_buf(tvb_get_ptr(tvb,offset+2,4),cont);
2857                 break;
2858
2859         case( RADIUS_IP6_ADDRESS ):
2860                 ip6_to_str_buf((const struct e_in6_addr *)tvb_get_ptr(tvb,offset+2,16),cont);
2861                 break;
2862
2863         case( RADIUS_IP6_PREFIX ):
2864                 ipv6_prefix_length = tvb_get_guint8(tvb,offset+3);
2865                 memset(ipv6_addr_temp, 0, 16);
2866                 if (ipv6_prefix_length > 16) ipv6_prefix_length = 16;
2867                 tvb_memcpy(tvb, ipv6_addr_temp, offset+4, ipv6_prefix_length);
2868                 ip6_to_str_buf((const struct e_in6_addr *)ipv6_addr_temp, cont);
2869                 break;
2870
2871         case( RADIUS_IP6_INTF_ID ):
2872                 ipv6_prefix_length = tvb_get_guint8(tvb,offset+1);
2873                 memset(ipv6_addr_temp, 0, 16);
2874                 if (ipv6_prefix_length > 16) ipv6_prefix_length = 16;
2875                 tvb_memcpy(tvb, ipv6_addr_temp, offset+2, ipv6_prefix_length);
2876                 ip6_to_str_buf((const struct e_in6_addr *)ipv6_addr_temp, cont);
2877                 break;
2878
2879         case( RADIUS_IPX_ADDRESS ):
2880                 pd = tvb_get_ptr(tvb,offset+2,4);
2881                 sprintf(cont,"%u:%u:%u:%u",pd[0],pd[1],pd[2],pd[3]);
2882                 break;
2883
2884         case( RADIUS_STRING_TAGGED ):
2885                 /* Tagged ? */
2886                 tag = tvb_get_guint8(tvb,offset+2);
2887                 if (tag > 0 && tag <= 0x1f) {
2888                         sprintf(dest, "Tag:%u, Value:",
2889                                         tag);
2890                         cont=&cont[strlen(cont)];
2891                         rdconvertbufftostr(cont,tvb,offset+3,avph->avp_length-3);
2892                         break;
2893                 }
2894                 rdconvertbufftostr(cont,tvb,offset+2,avph->avp_length-2);
2895                 break;
2896
2897         case ( RADIUS_VENDOR_SPECIFIC ):
2898                 intval = tvb_get_ntohl(tvb,offset+2);
2899                 sprintf(dest, "Vendor:%s(%u)", rd_match_strval(intval,radius_vendor_specific_vendors), intval);
2900                 cont = &dest[strlen(dest)];
2901                 vsa_length = avph->avp_length;
2902                 vsa_len = 6;
2903                 vsa_index = 0;
2904                 vsa_attr_info_table = get_attr_info_table(intval);
2905                 do
2906                 {
2907                         vsa_avph = (const e_avphdr*)tvb_get_ptr(tvb, offset+vsa_len,
2908                                 avph->avp_length-vsa_len);
2909                         if (vsa_attr_info_table)
2910                                 next_attr_info = find_radius_attr_info(vsa_avph->avp_type,
2911                                         vsa_attr_info_table);
2912                         else
2913                                 next_attr_info = NULL;
2914                         cont = &cont[strlen(cont)+1];
2915                         tmp_punt = cont;
2916                         (*vsabuffer)[vsa_index].str = cont;
2917                         (*vsabuffer)[vsa_index].offset = offset+vsa_len;
2918                         (*vsabuffer)[vsa_index].length = vsa_avph->avp_length;
2919                         sprintf(cont, "t:%s(%u) l:%u, ",
2920                                 (next_attr_info
2921                                         ? next_attr_info->str
2922                                         : "Unknown Type"),
2923                                 vsa_avph->avp_type, vsa_avph->avp_length);
2924                         cont = &cont[strlen(cont)];
2925                         rd_value_to_str(cont, vsabuffer, vsa_avph, tvb,
2926                                         offset+vsa_len, next_attr_info,
2927                                         tree);
2928                         vsa_index++;
2929                         vsa_len += vsa_avph->avp_length;
2930                         if (next_attr_info != NULL &&
2931                             next_attr_info->value_type == THE3GPP_QOS )
2932                         {
2933                                 cont = tmp_punt;
2934                                 vsa_index--;
2935                                 (*vsabuffer)[vsa_index].str = 0;
2936                         }
2937                 } while (vsa_length > vsa_len && vsa_index < VSABUFFER);
2938                 break;
2939
2940         case( COSINE_VPI_VCI ):
2941                 sprintf(cont,"%u/%u",
2942                         tvb_get_ntohs(tvb,offset+2),
2943                         tvb_get_ntohs(tvb,offset+4));
2944                 break;
2945
2946         case( THE3GPP_IMSI ):
2947         case( THE3GPP_IMSI_MCC_MNC ):
2948         case( THE3GPP_GGSN_MCC_MNC ):
2949         case( THE3GPP_SGSN_MCC_MNC ):
2950         case( THE3GPP_SELECTION_MODE ):
2951         case( THE3GPP_CHARGING_CHARACTERISTICS ):
2952                 sprintf(cont,"(encoded in UTF-8 format)");
2953                 break;
2954
2955         case( THE3GPP_NSAPI ):
2956         case( THE3GPP_SESSION_STOP_INDICATOR ):
2957                 sprintf(cont,"(not parsed)");
2958                 break;
2959
2960         case( THE3GPP_IPV6_DNS_SERVERS ):
2961                 /* XXX - this is described as a list of IPv6 addresses of
2962                    DNS servers, so we probably need to process more than
2963                    one IPv6 address. */
2964                 ip6_to_str_buf((const struct e_in6_addr *)tvb_get_ptr(tvb,offset+2,16),cont);
2965                 break;
2966
2967         case( THE3GPP_QOS ):
2968                 /* Find the ponter to the already-built label
2969                  * */
2970                 tmp_punt = dest - 2;
2971                 while (*tmp_punt)
2972                         tmp_punt--;
2973                 tmp_punt++;
2974
2975                 /* Call decode_qos_umts from packet-gtp package
2976                  * */
2977                 decode_qos_umts(tvb, offset + 1, tree, tmp_punt, 3);
2978                 break;
2979
2980         case( RADIUS_TIMESTAMP ):
2981                 timeval=tvb_get_ntohl(tvb,offset+2);
2982                 sprintf(cont,"%d (%s)", timeval, abs_time_secs_to_str(timeval));
2983                 break;
2984
2985         case( RADIUS_INTEGER4_TAGGED ):
2986                 tag = tvb_get_guint8(tvb,offset+2);
2987                 intval = tvb_get_ntoh24(tvb,offset+3);
2988                 /* Tagged ? */
2989                 if (tag) {
2990                         if (attr_info->vs != NULL) {
2991                                 sprintf(dest, "Tag:%u, Value:%s(%u)",
2992                                         tag,
2993                                         rd_match_strval(intval, attr_info->vs),
2994                                         intval);
2995                         } else {
2996                                 sprintf(dest, "Tag:%u, Value:%u",
2997                                         tag, intval);
2998                         }
2999                 } else {
3000                         if (attr_info->vs != NULL)
3001                                 sprintf(cont, "%s(%u)",
3002                                         rd_match_strval(intval, attr_info->vs),
3003                                         intval);
3004                         else
3005                                 sprintf(cont,"%u", intval);
3006                 }
3007                 break;
3008
3009         case( RADIUS_UNKNOWN ):
3010                 strcpy(cont,"Unknown Value Type");
3011                 break;
3012         default:
3013                 g_assert_not_reached();
3014   }
3015   cont=&cont[strlen(cont)];
3016   if (cont == dest) {
3017         strcpy(cont,"Unknown Value");
3018   }
3019 }
3020
3021 static void
3022 dissect_attribute_value_pairs(tvbuff_t *tvb, int offset,proto_tree *tree,
3023                                    int avplength,packet_info *pinfo)
3024 {
3025 /* adds the attribute value pairs to the tree */
3026   e_avphdr avph;
3027   const radius_attr_info *attr_info;
3028   proto_item *ti = NULL;
3029   guint8 *reassembled_data = NULL;
3030   int reassembled_data_len = 0;
3031   int data_needed = 0;
3032   char *attr_info_str = "(Invalid)";
3033
3034   if (avplength==0)
3035   {
3036     if (tree)
3037       proto_tree_add_text(tree, tvb,offset,0,"No Attribute Value Pairs Found");
3038     return;
3039   }
3040
3041   /*
3042    * In case we throw an exception, clean up whatever stuff we've
3043    * allocated (if any).
3044    */
3045   CLEANUP_PUSH(g_free, reassembled_data);
3046
3047   while (avplength > 0)
3048   {
3049     tvb_memcpy(tvb,(guint8 *)&avph,offset,sizeof(e_avphdr));
3050     attr_info = find_radius_attr_info(avph.avp_type, radius_attrib);
3051     if (avph.avp_length < 2) {
3052       /*
3053        * This AVP is bogus - the length includes the type and length
3054        * fields, so it must be >= 2.
3055        */
3056       if (tree) {
3057         if (attr_info) {
3058           attr_info_str = attr_info->str;
3059         }
3060         proto_tree_add_text(tree, tvb, offset, avph.avp_length,
3061                             "t:%s(%u) l:%u (length not >= 2)",
3062                             attr_info_str, avph.avp_type, avph.avp_length);
3063       }
3064       break;
3065     }
3066
3067     if (tree) {
3068       ti = proto_tree_add_text(tree, tvb, offset, avph.avp_length,
3069                                "t:%s(%u) l:%u",
3070                                attr_info ? attr_info->str : "Unknown Type",
3071                                avph.avp_type, avph.avp_length);
3072     }
3073     if (attr_info != NULL && attr_info->value_type == RADIUS_EAP_MESSAGE) {
3074       /* EAP Message */
3075       proto_tree *eap_tree = NULL;
3076       gint tvb_len;
3077       tvbuff_t *next_tvb;
3078       int data_len;
3079       int result;
3080
3081       if (tree)
3082         eap_tree = proto_item_add_subtree(ti, ett_radius_eap);
3083       tvb_len = tvb_length_remaining(tvb, offset+2);
3084       data_len = avph.avp_length-2;
3085       if (data_len < tvb_len)
3086         tvb_len = data_len;
3087       next_tvb = tvb_new_subset(tvb, offset+2, tvb_len, data_len);
3088
3089       /*
3090        * Set the columns non-writable, so that the packet list
3091        * shows this as an RADIUS packet, not as an EAP packet.
3092        */
3093       col_set_writable(pinfo->cinfo, FALSE);
3094
3095       /*
3096        * RFC 2869 says, in section 5.13, describing the EAP-Message
3097        * attribute:
3098        *
3099        *    The String field contains EAP packets, as defined in [3].  If
3100        *    multiple EAP-Message attributes are present in a packet their
3101        *    values should be concatenated; this allows EAP packets longer than
3102        *    253 octets to be passed by RADIUS.
3103        *
3104        * Do reassembly of EAP-Message attributes.
3105        */
3106
3107       /* Are we in the process of reassembling? */
3108       if (reassembled_data != NULL) {
3109         /* Yes - show this as an EAP fragment. */
3110         if (tree)
3111           proto_tree_add_text(eap_tree, next_tvb, 0, -1, "EAP fragment");
3112
3113         /*
3114          * Do we have all of the data in this fragment?
3115          */
3116         if (tvb_len >= data_len) {
3117           /*
3118            * Yes - add it to the reassembled data.
3119            */
3120           tvb_memcpy(next_tvb, reassembled_data + reassembled_data_len,
3121                      0, data_len);
3122           reassembled_data_len += data_len;
3123           data_needed -= data_len;
3124           if (data_needed <= 0) {
3125             /*
3126              * We got at least as much data as we needed; we're done
3127              * reassembling.
3128              * XXX - what if we got more?
3129              */
3130
3131             /*
3132              * Allocate a new tvbuff, referring to the reassembled payload.
3133              */
3134             next_tvb = tvb_new_real_data(reassembled_data, reassembled_data_len,
3135                                          reassembled_data_len);
3136
3137             /*
3138              * We have a tvbuff that refers to this data, so we shouldn't
3139              * free this data if we throw an exception; clear
3140              * "reassembled_data", so the cleanup handler won't free it.
3141              */
3142             reassembled_data = NULL;
3143             reassembled_data_len = 0;
3144             data_needed = 0;
3145
3146             /*
3147              * Arrange that the allocated packet data copy be freed when the
3148              * tvbuff is freed.
3149              */
3150             tvb_set_free_cb(next_tvb, g_free);
3151
3152             /*
3153              * Add the tvbuff to the list of tvbuffs to which the tvbuff we
3154              * were handed refers, so it'll get cleaned up when that tvbuff
3155              * is cleaned up.
3156              */
3157             tvb_set_child_real_data_tvbuff(tvb, next_tvb);
3158
3159             /* Add the defragmented data to the data source list. */
3160             add_new_data_source(pinfo, next_tvb, "Reassembled EAP");
3161
3162             /* Now dissect it. */
3163             call_dissector(eap_fragment_handle, next_tvb, pinfo, eap_tree);
3164           }
3165         }
3166       } else {
3167         /*
3168          * No - hand it to the dissector.
3169          */
3170         result = call_dissector(eap_fragment_handle, next_tvb, pinfo, eap_tree);
3171         if (result < 0) {
3172           /* This is only part of the full EAP packet; start reassembly. */
3173           proto_tree_add_text(eap_tree, next_tvb, 0, -1, "EAP fragment");
3174           reassembled_data_len = data_len;
3175           data_needed = -result;
3176           reassembled_data = g_malloc(reassembled_data_len + data_needed);
3177           tvb_memcpy(next_tvb, reassembled_data, 0, reassembled_data_len);
3178         }
3179       }
3180     } else {
3181       if (tree) {
3182         proto_tree *vsa_tree = NULL;
3183         int i;
3184         gchar textbuffer[TEXTBUFFER];
3185         rd_vsa_buffer vsabuffer[VSABUFFER];
3186
3187         /* We pre-add a text and a subtree to allow 3GPP QoS decoding
3188          * to access the protocol tree.
3189          * */
3190         vsa_tree = proto_item_add_subtree(ti, ett_radius_vsa);
3191         for (i = 0; i < VSABUFFER; i++)
3192             vsabuffer[i].str = NULL;
3193         rd_value_to_str(textbuffer, &vsabuffer, &avph, tvb, offset,
3194                         attr_info, vsa_tree);
3195         proto_item_append_text(ti, ", %s", textbuffer);
3196         for (i = 0; vsabuffer[i].str && i < VSABUFFER; i++)
3197             proto_tree_add_text(vsa_tree, tvb, vsabuffer[i].offset,
3198                                 vsabuffer[i].length, "%s", vsabuffer[i].str);
3199       }
3200     }
3201
3202     offset = offset+avph.avp_length;
3203     avplength = avplength-avph.avp_length;
3204   }
3205
3206   /*
3207    * Call the cleanup handler to free any reassembled data we haven't
3208    * attached to a tvbuff, and pop the handler.
3209    */
3210   CLEANUP_CALL_AND_POP;
3211 }
3212
3213 static void dissect_radius(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
3214 {
3215   proto_tree *radius_tree = NULL, *avptree = NULL;
3216   proto_item *ti,*avptf;
3217   guint rhlength;
3218   guint rhcode;
3219   guint rhident;
3220   guint avplength,hdrlength;
3221   e_radiushdr rh;
3222   gchar *hex_authenticator;
3223
3224   gchar *codestrval;
3225
3226   if (check_col(pinfo->cinfo, COL_PROTOCOL))
3227         col_set_str(pinfo->cinfo, COL_PROTOCOL, "RADIUS");
3228   if (check_col(pinfo->cinfo, COL_INFO))
3229         col_clear(pinfo->cinfo, COL_INFO);
3230
3231   tvb_memcpy(tvb,(guint8 *)&rh,0,sizeof(e_radiushdr));
3232
3233   rhcode= rh.rh_code;
3234   rhident= rh.rh_ident;
3235   rhlength= g_ntohs(rh.rh_pktlength);
3236   codestrval=  match_strval(rhcode,radius_vals);
3237   if (codestrval==NULL)
3238   {
3239         codestrval="Unknown Packet";
3240   }
3241   /* XXX Check for valid length value:
3242    * Length
3243    *
3244    *  The Length field is two octets.  It indicates the length of the
3245    *  packet including the Code, Identifier, Length, Authenticator and
3246    *  Attribute fields.  Octets outside the range of the Length field
3247    *  MUST be treated as padding and ignored on reception.  If the
3248    *  packet is shorter than the Length field indicates, it MUST be
3249    *  silently discarded.  The minimum length is 20 and maximum length
3250    *  is 4096.
3251    */
3252
3253   if (check_col(pinfo->cinfo, COL_INFO))
3254   {
3255         col_add_fstr(pinfo->cinfo,COL_INFO,"%s(%d) (id=%d, l=%d)",
3256                 codestrval, rhcode, rhident, rhlength);
3257   }
3258
3259   if (tree)
3260   {
3261         ti = proto_tree_add_item(tree,proto_radius, tvb, 0, rhlength, FALSE);
3262
3263         radius_tree = proto_item_add_subtree(ti, ett_radius);
3264
3265         proto_tree_add_uint(radius_tree,hf_radius_code, tvb, 0, 1,
3266                 rh.rh_code);
3267         proto_tree_add_uint_format(radius_tree,hf_radius_id, tvb, 1, 1,
3268                 rh.rh_ident, "Packet identifier: 0x%01x (%d)",
3269                         rhident,rhident);
3270
3271         proto_tree_add_uint(radius_tree, hf_radius_length, tvb,
3272                         2, 2, rhlength);
3273         if ( authenticator ) {
3274             g_free(authenticator);
3275         }
3276         authenticator = g_malloc(AUTHENTICATOR_LENGTH);
3277         if ( authenticator ) {
3278             memcpy(authenticator,tvb_get_ptr(tvb,4,AUTHENTICATOR_LENGTH),AUTHENTICATOR_LENGTH);
3279         }
3280         hex_authenticator = g_malloc(AUTHENTICATOR_LENGTH * 2 + 1);
3281         rdconvertbufftobinstr(hex_authenticator, tvb, 4, AUTHENTICATOR_LENGTH);
3282         proto_tree_add_text(radius_tree, tvb, 4,
3283                         AUTHENTICATOR_LENGTH,
3284                          "Authenticator: 0x%s", hex_authenticator);
3285         g_free(hex_authenticator);
3286   }
3287
3288   hdrlength=RD_HDR_LENGTH+AUTHENTICATOR_LENGTH;
3289   avplength= rhlength -hdrlength;
3290
3291   if (avplength > 0) {
3292     /* list the attribute value pairs */
3293
3294     if (tree)
3295     {
3296       avptf = proto_tree_add_text(radius_tree,
3297                                   tvb,hdrlength,avplength,
3298                                   "Attribute value pairs");
3299       avptree = proto_item_add_subtree(avptf, ett_radius_avp);
3300     }
3301
3302     dissect_attribute_value_pairs(tvb, hdrlength, avptree, avplength, pinfo);
3303   }
3304
3305 }
3306 /* registration with the filtering engine */
3307 void
3308 proto_register_radius(void)
3309 {
3310         static hf_register_info hf[] = {
3311                 { &hf_radius_code,
3312                 { "Code","radius.code", FT_UINT8, BASE_DEC, VALS(radius_vals), 0x0,
3313                         "", HFILL }},
3314
3315                 { &hf_radius_id,
3316                 { "Identifier", "radius.id", FT_UINT8, BASE_DEC, NULL, 0x0,
3317                         "", HFILL }},
3318
3319                 { &hf_radius_length,
3320                 { "Length","radius.length", FT_UINT16, BASE_DEC, NULL, 0x0,
3321                         "", HFILL }}
3322         };
3323         static gint *ett[] = {
3324                 &ett_radius,
3325                 &ett_radius_avp,
3326                 &ett_radius_eap,
3327                 &ett_radius_vsa,
3328         };
3329
3330         module_t *radius_module;
3331
3332         proto_radius = proto_register_protocol("Radius Protocol", "RADIUS",
3333             "radius");
3334         proto_register_field_array(proto_radius, hf, array_length(hf));
3335         proto_register_subtree_array(ett, array_length(ett));
3336         
3337         radius_module = prefs_register_protocol(proto_radius,NULL);
3338         prefs_register_string_preference(radius_module,"shared_secret","Shared Secret",
3339                                         "Shared secret used to decode User Passwords",
3340                                         &shared_secret);
3341 }
3342
3343 void
3344 proto_reg_handoff_radius(void)
3345 {
3346         dissector_handle_t radius_handle;
3347
3348         /*
3349          * Get a handle for the EAP fragment dissector.
3350          */
3351         eap_fragment_handle = find_dissector("eap_fragment");
3352
3353         radius_handle = create_dissector_handle(dissect_radius, proto_radius);
3354         dissector_add("udp.port", UDP_PORT_RADIUS, radius_handle);
3355         dissector_add("udp.port", UDP_PORT_RADIUS_NEW, radius_handle);
3356         dissector_add("udp.port", UDP_PORT_RADACCT, radius_handle);
3357         dissector_add("udp.port", UDP_PORT_RADACCT_NEW, radius_handle);
3358 }