From Didier Gautheron:
[obnox/wireshark/wip.git] / epan / dissectors / packet-radius_packetcable.c
1 /*
2  * packet-radius_packetcable.c
3  *
4  * Routines for Packetcable's RADIUS AVPs dissection
5  *
6  * $Id$
7  *
8  * Wireshark - Network traffic analyzer
9  * By Gerald Combs <gerald@wireshark.org>
10  * Copyright 1998 Gerald Combs
11  *
12  * This program is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU General Public License
14  * as published by the Free Software Foundation; either version 2
15  * of the License, or (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program; if not, write to the Free Software
24  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
25  *
26  */
27
28
29 /*
30  * Some of the development of the RADIUS protocol decoder was sponsored by
31  * Cable Television Laboratories, Inc. ("CableLabs") based upon proprietary
32  * CableLabs' specifications. Your license and use of this protocol decoder
33  * does not mean that you are licensed to use the CableLabs'
34  * specifications.  If you have questions about this protocol, contact
35  * jf.mule [AT] cablelabs.com or c.stuart [AT] cablelabs.com for additional
36  * information.
37  */
38
39 /*
40   See:
41        PacketCable(TM) 1.5 Specification: Event Messages [PKT-SP-EM1.5-I03-070412]
42        PacketCable(TM) Specification: Multimedia Specification [PKT-SP-MM-I04-080522]
43 */
44
45 #ifdef HAVE_CONFIG_H
46 #include "config.h"
47 #endif
48
49 #include <epan/packet.h>
50 #include <epan/sminmpec.h>
51
52 #include "packet-radius.h"
53
54
55
56 static int proto_packetcable = -1;
57
58 static int hf_packetcable_em_header_version_id = -1;
59 static int hf_packetcable_bcid_timestamp = -1;
60 static int hf_packetcable_bcid_event_counter = -1;
61 static int hf_packetcable_em_header_event_message_type = -1;
62 static int hf_packetcable_em_header_element_type = -1;
63 static int hf_packetcable_em_header_sequence_number = -1;
64 static int hf_packetcable_em_header_status = -1;
65 static int hf_packetcable_em_header_status_error_indicator = -1;
66 static int hf_packetcable_em_header_status_event_origin = -1;
67 static int hf_packetcable_em_header_status_event_message_proxied = -1;
68 static int hf_packetcable_em_header_priority = -1;
69 static int hf_packetcable_em_header_attribute_count = -1;
70 static int hf_packetcable_em_header_event_object = -1;
71 static int hf_packetcable_call_termination_cause_source_document = -1;
72 static int hf_packetcable_call_termination_cause_code = -1;
73 static int hf_packetcable_trunk_group_id_trunk_type = -1;
74 static int hf_packetcable_trunk_group_id_trunk_number = -1;
75 static int hf_packetcable_qos_status = -1;
76 static int hf_packetcable_qos_status_indication = -1;
77 static int hf_packetcable_time_adjustment = -1;
78 static int hf_packetcable_redirected_from_info_number_of_redirections = -1;
79 static int hf_packetcable_electronic_surveillance_indication_df_cdc_address = -1;
80 static int hf_packetcable_electronic_surveillance_indication_df_ccc_address = -1;
81 static int hf_packetcable_electronic_surveillance_indication_cdc_port = -1;
82 static int hf_packetcable_electronic_surveillance_indication_ccc_port = -1;
83 static int hf_packetcable_terminal_display_info_terminal_display_status_bitmask = -1;
84 static int hf_packetcable_terminal_display_info_sbm_general_display = -1;
85 static int hf_packetcable_terminal_display_info_sbm_calling_number = -1;
86 static int hf_packetcable_terminal_display_info_sbm_calling_name = -1;
87 static int hf_packetcable_terminal_display_info_sbm_message_waiting = -1;
88 static int hf_packetcable_terminal_display_info_general_display = -1;
89 static int hf_packetcable_terminal_display_info_calling_number = -1;
90 static int hf_packetcable_terminal_display_info_calling_name = -1;
91 static int hf_packetcable_terminal_display_info_message_waiting = -1;
92
93 /* This is slightly ugly.  */
94 static int hf_packetcable_qos_desc_flags[] =
95 {
96         -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
97 };
98 static int hf_packetcable_qos_desc_fields[] =
99 {
100         -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
101 };
102
103
104 static gint ett_radius_vendor_packetcable_bcid = -1;
105 static gint ett_radius_vendor_packetcable_status = -1;
106 static gint ett_radius_vendor_packetcable_qos_status = -1;
107 static gint ett_packetcable_term_dsply = -1;
108
109
110 #define PACKETCABLE_QOS_STATE_INDICATION_MASK 0X0003
111 #define PACKETCABLE_SERVICE_FLOW_SCHEDULING_TYPE_MASK  (1 << 2)
112 #define PACKETCABLE_NOMINAL_GRANT_INTERVAL_MASK        (1 << 3)
113 #define PACKETCABLE_TOLERATED_GRANT_JITTER_MASK        (1 << 4)
114 #define PACKETCABLE_GRANTS_PER_INTERVAL_MASK   (1 << 5)
115 #define PACKETCABLE_UNSOLICITED_GRANT_SIZE_MASK        (1 << 6)
116 #define PACKETCABLE_TRAFFIC_PRIORITY_MASK      (1 << 7)
117 #define PACKETCABLE_MAXIMUM_SUSTAINED_RATE_MASK        (1 << 8)
118 #define PACKETCABLE_MAXIMUM_TRAFFIC_BURST_MASK (1 << 9)
119 #define PACKETCABLE_MINIMUM_RESERVED_TRAFFIC_RATE_MASK (1 << 10)
120 #define PACKETCABLE_MINIMUM_PACKET_SIZE_MASK   (1 << 11)
121 #define PACKETCABLE_MAXIMUM_CONCATENATED_BURST_MASK    (1 << 12)
122 #define PACKETCABLE_REQUEST_TRANSMISSION_POLICY_MASK   (1 << 13)
123 #define PACKETCABLE_NOMINAL_POLLING_INTERVAL_MASK      (1 << 14)
124 #define PACKETCABLE_TOLERATED_POLL_JITTER_MASK (1 << 15)
125 #define PACKETCABLE_IP_TYPE_OF_SERVICE_OVERRIDE_MASK   (1 << 16)
126 #define PACKETCABLE_MAXIMUM_DOWNSTREAM_LATENCY_MASK    (1 << 17)
127
128 #define PACKETCABLE_QOS_DESC_BITFIELDS 16
129
130 #define PACKETCABLE_EMHS_EI_MASK 0X0003
131 #define PACKETCABLE_EMHS_EO_MASK 0X0004
132 #define PACKETCABLE_EMHS_EMP_MASK 0X0008
133 #define PACKETCABLE_EMHS_RESERVED_MASK 0Xfff0
134
135
136 static guint32 packetcable_qos_desc_mask[] =
137 {
138         PACKETCABLE_SERVICE_FLOW_SCHEDULING_TYPE_MASK,
139         PACKETCABLE_NOMINAL_GRANT_INTERVAL_MASK,
140         PACKETCABLE_TOLERATED_GRANT_JITTER_MASK,
141         PACKETCABLE_GRANTS_PER_INTERVAL_MASK,
142         PACKETCABLE_UNSOLICITED_GRANT_SIZE_MASK,
143         PACKETCABLE_TRAFFIC_PRIORITY_MASK,
144         PACKETCABLE_MAXIMUM_SUSTAINED_RATE_MASK,
145         PACKETCABLE_MAXIMUM_TRAFFIC_BURST_MASK,
146         PACKETCABLE_MINIMUM_RESERVED_TRAFFIC_RATE_MASK,
147         PACKETCABLE_MINIMUM_PACKET_SIZE_MASK,
148         PACKETCABLE_MAXIMUM_CONCATENATED_BURST_MASK,
149         PACKETCABLE_REQUEST_TRANSMISSION_POLICY_MASK,
150         PACKETCABLE_NOMINAL_POLLING_INTERVAL_MASK,
151         PACKETCABLE_TOLERATED_POLL_JITTER_MASK,
152         PACKETCABLE_IP_TYPE_OF_SERVICE_OVERRIDE_MASK,
153         PACKETCABLE_MAXIMUM_DOWNSTREAM_LATENCY_MASK
154 };
155
156 static const value_string radius_vendor_packetcable_event_message_vals[] =
157 {
158         {0,  "Reserved"},
159         {1,  "Signaling_Start"},
160         {2,  "Signaling_Stop"},
161         {3,  "Database_Query"},
162         {4,  "Intelligent_Peripheral_Usage_Start"},
163         {5,  "Intelligent_Peripheral_Usage_Stop"},
164         {6,  "Service_Instance"},
165         {7,  "QoS_Reserve"},
166         {8,  "QoS_Release"},
167         {9,  "Service_Activation"},
168         {10, "Service_Deactivation"},
169         {11,  "Media_Report"},
170         {12,  "Signal_Instance"},
171         {13, "Interconnect_(Signaling)_Start"},
172         {14, "Interconnect_(Signaling)_Stop"},
173         {15, "Call_Answer"},
174         {16, "Call_Disconnect"},
175         {17, "Time_Change"},
176         {19, "QoS_Commit"},
177         {20, "Media_Alive"},
178         {31,  "Policy_Request"},
179         {32,  "Policy_Delete"},
180         {33,  "Policy_Update"},
181         {0, NULL}
182 };
183
184 static const value_string packetcable_em_header_element_type_vals[] =
185 {
186         {0,  "Reserved"},
187         {1,  "CMS"},
188         {2,  "CMTS"},
189         {3,  "Media Gateway Controller"},
190         {4,  "Policy Server"},
191         {0, NULL}
192 };
193
194 static const value_string packetcable_em_header_status_error_indicator_vals[] =
195 {
196         {0,  "No Error"},
197         {1,  "Possible Error"},
198         {2,  "Known Error"},
199         {3,  "Reserved"},
200         {0, NULL}
201 };
202
203 static const value_string packetcable_em_header_status_event_origin_vals[] =
204 {
205         {0,  "Trusted Element"},
206         {1,  "Untrusted Element"},
207         {0, NULL}
208 };
209
210 static const value_string packetcable_em_header_status_event_message_proxied_vals[] =
211 {
212         {0,  "Not proxied"},
213         {1,  "Proxied"},
214         {0, NULL}
215 };
216
217 static const value_string packetcable_call_termination_cause_vals[] =
218 {
219         {0,  "Reserved"},
220         {1,  "BAF"},
221         {2,  "Reserved"},
222         {0, NULL}
223 };
224
225 static const value_string packetcable_trunk_type_vals[] =
226 {
227         {1,  "Not Used"},
228         {2,  "Not Used"},
229         {3,  "SS7 direct trunk group member"},
230         {4,  "SS7 from IC to AT and SS7 from AT to EO"},
231         {5,  "Not Used"},
232         {6,  "SS7 from IC to AT and non-SS7 from AT to EO (terminating only)"},
233         {9,  "Signaling type not specified"},
234         {0, NULL}
235 };
236
237 static const value_string packetcable_state_indication_vals[] =
238 {
239         {0,  "Illegal Value"},
240         {1,  "Resource Reserved but not Activated"},
241         {2,  "Resource Activated"},
242         {3,  "Resource Reserved & Activated"},
243         { 0, NULL }
244 };
245
246
247 /* Decode a PacketCable BCID. */
248 /* XXX - This should probably be combinde with the equivalent COPS code */
249 static void decode_packetcable_bcid (tvbuff_t *tvb, proto_tree *tree, int offset)
250 {
251         guint8 packetcable_buf[64];
252
253         proto_tree_add_item(tree, hf_packetcable_bcid_timestamp,
254                                                 tvb, offset, 4, FALSE);
255         tvb_memcpy(tvb, packetcable_buf, offset + 4, 8); packetcable_buf[8] = '\0';
256         proto_tree_add_text(tree, tvb, offset + 4, 8,
257                                                 "Element ID: %s", packetcable_buf);
258         tvb_memcpy(tvb, packetcable_buf, offset + 13, 7); packetcable_buf[7] = '\0';
259         proto_tree_add_text(tree, tvb, offset + 12, 8,
260                                                 "Time Zone: DST: %c, Offset: %s", tvb_get_guint8(tvb, offset + 12),
261                                                 packetcable_buf);
262         proto_tree_add_item(tree, hf_packetcable_bcid_event_counter,
263                                                 tvb, offset + 20, 4, FALSE);
264 }
265
266 static const gchar* dissect_packetcable_em_hdr(proto_tree* tree, tvbuff_t* tvb) {
267         guint8 packetcable_buf[64];
268         proto_item *ti;
269         proto_tree *obj_tree;
270
271         proto_tree_add_item(tree, hf_packetcable_em_header_version_id, tvb,  0, 2, FALSE);
272         ti = proto_tree_add_text(tree, tvb,  2, 24, "BCID");
273         obj_tree = proto_item_add_subtree(ti, ett_radius_vendor_packetcable_bcid);
274         decode_packetcable_bcid(tvb, obj_tree,  2);
275
276         proto_tree_add_item(tree, hf_packetcable_em_header_event_message_type, tvb,  26, 2, FALSE);
277         proto_tree_add_item(tree, hf_packetcable_em_header_element_type, tvb,  28, 2, FALSE);
278         tvb_memcpy(tvb, packetcable_buf,  30, 8); packetcable_buf[8] = '\0';
279         proto_tree_add_text(tree, tvb,  30, 8, "Element ID: %s", packetcable_buf );
280         tvb_memcpy(tvb, packetcable_buf,  39, 7); packetcable_buf[7] = '\0';
281         proto_tree_add_text(tree, tvb,  38, 8, "Time Zone: DST: %c, Offset: %s", tvb_get_guint8(tvb,  38), packetcable_buf);
282         proto_tree_add_item(tree, hf_packetcable_em_header_sequence_number, tvb,  46, 4, FALSE);
283         tvb_memcpy(tvb, packetcable_buf,  50, 18); packetcable_buf[18] = '\0';
284         proto_tree_add_text(tree, tvb,  50, 18, "Event Time: %s", packetcable_buf);
285
286         ti = proto_tree_add_item(tree, hf_packetcable_em_header_status, tvb,  68, 4, FALSE);
287         obj_tree = proto_item_add_subtree(ti, ett_radius_vendor_packetcable_status);
288         proto_tree_add_item(obj_tree, hf_packetcable_em_header_status_error_indicator, tvb,  68, 4, FALSE);
289         proto_tree_add_item(obj_tree, hf_packetcable_em_header_status_event_origin, tvb,  68, 4, FALSE);
290         proto_tree_add_item(obj_tree, hf_packetcable_em_header_status_event_message_proxied, tvb,  68, 4, FALSE);
291
292         proto_tree_add_item(tree, hf_packetcable_em_header_priority, tvb,  72, 1, FALSE);
293         proto_tree_add_item(tree, hf_packetcable_em_header_attribute_count, tvb,  73, 2, FALSE);
294         proto_tree_add_item(tree, hf_packetcable_em_header_event_object, tvb,  75, 1, FALSE);
295         return "";
296 }
297
298 static const gchar* dissect_packetcable_call_term_cause(proto_tree* tree, tvbuff_t* tvb) {
299         proto_tree_add_item(tree, hf_packetcable_call_termination_cause_source_document,
300                                                 tvb, 0, 2, FALSE);
301         proto_tree_add_item(tree, hf_packetcable_call_termination_cause_code,
302                                                 tvb, 2, 4, FALSE);
303
304         return "";
305 }
306
307 static const gchar* dissect_packetcable_rel_call_billing_correlation(proto_tree* tree, tvbuff_t* tvb) {
308         decode_packetcable_bcid(tvb, tree, 0);
309         return "";
310 }
311
312 static const gchar* dissect_packetcable_trunk_group_id(proto_tree* tree, tvbuff_t* tvb) {
313         proto_tree_add_item(tree, hf_packetcable_trunk_group_id_trunk_type,
314                                                 tvb, 0, 2, FALSE);
315         proto_tree_add_item(tree, hf_packetcable_trunk_group_id_trunk_number,
316                                                 tvb, 2, 4, FALSE);
317         return "";
318 }
319
320 static const gchar* dissect_packetcable_qos_descriptor(proto_tree* tree, tvbuff_t* tvb) {
321         guint8 packetcable_buf[64];
322         guint32 intval;
323         guint32 packetcable_qos_flags = tvb_get_ntohl(tvb, 0);
324         proto_item* ti = proto_tree_add_item(tree, hf_packetcable_qos_status, tvb, 0, 4, FALSE);
325         proto_tree* obj_tree = proto_item_add_subtree(ti, ett_radius_vendor_packetcable_qos_status);
326
327         guint packetcable_qos_off = 20;
328
329         proto_tree_add_item(obj_tree, hf_packetcable_qos_status_indication, tvb, 0, 4, FALSE);
330
331         for (intval = 0; intval < PACKETCABLE_QOS_DESC_BITFIELDS; intval++) {
332                 proto_tree_add_item(obj_tree, hf_packetcable_qos_desc_flags[intval], tvb, 0, 4, FALSE);
333         }
334
335         tvb_memcpy(tvb, packetcable_buf, 4, 16);
336         packetcable_buf[16] = '\0';
337
338         proto_tree_add_text(tree, tvb, 4, 16, "Service Class Name: %s", packetcable_buf);
339
340         for (intval = 0; intval < PACKETCABLE_QOS_DESC_BITFIELDS; intval++) {
341                 if (packetcable_qos_flags & packetcable_qos_desc_mask[intval]) {
342                         proto_tree_add_item(tree, hf_packetcable_qos_desc_fields[intval],
343                                                                 tvb, packetcable_qos_off, 4, FALSE);
344                         packetcable_qos_off += 4;
345                 }
346         }
347
348         return "";
349 }
350
351 static const gchar* dissect_packetcable_time_adjustment(proto_tree* tree, tvbuff_t* tvb) {
352         proto_tree_add_item(tree, hf_packetcable_time_adjustment, tvb, 0, 8, FALSE);
353
354         return "";
355 }
356
357 static const gchar* dissect_packetcable_redirected_from_info(proto_tree* tree, tvbuff_t* tvb) {
358         guint8 packetcable_buf[64];
359
360         tvb_memcpy(tvb, packetcable_buf, 0, 20); packetcable_buf[20] = '\0';
361         proto_tree_add_text(tree, tvb, 0, 20,
362                                                 "Last-Redirecting-Party: %s", packetcable_buf);
363
364         tvb_memcpy(tvb, packetcable_buf, 20, 20); packetcable_buf[20] = '\0';
365         proto_tree_add_text(tree, tvb, 20, 20,
366                                                 "Original-Called-Party: %s", packetcable_buf);
367
368         proto_tree_add_item(tree, hf_packetcable_redirected_from_info_number_of_redirections,
369                                                 tvb, 40, 2, FALSE);
370
371         return "";
372 }
373
374 static const gchar* dissect_packetcable_time_electr_surv_ind(proto_tree* tree, tvbuff_t* tvb) {
375
376         if (tvb_length(tvb) == 0)
377                 return "None";
378
379         proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_df_cdc_address,
380                                                 tvb, 0, 4, FALSE);
381         proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_df_ccc_address,
382                                                 tvb, 4, 4, FALSE);
383         proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_cdc_port,
384                                                 tvb, 8, 2, FALSE);
385         proto_tree_add_item(tree, hf_packetcable_electronic_surveillance_indication_ccc_port,
386                                                 tvb, 10, 2, FALSE);
387         proto_tree_add_text(tree, tvb, 12, tvb_length(tvb) - 12, "DF-DF-Key");
388
389         return "";
390 }
391
392 static const gchar* dissect_packetcable_surv_df_sec(proto_tree* tree _U_, tvbuff_t* tvb _U_) {
393                 return "";
394 }
395
396 #define PACKETCABLE_GENERAL_DISPLAY (1 << 0)
397 #define PACKETCABLE_CALLING_NUMBER  (1 << 1)
398 #define PACKETCABLE_CALLING_NAME    (1 << 2)
399 #define PACKETCABLE_MESSAGE_WAITING (1 << 3)
400
401 static const gchar* dissect_packetcable_term_dsply_info(proto_tree* tree, tvbuff_t* tvb) {
402         guint8 bitmask = tvb_get_guint8(tvb, 2);
403         guint intval = 1;
404         proto_item* ti = proto_tree_add_item(tree, hf_packetcable_terminal_display_info_terminal_display_status_bitmask,
405                                                          tvb, 0, 1, FALSE);
406         proto_tree* obj_tree = proto_item_add_subtree(ti, ett_packetcable_term_dsply);
407
408         proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_sbm_general_display,
409                                                 tvb, 0, 1, bitmask);
410         proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_sbm_calling_number,
411                                                 tvb, 0, 1, bitmask);
412         proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_sbm_calling_name,
413                                                 tvb, 0, 1, bitmask);
414         proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_sbm_message_waiting,
415                                                 tvb, 0, 1, bitmask);
416
417         if (bitmask & PACKETCABLE_GENERAL_DISPLAY) {
418                 proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_general_display,
419                                                         tvb, intval, 80, FALSE);
420                 intval += 80;
421         }
422
423         if (bitmask & PACKETCABLE_CALLING_NUMBER) {
424                 proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_calling_number,
425                                                         tvb, intval, 40, FALSE);
426                 intval += 40;
427         }
428
429         if (bitmask & PACKETCABLE_CALLING_NAME) {
430                 proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_calling_name,
431                                                         tvb, intval, 40, FALSE);
432                 intval += 40;
433         }
434
435         if (bitmask & PACKETCABLE_MESSAGE_WAITING) {
436                 proto_tree_add_item(obj_tree, hf_packetcable_terminal_display_info_message_waiting,
437                                                         tvb, intval, 40, FALSE);
438         }
439
440         return "";
441 }
442
443
444 void proto_register_packetcable(void) {
445
446         static hf_register_info hf[] = {
447                 { &hf_packetcable_em_header_version_id,
448                 { "Event Message Version ID","radius.vendor.pkt.emh.vid",
449                         FT_UINT16, BASE_DEC, NULL, 0x0,
450                         "PacketCable Event Message header version ID", HFILL }
451                 },
452                 { &hf_packetcable_bcid_timestamp,
453                 { "Timestamp","radius.vendor.pkt.bcid.ts",
454                         FT_UINT32, BASE_DEC, NULL, 0x0,
455                         "PacketCable Event Message BCID Timestamp", HFILL }
456                 },
457                 { &hf_packetcable_bcid_event_counter,
458                 { "Event Counter","radius.vendor.pkt.bcid.ec",
459                         FT_UINT32, BASE_DEC, NULL, 0x0,
460                         "PacketCable Event Message BCID Event Counter", HFILL }
461                 },
462                 { &hf_packetcable_em_header_event_message_type,
463                 { "Event Message Type","radius.vendor.pkt.emh.emt",
464                         FT_UINT16, BASE_DEC, radius_vendor_packetcable_event_message_vals, 0x0,
465                         "PacketCable Event Message Type", HFILL }
466                 },
467                 { &hf_packetcable_em_header_element_type,
468                 { "Element Type","radius.vendor.pkt.emh.et",
469                         FT_UINT16, BASE_DEC, packetcable_em_header_element_type_vals, 0x0,
470                         "PacketCable Event Message Element Type", HFILL }
471                 },
472                 { &hf_packetcable_em_header_sequence_number,
473                 { "Sequence Number","radius.vendor.pkt.emh.sn",
474                         FT_UINT32, BASE_DEC, NULL, 0x0,
475                         "PacketCable Event Message Sequence Number", HFILL }
476                 },
477                 { &hf_packetcable_em_header_status,
478                 { "Status","radius.vendor.pkt.emh.st",
479                         FT_UINT32, BASE_HEX, NULL, 0x0,
480                         "PacketCable Event Message Status", HFILL }
481                 },
482                 { &hf_packetcable_em_header_status_error_indicator,
483                 { "Status","radius.vendor.pkt.emh.st.ei",
484                         FT_UINT32, BASE_HEX, packetcable_em_header_status_error_indicator_vals,
485                         PACKETCABLE_EMHS_EI_MASK,
486                         "PacketCable Event Message Status Error Indicator", HFILL }
487                 },
488                 { &hf_packetcable_em_header_status_event_origin,
489                 { "Event Origin","radius.vendor.pkt.emh.st.eo",
490                         FT_UINT32, BASE_HEX, packetcable_em_header_status_event_origin_vals,
491                         PACKETCABLE_EMHS_EO_MASK,
492                         "PacketCable Event Message Status Event Origin", HFILL }
493                 },
494                 { &hf_packetcable_em_header_status_event_message_proxied,
495                 { "Event Message Proxied","radius.vendor.pkt.emh.st.emp",
496                         FT_UINT32, BASE_HEX, packetcable_em_header_status_event_message_proxied_vals,
497                         PACKETCABLE_EMHS_EMP_MASK,
498                         "PacketCable Event Message Status Event Message Proxied", HFILL }
499                 },
500                 { &hf_packetcable_em_header_priority,
501                 { "Priority","radius.vendor.pkt.emh.priority",
502                         FT_UINT8, BASE_DEC, NULL, 0x0,
503                         "PacketCable Event Message Priority", HFILL }
504                 },
505                 { &hf_packetcable_em_header_attribute_count,
506                 { "Attribute Count","radius.vendor.pkt.emh.ac",
507                         FT_UINT16, BASE_DEC, NULL, 0x0,
508                         "PacketCable Event Message Attribute Count", HFILL }
509                 },
510                 { &hf_packetcable_em_header_event_object,
511                 { "Event Object","radius.vendor.pkt.emh.eo",
512                         FT_UINT8, BASE_DEC, NULL, 0x0,
513                         "PacketCable Event Message Event Object", HFILL }
514                 },
515                 { &hf_packetcable_call_termination_cause_source_document,
516                 { "Source Document","radius.vendor.pkt.ctc.sd",
517                         FT_UINT16, BASE_HEX, packetcable_call_termination_cause_vals, 0x0,
518                         "PacketCable Call Termination Cause Source Document", HFILL }
519                 },
520                 { &hf_packetcable_call_termination_cause_code,
521                 { "Event Object","radius.vendor.pkt.ctc.cc",
522                         FT_UINT32, BASE_DEC, NULL, 0x0,
523                         "PacketCable Call Termination Cause Code", HFILL }
524                 },
525                 { &hf_packetcable_trunk_group_id_trunk_type,
526                 { "Trunk Type","radius.vendor.pkt.tgid.tt",
527                         FT_UINT16, BASE_HEX, packetcable_trunk_type_vals, 0x0,
528                         "PacketCable Trunk Group ID Trunk Type", HFILL }
529                 },
530                 { &hf_packetcable_trunk_group_id_trunk_number,
531                 { "Event Object","radius.vendor.pkt.tgid.tn",
532                         FT_UINT32, BASE_DEC, NULL, 0x0,
533                         "PacketCable Trunk Group ID Trunk Number", HFILL }
534                 },
535                 { &hf_packetcable_qos_status,
536                 { "QoS Status","radius.vendor.pkt.qs",
537                         FT_UINT32, BASE_HEX, NULL, 0x0,
538                         "PacketCable QoS Descriptor Attribute QoS Status", HFILL }
539                 },
540                 { &hf_packetcable_qos_status_indication,
541                 { "Status Indication","radius.vendor.pkt.qs.si",
542                         FT_UINT32, BASE_DEC, packetcable_state_indication_vals, PACKETCABLE_QOS_STATE_INDICATION_MASK,
543                         "PacketCable QoS Descriptor Attribute QoS State Indication", HFILL }
544                 },
545                 { &hf_packetcable_qos_desc_flags[0],
546                 { "Service Flow Scheduling Type","radius.vendor.pkt.qs.flags.sfst",
547                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_SERVICE_FLOW_SCHEDULING_TYPE_MASK,
548                         "PacketCable QoS Descriptor Attribute Bitmask: Service Flow Scheduling Type", HFILL }
549                 },
550                 { &hf_packetcable_qos_desc_flags[1],
551                 { "Grant Interval","radius.vendor.pkt.qs.flags.gi",
552                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_NOMINAL_GRANT_INTERVAL_MASK,
553                         "PacketCable QoS Descriptor Attribute Bitmask: Grant Interval", HFILL }
554                 },
555                 { &hf_packetcable_qos_desc_flags[2],
556                 { "Tolerated Grant Jitter","radius.vendor.pkt.qs.flags.tgj",
557                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_TOLERATED_GRANT_JITTER_MASK,
558                         "PacketCable QoS Descriptor Attribute Bitmask: Tolerated Grant Jitter", HFILL }
559                 },
560                 { &hf_packetcable_qos_desc_flags[3],
561                 { "Grants Per Interval","radius.vendor.pkt.qs.flags.gpi",
562                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_GRANTS_PER_INTERVAL_MASK,
563                         "PacketCable QoS Descriptor Attribute Bitmask: Grants Per Interval", HFILL }
564                 },
565                 { &hf_packetcable_qos_desc_flags[4],
566                 { "Unsolicited Grant Size","radius.vendor.pkt.qs.flags.ugs",
567                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_UNSOLICITED_GRANT_SIZE_MASK,
568                         "PacketCable QoS Descriptor Attribute Bitmask: Unsolicited Grant Size", HFILL }
569                 },
570                 { &hf_packetcable_qos_desc_flags[5],
571                 { "Traffic Priority","radius.vendor.pkt.qs.flags.tp",
572                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_TRAFFIC_PRIORITY_MASK,
573                         "PacketCable QoS Descriptor Attribute Bitmask: Traffic Priority", HFILL }
574                 },
575                 { &hf_packetcable_qos_desc_flags[6],
576                 { "Maximum Sustained Rate","radius.vendor.pkt.qs.flags.msr",
577                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_SUSTAINED_RATE_MASK,
578                         "PacketCable QoS Descriptor Attribute Bitmask: Maximum Sustained Rate", HFILL }
579                 },
580                 { &hf_packetcable_qos_desc_flags[7],
581                 { "Maximum Traffic Burst","radius.vendor.pkt.qs.flags.mtb",
582                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_TRAFFIC_BURST_MASK,
583                         "PacketCable QoS Descriptor Attribute Bitmask: Maximum Traffic Burst", HFILL }
584                 },
585                 { &hf_packetcable_qos_desc_flags[8],
586                 { "Minimum Reserved Traffic Rate","radius.vendor.pkt.qs.flags.mrtr",
587                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MINIMUM_RESERVED_TRAFFIC_RATE_MASK,
588                         "PacketCable QoS Descriptor Attribute Bitmask: Minimum Reserved Traffic Rate", HFILL }
589                 },
590                 { &hf_packetcable_qos_desc_flags[9],
591                 { "Minimum Packet Size","radius.vendor.pkt.qs.flags.mps",
592                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MINIMUM_PACKET_SIZE_MASK,
593                         "PacketCable QoS Descriptor Attribute Bitmask: Minimum Packet Size", HFILL }
594                 },
595                 { &hf_packetcable_qos_desc_flags[10],
596                 { "Maximum Concatenated Burst","radius.vendor.pkt.qs.flags.mcb",
597                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_CONCATENATED_BURST_MASK,
598                         "PacketCable QoS Descriptor Attribute Bitmask: Maximum Concatenated Burst", HFILL }
599                 },
600                 { &hf_packetcable_qos_desc_flags[11],
601                 { "Status Request/Transmission Policy","radius.vendor.pkt.qs.flags.srtp",
602                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_REQUEST_TRANSMISSION_POLICY_MASK,
603                         "PacketCable QoS Descriptor Attribute Bitmask: Status Request/Transmission Policy", HFILL }
604                 },
605                 { &hf_packetcable_qos_desc_flags[12],
606                 { "Nominal Polling Interval","radius.vendor.pkt.qs.flags.npi",
607                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_NOMINAL_POLLING_INTERVAL_MASK,
608                         "PacketCable QoS Descriptor Attribute Bitmask: Nominal Polling Interval", HFILL }
609                 },
610                 { &hf_packetcable_qos_desc_flags[13],
611                 { "Tolerated Poll Jitter","radius.vendor.pkt.qs.flags.tpj",
612                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_TOLERATED_POLL_JITTER_MASK,
613                         "PacketCable QoS Descriptor Attribute Bitmask: Tolerated Poll Jitter", HFILL }
614                 },
615                 { &hf_packetcable_qos_desc_flags[14],
616                 { "Type of Service Override","radius.vendor.pkt.qs.flags.toso",
617                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_IP_TYPE_OF_SERVICE_OVERRIDE_MASK,
618                         "PacketCable QoS Descriptor Attribute Bitmask: Type of Service Override", HFILL }
619                 },
620                 { &hf_packetcable_qos_desc_flags[15],
621                 { "Maximum Downstream Latency","radius.vendor.pkt.qs.flags.mdl",
622                         FT_UINT32, BASE_DEC, NULL, PACKETCABLE_MAXIMUM_DOWNSTREAM_LATENCY_MASK,
623                         "PacketCable QoS Descriptor Attribute Bitmask: Maximum Downstream Latency", HFILL }
624                 },
625                 { &hf_packetcable_qos_desc_fields[0],
626                 { "Service Flow Scheduling Type","radius.vendor.pkt.qs.sfst",
627                         FT_UINT32, BASE_DEC, NULL, 0x0,
628                         "PacketCable QoS Descriptor Attribute Service Flow Scheduling Type", HFILL }
629                 },
630                 { &hf_packetcable_qos_desc_fields[1],
631                 { "Grant Interval","radius.vendor.pkt.qs.gi",
632                         FT_UINT32, BASE_DEC, NULL, 0x0,
633                         "PacketCable QoS Descriptor Attribute Grant Interval", HFILL }
634                 },
635                 { &hf_packetcable_qos_desc_fields[2],
636                 { "Tolerated Grant Jitter","radius.vendor.pkt.qs.tgj",
637                         FT_UINT32, BASE_DEC, NULL, 0x0,
638                         "PacketCable QoS Descriptor Attribute Tolerated Grant Jitter", HFILL }
639                 },
640                 { &hf_packetcable_qos_desc_fields[3],
641                 { "Grants Per Interval","radius.vendor.pkt.qs.gpi",
642                         FT_UINT32, BASE_DEC, NULL, 0x0,
643                         "PacketCable QoS Descriptor Attribute Grants Per Interval", HFILL }
644                 },
645                 { &hf_packetcable_qos_desc_fields[4],
646                 { "Unsolicited Grant Size","radius.vendor.pkt.qs.ugs",
647                         FT_UINT32, BASE_DEC, NULL, 0x0,
648                         "PacketCable QoS Descriptor Attribute Unsolicited Grant Size", HFILL }
649                 },
650                 { &hf_packetcable_qos_desc_fields[5],
651                 { "Traffic Priority","radius.vendor.pkt.qs.tp",
652                         FT_UINT32, BASE_DEC, NULL, 0x0,
653                         "PacketCable QoS Descriptor Attribute Traffic Priority", HFILL }
654                 },
655                 { &hf_packetcable_qos_desc_fields[6],
656                 { "Maximum Sustained Rate","radius.vendor.pkt.qs.msr",
657                         FT_UINT32, BASE_DEC, NULL, 0x0,
658                         "PacketCable QoS Descriptor Attribute Maximum Sustained Rate", HFILL }
659                 },
660                 { &hf_packetcable_qos_desc_fields[7],
661                 { "Maximum Traffic Burst","radius.vendor.pkt.qs.mtb",
662                         FT_UINT32, BASE_DEC, NULL, 0x0,
663                         "PacketCable QoS Descriptor Attribute Maximum Traffic Burst", HFILL }
664                 },
665                 { &hf_packetcable_qos_desc_fields[8],
666                 { "Minimum Reserved Traffic Rate","radius.vendor.pkt.qs.mrtr",
667                         FT_UINT32, BASE_DEC, NULL, 0x0,
668                         "PacketCable QoS Descriptor Attribute Minimum Reserved Traffic Rate", HFILL }
669                 },
670                 { &hf_packetcable_qos_desc_fields[9],
671                 { "Minimum Packet Size","radius.vendor.pkt.qs.mps",
672                         FT_UINT32, BASE_DEC, NULL, 0x0,
673                         "PacketCable QoS Descriptor Attribute Minimum Packet Size", HFILL }
674                 },
675                 { &hf_packetcable_qos_desc_fields[10],
676                 { "Maximum Concatenated Burst","radius.vendor.pkt.qs.mcb",
677                         FT_UINT32, BASE_DEC, NULL, 0x0,
678                         "PacketCable QoS Descriptor Attribute Maximum Concatenated Burst", HFILL }
679                 },
680                 { &hf_packetcable_qos_desc_fields[11],
681                 { "Status Request/Transmission Policy","radius.vendor.pkt.qs.srtp",
682                         FT_UINT32, BASE_DEC, NULL, 0x0,
683                         "PacketCable QoS Descriptor Attribute Status Request/Transmission Policy", HFILL }
684                 },
685                 { &hf_packetcable_qos_desc_fields[12],
686                 { "Nominal Polling Interval","radius.vendor.pkt.qs.npi",
687                         FT_UINT32, BASE_DEC, NULL, 0x0,
688                         "PacketCable QoS Descriptor Attribute Nominal Polling Interval", HFILL }
689                 },
690                 { &hf_packetcable_qos_desc_fields[13],
691                 { "Tolerated Poll Jitter","radius.vendor.pkt.qs.tpj",
692                         FT_UINT32, BASE_DEC, NULL, 0x0,
693                         "PacketCable QoS Descriptor Attribute Tolerated Poll Jitter", HFILL }
694                 },
695                 { &hf_packetcable_qos_desc_fields[14],
696                 { "Type of Service Override","radius.vendor.pkt.qs.toso",
697                         FT_UINT32, BASE_DEC, NULL, 0x0,
698                         "PacketCable QoS Descriptor Attribute Type of Service Override", HFILL }
699                 },
700                 { &hf_packetcable_qos_desc_fields[15],
701                 { "Maximum Downstream Latency","radius.vendor.pkt.qs.mdl",
702                         FT_UINT32, BASE_DEC, NULL, 0x0,
703                         "PacketCable QoS Descriptor Attribute Maximum Downstream Latency", HFILL }
704                 },
705                 { &hf_packetcable_time_adjustment,
706                 { "Time Adjustment","radius.vendor.pkt.ti",
707                         FT_UINT64, BASE_DEC, NULL, 0x0,
708                         "PacketCable Time Adjustment", HFILL }
709                 },
710                 { &hf_packetcable_redirected_from_info_number_of_redirections,
711                 { "Number-of-Redirections","radius.vendor.pkt.rfi.nr",
712                         FT_UINT16, BASE_DEC, NULL, 0x0,
713                         "PacketCable Redirected-From-Info Number-of-Redirections", HFILL }
714                 },
715                 { &hf_packetcable_electronic_surveillance_indication_df_cdc_address,
716                 { "DF_CDC_Address","radius.vendor.pkt.esi.dfcdca",
717                         FT_IPv4, BASE_NONE, NULL, 0x0,
718                         "PacketCable Electronic-Surveillance-Indication DF_CDC_Address", HFILL }
719                 },
720                 { &hf_packetcable_electronic_surveillance_indication_df_ccc_address,
721                 { "DF_CDC_Address","radius.vendor.pkt.esi.dfccca",
722                         FT_IPv4, BASE_NONE, NULL, 0x0,
723                         "PacketCable Electronic-Surveillance-Indication DF_CCC_Address", HFILL }
724                 },
725                 { &hf_packetcable_electronic_surveillance_indication_cdc_port,
726                 { "CDC-Port","radius.vendor.pkt.esi.cdcp",
727                         FT_UINT16, BASE_DEC, NULL, 0x0,
728                         "PacketCable Electronic-Surveillance-Indication CDC-Port", HFILL }
729                 },
730                 { &hf_packetcable_electronic_surveillance_indication_ccc_port,
731                 { "CCC-Port","radius.vendor.pkt.esi.cccp",
732                         FT_UINT16, BASE_DEC, NULL, 0x0,
733                         "PacketCable Electronic-Surveillance-Indication CCC-Port", HFILL }
734                 },
735
736                 { &hf_packetcable_terminal_display_info_terminal_display_status_bitmask,
737                 { "Terminal_Display_Status_Bitmask","radius.vendor.pkt.tdi.sbm",
738                         FT_UINT8, BASE_HEX, NULL, 0xff,
739                         "PacketCable Terminal_Display_Info Terminal_Display_Status_Bitmask", HFILL }
740                 },
741                 { &hf_packetcable_terminal_display_info_sbm_general_display,
742                 { "General_Display","radius.vendor.pkt.tdi.sbm.gd",
743                         FT_BOOLEAN, 8, NULL, 0x01,
744                         "PacketCable Terminal_Display_Info Terminal_Display_Status_Bitmask General_Display", HFILL }
745                 },
746                 { &hf_packetcable_terminal_display_info_sbm_calling_number,
747                 { "Calling_Number","radius.vendor.pkt.tdi.sbm.cnum",
748                         FT_BOOLEAN, 8, NULL, 0x02,
749                         "PacketCable Terminal_Display_Info Terminal_Display_Status_Bitmask Calling_Number", HFILL }
750                 },
751                 { &hf_packetcable_terminal_display_info_sbm_calling_name,
752                 { "Calling_Name","radius.vendor.pkt.tdi.sbm.cname",
753                         FT_BOOLEAN, 8, NULL, 0x04,
754                         "PacketCable Terminal_Display_Info Terminal_Display_Status_Bitmask Calling_Name", HFILL }
755                 },
756                 { &hf_packetcable_terminal_display_info_sbm_message_waiting,
757                 { "Message_Waiting","radius.vendor.pkt.tdi.sbm.mw",
758                         FT_BOOLEAN, 8, NULL, 0x08,
759                         "PacketCable Terminal_Display_Info Terminal_Display_Status_Bitmask Message_Waiting", HFILL }
760                 },
761                 { &hf_packetcable_terminal_display_info_general_display,
762                 { "General_Display","radius.vendor.pkt.tdi.gd",
763                         FT_STRING, BASE_NONE, NULL, 0,
764                         "PacketCable Terminal_Display_Info General_Display", HFILL }
765                 },
766                 { &hf_packetcable_terminal_display_info_calling_number,
767                 { "Calling_Number","radius.vendor.pkt.tdi.cnum",
768                         FT_STRING, BASE_NONE, NULL, 0,
769                         "PacketCable Terminal_Display_Info Calling_Number", HFILL }
770                 },
771                 { &hf_packetcable_terminal_display_info_calling_name,
772                 { "Calling_Name","radius.vendor.pkt.tdi.cname",
773                         FT_STRING, BASE_NONE, NULL, 0,
774                         "PacketCable Terminal_Display_Info Calling_Name", HFILL }
775                 },
776                 { &hf_packetcable_terminal_display_info_message_waiting,
777                 { "Message_Waiting","radius.vendor.pkt.tdi.mw",
778                         FT_STRING, BASE_NONE, NULL, 0,
779                         "PacketCable Terminal_Display_Info Message_Waiting", HFILL }
780                 }
781         };
782
783         static gint *ett[] = {
784                 &ett_radius_vendor_packetcable_bcid,
785                 &ett_radius_vendor_packetcable_status,
786                 &ett_radius_vendor_packetcable_qos_status,
787                 &ett_packetcable_term_dsply
788         };
789
790         proto_packetcable = proto_register_protocol("PacketCable AVPs", "PACKETCABLE", "paketcable_avps");
791
792         proto_register_field_array(proto_packetcable, hf, array_length(hf));
793         proto_register_subtree_array(ett, array_length(ett));
794 }
795
796 void
797 proto_reg_handoff_packetcable(void)
798 {
799
800         radius_register_avp_dissector(VENDOR_CABLELABS, 1, dissect_packetcable_em_hdr);
801         radius_register_avp_dissector(VENDOR_CABLELABS, 11, dissect_packetcable_call_term_cause);
802         radius_register_avp_dissector(VENDOR_CABLELABS, 13, dissect_packetcable_rel_call_billing_correlation);
803         radius_register_avp_dissector(VENDOR_CABLELABS, 24, dissect_packetcable_trunk_group_id);
804         radius_register_avp_dissector(VENDOR_CABLELABS, 32, dissect_packetcable_qos_descriptor);
805         radius_register_avp_dissector(VENDOR_CABLELABS, 38, dissect_packetcable_time_adjustment);
806         radius_register_avp_dissector(VENDOR_CABLELABS, 43, dissect_packetcable_redirected_from_info);
807         radius_register_avp_dissector(VENDOR_CABLELABS, 44, dissect_packetcable_time_electr_surv_ind);
808         radius_register_avp_dissector(VENDOR_CABLELABS, 47, dissect_packetcable_surv_df_sec);
809         radius_register_avp_dissector(VENDOR_CABLELABS, 54, dissect_packetcable_term_dsply_info);
810 /*      radius_register_avp_dissector(VENDOR_CABLELABS, 90, dissect_packetcable_party_info);
811         radius_register_avp_dissector(VENDOR_CABLELABS, 91, dissect_packetcable_party_info);
812         radius_register_avp_dissector(VENDOR_CABLELABS, 92, dissect_packetcable_party_info); */
813 }
814