2 * Routines for unistim packet dissection
3 * Copyright 2007 Don Newton <dnewton@cypresscom.net>
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #include <epan/packet.h>
34 #include <epan/emem.h>
35 #include <epan/expert.h>
36 #include <epan/address.h>
37 #include <epan/prefs.h>
38 #include <epan/dissectors/packet-rtp.h>
39 #include <epan/dissectors/packet-rtcp.h>
41 #include "packet-unistim.h"
48 #include "broadcast.h"
51 /* Don't set this to 5000 until this dissector is made a heuristic one!
52 It collides (at least) with tapa. */
53 static guint global_unistim_port = 0;
55 static unistim_info_t *uinfo;
56 static int unistim_tap = -1;
58 void proto_reg_handoff_unistim(void);
59 static void dissect_payload(proto_tree *unistim_tree,tvbuff_t *tvb,gint offset, packet_info *pinfo);
60 static void dissect_unistim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
62 static gint dissect_broadcast_switch(proto_tree *msg_tree,
63 tvbuff_t *tvb,gint offset,guint msg_len);
64 static gint dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
65 tvbuff_t *tvb,gint offset,guint msg_len);
66 static gint dissect_display_switch(proto_tree *msg_tree,
67 tvbuff_t *tvb,gint offset,guint msg_len);
68 static gint dissect_key_indicator_switch(proto_tree *msg_tree,
69 tvbuff_t *tvb,gint offset,guint msg_len);
70 static gint dissect_basic_switch(proto_tree *msg_tree,
71 tvbuff_t *tvb,gint offset,guint msg_len);
72 static gint dissect_network_switch(proto_tree *msg_tree,
73 tvbuff_t *tvb,gint offset,guint msg_len);
74 static gint dissect_broadcast_phone(proto_tree *msg_tree,
75 tvbuff_t *tvb,gint offset,guint msg_len);
76 static gint dissect_audio_phone(proto_tree *msg_tree,
77 tvbuff_t *tvb,gint offset,guint msg_len);
78 static gint dissect_display_phone(proto_tree *msg_tree,
79 tvbuff_t *tvb,gint offset,guint msg_len);
80 static gint dissect_key_indicator_phone(proto_tree *msg_tree,
81 tvbuff_t *tvb,gint offset,guint msg_len);
82 static gint dissect_basic_phone(proto_tree *msg_tree,
83 tvbuff_t *tvb,gint offset,guint msg_len);
84 static gint dissect_network_phone(proto_tree *msg_tree,
85 tvbuff_t *tvb,gint offset,guint msg_len);
86 static gint dissect_unistim_message(proto_tree *unistim_tree, packet_info *pinfo,
87 tvbuff_t *tvb,gint offset);
88 static gint dissect_uftp_message(proto_tree *unistim_tree, packet_info *pinfo,
89 tvbuff_t *tvb,gint offset);
92 static void set_ascii_item(proto_tree *unistim_tree, tvbuff_t *tvb,
93 gint offset,guint msg_len);
94 static void set_ascii_null_term_item(proto_tree *msg_tree,tvbuff_t *tvb,
95 gint offset,guint msg_len, char *label);
98 static int proto_unistim = -1;
99 static int hf_unistim_seq_nu = -1;
100 static int hf_unistim_packet_type = -1;
101 static int hf_unistim_payload = -1;
102 static int hf_unistim_cmd_add = -1;
103 static int hf_unistim_len =-1;
104 static int hf_terminal_id=-1;
105 static int hf_basic_bit_field=-1;
106 static const true_false_string basic_bit_yn={
107 "For Following Byte",
111 static int hf_basic_switch_cmd=-1;
112 static int hf_basic_phone_cmd=-1;
113 static int hf_broadcast_switch_cmd=-1;
114 static int hf_broadcast_phone_cmd=-1;
115 static int hf_audio_switch_cmd=-1;
116 static int hf_audio_phone_cmd=-1;
117 static int hf_display_switch_cmd=-1;
118 static int hf_display_phone_cmd=-1;
119 static int hf_key_switch_cmd=-1;
120 static int hf_key_phone_cmd=-1;
121 static int hf_network_switch_cmd=-1;
122 static int hf_network_phone_cmd=-1;
124 static int hf_generic_data=-1;
125 static int hf_generic_string=-1;
127 static gint ett_unistim = -1;
129 static const value_string packet_names[]={
136 static const value_string payload_names[]={
137 {0x00,"NULL Protocol"},
138 {0x01,"Aggregate Unistim"},
139 {0x02,"Aggregate Unistim with Terminal ID"},
141 {0xff,"Free Form Protocol"},
145 static const range_string sequence_numbers[]={
146 {0x00,0xFFFFFFFE,"Normal Sequence Number"},
147 {0xFFFFFFFF,0xFFFFFFFF, "RESET Sequence Number"},
151 static const value_string command_address[]={
152 {0x11,"Broadcast Manager Switch"},
153 {0x16,"Audio Manager Switch"},
154 {0x17,"Display Manager Switch"},
155 {0x19,"Key/Indicator Manager Switch"},
156 {0x1a,"Basic Manager Switch"},
157 {0x1e,"Network Manager Switch"},
158 {0x91,"Broadcast Manager Phone"},
159 {0x96,"Audio Manager Phone"},
160 {0x97,"Display Manager Phone"},
161 {0x99,"Key/Indicator Manager Phone"},
162 {0x9a,"Basic Manager Phone"},
163 {0x9e,"Network Manager Phone"},
167 #include "header_field.h"
170 proto_register_unistim(void){
172 module_t* unistim_module;
174 /* Setup protocol subtree array */
176 static gint *ett[] = {
180 proto_unistim=proto_register_protocol("UNISTIM Protocol", "UNISTIM", "unistim");
182 proto_register_subtree_array(ett,array_length(ett));
183 proto_register_field_array(proto_unistim,hf,array_length(hf));
185 unistim_tap = register_tap("unistim");
187 unistim_module = prefs_register_protocol(proto_unistim, proto_reg_handoff_unistim);
189 prefs_register_uint_preference(unistim_module, "udp.port", "UNISTIM UDP port",
190 "UNISTIM port (default 5000)", 10, &global_unistim_port);
194 proto_reg_handoff_unistim(void) {
195 static gboolean initialized = FALSE;
196 static dissector_handle_t unistim_handle;
197 static guint unistim_port;
200 unistim_handle=create_dissector_handle(dissect_unistim,proto_unistim);
201 dissector_add_handle("udp.port", unistim_handle); /* for "decode as" */
204 if (unistim_port != 0) {
205 dissector_delete("udp.port",unistim_port,unistim_handle);
209 if (global_unistim_port != 0) {
210 dissector_add("udp.port",global_unistim_port,unistim_handle);
212 unistim_port = global_unistim_port;
217 dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree){
219 proto_item *ti= NULL;
220 proto_item *ti1= NULL;
221 proto_tree *overall_unistim_tree = NULL;
222 proto_tree *rudpm_tree=NULL;
223 if(check_col(pinfo->cinfo,COL_PROTOCOL))
224 col_set_str(pinfo->cinfo,COL_PROTOCOL,"UNISTIM");
225 /* Clear out stuff in the info column */
226 if (check_col(pinfo->cinfo,COL_INFO)) {
227 col_clear(pinfo->cinfo,COL_INFO);
229 ti = proto_tree_add_item(tree,proto_unistim,tvb,offset,-1,FALSE);
230 overall_unistim_tree = proto_item_add_subtree(ti,ett_unistim);
231 ti1=proto_tree_add_text(overall_unistim_tree,tvb,offset,5,"Reliable UDP");
232 rudpm_tree=proto_item_add_subtree(ti1,ett_unistim);
234 proto_tree_add_item(rudpm_tree,hf_unistim_seq_nu,tvb,offset,4,FALSE);
236 /* Allocate new mem for queueing */
237 uinfo = se_alloc(sizeof(unistim_info_t));
239 /* Clear tap struct */
240 uinfo->rudp_type = 0;
241 uinfo->payload_type = 0;
242 uinfo->sequence = tvb_get_ntohl(tvb,offset);
245 uinfo->key_state = -1;
246 uinfo->hook_state = -1;
247 uinfo->stream_connect = -1;
248 uinfo->trans_connect = -1;
249 uinfo->set_termid = -1;
250 uinfo->string_data = NULL;
251 uinfo->key_buffer = NULL;
252 SET_ADDRESS(&uinfo->it_ip, AT_NONE, 0, NULL);
253 SET_ADDRESS(&uinfo->ni_ip, AT_NONE, 0, NULL);
257 proto_tree_add_item(rudpm_tree,hf_unistim_packet_type,tvb,offset,1,FALSE);
258 uinfo->rudp_type = tvb_get_guint8(tvb,offset);
260 switch(tvb_get_guint8(tvb,offset)) {
263 if (check_col(pinfo->cinfo, COL_INFO))
264 col_add_fstr(pinfo->cinfo, COL_INFO, "NAK for seq - 0x%X",
265 tvb_get_ntohl(tvb, offset-4));
269 if (check_col(pinfo->cinfo, COL_INFO))
270 col_add_fstr(pinfo->cinfo, COL_INFO, "ACK for seq - 0x%X",
271 tvb_get_ntohl(tvb, offset-4));
274 if (check_col(pinfo->cinfo, COL_INFO))
275 col_add_fstr(pinfo->cinfo, COL_INFO, "Payload seq - 0x%X",
276 tvb_get_ntohl(tvb, offset-4));
278 dissect_payload(overall_unistim_tree,tvb,offset,pinfo);
281 if (check_col(pinfo->cinfo, COL_INFO))
282 col_add_fstr(pinfo->cinfo, COL_INFO, "Unknown seq - 0x%X",
283 tvb_get_ntohl(tvb, offset-4));
287 /* Queue packet for tap */
288 tap_queue_packet(unistim_tap, pinfo, uinfo);
292 dissect_payload(proto_tree *overall_unistim_tree,tvbuff_t *tvb, gint offset, packet_info *pinfo){
294 proto_tree *unistim_tree;
295 guint payload_proto=tvb_get_guint8(tvb,offset);
297 /* Payload type for tap */
298 uinfo->payload_type = payload_proto;
300 ti=proto_tree_add_item(overall_unistim_tree,hf_unistim_payload,
303 unistim_tree=proto_item_add_subtree(ti,ett_unistim);
305 switch(payload_proto){
307 /*NULL PROTO - NOTHING LEFT TO DO*/
310 /*UNISTIM only so no term id but further payload work*/
311 /* Collect info for tap */
312 /* If no term id then packet sourced from NI */
313 COPY_ADDRESS(&(uinfo->ni_ip), &(pinfo->src));
314 COPY_ADDRESS(&(uinfo->it_ip), &(pinfo->dst));
315 uinfo->it_port = pinfo->destport;
318 /*UNISTIM with term id*/
319 /* Termid packs are always sourced from the it, so collect relevant infos */
320 COPY_ADDRESS(&(uinfo->ni_ip),&(pinfo->dst));
321 COPY_ADDRESS(&(uinfo->it_ip),&(pinfo->src));
322 uinfo->it_port = pinfo->srcport;
323 uinfo->termid = tvb_get_ntohl(tvb,offset);
325 proto_tree_add_item(unistim_tree,hf_terminal_id,tvb,offset,4,FALSE);
330 offset = dissect_uftp_message(unistim_tree,pinfo,tvb,offset);
333 /*TODO flesh this out probably only for init*/
337 /* Handle UFTP seperately because it is significantly different
338 than standard UNISTIM */
339 while (tvb_length_remaining(tvb, offset) > 0)
340 offset = dissect_unistim_message(unistim_tree,pinfo,tvb,offset);
345 dissect_uftp_message(proto_tree *unistim_tree,packet_info *pinfo _U_,tvbuff_t *tvb,gint offset){
351 proto_tree *msg_tree;
353 ti = proto_tree_add_text(unistim_tree,tvb,offset,-1,"UFTP CMD");
355 msg_tree = proto_item_add_subtree(ti,ett_unistim);
357 command=tvb_get_guint8(tvb,offset);
359 proto_tree_add_item(msg_tree,hf_uftp_command,tvb,offset,1,FALSE);
366 /* Connection request */
371 /* Connection Details */
372 /* Get datablock size */
373 proto_tree_add_item(msg_tree,hf_uftp_datablock_size,tvb,offset,2,FALSE);
375 /* Get datablock limit b4 flow control */
376 proto_tree_add_item(msg_tree,hf_uftp_datablock_limit,tvb,offset,1,FALSE);
379 str_len = tvb_length_remaining(tvb, offset);
380 proto_tree_add_item(msg_tree,hf_uftp_filename,tvb,offset,str_len,FALSE);
385 /* Flow Control off */
390 /* Connection Granted */
395 /* Connection Denied */
400 /* File Data Block */
402 dat_len = tvb_length_remaining(tvb, offset);
403 proto_tree_add_item(msg_tree,hf_uftp_datablock,tvb,offset,dat_len,FALSE);
414 dissect_unistim_message(proto_tree *unistim_tree,packet_info *pinfo,tvbuff_t *tvb,gint offset){
418 proto_tree *msg_tree;
420 ti = proto_tree_add_text(unistim_tree,tvb,offset,-1,"Unistim CMD");
422 msg_tree = proto_item_add_subtree(ti,ett_unistim);
424 address=tvb_get_guint8(tvb,offset);
426 proto_tree_add_item(msg_tree,hf_unistim_cmd_add,tvb,offset,1,FALSE);
429 msg_len=tvb_get_guint8(tvb,offset);
433 ti=proto_tree_add_item(msg_tree,hf_unistim_len,tvb,offset,1,FALSE);
434 expert_add_info_format(pinfo,ti,PI_MALFORMED,PI_ERROR,"Length too short");
435 return tvb_length(tvb);
437 proto_item_set_len(ti,msg_len);
438 proto_tree_add_item(msg_tree,hf_unistim_len,tvb,offset,1,FALSE);
448 /*Broadcast Manager Switch*/
449 offset = dissect_broadcast_switch(msg_tree,tvb,offset,msg_len-2);
452 /*Audio Manager Switch*/
453 offset = dissect_audio_switch(msg_tree,pinfo,tvb,offset,msg_len-2);
456 /*Display Manager Switch*/
457 offset = dissect_display_switch(msg_tree,tvb,offset,msg_len-2);
460 /*Key Indicator Manager Switch*/
461 offset = dissect_key_indicator_switch(msg_tree,tvb,offset,msg_len-2);
464 /*Basic Manager Switch*/
465 offset = dissect_basic_switch(msg_tree,tvb,offset,msg_len-2);
468 /*Network Manager Switch*/
469 offset = dissect_network_switch(msg_tree,tvb,offset,msg_len-2);
472 /*Broadcast Manager phone*/
473 offset = dissect_broadcast_phone(msg_tree,tvb,offset,msg_len-2);
476 /*Audio Manager phone*/
477 offset = dissect_audio_phone(msg_tree,tvb,offset,msg_len-2);
480 /*Display Manager phone*/
481 offset = dissect_display_phone(msg_tree,tvb,offset,msg_len-2);
484 /*Key/Indicator Manager phone*/
485 offset = dissect_key_indicator_phone(msg_tree,tvb,offset,msg_len-2);
488 /*Basic Manager phone*/
489 offset = dissect_basic_phone(msg_tree,tvb,offset,msg_len-2);
492 /*Network Manager Switch*/
493 offset = dissect_network_phone(msg_tree,tvb,offset,msg_len-2);
496 /*See some undocumented messages. Don't want to miss the ones we understand*/
497 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len-2,FALSE);
508 dissect_basic_phone(proto_tree *msg_tree,
509 tvbuff_t *tvb,gint offset, guint msg_len){
513 basic_cmd=tvb_get_guint8(tvb,offset);
515 ti=proto_tree_add_item(msg_tree,hf_basic_phone_cmd,tvb,offset,1,FALSE);
517 offset+=1;msg_len-=1;
521 /*Basic Manager Attributes Info*/
522 proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_stat_cksum,
525 proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_dynam,
528 proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_net_config_cksum,
533 /*Basic Manager Options Report*/
534 proto_tree_add_item(msg_tree,hf_basic_switch_options_secure,
540 proto_tree_add_item(msg_tree,hf_basic_phone_fw_ver,
541 tvb,offset,msg_len,FALSE);
546 proto_tree_add_item(msg_tree,hf_basic_it_type,tvb,offset,1,FALSE);
551 proto_tree_add_item(msg_tree,hf_basic_phone_hw_id,
552 tvb,offset,msg_len,FALSE);
556 /*Product Engineering Code*/
557 proto_tree_add_item(msg_tree,hf_basic_prod_eng_code,
558 tvb,offset,msg_len,FALSE);
563 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
567 /*Encapsulate Command*/
568 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
572 /*Phone Ethernet address*/
573 proto_tree_add_item(msg_tree,hf_basic_ether_address,
574 tvb,offset,msg_len,FALSE);
578 /*not in pdf but get them*/
579 set_ascii_item(msg_tree,tvb,offset,msg_len);
586 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
594 dissect_basic_switch(proto_tree *msg_tree,
595 tvbuff_t *tvb,gint offset,guint msg_len){
597 basic_cmd=tvb_get_guint8(tvb,offset);
598 proto_tree_add_item(msg_tree,hf_basic_switch_cmd,tvb,offset,1,FALSE);
599 offset+=1;msg_len-=1;
602 /*Query Basic Manager*/
603 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
604 proto_tree_add_item(msg_tree,hf_basic_switch_query_attr,
606 proto_tree_add_item(msg_tree,hf_basic_switch_query_opts,
608 proto_tree_add_item(msg_tree,hf_basic_switch_query_fw,
610 proto_tree_add_item(msg_tree,hf_basic_switch_query_hw_id,
612 proto_tree_add_item(msg_tree,hf_basic_switch_query_it_type,
614 proto_tree_add_item(msg_tree,hf_basic_switch_query_prod_eng_code,
616 proto_tree_add_item(msg_tree,hf_basic_switch_query_gray_mkt_info,
621 /*Basic Manager Options*/
622 proto_tree_add_item(msg_tree,hf_basic_switch_options_secure,
628 proto_tree_add_item(msg_tree,hf_basic_switch_element_id,
631 proto_tree_add_item(msg_tree,hf_basic_switch_eeprom_data,
632 tvb,offset,msg_len,FALSE);
636 /*Assign Terminal ID*/
638 uinfo->set_termid = 1;
640 proto_tree_add_item(msg_tree,hf_basic_switch_terminal_id,
641 tvb,offset,msg_len,FALSE);
645 /*Encapsulate Command*/
646 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
650 /*showing up in captures but not in pdf*/
651 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
657 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
668 dissect_broadcast_switch(proto_tree *msg_tree,
669 tvbuff_t *tvb,gint offset, guint msg_len){
671 guint year,month,day,hour,minute,second;
672 proto_item *date_label;
673 proto_item *time_label;
674 proto_tree *date_tree;
675 proto_tree *time_tree;
676 bcast_cmd=tvb_get_guint8(tvb,offset);
677 proto_tree_add_item(msg_tree,hf_broadcast_switch_cmd,tvb,offset,1,FALSE);
681 /*Accessory Sync Update - len=3 */
684 /*Logical Icon Update*/
685 proto_tree_add_item(msg_tree,hf_basic_bit_field,
687 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,
689 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,
694 /*Time and Date Download*/
695 year=tvb_get_guint8(tvb,offset);
696 month=tvb_get_guint8(tvb,offset+1);
697 day=tvb_get_guint8(tvb,offset+2);
698 hour=tvb_get_guint8(tvb,offset+3);
699 minute=tvb_get_guint8(tvb,offset+4);
700 second=tvb_get_guint8(tvb,offset+5);
701 date_label=proto_tree_add_text(msg_tree,tvb,offset,3,
702 "Date %i/%i/%i",month,day,year%100);
703 date_tree=proto_item_add_subtree(date_label,ett_unistim);
704 proto_tree_add_item(date_tree,hf_broadcast_year,tvb,offset,1,FALSE);
706 proto_tree_add_item(date_tree,hf_broadcast_month,tvb,offset,1,FALSE);
708 proto_tree_add_item(date_tree,hf_broadcast_day,tvb,offset,1,FALSE);
711 time_label=proto_tree_add_text(msg_tree,tvb,offset,3,
712 "Time %i:%i:%i",hour,minute,second);
713 time_tree=proto_item_add_subtree(time_label,ett_unistim);
714 proto_tree_add_item(time_tree,hf_broadcast_hour,tvb,offset,1,FALSE);
716 proto_tree_add_item(time_tree,hf_broadcast_minute,tvb,offset,1,FALSE);
718 proto_tree_add_item(time_tree,hf_broadcast_second,tvb,offset,1,FALSE);
722 /*Set Default Character Table Config */
723 /* UGLY may work may not*/
724 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
731 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
737 /*DONE Haven't seen any phone broadcasts, wouldn't expect to*/
739 dissect_broadcast_phone(proto_tree *msg_tree,
740 tvbuff_t *tvb, gint offset,guint msg_len){
742 proto_tree_add_item(msg_tree,hf_generic_data, tvb,offset,msg_len,FALSE);
750 dissect_display_switch(proto_tree *msg_tree,
751 tvbuff_t *tvb, gint offset,guint msg_len){
754 guint time_date_mask;
758 proto_tree *address_tree;
760 display_cmd=tvb_get_guint8(tvb,offset);
761 proto_tree_add_item(msg_tree,hf_display_switch_cmd,tvb,offset,1,FALSE);
762 offset+=1;msg_len-=1;
766 /*Restore Default Character Table Configuration length = 3*/
770 proto_tree_add_item(msg_tree,hf_display_arrow,tvb,offset,1,FALSE);
774 /*Query Status Bar Icon*/
775 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
779 /*Highlight Off length = 3*/
782 /*Highlight On length = 3*/
785 /*Restore Time and Date length = 3*/
788 /*Clear Time and Date length = 3*/
791 /*Call Duration Timer*/
792 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
793 proto_tree_add_item(msg_tree,hf_display_call_timer_mode,tvb,offset,
795 proto_tree_add_item(msg_tree,hf_display_call_timer_reset,tvb,offset,
797 proto_tree_add_item(msg_tree,hf_display_call_timer_display,tvb,offset,
799 proto_tree_add_item(msg_tree,hf_display_call_timer_delay,tvb,offset,
801 offset+=1;msg_len-=1;
802 proto_tree_add_item(msg_tree,hf_display_call_timer_id,tvb,offset,
804 offset+=1;msg_len-=1;
807 /*Query Display Manager*/
808 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
812 /*Download Call Duration Timer Delay*/
813 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
817 /*Disable Display Field*/
818 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
823 clear_mask=tvb_get_guint8(tvb,offset);
824 /*need to know which paths to take*/
825 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
826 proto_tree_add_item(msg_tree,hf_display_clear_numeric,
828 proto_tree_add_item(msg_tree,hf_display_clear_context,
830 proto_tree_add_item(msg_tree,hf_display_clear_date,
833 proto_tree_add_item(msg_tree,hf_display_clear_time,
835 proto_tree_add_item(msg_tree,hf_display_clear_line,
837 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon,
839 proto_tree_add_item(msg_tree,hf_display_clear_softkey,
841 proto_tree_add_item(msg_tree,hf_display_clear_softkey_label,
843 offset+=1;msg_len-=1;
844 if((clear_mask&DISPLAY_CLEAR_LINE)==DISPLAY_CLEAR_LINE){
845 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
846 proto_tree_add_item(msg_tree,hf_display_clear_line_1,
848 proto_tree_add_item(msg_tree,hf_display_clear_line_2,
850 proto_tree_add_item(msg_tree,hf_display_clear_line_3,
852 proto_tree_add_item(msg_tree,hf_display_clear_line_4,
854 proto_tree_add_item(msg_tree,hf_display_clear_line_5,
856 proto_tree_add_item(msg_tree,hf_display_clear_line_6,
858 proto_tree_add_item(msg_tree,hf_display_clear_line_7,
860 proto_tree_add_item(msg_tree,hf_display_clear_line_8,
862 offset+=1;msg_len-=1;
864 if((clear_mask&DISPLAY_CLEAR_STATUS_BAR_ICON)==
865 DISPLAY_CLEAR_STATUS_BAR_ICON){
866 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
867 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_1,
869 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_2,
871 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_3,
873 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_4,
875 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_5,
877 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_6,
879 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_7,
881 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_8,
883 offset+=1;msg_len-=1;
885 if((clear_mask&DISPLAY_CLEAR_SOFTKEY)==DISPLAY_CLEAR_SOFTKEY){
886 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
887 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_1,
889 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_2,
891 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_3,
893 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_4,
895 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_5,
897 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_6,
899 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_7,
901 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_8,
903 offset+=1;msg_len-=1;
905 if((clear_mask&DISPLAY_CLEAR_SOFTKEY_LABEL)==DISPLAY_CLEAR_SOFTKEY_LABEL){
906 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
907 proto_tree_add_item(msg_tree,hf_display_clear_sk_label_key_id,tvb,offset,1,FALSE);
908 proto_tree_add_item(msg_tree,hf_display_clear_all_slks,tvb,offset,1,FALSE);
909 offset+=1;msg_len-=1;
914 movement_byte=tvb_get_guint8(tvb,offset);
915 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
916 proto_tree_add_item(msg_tree,hf_display_cursor_move_cmd,tvb,offset,1,FALSE);
917 proto_tree_add_item(msg_tree,hf_display_cursor_blink,tvb,offset,1,FALSE);
918 offset+=1;msg_len-=1;
923 if((movement_byte&0x01)==0x01){
924 address_byte=tvb_get_guint8(tvb,offset);
925 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
926 proto_tree_add_item(msg_tree,hf_display_write_address_numeric,
928 proto_tree_add_item(msg_tree,hf_display_write_address_context,
930 proto_tree_add_item(msg_tree,hf_display_write_address_line,
932 proto_tree_add_item(msg_tree,hf_display_write_address_soft_key,
934 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
935 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)
936 proto_tree_add_item(msg_tree,
937 hf_display_write_address_softkey_id,
939 offset+=1;msg_len-=1;
945 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
946 proto_tree_add_item(msg_tree,hf_display_write_address_char_pos,
948 proto_tree_add_item(msg_tree,hf_display_write_address_line_number,
950 offset+=1;msg_len-=1;
953 /*Display Scroll with Data (before)*/
954 set_ascii_item(msg_tree,tvb,offset,msg_len);
958 /*Display Scroll with Data (after)*/
959 set_ascii_item(msg_tree,tvb,offset,msg_len);
963 /*Status Bar Icon Update*/
964 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
965 proto_tree_add_item(msg_tree,hf_icon_id,tvb,offset,1,FALSE);
967 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
968 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,
970 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,
975 /*Month Labels Download*/
976 set_ascii_item(msg_tree,tvb,offset,msg_len);
980 /*Call Duration Timer Label Download*/
981 set_ascii_item(msg_tree,tvb,offset,msg_len);
982 offset+=1;msg_len-=1;
985 /*Time and Date Format*/
986 time_date_mask=tvb_get_guint8(tvb,offset);
987 if((time_date_mask&DISPLAY_USE_TIME_FORMAT)==DISPLAY_USE_TIME_FORMAT){
988 proto_tree_add_item(msg_tree,hf_display_time_format,tvb,offset,1,FALSE);
990 if((time_date_mask&DISPLAY_USE_DATE_FORMAT)==DISPLAY_USE_DATE_FORMAT){
991 proto_tree_add_item(msg_tree,hf_display_date_format,tvb,offset,1,FALSE);
993 proto_tree_add_item(msg_tree,hf_display_use_time_format,tvb,offset,1,FALSE);
994 proto_tree_add_item(msg_tree,hf_display_use_date_format,tvb,offset,1,FALSE);
995 offset+=1;msg_len-=1;
998 /*address|no control|no tag|no*/
999 set_ascii_item(msg_tree,tvb,offset,msg_len);
1003 /*address|yes control|no tag|no*/
1004 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address");
1006 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1007 address_byte=tvb_get_guint8(tvb,offset);
1008 proto_tree_add_item(address_tree,hf_basic_bit_field,
1009 tvb,offset,1,FALSE);
1010 proto_tree_add_item(address_tree,hf_display_write_address_numeric,
1011 tvb,offset,1,FALSE);
1012 proto_tree_add_item(address_tree,hf_display_write_address_context,
1013 tvb,offset,1,FALSE);
1014 proto_tree_add_item(address_tree,hf_display_write_address_line,
1015 tvb,offset,1,FALSE);
1016 proto_tree_add_item(address_tree,hf_display_write_address_soft_key,
1017 tvb,offset,1,FALSE);
1018 proto_tree_add_item(address_tree,hf_display_write_address_soft_label,
1019 tvb,offset,1,FALSE);
1021 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1022 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG){
1023 proto_tree_add_item(address_tree,
1024 hf_display_write_address_softkey_id,
1025 tvb,offset,1,FALSE);
1027 offset+=1;msg_len-=1;
1028 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1029 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1030 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1031 proto_tree_add_item(address_tree,
1032 hf_display_write_address_char_pos,
1033 tvb,offset,1,FALSE);
1034 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)!=
1035 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1036 offset+=1;msg_len-=1;
1039 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1040 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1041 proto_tree_add_item(address_tree,
1042 hf_display_write_address_line_number,
1043 tvb,offset,1,FALSE);
1044 offset+=1;msg_len-=1;
1047 /* I'm guessing this will work flakily at best */
1048 uinfo->string_data = tvb_get_string(tvb,offset,msg_len);
1049 set_ascii_item(msg_tree,tvb,offset,msg_len);
1055 /*address|no control|yes tag|no*/
1056 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1057 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1058 tvb,offset,1,FALSE);
1059 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1060 tvb,offset,1,FALSE);
1061 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1062 tvb,offset,1,FALSE);
1063 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1064 tvb,offset,1,FALSE);
1065 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1066 tvb,offset,1,FALSE);
1067 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1068 tvb,offset,1,FALSE);
1069 offset+=1;msg_len-=1;
1070 set_ascii_item(msg_tree,tvb,offset,msg_len);
1072 proto_tree_add_item(msg_tree,hf_generic_string,
1073 tvb,offset,msg_len,FALSE);
1077 /*address|yes control|yes tag|no*/
1078 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address Data");
1079 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1080 address_byte=tvb_get_guint8(tvb,offset);
1081 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1082 proto_tree_add_item(address_tree,
1083 hf_display_write_address_numeric,
1084 tvb,offset,1,FALSE);
1085 proto_tree_add_item(address_tree,
1086 hf_display_write_address_context,
1087 tvb,offset,1,FALSE);
1088 proto_tree_add_item(address_tree,
1089 hf_display_write_address_line,
1090 tvb,offset,1,FALSE);
1091 proto_tree_add_item(address_tree,
1092 hf_display_write_address_soft_key,
1093 tvb,offset,1,FALSE);
1094 proto_tree_add_item(address_tree,
1095 hf_display_write_address_soft_label,
1096 tvb,offset,1,FALSE);
1097 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1098 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG){
1099 proto_tree_add_item(address_tree,hf_display_write_address_softkey_id,
1100 tvb,offset,1,FALSE);
1101 offset+=1; msg_len-=1;
1103 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1104 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1105 proto_tree_add_item(address_tree,
1106 hf_display_write_address_char_pos,
1107 tvb,offset,1,FALSE);
1108 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)!=
1109 DISPLAY_WRITE_ADDRESS_LINE_FLAG)
1110 offset+=1;msg_len-=1;
1112 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1113 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1114 proto_tree_add_item(address_tree,
1115 hf_display_write_address_line_number,
1116 tvb,offset,1,FALSE);
1117 offset+=1;msg_len-=1;
1119 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1120 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1121 tvb,offset,1,FALSE);
1122 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1123 tvb,offset,1,FALSE);
1124 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1125 tvb,offset,1,FALSE);
1126 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1127 tvb,offset,1,FALSE);
1128 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1129 tvb,offset,1,FALSE);
1130 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1131 tvb,offset,1,FALSE);
1132 offset+=1;msg_len-=1;
1133 set_ascii_item(msg_tree,tvb,offset,msg_len);
1137 /*address|no control|no tag|yes*/
1138 proto_tree_add_item(msg_tree,hf_display_write_tag,tvb,offset,1,FALSE);
1139 offset+=1;msg_len-=1;
1140 set_ascii_item(msg_tree,tvb,offset,msg_len);
1144 /*address|yes control|no tag|yes*/
1145 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address Data");
1146 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1147 address_byte=tvb_get_guint8(tvb,offset);
1148 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1149 proto_tree_add_item(address_tree,hf_display_write_address_numeric,tvb,
1151 proto_tree_add_item(address_tree,hf_display_write_address_context,
1152 tvb,offset,1,FALSE);
1153 proto_tree_add_item(address_tree,hf_display_write_address_line,
1154 tvb,offset,1,FALSE);
1155 proto_tree_add_item(address_tree,hf_display_write_address_soft_key,
1156 tvb,offset,1,FALSE);
1157 proto_tree_add_item(address_tree,hf_display_write_address_soft_label,
1158 tvb,offset,1,FALSE);
1159 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1160 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)
1161 proto_tree_add_item(address_tree,
1162 hf_display_write_address_softkey_id,
1163 tvb,offset,1,FALSE);
1164 offset+=1; msg_len-=1;
1165 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1166 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1167 proto_tree_add_item(address_tree,
1168 hf_display_write_address_char_pos,
1169 tvb,offset,1,FALSE);
1170 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)!=
1171 DISPLAY_WRITE_ADDRESS_LINE_FLAG)
1172 offset+=1;msg_len-=1;
1174 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1175 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1176 proto_tree_add_item(address_tree,hf_display_write_address_line_number,
1177 tvb,offset,1,FALSE);
1178 offset+=1;msg_len-=1;
1180 set_ascii_item(msg_tree,tvb,offset,msg_len);
1184 /*address|no control|yes tag|yes*/
1185 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1186 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1187 tvb,offset,1,FALSE);
1188 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1189 tvb,offset,1,FALSE);
1190 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1191 tvb,offset,1,FALSE);
1192 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1193 tvb,offset,1,FALSE);
1194 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1195 tvb,offset,1,FALSE);
1196 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1197 tvb,offset,1,FALSE);
1198 offset+=1;msg_len-=1;
1200 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1202 proto_tree_add_item(msg_tree,hf_display_write_tag,tvb,offset,1,FALSE);
1203 offset+=1;msg_len-=1;
1204 set_ascii_item(msg_tree,tvb,offset,msg_len);
1208 /*address|yes control|yes tag|yes*/
1209 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address");
1210 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1211 address_byte=tvb_get_guint8(tvb,offset);
1212 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1213 proto_tree_add_item(address_tree,hf_display_write_address_numeric,
1214 tvb,offset,1,FALSE);
1215 proto_tree_add_item(address_tree,hf_display_write_address_context,
1216 tvb,offset,1,FALSE);
1217 proto_tree_add_item(address_tree,hf_display_write_address_line,
1218 tvb,offset,1,FALSE);
1219 proto_tree_add_item(address_tree,hf_display_write_address_soft_key,
1220 tvb,offset,1,FALSE);
1221 proto_tree_add_item(address_tree,hf_display_write_address_soft_label,
1222 tvb,offset,1,FALSE);
1223 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1224 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)
1225 proto_tree_add_item(address_tree,hf_display_write_address_softkey_id,
1226 tvb,offset,1,FALSE);
1227 offset+=1; msg_len-=1;
1228 proto_tree_add_item(msg_tree,hf_generic_string,
1229 tvb,offset,msg_len,FALSE);
1231 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1232 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1233 proto_tree_add_item(address_tree,hf_display_write_address_char_pos,
1234 tvb,offset,1,FALSE);
1235 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)!=
1236 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)
1237 offset+=1;msg_len-=1;
1239 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1240 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1241 proto_tree_add_item(address_tree,
1242 hf_display_write_address_line_number,
1243 tvb,offset,1,FALSE);
1244 offset+=1;msg_len-=1;
1246 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1247 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1248 tvb,offset,1,FALSE);
1249 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1250 tvb,offset,1,FALSE);
1251 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1252 tvb,offset,1,FALSE);
1253 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1254 tvb,offset,1,FALSE);
1255 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1256 tvb,offset,1,FALSE);
1257 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1258 tvb,offset,1,FALSE);
1259 offset+=1;msg_len-=1;
1260 proto_tree_add_item(msg_tree,hf_display_write_tag,
1261 tvb,offset,1,FALSE);
1262 offset+=1;msg_len-=1;
1263 set_ascii_item(msg_tree,tvb,offset,msg_len);
1267 /*Context Info Bar Format*/
1269 proto_tree_add_item(msg_tree,hf_display_context_format,tvb,offset,1,FALSE);
1270 proto_tree_add_item(msg_tree,hf_display_context_field,tvb,offset,1,FALSE);
1271 offset+=1;msg_len-=1;
1275 /*Set Default Character Table Configuration VERY UGLY*/
1276 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1280 /*Special Character Download*/
1281 proto_tree_add_item(msg_tree,hf_display_char_address,tvb,offset,1,FALSE);
1282 offset+=1;msg_len-=1;
1283 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1287 /*Highlighted Field Definition*/
1288 highlight_cmd=tvb_get_guint8(tvb,offset);
1289 proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,FALSE);
1290 proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,FALSE);
1291 proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,FALSE);
1292 proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,FALSE);
1293 proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,FALSE);
1294 offset+=1;msg_len-=1;proto_tree_add_item(msg_tree,hf_display_hlight_start,tvb,offset,1,FALSE);
1295 offset+=1;msg_len-=1;
1296 proto_tree_add_item(msg_tree,hf_display_hlight_end,tvb,offset,1,FALSE);
1297 offset+=1;msg_len-=1;
1300 if((highlight_cmd&DISPLAY_CURSOR_LINE)==DISPLAY_CURSOR_LINE){
1301 proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,FALSE);
1302 proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,FALSE);
1303 offset+=1;msg_len-=1;
1305 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1310 proto_tree_add_item(msg_tree,hf_display_contrast,tvb,offset,1,FALSE);
1311 offset+=1;msg_len-=1;
1314 /*Caller Log Download*/
1315 proto_tree_add_item(msg_tree,hf_broadcast_hour,tvb,offset,msg_len,FALSE);
1316 offset+=1;msg_len-=1;
1317 proto_tree_add_item(msg_tree,hf_broadcast_minute,tvb,offset,msg_len,FALSE);
1318 offset+=1;msg_len-=1;
1319 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1323 /*Layered Softkey Text Download*/
1324 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1325 offset+=1;msg_len-=1;
1326 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1327 offset+=1;msg_len-=1;
1328 set_ascii_item(msg_tree,tvb,offset,msg_len);
1332 /*Layered Softkey Clear*/
1333 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1334 proto_tree_add_item(msg_tree,hf_display_layer_all_skeys,tvb,offset,msg_len,FALSE);
1335 offset+=1;msg_len-=1;
1336 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1337 offset+=1;msg_len-=1;
1340 /*Set Visible Softkey Layer*/
1341 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1342 proto_tree_add_item(msg_tree,hf_display_layer_all_skeys,tvb,offset,msg_len,FALSE);
1343 offset+=1;msg_len-=1;
1344 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1345 offset+=1;msg_len-=1;
1348 /*Layered Softkey Cadence Download*/
1349 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1350 proto_tree_add_item(msg_tree,hf_display_once_or_cyclic,tvb,offset,msg_len,FALSE);
1351 offset+=1;msg_len-=1;
1353 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1354 offset+=1;msg_len-=1;
1355 proto_tree_add_item(msg_tree,hf_display_layer_duration,tvb,offset,1,FALSE);
1356 offset+=1;msg_len-=1;
1360 /*Layered Softkey Cadencing On*/
1361 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1362 offset+=1;msg_len-=1;
1365 /*Layered Softkey Cadencing Off*/
1366 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1367 offset+=1;msg_len-=1;
1373 proto_tree_add_item(msg_tree,hf_generic_data,
1374 tvb,offset,msg_len,FALSE);
1382 dissect_display_phone(proto_tree *msg_tree,
1383 tvbuff_t *tvb,gint offset,guint msg_len){
1385 guint highlight_cmd;
1386 display_cmd=tvb_get_guint8(tvb,offset);
1387 proto_tree_add_item(msg_tree,hf_display_phone_cmd,tvb,offset,1,FALSE);
1389 switch(display_cmd){
1391 /*Display Manager Attributes Info*/
1392 proto_tree_add_item(msg_tree,hf_display_line_width,tvb,offset,1,FALSE);
1393 proto_tree_add_item(msg_tree,hf_display_lines,tvb,offset,1,FALSE);
1394 offset+=1;msg_len-=1;
1395 proto_tree_add_item(msg_tree,hf_display_softkey_width,tvb,offset,1,FALSE);
1396 proto_tree_add_item(msg_tree,hf_display_softkeys,tvb,offset,1,FALSE);
1397 proto_tree_add_item(msg_tree,hf_display_icon,tvb,offset,1,FALSE);
1398 offset+=1;msg_len-=1;
1399 proto_tree_add_item(msg_tree,hf_display_softlabel_key_width,tvb,offset,1,FALSE);
1400 proto_tree_add_item(msg_tree,hf_display_context_width,tvb,offset,1,FALSE);
1401 offset+=1;msg_len-=1;
1402 proto_tree_add_item(msg_tree,hf_display_numeric_width,tvb,offset,1,FALSE);
1403 proto_tree_add_item(msg_tree,hf_display_time_width,tvb,offset,1,FALSE);
1404 proto_tree_add_item(msg_tree,hf_display_date_width,tvb,offset,1,FALSE);
1405 offset+=1;msg_len-=1;
1406 proto_tree_add_item(msg_tree,hf_display_char_dload,tvb,offset,1,FALSE);
1407 proto_tree_add_item(msg_tree,hf_display_freeform_icon_dload,tvb,offset,1,FALSE);
1408 proto_tree_add_item(msg_tree,hf_display_icon_type,tvb,offset,1,FALSE);
1409 offset+=1;msg_len-=1;
1410 proto_tree_add_item(msg_tree,hf_display_charsets,tvb,offset,1,FALSE);
1411 offset+=1;msg_len-=1;
1415 /*Contrast Level Report*/
1416 proto_tree_add_item(msg_tree,hf_display_contrast,tvb,offset,1,FALSE);
1417 offset+=1;msg_len-=1;
1420 /*Cursor Location Report*/
1421 proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,FALSE);
1422 proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,FALSE);
1423 proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,FALSE);
1424 proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,FALSE);
1425 proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,FALSE);
1426 offset+=1;msg_len-=1;
1427 proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,FALSE);
1428 proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,FALSE);
1429 offset+=1;msg_len-=1;
1432 /*Highlight Status On*/
1433 highlight_cmd=tvb_get_guint8(tvb,offset);
1434 proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,FALSE);
1435 proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,FALSE);
1436 proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,FALSE);
1437 proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,FALSE);
1438 proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,FALSE);
1439 offset+=1;msg_len-=1;proto_tree_add_item(msg_tree,hf_display_hlight_start,tvb,offset,1,FALSE);
1440 offset+=1;msg_len-=1;
1441 proto_tree_add_item(msg_tree,hf_display_hlight_end,tvb,offset,1,FALSE);
1442 offset+=1;msg_len-=1;
1443 if((highlight_cmd&DISPLAY_CURSOR_LINE)==DISPLAY_CURSOR_LINE){
1444 proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,FALSE);
1445 proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,FALSE);
1446 offset+=1;msg_len-=1;
1450 /*Current Character Table Configuration Status VERY UGLY*/
1451 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1455 /*Default Character Table Configuration Status VERY UGLY*/
1456 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1460 /*Timer And Date Format Report*/
1461 proto_tree_add_item(msg_tree,hf_display_time_format,tvb,offset,1,FALSE);
1462 proto_tree_add_item(msg_tree,hf_display_date_format,tvb,offset,1,FALSE);
1463 offset+=1;msg_len-=1;
1466 /*Status Bar Icon State Report*/
1467 proto_tree_add_item(msg_tree,hf_icon_id,tvb,offset,msg_len,FALSE);
1468 offset+=1;msg_len-=1;
1469 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,tvb,offset,msg_len,FALSE);
1470 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,tvb,offset,msg_len,FALSE);
1471 offset+=1;msg_len-=1;
1474 /*Highlight Status Off length = 3*/
1480 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1489 dissect_key_indicator_switch(proto_tree *msg_tree,
1490 tvbuff_t *tvb, gint offset,guint msg_len){
1492 key_cmd=tvb_get_guint8(tvb,offset);
1493 proto_tree_add_item(msg_tree,hf_key_switch_cmd,tvb,offset,1,FALSE);
1494 offset+=1;msg_len-=1;
1498 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1499 proto_tree_add_item(msg_tree,hf_key_led_cadence,tvb,offset,1,FALSE);
1500 proto_tree_add_item(msg_tree,hf_key_led_id,tvb,offset,1,FALSE);
1501 offset+=1;msg_len-=1;
1504 /*Query Hookswitch length = 3 */
1507 /*User Activity Timer Stop length = 3*/
1510 /*User Activity Timer Start length = 3*/
1513 /*Downloadable Free Form Icon Access (Hardcoded) length of 3*/
1516 /*Downloadable Free Form Icon Access (Downloadable) length of 3*/
1519 /*Query Key/Indicator Manager*/
1520 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1524 /*Key/Indicator Manager Options*/
1525 proto_tree_add_item(msg_tree,hf_keys_send_key_rel,tvb,offset,1,FALSE);
1526 proto_tree_add_item(msg_tree,hf_keys_enable_vol,tvb,offset,1,FALSE);
1527 proto_tree_add_item(msg_tree,hf_keys_conspic_prog_key,tvb,offset,1,FALSE);
1528 proto_tree_add_item(msg_tree,hf_keys_acd_super_control,tvb,offset,1,FALSE);
1529 proto_tree_add_item(msg_tree,hf_keys_local_dial_feedback,tvb,offset,1,FALSE);
1530 offset+=1;msg_len-=1;
1533 /*Logical Icon Mapping*/
1534 proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,FALSE);
1535 proto_tree_add_item(msg_tree,hf_keys_admin_command,tvb,offset,1,FALSE);
1536 offset+=1;msg_len-=1;
1537 proto_tree_add_item(msg_tree,hf_keys_logical_icon_id,tvb,offset,2,FALSE);
1538 offset+=2;msg_len-=2;
1541 /*Key Repeat Timer Download*/
1542 proto_tree_add_item(msg_tree,hf_keys_repeat_timer_one,tvb,offset,1,FALSE);
1543 offset+=1;msg_len-=1;
1544 proto_tree_add_item(msg_tree,hf_keys_repeat_timer_two,tvb,offset,1,FALSE);
1545 offset+=1;msg_len-=1;
1549 proto_tree_add_item(msg_tree,hf_keys_led_id,tvb,offset,1,FALSE);
1550 offset+=1;msg_len-=1;
1553 /*Query Phone Icon State*/
1554 proto_tree_add_item(msg_tree,hf_keys_phone_icon_id,tvb,offset,1,FALSE);
1555 offset+=1;msg_len-=1;
1558 /*Indicator Cadence Download*/
1560 proto_tree_add_item(msg_tree,hf_keys_cadence_on_time,tvb,offset,1,FALSE);
1561 offset+=1;msg_len-=1;
1562 proto_tree_add_item(msg_tree,hf_keys_cadence_off_time,tvb,offset,1,FALSE);
1563 offset+=1;msg_len-=1;
1567 /*User Activity Timer Download*/
1568 proto_tree_add_item(msg_tree,hf_keys_user_activity_timeout,tvb,offset,1,FALSE);
1569 offset+=1;msg_len-=1;
1572 /*Free Form Icon Download*/
1573 proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,FALSE);
1574 offset+=1;msg_len-=1;
1575 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1579 /*Phone Icon Update*/
1580 proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,FALSE);
1581 offset+=1;msg_len-=1;
1582 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1583 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,tvb,offset,1,FALSE);
1584 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,tvb,offset,1,FALSE);
1585 offset+=1;msg_len-=1;
1589 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1593 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1602 dissect_key_indicator_phone(proto_tree *msg_tree,
1603 tvbuff_t *tvb,gint offset, guint msg_len){
1605 key_cmd=tvb_get_guint8(tvb,offset);
1606 proto_tree_add_item(msg_tree,hf_key_phone_cmd,tvb,offset,1,FALSE);
1607 offset+=1;msg_len-=1;
1611 /* Set the tap info */
1612 uinfo->key_state = tvb_get_guint8(tvb,offset);
1613 uinfo->key_state >>= 6;
1614 /* Extract the key code */
1615 uinfo->key_val = (tvb_get_guint8(tvb,offset) & 0x3F);
1617 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1618 proto_tree_add_item(msg_tree,hf_key_code,tvb,offset,1,FALSE);
1619 proto_tree_add_item(msg_tree,hf_key_command,tvb,offset,1,FALSE);
1623 /*LED Status Report*/
1624 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1628 /*On Hook length = 3*/
1629 /* Set tap info.. */
1630 uinfo->hook_state = 0;
1634 /*Off Hook length = 3*/
1635 /* Set tap info.. */
1636 uinfo->hook_state = 1;
1640 /*User Activity Timer Expired length = 3*/
1643 /*Hookswitch State (on hook) length = 3*/
1646 /*Hookswitch State (off hook) length = 3*/
1649 /*Key/Indicator Manager Attributes Info*/
1650 proto_tree_add_item(msg_tree,hf_key_programmable_keys,tvb,offset,1,FALSE);
1651 proto_tree_add_item(msg_tree,hf_keys_soft_keys,tvb,offset,1,FALSE);
1652 offset+=1;msg_len-=1;
1653 proto_tree_add_item(msg_tree,hf_keys_hd_key,tvb,offset,1,FALSE);
1654 proto_tree_add_item(msg_tree,hf_keys_mute_key,tvb,offset,1,FALSE);
1655 proto_tree_add_item(msg_tree,hf_keys_quit_key,tvb,offset,1,FALSE);
1656 proto_tree_add_item(msg_tree,hf_keys_copy_key,tvb,offset,1,FALSE);
1657 proto_tree_add_item(msg_tree,hf_keys_mwi_key,tvb,offset,1,FALSE);
1658 offset+=1;msg_len-=1;
1659 proto_tree_add_item(msg_tree,hf_keys_num_nav_keys,tvb,offset,1,FALSE);
1660 proto_tree_add_item(msg_tree,hf_keys_num_conspic_keys,tvb,offset,1,FALSE);
1661 offset+=1;msg_len-=1;
1665 /*Key/Indicator Manager Options Report*/
1666 proto_tree_add_item(msg_tree,hf_keys_send_key_rel,tvb,offset,1,FALSE);
1667 proto_tree_add_item(msg_tree,hf_keys_enable_vol,tvb,offset,1,FALSE);
1668 proto_tree_add_item(msg_tree,hf_keys_conspic_prog_key,tvb,offset,1,FALSE);
1669 proto_tree_add_item(msg_tree,hf_keys_acd_super_control,tvb,offset,1,FALSE);
1670 proto_tree_add_item(msg_tree,hf_keys_local_dial_feedback,tvb,offset,1,FALSE);
1671 offset+=1;msg_len-=1;
1674 /*Phone Icon Status Report*/
1675 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1682 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1692 dissect_network_switch(proto_tree *msg_tree,
1693 tvbuff_t *tvb,gint offset, guint msg_len){
1695 network_cmd=tvb_get_guint8(tvb,offset);
1696 proto_tree_add_item(msg_tree,hf_network_switch_cmd,tvb,offset,1,FALSE);
1697 offset+=1;msg_len-=1;
1698 switch(network_cmd){
1706 /*Query Network Manager*/
1707 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1708 proto_tree_add_item(msg_tree,hf_net_diag_flag,tvb,offset,1,FALSE);
1709 proto_tree_add_item(msg_tree,hf_net_managers_flag,tvb,offset,1,FALSE);
1710 proto_tree_add_item(msg_tree,hf_net_attributes_flag,tvb,offset,1,FALSE);
1711 proto_tree_add_item(msg_tree,hf_net_serv_info_flag,tvb,offset,1,FALSE);
1712 proto_tree_add_item(msg_tree,hf_net_options_flag,tvb,offset,1,FALSE);
1713 proto_tree_add_item(msg_tree,hf_net_sanity_flag,tvb,offset,1,FALSE);
1717 /*Network Manager Options*/
1718 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1719 proto_tree_add_item(msg_tree,hf_net_enable_diag,tvb,offset,1,FALSE);
1720 proto_tree_add_item(msg_tree,hf_net_enable_rudp,tvb,offset,1,FALSE);
1724 /*QoS Configuration*/
1725 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1729 /*Set RTCP Source Description Item*/
1730 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1734 /*Download Server Information*/
1735 proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,FALSE);
1737 proto_tree_add_item(msg_tree,hf_net_server_port,tvb,offset,2,FALSE);
1739 proto_tree_add_item(msg_tree,hf_net_server_action,tvb,offset,1,FALSE);
1741 proto_tree_add_item(msg_tree,hf_net_server_retry_count,tvb,offset,1,FALSE);
1743 proto_tree_add_item(msg_tree,hf_net_server_failover_id,tvb,offset,1,FALSE);
1745 proto_tree_add_item(msg_tree,hf_net_server_ip_address,tvb,offset,4,FALSE);
1750 proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,FALSE);
1754 /*Query Network Configuration Element*/
1755 proto_tree_add_item(msg_tree,hf_net_server_config_element,
1756 tvb,offset-1,1,FALSE);
1760 /*Download Software Upgrade*/
1761 proto_tree_add_item(msg_tree,hf_net_file_xfer_mode,tvb,offset,1,FALSE);
1762 proto_tree_add_item(msg_tree,hf_net_force_download,tvb,offset,1,FALSE);
1763 proto_tree_add_item(msg_tree,hf_net_use_file_server_port,tvb,offset,1,FALSE);
1764 proto_tree_add_item(msg_tree,hf_net_use_local_port,tvb,offset,1,FALSE);
1765 offset+=1;msg_len-=1;
1766 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,1,FALSE);
1767 offset+=1;msg_len-=1;
1768 set_ascii_null_term_item(msg_tree,tvb,offset,msg_len,"Full Pathname :");
1769 set_ascii_null_term_item(msg_tree,tvb,offset,msg_len,"File Identifier :");
1770 proto_tree_add_item(msg_tree,hf_net_file_server_port,tvb,offset,2,FALSE);
1771 offset+=2;msg_len-=2;
1772 proto_tree_add_item(msg_tree,hf_net_local_port,tvb,offset,2,FALSE);
1773 offset+=2;msg_len-=2;
1774 proto_tree_add_item(msg_tree,hf_net_file_server_address,tvb,offset,4,FALSE);
1775 offset+=4;msg_len-=4;
1778 /*Set RTCP Report Interval*/
1779 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1783 /*Set Primary Server*/
1784 proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,FALSE);
1789 proto_tree_add_item(msg_tree,hf_net_server_time_out,
1790 tvb,offset,2,FALSE);
1794 /*Set Recovery Procedure Time Interval*/
1795 proto_tree_add_item(msg_tree,hf_net_server_recovery_time_low,
1796 tvb,offset,2,FALSE);
1798 proto_tree_add_item(msg_tree,hf_net_server_recovery_time_high,
1799 tvb,offset,2,FALSE);
1803 /*Transport Reliability Layer Parameters Download*/
1804 proto_tree_add_item(msg_tree,hf_generic_data,
1805 tvb,offset,msg_len,FALSE);
1810 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1814 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1824 dissect_network_phone(proto_tree *msg_tree,
1825 tvbuff_t *tvb,gint offset, guint msg_len){
1827 proto_tree *server_tree;
1830 network_cmd=tvb_get_guint8(tvb,offset);
1831 proto_tree_add_item(msg_tree,hf_network_phone_cmd,tvb,offset,1,FALSE);
1833 switch(network_cmd){
1835 /*Soft Reset Ack done length = 3*/
1838 /*Sanity OK done length = 3*/
1841 /*Network Manager Attributes Info*/
1842 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1846 /*Network Manager Diagnostic Info*/
1847 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1848 proto_tree_add_item(msg_tree,hf_net_phone_rx_ovr_flag,
1849 tvb,offset,1,FALSE);
1850 proto_tree_add_item(msg_tree,hf_net_phone_tx_ovr_flag,
1851 tvb,offset,1,FALSE);
1852 proto_tree_add_item(msg_tree,hf_net_phone_rx_empty_flag,
1853 tvb,offset,1,FALSE);
1854 proto_tree_add_item(msg_tree,hf_net_phone_invalid_msg_flag,
1855 tvb,offset,1,FALSE);
1856 proto_tree_add_item(msg_tree,hf_net_phone_eeprom_insane_flag,
1857 tvb,offset,1,FALSE);
1858 proto_tree_add_item(msg_tree,hf_net_phone_eeprom_unsafe_flag,
1859 tvb,offset,1,FALSE);
1864 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1868 /*Network Manager Options Report*/
1869 proto_tree_add_boolean(msg_tree,hf_net_phone_diag,tvb,offset,1,FALSE);
1870 proto_tree_add_item(msg_tree,hf_net_phone_rudp,tvb,offset,1,FALSE);
1874 /*Resume Connection with Server done*/
1877 /*Suspend Connection with Server done*/
1880 /*Network Configuration Element Report*/
1881 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1885 /*Server Information Report*/
1886 proto_tree_add_item(msg_tree,hf_net_phone_primary_server_id,
1887 tvb,offset,1,FALSE);
1888 offset+=1;msg_len-=1;
1889 for (i=1; msg_len>8; i++){
1890 /*if less than 9 not full report so punt*/
1891 /* guint16 port_num;
1892 port_num=tvb_get_ntohs(tvb,offset);
1896 server=proto_tree_add_text(msg_tree,tvb,offset,9,
1897 "Server (S%d) Server ID: %X",i,i-1);
1898 server_tree=proto_item_add_subtree(server,ett_unistim);
1899 proto_tree_add_item(server_tree,
1900 hf_net_phone_server_port,
1901 tvb,offset,2,FALSE);
1902 offset+=2;msg_len-=2;
1903 proto_tree_add_item(server_tree,
1904 hf_net_phone_server_action,
1905 tvb,offset,1,FALSE);
1906 offset+=1;msg_len-=1;
1907 proto_tree_add_item(server_tree,
1908 hf_net_phone_server_retry_count,
1909 tvb,offset,1,FALSE);
1910 offset+=1;msg_len-=1;
1911 proto_tree_add_item(server_tree,
1912 hf_net_phone_server_failover_id,
1913 tvb,offset,1,FALSE);
1914 offset+=1;msg_len-=1;
1915 proto_tree_add_item(server_tree,hf_net_phone_server_ip,
1916 tvb,offset,4,FALSE);
1917 offset+=4;msg_len-=4;
1924 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1932 dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
1933 tvbuff_t *tvb,gint offset,guint msg_len){
1934 proto_tree *param_tree;
1939 guint vocoder_param;
1940 audio_cmd=tvb_get_guint8(tvb,offset);
1941 proto_tree_add_item(msg_tree,hf_audio_switch_cmd,tvb,offset,1,FALSE);
1942 offset+=1;msg_len-=1;
1945 /*Query Audio Manager*/
1946 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1947 proto_tree_add_item(msg_tree,hf_audio_mgr_attr,tvb,offset,1,FALSE);
1948 proto_tree_add_item(msg_tree,hf_audio_mgr_opts,tvb,offset,1,FALSE);
1949 proto_tree_add_item(msg_tree,hf_audio_mgr_alert,tvb,offset,1,FALSE);
1950 proto_tree_add_item(msg_tree,hf_audio_mgr_adj_rx_vol,tvb,offset,1,FALSE);
1951 proto_tree_add_item(msg_tree,hf_audio_mgr_def_rx_vol,tvb,offset,1,FALSE);
1952 proto_tree_add_item(msg_tree,hf_audio_mgr_handset,tvb,offset,1,FALSE);
1953 proto_tree_add_item(msg_tree,hf_audio_mgr_headset,tvb,offset,1,FALSE);
1955 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
1956 tvb,offset,1,FALSE);
1960 /*Query Supervisor Headset Status*/
1964 /*Audio Manager Options*/
1965 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1966 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_max_vol,
1967 tvb,offset,1,FALSE);
1968 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_adj_vol,
1969 tvb,offset,1,FALSE);
1970 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_aa_rx_vol_rpt,
1971 tvb,offset,1,FALSE);
1972 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_hs_on_air,
1973 tvb,offset,1,FALSE);
1974 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_hd_on_air,
1975 tvb,offset,1,FALSE);
1976 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_noise_squelch,
1977 tvb,offset,1,FALSE);
1983 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1984 proto_tree_add_item(msg_tree,hf_audio_mgr_mute,tvb,offset,1,FALSE);
1985 proto_tree_add_item(msg_tree,hf_audio_mgr_tx_rx,tvb,offset,1,FALSE);
1986 offset+=1;msg_len-=1;
1987 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,
1988 tvb,offset,1,FALSE);
1989 offset+=1;msg_len-=1;
1993 /*Transducer Based Tone On*/
1994 proto_tree_add_item(msg_tree,
1995 hf_audio_mgr_transducer_based_tone_id,
1996 tvb,offset,1,FALSE);
1997 proto_tree_add_item(msg_tree,hf_audio_mgr_attenuated,
1998 tvb,offset,1,FALSE);
2002 /*Transducer Based Tone Off*/
2003 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_based_tone_id,
2004 tvb,offset,1,FALSE);
2008 /*Alerting Tone Configuration*/
2009 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2010 proto_tree_add_item(msg_tree,hf_audio_mgr_warbler_select,
2011 tvb,offset,1,FALSE);
2012 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
2013 tvb,offset,1,FALSE);
2015 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2016 proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
2017 tvb,offset,1,FALSE);
2018 proto_tree_add_item(msg_tree,hf_audio_mgr_cadence_select,
2019 tvb,offset,1,FALSE);
2023 /*Special Tone Configuration*/
2024 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
2025 tvb,offset,1,FALSE);
2027 proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
2028 tvb,offset,1,FALSE);
2030 proto_tree_add_item(msg_tree,hf_audio_special_tone,tvb,offset,1,FALSE);
2034 /*Paging Tone Configuration*/
2035 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
2036 tvb,offset,1,FALSE);
2038 proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
2039 tvb,offset,1,FALSE);
2040 proto_tree_add_item(msg_tree,hf_audio_mgr_cadence_select,
2041 tvb,offset,1,FALSE);
2045 /*Alerting Tone Cadence Download*/
2046 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2051 /*Paging Tone Cadence Download*/
2052 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2057 /*Transducer Based Tone Volume Level*/
2058 proto_tree_add_item(msg_tree,hf_basic_bit_field,
2059 tvb,offset,1,FALSE);
2060 proto_tree_add_item(msg_tree,
2061 hf_audio_mgr_transducer_based_tone_id,
2062 tvb,offset,1,FALSE);
2063 proto_tree_add_item(msg_tree,hf_audio_tone_level,tvb,offset,1,FALSE);
2067 /*Visual Transducer Based Tone Enable*/
2068 proto_tree_add_item(msg_tree,hf_audio_visual_tones,
2069 tvb,offset,1,FALSE);
2073 /*Stream Based Tone On*/
2074 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2075 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_id,
2076 tvb,offset,1,FALSE);
2077 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_rx_tx,
2078 tvb,offset,1,FALSE);
2079 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_mute,
2080 tvb,offset,1,FALSE);
2082 proto_tree_add_item(msg_tree,hf_audio_stream_id,tvb,offset,1,FALSE);
2084 proto_tree_add_item(msg_tree,hf_audio_stream_based_volume,tvb,offset,1,FALSE);
2088 /*Stream Based Tone Off*/
2089 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2090 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_id,
2091 tvb,offset,1,FALSE);
2092 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_rx_tx,
2093 tvb,offset,1,FALSE);
2095 proto_tree_add_item(msg_tree,hf_audio_stream_id,tvb,offset,1,FALSE);
2099 /*Stream Based Tone Frequency Component List Download*/
2100 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2104 /*Stream Based Tone Cadence Download*/
2105 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2109 /*Select Adjustable Rx Volume*/
2110 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
2111 tvb,offset,1,FALSE);
2114 /*Set APB's Rx Volume Level*/
2115 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2119 /*Change Adjustable Rx Volume (quieter) DONE*/
2120 proto_tree_add_item(msg_tree,hf_generic_data,
2121 tvb,offset,msg_len,FALSE);
2125 /*Change Adjustable Rx Volume (louder) DONE*/
2126 proto_tree_add_item(msg_tree,hf_generic_data,
2127 tvb,offset,msg_len,FALSE);
2131 /*Adjust Default Rx Volume(quieter)*/
2132 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
2133 tvb,offset,1,FALSE);
2136 /*Adjust Default Rx Volume(louder)*/
2137 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
2138 tvb,offset,1,FALSE);
2142 proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,FALSE);
2143 offset+=1;msg_len-=1;
2145 apb_op_code=tvb_get_guint8(tvb,offset);
2146 proto_tree_add_item(msg_tree,hf_audio_apb_op_code,tvb,
2148 offset+=1;msg_len-=1;
2149 if(apb_op_code>0x39){
2150 /*should have a len + data*/
2151 apb_data_len=tvb_get_guint8(tvb,offset);
2152 proto_tree_add_item(msg_tree,hf_audio_apb_param_len,tvb,
2154 offset+=1;msg_len-=1;
2155 proto_tree_add_item(msg_tree,hf_audio_apb_data,tvb,
2156 offset,apb_data_len,FALSE);
2157 offset+=apb_data_len;msg_len-=apb_data_len;
2162 /*Open Audio Stream*/
2163 /* Set the tap info */
2164 uinfo->stream_connect = 1;
2166 proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,FALSE);
2167 offset+=1;msg_len-=1;
2168 proto_tree_add_item(msg_tree,hf_audio_tx_stream_id,tvb,offset,1,FALSE);
2169 offset+=1;msg_len-=1;
2170 proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,FALSE);
2171 offset+=1;msg_len-=1;
2172 proto_tree_add_item(msg_tree,hf_tx_vocoder_type,tvb,offset,1,FALSE);
2173 offset+=1;msg_len-=1;
2174 proto_tree_add_item(msg_tree,hf_frames_per_packet,tvb,offset,1,FALSE);
2175 offset+=1;msg_len-=1;
2176 proto_tree_add_item(msg_tree,hf_audio_tos,tvb,offset,1,FALSE);
2177 proto_tree_add_item(msg_tree,hf_audio_precedence,tvb,offset,1,FALSE);
2178 proto_tree_add_item(msg_tree,hf_audio_frf_11,tvb,offset,1,FALSE);
2179 offset+=1;msg_len-=1;
2180 proto_tree_add_item(msg_tree,hf_rtcp_bucket_id,
2181 tvb,offset,1,FALSE);
2182 offset+=1;msg_len-=1;
2183 proto_tree_add_item(msg_tree,hf_generic_data,
2184 tvb,offset,4,FALSE);
2185 offset+=4;msg_len-=4;
2186 proto_tree_add_item(msg_tree,hf_audio_lcl_rtp_port,
2187 tvb,offset,2,FALSE);
2188 offset+=2;msg_len-=2;
2189 proto_tree_add_item(msg_tree,hf_audio_lcl_rtcp_port,
2190 tvb,offset,2,FALSE);
2191 offset+=2;msg_len-=2;
2193 proto_tree_add_item(msg_tree,hf_audio_far_rtp_port,
2194 tvb,offset,2,FALSE);
2195 offset+=2;msg_len-=2;
2196 proto_tree_add_item(msg_tree,hf_audio_far_rtcp_port,
2197 tvb,offset,2,FALSE);
2198 offset+=2;msg_len-=2;
2200 /* Sometimes the open stream does not specify an endpoint */
2201 /* In this circumstance the packet is truncated at the far end */
2204 proto_tree_add_item(msg_tree,hf_audio_far_ip_add,tvb,offset,4,FALSE);
2205 offset+=4;msg_len-=4;
2207 guint32 far_ip_addr;
2211 far_ip_addr = tvb_get_ipv4(tvb, offset-4);
2212 SET_ADDRESS(&far_addr, AT_IPv4, 4, &far_ip_addr);
2214 far_port = tvb_get_ntohs(tvb, offset-8);
2215 rtp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num, NULL);
2217 far_port = tvb_get_ntohs(tvb, offset-6);
2218 rtcp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num);
2223 /*Close Audio Stream*/
2224 /* Set the tap info */
2225 uinfo->stream_connect = 0;
2227 proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,FALSE);
2228 offset+=1;msg_len-=1;
2229 proto_tree_add_item(msg_tree,hf_audio_tx_stream_id,tvb,offset,1,FALSE);
2230 offset+=1;msg_len-=1;
2233 /*Connect Transducer*/
2234 /* Tap info again */
2235 uinfo->trans_connect = 1;
2237 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
2238 proto_tree_add_item(msg_tree,hf_audio_transducer_pair,tvb,offset,1,FALSE);
2239 proto_tree_add_item(msg_tree,hf_audio_rx_enable,tvb,offset,1,FALSE);
2240 proto_tree_add_item(msg_tree,hf_audio_tx_enable,tvb,offset,1,FALSE);
2241 offset+=1;msg_len-=1;
2242 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
2243 proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,FALSE);
2244 proto_tree_add_item(msg_tree,hf_audio_sidetone_disable,tvb,offset,1,FALSE);
2245 proto_tree_add_item(msg_tree,hf_audio_destruct_additive,tvb,offset,1,FALSE);
2246 proto_tree_add_item(msg_tree,hf_audio_dont_force_active,tvb,offset,1,FALSE);
2247 offset+=1;msg_len-=1;
2249 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,TRUE);
2250 offset+=1;msg_len-=1;
2254 /*Filter Block Download*/
2255 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2259 /*Query RTCP Statistics*/
2260 proto_tree_add_item(msg_tree,hf_audio_rtcp_bucket_id,tvb,offset,1,FALSE);
2261 proto_tree_add_item(msg_tree,hf_audio_clear_bucket,tvb,offset,1,FALSE);
2263 offset+=1;msg_len-=1;
2266 /*Configure Vocoder Parameters*/
2267 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,TRUE);
2268 offset+=1;msg_len-=1;
2269 proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,FALSE),
2270 offset+=1;msg_len-=1;
2272 param=proto_tree_add_text(msg_tree,tvb,offset,0,"Param");
2273 param_tree=proto_item_add_subtree(param,ett_unistim);
2274 vocoder_param=tvb_get_guint8(tvb,offset);
2275 proto_tree_add_item(param_tree,hf_basic_bit_field,
2276 tvb,offset,1,FALSE);
2277 proto_tree_add_item(param_tree,hf_audio_vocoder_param,
2278 tvb,offset,1,FALSE);
2279 proto_tree_add_item(param_tree,hf_audio_vocoder_entity,
2280 tvb,offset,1,FALSE);
2281 offset+=1;msg_len-=1;
2282 if((vocoder_param&0x0a)==0x0a){
2283 proto_tree_add_item(param_tree,hf_audio_vocoder_annexa,
2284 tvb,offset,1,FALSE);
2285 proto_tree_add_item(param_tree,hf_audio_vocoder_annexb,
2286 tvb,offset,1,FALSE);
2287 offset+=1;msg_len-=1;
2289 else if((vocoder_param&0x0b)==0x0b){
2290 proto_tree_add_item(param_tree,hf_audio_sample_rate,
2291 tvb,offset,1,FALSE);
2292 offset+=1;msg_len-=1;
2294 else if((vocoder_param&0x0c)==0x0c){
2295 proto_tree_add_item(param_tree,hf_audio_rtp_type,
2296 tvb,offset,1,FALSE);
2297 offset+=1;msg_len-=1;
2299 else if((vocoder_param&0x20)==0x20){
2300 proto_tree_add_item(param_tree,hf_audio_bytes_per_frame,
2301 tvb,offset,2,FALSE);
2302 offset+=2;msg_len-=2;
2307 /*Query RTCP Bucket's SDES Information*/
2308 proto_tree_add_item(msg_tree,hf_audio_source_descr,tvb,offset,msg_len,FALSE);
2309 proto_tree_add_item(msg_tree,hf_audio_sdes_rtcp_bucket,tvb,offset,msg_len,FALSE);
2310 offset+=1;msg_len-=1;
2313 /*Jitter Buffer Parameters Configuration*/
2314 proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,FALSE);
2315 offset+=1;msg_len-=1;
2316 proto_tree_add_item(msg_tree,hf_audio_desired_jitter,tvb,offset,1,FALSE);
2317 offset+=1;msg_len-=1;
2318 proto_tree_add_item(msg_tree,hf_audio_high_water_mark,tvb,offset,1,FALSE);
2319 offset+=1;msg_len-=1;
2320 proto_tree_add_item(msg_tree,hf_audio_early_packet_resync_thresh,tvb,
2322 offset+=4;msg_len-=4;
2323 proto_tree_add_item(msg_tree,hf_audio_late_packet_resync_thresh,tvb,
2325 offset+=4;msg_len-=4;
2328 /*Resolve Port Mapping*/
2329 proto_tree_add_item(msg_tree,hf_audio_resolve_phone_port,tvb,offset,1,FALSE);
2330 offset+=2;msg_len-=2;
2331 proto_tree_add_item(msg_tree,hf_audio_far_end_echo_port,tvb,offset,1,FALSE);
2332 offset+=2;msg_len-=2;
2333 proto_tree_add_item(msg_tree,hf_audio_far_end_ip_address,tvb,offset,1,FALSE);
2334 offset+=4;msg_len-=4;
2337 /*Port Mpping Discovery Ack*/
2338 proto_tree_add_item(msg_tree,hf_audio_nat_port,tvb,offset,1,FALSE);
2339 offset+=2;msg_len-=2;
2340 proto_tree_add_item(msg_tree,hf_audio_nat_ip_address,tvb,offset,1,FALSE);
2341 offset+=4;msg_len-=4;
2344 /*Query Audio Stream Status*/
2345 proto_tree_add_item(msg_tree,hf_audio_direction_code,tvb,offset,1,FALSE);
2346 offset+=1;msg_len-=1;
2347 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,FALSE);
2348 offset+=1;msg_len-=1;
2353 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2362 dissect_audio_phone(proto_tree *msg_tree,
2363 tvbuff_t *tvb,gint offset,guint msg_len){
2369 audio_cmd=tvb_get_guint8(tvb,offset);
2370 proto_tree_add_item(msg_tree,hf_audio_phone_cmd,tvb,offset,1,FALSE);
2371 offset+=1;msg_len-=1;
2374 /*Handset Connected length =3*/
2375 /* Set the tap info */
2376 uinfo->hook_state = 1;
2379 /*Handset Disconnected length =3*/
2380 /* Set the tap info */
2381 uinfo->hook_state = 0;
2384 /*Headset Connected length =3*/
2385 /* Set the tap info */
2386 uinfo->hook_state = 1;
2389 /*Headset Disconnected length =3*/
2390 /* Set the tap info */
2391 uinfo->hook_state = 0;
2394 /*Supervisor Headset Connected length =3*/
2395 /* Set the tap info */
2396 uinfo->hook_state = 1;
2399 /*Supervisor Headset Disconnected length =3*/
2400 /* Set the tap info */
2401 uinfo->hook_state = 0;
2404 /*Audio Manager Attributes Info*/
2405 proto_tree_add_item(msg_tree,hf_audio_hf_support,tvb,1,msg_len,FALSE);
2406 offset+=1;msg_len-=1;
2408 proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,FALSE);
2409 offset+=1;msg_len-=1;
2413 /*Audio Manager Options Report*/
2414 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2415 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_max,tvb,offset,1,FALSE);
2416 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_adj_vol,tvb,offset,1,FALSE);
2417 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_auto_adj_vol,tvb,offset,1,FALSE);
2418 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_hs_on_air,tvb,offset,1,FALSE);
2419 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_hd_on_air,tvb,offset,1,FALSE);
2420 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_noise_squelch,tvb,offset,1,FALSE);
2421 offset+=1;msg_len-=1;
2424 /*Adjustable Rx Volume Report*/
2425 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2426 proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,FALSE);
2427 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,FALSE);
2428 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,FALSE);
2429 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,FALSE);
2430 offset+=1;msg_len-=1;
2433 /*Adjustable Rx Volume Information*/
2434 proto_tree_add_item(msg_tree,hf_audio_current_adj_vol_id,tvb,offset,1,FALSE);
2435 proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,FALSE);
2436 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,FALSE);
2437 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,FALSE);
2438 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,FALSE);
2439 offset+=1;msg_len-=1;
2440 proto_tree_add_item(msg_tree,hf_audio_current_rx_level,tvb,offset,1,FALSE);
2441 offset+=1;msg_len-=1;
2442 proto_tree_add_item(msg_tree,hf_audio_current_rx_range,tvb,offset,1,FALSE);
2443 offset+=1;msg_len-=1;
2446 /*APB's Default Rx Volume Value*/
2447 proto_tree_add_item(msg_tree,hf_audio_current_adj_vol_id,tvb,offset,1,FALSE);
2448 proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,FALSE);
2449 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,FALSE);
2450 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,FALSE);
2451 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,FALSE);
2452 offset+=1;msg_len-=1;
2453 proto_tree_add_item(msg_tree,hf_audio_current_rx_level,tvb,offset,1,FALSE);
2454 offset+=1;msg_len-=1;
2455 proto_tree_add_item(msg_tree,hf_audio_current_rx_range,tvb,offset,1,FALSE);
2456 offset+=1;msg_len-=1;
2459 /*Alerting Tone Select*/
2460 proto_tree_add_item(msg_tree,hf_audio_cadence_select,tvb,offset,1,FALSE);
2461 proto_tree_add_item(msg_tree,hf_audio_warbler_select,tvb,offset,1,FALSE);
2462 offset+=1;msg_len-=1;
2465 /*RTCP Statistics Report UGLY*/
2466 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2470 /*Open Audio Stream Report*/
2471 proto_tree_add_item(msg_tree,hf_audio_open_stream_rpt,tvb,offset,1,FALSE);
2472 offset+=1;msg_len-=1;
2475 /*RTCP Bucket SDES Information Report*/
2476 proto_tree_add_item(msg_tree,hf_audio_sdes_rpt_source_desc,tvb,offset,1,FALSE);
2477 proto_tree_add_item(msg_tree,hf_audio_sdes_rpt_buk_id,tvb,offset,1,FALSE);
2478 offset+=1;msg_len-=1;
2479 set_ascii_item(msg_tree,tvb,offset,msg_len);
2483 /*Port Mapping Discovery*/
2484 proto_tree_add_item(msg_tree,hf_audio_phone_port,tvb,offset,2,FALSE);
2485 offset+=2;msg_len-=2;
2486 proto_tree_add_item(msg_tree,hf_audio_phone_ip,tvb,offset,4,FALSE);
2487 offset+=4;msg_len-=4;
2490 /*Resolve Port Mapping*/
2491 proto_tree_add_item(msg_tree,hf_audio_nat_listen_port,tvb,offset,2,FALSE);
2492 offset+=2;msg_len-=2;
2493 proto_tree_add_item(msg_tree,hf_audio_nat_ip,tvb,offset,4,FALSE);
2494 offset+=4;msg_len-=4;
2495 proto_tree_add_item(msg_tree,hf_audio_nat_add_len,tvb,offset,1,FALSE);
2496 offset+=1;msg_len-=1;
2497 proto_tree_add_item(msg_tree,hf_audio_phone_port,tvb,offset,2,FALSE);
2498 offset+=2;msg_len-=2;
2499 proto_tree_add_item(msg_tree,hf_audio_phone_ip,tvb,offset,4,FALSE);
2500 offset+=4;msg_len-=4;
2501 proto_tree_add_item(msg_tree,hf_audio_phone_add_len,tvb,offset,1,FALSE);
2502 offset+=1;msg_len-=1;
2505 /*Audio Stream Status Report*/
2506 stream_dir=tvb_get_guint8(tvb,offset);
2507 proto_tree_add_item(msg_tree,hf_audio_stream_direction_code,tvb,offset,1,FALSE);
2508 offset+=1;msg_len-=1;
2509 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,FALSE);
2510 offset+=1;msg_len-=1;
2511 stream_state=tvb_get_guint8(tvb,offset);
2512 proto_tree_add_item(msg_tree,hf_audio_stream_state,tvb,offset,1,FALSE);
2513 offset+=1;msg_len-=1;
2514 if((AUDIO_STREAM_STATE&stream_state)!=AUDIO_STREAM_STATE)
2516 if((AUDIO_STREAM_DIRECTION_RX&stream_dir)==AUDIO_STREAM_DIRECTION_RX)
2517 proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,FALSE);
2518 else if((AUDIO_STREAM_DIRECTION_TX&stream_dir)==AUDIO_STREAM_DIRECTION_TX)
2519 proto_tree_add_item(msg_tree,hf_tx_vocoder_type,tvb,offset,1,FALSE);
2521 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,1,FALSE);
2522 offset+=1;msg_len-=1;
2523 proto_tree_add_item(msg_tree,hf_frames_per_packet,tvb,offset,1,FALSE);
2524 offset+=1;msg_len-=1;
2525 proto_tree_add_item(msg_tree,hf_audio_tos,tvb,offset,1,FALSE);
2526 proto_tree_add_item(msg_tree,hf_audio_precedence,tvb,offset,1,FALSE);
2527 proto_tree_add_item(msg_tree,hf_audio_frf_11,tvb,offset,1,FALSE);
2528 offset+=1;msg_len-=1;
2529 proto_tree_add_item(msg_tree,hf_rtcp_bucket_id,tvb,offset,1,FALSE);
2530 offset+=1;msg_len-=1;
2531 proto_tree_add_item(msg_tree,hf_audio_lcl_rtp_port,tvb,offset,2,FALSE);
2532 offset+=2;msg_len-=2;
2533 proto_tree_add_item(msg_tree,hf_audio_lcl_rtcp_port,tvb,offset,2,FALSE);
2534 offset+=2;msg_len-=2;
2535 proto_tree_add_item(msg_tree,hf_audio_far_rtp_port,tvb,offset,2,FALSE);
2536 offset+=2;msg_len-=2;
2537 proto_tree_add_item(msg_tree,hf_audio_far_rtcp_port,tvb,offset,2,FALSE);
2538 offset+=2;msg_len-=2;
2539 proto_tree_add_item(msg_tree,hf_audio_far_ip_add,tvb,offset,4,FALSE);
2540 offset+=4;msg_len-=4;
2541 proto_tree_add_item(msg_tree,hf_audio_transducer_list_length,tvb,offset,1,FALSE);
2542 offset+=1;msg_len-=1;
2544 proto_tree_add_item(msg_tree,hf_audio_transducer_pair,tvb,offset,1,FALSE);
2545 offset+=1;msg_len-=1;
2548 /*Query APB Response*/
2549 proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,FALSE);
2550 offset+=1;msg_len-=1;
2552 apb_op_code=tvb_get_guint8(tvb,offset);
2553 proto_tree_add_item(msg_tree,hf_audio_apb_op_code,tvb,
2555 offset+=1;msg_len-=1;
2556 if(apb_op_code>0x39){
2557 /*should have a len + data*/
2558 apb_data_len=tvb_get_guint8(tvb,offset);
2559 proto_tree_add_item(msg_tree,hf_audio_apb_param_len,tvb,
2561 offset+=1;msg_len-=1;
2562 proto_tree_add_item(msg_tree,hf_audio_apb_data,tvb,
2563 offset,apb_data_len,FALSE);
2564 offset+=apb_data_len;msg_len-=apb_data_len;
2572 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2580 set_ascii_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len){
2582 guint16 buffer_index=0;
2583 guint16 msg_index=0;
2585 char *label="DATA: ";
2586 #define MAX_BUFFER 1024
2587 buffer=ep_alloc(MAX_BUFFER);
2589 g_snprintf(buffer,MAX_BUFFER,"%s",label);
2590 buffer_index=strlen(label);
2592 while((buffer_index<MAX_BUFFER-2)&&(msg_index<msg_len)){
2593 character=tvb_get_guint8(tvb,offset+msg_index);
2595 if((character>0x1f)&&(character<0x7f)){
2596 /*g_vsnprintf called in proto_tree_add_text blows up if you end up with %s as text so escape %*/
2598 buffer[buffer_index]='%';
2601 buffer[buffer_index]=character;
2605 buffer[buffer_index]='.';
2609 buffer[buffer_index]='\0';
2611 proto_tree_add_text(msg_tree,tvb,offset,msg_len,"%s",buffer);
2615 set_ascii_null_term_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len,char *label){
2617 guint16 buffer_index=0;
2618 guint16 msg_index=0;
2620 #define MAX_BUFFER 1024
2621 buffer=ep_alloc(MAX_BUFFER);
2623 g_snprintf(buffer,MAX_BUFFER,"%s",label);
2624 buffer_index=strlen(label);
2626 while((buffer_index<MAX_BUFFER-2)&&(msg_index<msg_len)){
2627 character=tvb_get_guint8(tvb,offset+msg_index);
2629 if((character>0x1f)&&(character<0x7f)){
2630 /*g_vsnprintf called in proto_tree_add_text blows up if you end up with %s as text so escape %*/
2632 buffer[buffer_index]='%';
2635 buffer[buffer_index]=character;
2638 else if(character==0x00)
2641 buffer[buffer_index]='.';
2645 buffer[buffer_index]='\0';
2647 proto_tree_add_text(msg_tree,tvb,offset,msg_len,"%s",buffer);