MSWSP: fix dissect_mswsp_smb()
[wireshark-wip.git] / epan / dissectors / packet-radius.h
blobc85ace294cfc8641a63ce413bb8bcd5263ccf963
1 /*
2 * packet-radius.h
4 * Definitions for RADIUS packet disassembly
5 * $Id$
7 * Wireshark - Network traffic analyzer
8 * By Gerald Combs <gerald@wireshark.org>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 /* radius packet-type codes */
27 /* 09/12/2011: Updated from IANA:
28 * http://www.iana.org/assignments/radius-types/radius-types.xml#radius-types-27
30 #define RADIUS_PKT_TYPE_ACCESS_REQUEST 1
31 #define RADIUS_PKT_TYPE_ACCESS_ACCEPT 2
32 #define RADIUS_PKT_TYPE_ACCESS_REJECT 3
33 #define RADIUS_PKT_TYPE_ACCOUNTING_REQUEST 4
34 #define RADIUS_PKT_TYPE_ACCOUNTING_RESPONSE 5
35 #define RADIUS_PKT_TYPE_ACCOUNTING_STATUS 6
36 #define RADIUS_PKT_TYPE_PASSWORD_REQUEST 7
37 #define RADIUS_PKT_TYPE_PASSWORD_ACK 8
38 #define RADIUS_PKT_TYPE_PASSWORD_REJECT 9
39 #define RADIUS_PKT_TYPE_ACCOUNTING_MESSAGE 10
40 #define RADIUS_PKT_TYPE_ACCESS_CHALLENGE 11
41 #define RADIUS_PKT_TYPE_STATUS_SERVER 12
42 #define RADIUS_PKT_TYPE_STATUS_CLIENT 13
44 #define RADIUS_PKT_TYPE_RESOURCE_FREE_REQUEST 21
45 #define RADIUS_PKT_TYPE_RESOURCE_FREE_RESPONSE 22
46 #define RADIUS_PKT_TYPE_RESOURCE_QUERY_REQUEST 23
47 #define RADIUS_PKT_TYPE_RESOURCE_QUERY_RESPONSE 24
48 #define RADIUS_PKT_TYPE_ALTERNATE_RESOURCE_RECLAIM_REQUEST 25
49 #define RADIUS_PKT_TYPE_NAS_REBOOT_REQUEST 26
50 #define RADIUS_PKT_TYPE_NAS_REBOOT_RESPONSE 27
52 #define RADIUS_PKT_TYPE_NEXT_PASSCODE 29
53 #define RADIUS_PKT_TYPE_NEW_PIN 30
54 #define RADIUS_PKT_TYPE_TERMINATE_SESSION 31
55 #define RADIUS_PKT_TYPE_PASSWORD_EXPIRED 32
56 #define RADIUS_PKT_TYPE_EVENT_REQUEST 33
57 #define RADIUS_PKT_TYPE_EVENT_RESPONSE 34
59 #define RADIUS_PKT_TYPE_DISCONNECT_REQUEST 40
60 #define RADIUS_PKT_TYPE_DISCONNECT_ACK 41
61 #define RADIUS_PKT_TYPE_DISCONNECT_NAK 42
62 #define RADIUS_PKT_TYPE_COA_REQUEST 43
63 #define RADIUS_PKT_TYPE_COA_ACK 44
64 #define RADIUS_PKT_TYPE_COA_NAK 45
66 #define RADIUS_PKT_TYPE_IP_ADDRESS_ALLOCATE 50
67 #define RADIUS_PKT_TYPE_IP_ADDRESS_RELEASE 51
69 /* ALU proprietary packet type codes */
70 #define RADIUS_PKT_TYPE_ALU_STATE_REQUEST 129
71 #define RADIUS_PKT_TYPE_ALU_STATE_ACCEPT 130
72 #define RADIUS_PKT_TYPE_ALU_STATE_REJECT 131
73 #define RADIUS_PKT_TYPE_ALU_STATE_ERROR 132
75 /* Radius Attribute Types*/
76 /* 09/12/2011: Updated from IANA:
77 * http://www.iana.org/assignments/radius-types/radius-types.xml#radius-types-1
79 #define RADIUS_ATTR_TYPE_VENDOR_SPECIFIC 26
80 #define RADIUS_ATTR_TYPE_EAP_MESSAGE 79
83 typedef struct _radius_vendor_info_t {
84 const gchar *name;
85 guint code;
86 GHashTable* attrs_by_id;
87 gint ett;
88 guint type_octets;
89 guint length_octets;
90 gboolean has_flags;
91 } radius_vendor_info_t;
93 typedef struct _radius_attr_info_t radius_attr_info_t;
94 typedef void (radius_attr_dissector_t)(radius_attr_info_t*, proto_tree*, packet_info*, tvbuff_t*, int, int, proto_item* );
96 typedef const gchar* (radius_avp_dissector_t)(proto_tree*,tvbuff_t*, packet_info*);
98 struct _radius_attr_info_t {
99 const gchar *name;
100 guint code;
101 guint encrypt; /* 0 or value for "encrypt=" option */
102 gboolean tagged;
103 radius_attr_dissector_t* type;
104 radius_avp_dissector_t* dissector;
105 const value_string *vs;
106 gint ett;
107 int hf;
108 int hf_alt; /* 64-bit version for integers, encrypted version for strings, IPv6 for radius_combo_ip */
109 int hf_tag;
110 int hf_len;
111 GHashTable* tlvs_by_id;
114 typedef struct _radius_dictionary_t {
115 GHashTable* attrs_by_id;
116 GHashTable* attrs_by_name;
117 GHashTable* vendors_by_id;
118 GHashTable* vendors_by_name;
119 GHashTable* tlvs_by_name;
120 } radius_dictionary_t;
122 radius_attr_dissector_t radius_integer;
123 radius_attr_dissector_t radius_string;
124 radius_attr_dissector_t radius_octets;
125 radius_attr_dissector_t radius_ipaddr;
126 radius_attr_dissector_t radius_ipv6addr;
127 radius_attr_dissector_t radius_ipv6prefix;
128 radius_attr_dissector_t radius_ipxnet;
129 radius_attr_dissector_t radius_date;
130 radius_attr_dissector_t radius_abinary;
131 radius_attr_dissector_t radius_ether;
132 radius_attr_dissector_t radius_ifid;
133 radius_attr_dissector_t radius_byte;
134 radius_attr_dissector_t radius_short;
135 radius_attr_dissector_t radius_signed;
136 radius_attr_dissector_t radius_combo_ip;
137 radius_attr_dissector_t radius_tlv;
139 extern void radius_register_avp_dissector(guint32 vendor_id, guint32 attribute_id, radius_avp_dissector_t dissector);
140 void dissect_attribute_value_pairs(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset, guint length);
142 /* from radius_dict.l */
143 gboolean radius_load_dictionary (radius_dictionary_t* dict, gchar* directory, const gchar* filename, gchar** err_str);
145 /* Item of request list */
146 typedef struct _radius_call_t
148 guint code;
149 guint ident;
151 guint32 req_num; /* frame number request seen */
152 guint32 rsp_num; /* frame number response seen */
153 guint32 rspcode;
154 nstime_t req_time;
155 gboolean responded;
156 } radius_call_t;
158 /* Container for tapping relevant data */
159 typedef struct _radius_info_t
161 guint code;
162 guint ident;
163 nstime_t req_time;
164 gboolean is_duplicate;
165 gboolean request_available;
166 guint32 req_num; /* frame number request seen */
167 guint32 rspcode;
168 } radius_info_t;