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 = 5000; */
54 static guint global_unistim_port = 0;
56 static unistim_info_t *uinfo;
57 static int unistim_tap = -1;
59 void proto_reg_handoff_unistim(void);
60 static void dissect_payload(proto_tree *unistim_tree,tvbuff_t *tvb,gint offset, packet_info *pinfo);
61 static int dissect_unistim(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree);
63 static gint dissect_broadcast_switch(proto_tree *msg_tree,
64 tvbuff_t *tvb,gint offset,guint msg_len);
65 static gint dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
66 tvbuff_t *tvb,gint offset,guint msg_len);
67 static gint dissect_display_switch(proto_tree *msg_tree,
68 tvbuff_t *tvb,gint offset,guint msg_len);
69 static gint dissect_key_indicator_switch(proto_tree *msg_tree,
70 tvbuff_t *tvb,gint offset,guint msg_len);
71 static gint dissect_basic_switch(proto_tree *msg_tree,
72 tvbuff_t *tvb,gint offset,guint msg_len);
73 static gint dissect_network_switch(proto_tree *msg_tree,
74 tvbuff_t *tvb,gint offset,guint msg_len);
75 static gint dissect_broadcast_phone(proto_tree *msg_tree,
76 tvbuff_t *tvb,gint offset,guint msg_len);
77 static gint dissect_audio_phone(proto_tree *msg_tree,
78 tvbuff_t *tvb,gint offset,guint msg_len);
79 static gint dissect_display_phone(proto_tree *msg_tree,
80 tvbuff_t *tvb,gint offset,guint msg_len);
81 static gint dissect_key_indicator_phone(proto_tree *msg_tree,
82 tvbuff_t *tvb,gint offset,guint msg_len);
83 static gint dissect_basic_phone(proto_tree *msg_tree,
84 tvbuff_t *tvb,gint offset,guint msg_len);
85 static gint dissect_network_phone(proto_tree *msg_tree,
86 tvbuff_t *tvb,gint offset,guint msg_len);
87 static gint dissect_unistim_message(proto_tree *unistim_tree, packet_info *pinfo,
88 tvbuff_t *tvb,gint offset);
89 static gint dissect_uftp_message(proto_tree *unistim_tree, packet_info *pinfo,
90 tvbuff_t *tvb,gint offset);
93 static void set_ascii_item(proto_tree *unistim_tree, tvbuff_t *tvb,
94 gint offset,guint msg_len);
95 static void set_ascii_null_term_item(proto_tree *msg_tree,tvbuff_t *tvb,
96 gint offset,guint msg_len, char *label);
99 static int proto_unistim = -1;
100 static int hf_unistim_seq_nu = -1;
101 static int hf_unistim_packet_type = -1;
102 static int hf_unistim_payload = -1;
103 static int hf_unistim_cmd_add = -1;
104 static int hf_unistim_len =-1;
105 static int hf_terminal_id=-1;
106 static int hf_basic_bit_field=-1;
107 static const true_false_string basic_bit_yn={
108 "For Following Byte",
112 static int hf_basic_switch_cmd=-1;
113 static int hf_basic_phone_cmd=-1;
114 static int hf_broadcast_switch_cmd=-1;
115 static int hf_broadcast_phone_cmd=-1;
116 static int hf_audio_switch_cmd=-1;
117 static int hf_audio_phone_cmd=-1;
118 static int hf_display_switch_cmd=-1;
119 static int hf_display_phone_cmd=-1;
120 static int hf_key_switch_cmd=-1;
121 static int hf_key_phone_cmd=-1;
122 static int hf_network_switch_cmd=-1;
123 static int hf_network_phone_cmd=-1;
125 static int hf_generic_data=-1;
126 static int hf_generic_string=-1;
128 static gint ett_unistim = -1;
130 static const value_string packet_names[]={
137 static const value_string payload_names[]={
138 {0x00,"NULL Protocol"},
139 {0x01,"Aggregate Unistim"},
140 {0x02,"Aggregate Unistim with Terminal ID"},
142 {0xff,"Free Form Protocol"},
146 static const range_string sequence_numbers[]={
147 {0x00,0xFFFFFFFE,"Normal Sequence Number"},
148 {0xFFFFFFFF,0xFFFFFFFF, "RESET Sequence Number"},
152 static const value_string command_address[]={
153 {0x11,"Broadcast Manager Switch"},
154 {0x16,"Audio Manager Switch"},
155 {0x17,"Display Manager Switch"},
156 {0x19,"Key/Indicator Manager Switch"},
157 {0x1a,"Basic Manager Switch"},
158 {0x1e,"Network Manager Switch"},
159 {0x91,"Broadcast Manager Phone"},
160 {0x96,"Audio Manager Phone"},
161 {0x97,"Display Manager Phone"},
162 {0x99,"Key/Indicator Manager Phone"},
163 {0x9a,"Basic Manager Phone"},
164 {0x9e,"Network Manager Phone"},
168 #include "header_field.h"
171 proto_register_unistim(void){
173 module_t* unistim_module;
175 /* Setup protocol subtree array */
177 static gint *ett[] = {
181 proto_unistim=proto_register_protocol("UNISTIM Protocol", "UNISTIM", "unistim");
183 proto_register_subtree_array(ett,array_length(ett));
184 proto_register_field_array(proto_unistim,hf,array_length(hf));
186 unistim_tap = register_tap("unistim");
188 unistim_module = prefs_register_protocol(proto_unistim, proto_reg_handoff_unistim);
190 prefs_register_uint_preference(unistim_module, "udp.port", "UNISTIM UDP port",
191 "UNISTIM port (default 5000)", 10, &global_unistim_port);
195 proto_reg_handoff_unistim(void) {
196 static gboolean initialized = FALSE;
197 static dissector_handle_t unistim_handle;
198 static guint unistim_port;
201 unistim_handle=new_create_dissector_handle(dissect_unistim,proto_unistim);
202 dissector_add_handle("udp.port", unistim_handle); /* for "decode as" */
205 if (unistim_port != 0) {
206 dissector_delete("udp.port",unistim_port,unistim_handle);
210 if (global_unistim_port != 0) {
211 dissector_add("udp.port",global_unistim_port,unistim_handle);
213 unistim_port = global_unistim_port;
218 dissect_unistim(tvbuff_t *tvb,packet_info *pinfo,proto_tree *tree){
220 proto_item *ti= NULL;
221 proto_item *ti1= NULL;
222 proto_tree *overall_unistim_tree = NULL;
223 proto_tree *rudpm_tree=NULL;
227 switch(tvb_get_guint8(tvb,offset+4)) {/*rudp packet type 0,1,2 only */
232 switch(tvb_get_guint8(tvb,offset+5)){/*payload type 0,1,2,3,ff only */
235 case 0x2:/*UNISTIM WITH TERM ID*/
237 case 0xff:/*UNKNOWN BUT VALID*/
248 size=tvb_length_remaining(tvb, offset);
249 if(check_col(pinfo->cinfo,COL_PROTOCOL))
250 col_set_str(pinfo->cinfo,COL_PROTOCOL,"UNISTIM");
251 /* Clear out stuff in the info column */
252 if (check_col(pinfo->cinfo,COL_INFO)) {
253 col_clear(pinfo->cinfo,COL_INFO);
255 ti = proto_tree_add_item(tree,proto_unistim,tvb,offset,-1,FALSE);
256 overall_unistim_tree = proto_item_add_subtree(ti,ett_unistim);
257 ti1=proto_tree_add_text(overall_unistim_tree,tvb,offset,5,"Reliable UDP");
258 rudpm_tree=proto_item_add_subtree(ti1,ett_unistim);
260 proto_tree_add_item(rudpm_tree,hf_unistim_seq_nu,tvb,offset,4,FALSE);
262 /* Allocate new mem for queueing */
263 uinfo = se_alloc(sizeof(unistim_info_t));
265 /* Clear tap struct */
266 uinfo->rudp_type = 0;
267 uinfo->payload_type = 0;
268 uinfo->sequence = tvb_get_ntohl(tvb,offset);
271 uinfo->key_state = -1;
272 uinfo->hook_state = -1;
273 uinfo->stream_connect = -1;
274 uinfo->trans_connect = -1;
275 uinfo->set_termid = -1;
276 uinfo->string_data = NULL;
277 uinfo->key_buffer = NULL;
278 SET_ADDRESS(&uinfo->it_ip, AT_NONE, 0, NULL);
279 SET_ADDRESS(&uinfo->ni_ip, AT_NONE, 0, NULL);
283 proto_tree_add_item(rudpm_tree,hf_unistim_packet_type,tvb,offset,1,FALSE);
284 uinfo->rudp_type = tvb_get_guint8(tvb,offset);
286 switch(tvb_get_guint8(tvb,offset)) {
289 if (check_col(pinfo->cinfo, COL_INFO))
290 col_add_fstr(pinfo->cinfo, COL_INFO, "NAK for seq - 0x%X",
291 tvb_get_ntohl(tvb, offset-4));
295 if (check_col(pinfo->cinfo, COL_INFO))
296 col_add_fstr(pinfo->cinfo, COL_INFO, "ACK for seq - 0x%X",
297 tvb_get_ntohl(tvb, offset-4));
300 if (check_col(pinfo->cinfo, COL_INFO))
301 col_add_fstr(pinfo->cinfo, COL_INFO, "Payload seq - 0x%X",
302 tvb_get_ntohl(tvb, offset-4));
304 dissect_payload(overall_unistim_tree,tvb,offset,pinfo);
311 /* Queue packet for tap */
312 tap_queue_packet(unistim_tap, pinfo, uinfo);
317 dissect_payload(proto_tree *overall_unistim_tree,tvbuff_t *tvb, gint offset, packet_info *pinfo){
319 proto_tree *unistim_tree;
320 guint payload_proto=tvb_get_guint8(tvb,offset);
322 /* Payload type for tap */
323 uinfo->payload_type = payload_proto;
325 ti=proto_tree_add_item(overall_unistim_tree,hf_unistim_payload,
328 unistim_tree=proto_item_add_subtree(ti,ett_unistim);
330 switch(payload_proto){
332 /*NULL PROTO - NOTHING LEFT TO DO*/
335 /*UNISTIM only so no term id but further payload work*/
336 /* Collect info for tap */
337 /* If no term id then packet sourced from NI */
338 COPY_ADDRESS(&(uinfo->ni_ip), &(pinfo->src));
339 COPY_ADDRESS(&(uinfo->it_ip), &(pinfo->dst));
340 uinfo->it_port = pinfo->destport;
343 /*UNISTIM with term id*/
344 /* Termid packs are always sourced from the it, so collect relevant infos */
345 COPY_ADDRESS(&(uinfo->ni_ip),&(pinfo->dst));
346 COPY_ADDRESS(&(uinfo->it_ip),&(pinfo->src));
347 uinfo->it_port = pinfo->srcport;
348 uinfo->termid = tvb_get_ntohl(tvb,offset);
350 proto_tree_add_item(unistim_tree,hf_terminal_id,tvb,offset,4,FALSE);
355 offset = dissect_uftp_message(unistim_tree,pinfo,tvb,offset);
358 /*TODO flesh this out probably only for init*/
362 /* Handle UFTP seperately because it is significantly different
363 than standard UNISTIM */
364 while (tvb_length_remaining(tvb, offset) > 0)
365 offset = dissect_unistim_message(unistim_tree,pinfo,tvb,offset);
370 dissect_uftp_message(proto_tree *unistim_tree,packet_info *pinfo _U_,tvbuff_t *tvb,gint offset){
376 proto_tree *msg_tree;
378 ti = proto_tree_add_text(unistim_tree,tvb,offset,-1,"UFTP CMD");
380 msg_tree = proto_item_add_subtree(ti,ett_unistim);
382 command=tvb_get_guint8(tvb,offset);
384 proto_tree_add_item(msg_tree,hf_uftp_command,tvb,offset,1,FALSE);
391 /* Connection request */
396 /* Connection Details */
397 /* Get datablock size */
398 proto_tree_add_item(msg_tree,hf_uftp_datablock_size,tvb,offset,2,FALSE);
400 /* Get datablock limit b4 flow control */
401 proto_tree_add_item(msg_tree,hf_uftp_datablock_limit,tvb,offset,1,FALSE);
404 str_len = tvb_length_remaining(tvb, offset);
405 proto_tree_add_item(msg_tree,hf_uftp_filename,tvb,offset,str_len,FALSE);
410 /* Flow Control off */
415 /* Connection Granted */
420 /* Connection Denied */
425 /* File Data Block */
427 dat_len = tvb_length_remaining(tvb, offset);
428 proto_tree_add_item(msg_tree,hf_uftp_datablock,tvb,offset,dat_len,FALSE);
439 dissect_unistim_message(proto_tree *unistim_tree,packet_info *pinfo,tvbuff_t *tvb,gint offset){
443 proto_tree *msg_tree;
445 ti = proto_tree_add_text(unistim_tree,tvb,offset,-1,"Unistim CMD");
447 msg_tree = proto_item_add_subtree(ti,ett_unistim);
449 address=tvb_get_guint8(tvb,offset);
451 proto_tree_add_item(msg_tree,hf_unistim_cmd_add,tvb,offset,1,FALSE);
454 msg_len=tvb_get_guint8(tvb,offset);
458 ti=proto_tree_add_item(msg_tree,hf_unistim_len,tvb,offset,1,FALSE);
459 expert_add_info_format(pinfo,ti,PI_MALFORMED,PI_ERROR,"Length too short");
460 return tvb_length(tvb);
462 proto_item_set_len(ti,msg_len);
463 proto_tree_add_item(msg_tree,hf_unistim_len,tvb,offset,1,FALSE);
473 /*Broadcast Manager Switch*/
474 offset = dissect_broadcast_switch(msg_tree,tvb,offset,msg_len-2);
477 /*Audio Manager Switch*/
478 offset = dissect_audio_switch(msg_tree,pinfo,tvb,offset,msg_len-2);
481 /*Display Manager Switch*/
482 offset = dissect_display_switch(msg_tree,tvb,offset,msg_len-2);
485 /*Key Indicator Manager Switch*/
486 offset = dissect_key_indicator_switch(msg_tree,tvb,offset,msg_len-2);
489 /*Basic Manager Switch*/
490 offset = dissect_basic_switch(msg_tree,tvb,offset,msg_len-2);
493 /*Network Manager Switch*/
494 offset = dissect_network_switch(msg_tree,tvb,offset,msg_len-2);
497 /*Broadcast Manager phone*/
498 offset = dissect_broadcast_phone(msg_tree,tvb,offset,msg_len-2);
501 /*Audio Manager phone*/
502 offset = dissect_audio_phone(msg_tree,tvb,offset,msg_len-2);
505 /*Display Manager phone*/
506 offset = dissect_display_phone(msg_tree,tvb,offset,msg_len-2);
509 /*Key/Indicator Manager phone*/
510 offset = dissect_key_indicator_phone(msg_tree,tvb,offset,msg_len-2);
513 /*Basic Manager phone*/
514 offset = dissect_basic_phone(msg_tree,tvb,offset,msg_len-2);
517 /*Network Manager Switch*/
518 offset = dissect_network_phone(msg_tree,tvb,offset,msg_len-2);
521 /*See some undocumented messages. Don't want to miss the ones we understand*/
522 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len-2,FALSE);
533 dissect_basic_phone(proto_tree *msg_tree,
534 tvbuff_t *tvb,gint offset, guint msg_len){
538 basic_cmd=tvb_get_guint8(tvb,offset);
540 ti=proto_tree_add_item(msg_tree,hf_basic_phone_cmd,tvb,offset,1,FALSE);
542 offset+=1;msg_len-=1;
546 /*Basic Manager Attributes Info*/
547 proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_stat_cksum,
550 proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_dynam,
553 proto_tree_add_item(msg_tree,hf_basic_phone_eeprom_net_config_cksum,
558 /*Basic Manager Options Report*/
559 proto_tree_add_item(msg_tree,hf_basic_switch_options_secure,
565 proto_tree_add_item(msg_tree,hf_basic_phone_fw_ver,
566 tvb,offset,msg_len,FALSE);
571 proto_tree_add_item(msg_tree,hf_basic_it_type,tvb,offset,1,FALSE);
576 proto_tree_add_item(msg_tree,hf_basic_phone_hw_id,
577 tvb,offset,msg_len,FALSE);
581 /*Product Engineering Code*/
582 proto_tree_add_item(msg_tree,hf_basic_prod_eng_code,
583 tvb,offset,msg_len,FALSE);
588 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
592 /*Encapsulate Command*/
593 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
597 /*Phone Ethernet address*/
598 proto_tree_add_item(msg_tree,hf_basic_ether_address,
599 tvb,offset,msg_len,FALSE);
603 /*not in pdf but get them*/
604 set_ascii_item(msg_tree,tvb,offset,msg_len);
611 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
619 dissect_basic_switch(proto_tree *msg_tree,
620 tvbuff_t *tvb,gint offset,guint msg_len){
622 basic_cmd=tvb_get_guint8(tvb,offset);
623 proto_tree_add_item(msg_tree,hf_basic_switch_cmd,tvb,offset,1,FALSE);
624 offset+=1;msg_len-=1;
627 /*Query Basic Manager*/
628 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
629 proto_tree_add_item(msg_tree,hf_basic_switch_query_attr,
631 proto_tree_add_item(msg_tree,hf_basic_switch_query_opts,
633 proto_tree_add_item(msg_tree,hf_basic_switch_query_fw,
635 proto_tree_add_item(msg_tree,hf_basic_switch_query_hw_id,
637 proto_tree_add_item(msg_tree,hf_basic_switch_query_it_type,
639 proto_tree_add_item(msg_tree,hf_basic_switch_query_prod_eng_code,
641 proto_tree_add_item(msg_tree,hf_basic_switch_query_gray_mkt_info,
646 /*Basic Manager Options*/
647 proto_tree_add_item(msg_tree,hf_basic_switch_options_secure,
653 proto_tree_add_item(msg_tree,hf_basic_switch_element_id,
656 proto_tree_add_item(msg_tree,hf_basic_switch_eeprom_data,
657 tvb,offset,msg_len,FALSE);
661 /*Assign Terminal ID*/
663 uinfo->set_termid = 1;
665 proto_tree_add_item(msg_tree,hf_basic_switch_terminal_id,
666 tvb,offset,msg_len,FALSE);
670 /*Encapsulate Command*/
671 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
675 /*showing up in captures but not in pdf*/
676 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
682 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
693 dissect_broadcast_switch(proto_tree *msg_tree,
694 tvbuff_t *tvb,gint offset, guint msg_len){
696 guint year,month,day,hour,minute,second;
697 proto_item *date_label;
698 proto_item *time_label;
699 proto_tree *date_tree;
700 proto_tree *time_tree;
701 bcast_cmd=tvb_get_guint8(tvb,offset);
702 proto_tree_add_item(msg_tree,hf_broadcast_switch_cmd,tvb,offset,1,FALSE);
706 /*Accessory Sync Update - len=3 */
709 /*Logical Icon Update*/
710 proto_tree_add_item(msg_tree,hf_basic_bit_field,
712 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,
714 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,
719 /*Time and Date Download*/
720 year=tvb_get_guint8(tvb,offset);
721 month=tvb_get_guint8(tvb,offset+1);
722 day=tvb_get_guint8(tvb,offset+2);
723 hour=tvb_get_guint8(tvb,offset+3);
724 minute=tvb_get_guint8(tvb,offset+4);
725 second=tvb_get_guint8(tvb,offset+5);
726 date_label=proto_tree_add_text(msg_tree,tvb,offset,3,
727 "Date %i/%i/%i",month,day,year%100);
728 date_tree=proto_item_add_subtree(date_label,ett_unistim);
729 proto_tree_add_item(date_tree,hf_broadcast_year,tvb,offset,1,FALSE);
731 proto_tree_add_item(date_tree,hf_broadcast_month,tvb,offset,1,FALSE);
733 proto_tree_add_item(date_tree,hf_broadcast_day,tvb,offset,1,FALSE);
736 time_label=proto_tree_add_text(msg_tree,tvb,offset,3,
737 "Time %i:%i:%i",hour,minute,second);
738 time_tree=proto_item_add_subtree(time_label,ett_unistim);
739 proto_tree_add_item(time_tree,hf_broadcast_hour,tvb,offset,1,FALSE);
741 proto_tree_add_item(time_tree,hf_broadcast_minute,tvb,offset,1,FALSE);
743 proto_tree_add_item(time_tree,hf_broadcast_second,tvb,offset,1,FALSE);
747 /*Set Default Character Table Config */
748 /* UGLY may work may not*/
749 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
756 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
762 /*DONE Haven't seen any phone broadcasts, wouldn't expect to*/
764 dissect_broadcast_phone(proto_tree *msg_tree,
765 tvbuff_t *tvb, gint offset,guint msg_len){
767 proto_tree_add_item(msg_tree,hf_generic_data, tvb,offset,msg_len,FALSE);
775 dissect_display_switch(proto_tree *msg_tree,
776 tvbuff_t *tvb, gint offset,guint msg_len){
779 guint time_date_mask;
783 proto_tree *address_tree;
785 display_cmd=tvb_get_guint8(tvb,offset);
786 proto_tree_add_item(msg_tree,hf_display_switch_cmd,tvb,offset,1,FALSE);
787 offset+=1;msg_len-=1;
791 /*Restore Default Character Table Configuration length = 3*/
795 proto_tree_add_item(msg_tree,hf_display_arrow,tvb,offset,1,FALSE);
799 /*Query Status Bar Icon*/
800 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
804 /*Highlight Off length = 3*/
807 /*Highlight On length = 3*/
810 /*Restore Time and Date length = 3*/
813 /*Clear Time and Date length = 3*/
816 /*Call Duration Timer*/
817 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
818 proto_tree_add_item(msg_tree,hf_display_call_timer_mode,tvb,offset,
820 proto_tree_add_item(msg_tree,hf_display_call_timer_reset,tvb,offset,
822 proto_tree_add_item(msg_tree,hf_display_call_timer_display,tvb,offset,
824 proto_tree_add_item(msg_tree,hf_display_call_timer_delay,tvb,offset,
826 offset+=1;msg_len-=1;
827 proto_tree_add_item(msg_tree,hf_display_call_timer_id,tvb,offset,
829 offset+=1;msg_len-=1;
832 /*Query Display Manager*/
833 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
837 /*Download Call Duration Timer Delay*/
838 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
842 /*Disable Display Field*/
843 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
848 clear_mask=tvb_get_guint8(tvb,offset);
849 /*need to know which paths to take*/
850 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
851 proto_tree_add_item(msg_tree,hf_display_clear_numeric,
853 proto_tree_add_item(msg_tree,hf_display_clear_context,
855 proto_tree_add_item(msg_tree,hf_display_clear_date,
858 proto_tree_add_item(msg_tree,hf_display_clear_time,
860 proto_tree_add_item(msg_tree,hf_display_clear_line,
862 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon,
864 proto_tree_add_item(msg_tree,hf_display_clear_softkey,
866 proto_tree_add_item(msg_tree,hf_display_clear_softkey_label,
868 offset+=1;msg_len-=1;
869 if((clear_mask&DISPLAY_CLEAR_LINE)==DISPLAY_CLEAR_LINE){
870 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
871 proto_tree_add_item(msg_tree,hf_display_clear_line_1,
873 proto_tree_add_item(msg_tree,hf_display_clear_line_2,
875 proto_tree_add_item(msg_tree,hf_display_clear_line_3,
877 proto_tree_add_item(msg_tree,hf_display_clear_line_4,
879 proto_tree_add_item(msg_tree,hf_display_clear_line_5,
881 proto_tree_add_item(msg_tree,hf_display_clear_line_6,
883 proto_tree_add_item(msg_tree,hf_display_clear_line_7,
885 proto_tree_add_item(msg_tree,hf_display_clear_line_8,
887 offset+=1;msg_len-=1;
889 if((clear_mask&DISPLAY_CLEAR_STATUS_BAR_ICON)==
890 DISPLAY_CLEAR_STATUS_BAR_ICON){
891 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
892 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_1,
894 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_2,
896 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_3,
898 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_4,
900 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_5,
902 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_6,
904 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_7,
906 proto_tree_add_item(msg_tree,hf_display_clear_status_bar_icon_8,
908 offset+=1;msg_len-=1;
910 if((clear_mask&DISPLAY_CLEAR_SOFTKEY)==DISPLAY_CLEAR_SOFTKEY){
911 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
912 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_1,
914 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_2,
916 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_3,
918 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_4,
920 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_5,
922 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_6,
924 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_7,
926 proto_tree_add_item(msg_tree,hf_display_clear_soft_key_8,
928 offset+=1;msg_len-=1;
930 if((clear_mask&DISPLAY_CLEAR_SOFTKEY_LABEL)==DISPLAY_CLEAR_SOFTKEY_LABEL){
931 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
932 proto_tree_add_item(msg_tree,hf_display_clear_sk_label_key_id,tvb,offset,1,FALSE);
933 proto_tree_add_item(msg_tree,hf_display_clear_all_slks,tvb,offset,1,FALSE);
934 offset+=1;msg_len-=1;
939 movement_byte=tvb_get_guint8(tvb,offset);
940 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
941 proto_tree_add_item(msg_tree,hf_display_cursor_move_cmd,tvb,offset,1,FALSE);
942 proto_tree_add_item(msg_tree,hf_display_cursor_blink,tvb,offset,1,FALSE);
943 offset+=1;msg_len-=1;
948 if((movement_byte&0x01)==0x01){
949 address_byte=tvb_get_guint8(tvb,offset);
950 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
951 proto_tree_add_item(msg_tree,hf_display_write_address_numeric,
953 proto_tree_add_item(msg_tree,hf_display_write_address_context,
955 proto_tree_add_item(msg_tree,hf_display_write_address_line,
957 proto_tree_add_item(msg_tree,hf_display_write_address_soft_key,
959 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
960 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)
961 proto_tree_add_item(msg_tree,
962 hf_display_write_address_softkey_id,
964 offset+=1;msg_len-=1;
970 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
971 proto_tree_add_item(msg_tree,hf_display_write_address_char_pos,
973 proto_tree_add_item(msg_tree,hf_display_write_address_line_number,
975 offset+=1;msg_len-=1;
978 /*Display Scroll with Data (before)*/
979 set_ascii_item(msg_tree,tvb,offset,msg_len);
983 /*Display Scroll with Data (after)*/
984 set_ascii_item(msg_tree,tvb,offset,msg_len);
988 /*Status Bar Icon Update*/
989 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
990 proto_tree_add_item(msg_tree,hf_icon_id,tvb,offset,1,FALSE);
992 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
993 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,
995 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,
1000 /*Month Labels Download*/
1001 set_ascii_item(msg_tree,tvb,offset,msg_len);
1005 /*Call Duration Timer Label Download*/
1006 set_ascii_item(msg_tree,tvb,offset,msg_len);
1007 offset+=1;msg_len-=1;
1010 /*Time and Date Format*/
1011 time_date_mask=tvb_get_guint8(tvb,offset);
1012 if((time_date_mask&DISPLAY_USE_TIME_FORMAT)==DISPLAY_USE_TIME_FORMAT){
1013 proto_tree_add_item(msg_tree,hf_display_time_format,tvb,offset,1,FALSE);
1015 if((time_date_mask&DISPLAY_USE_DATE_FORMAT)==DISPLAY_USE_DATE_FORMAT){
1016 proto_tree_add_item(msg_tree,hf_display_date_format,tvb,offset,1,FALSE);
1018 proto_tree_add_item(msg_tree,hf_display_use_time_format,tvb,offset,1,FALSE);
1019 proto_tree_add_item(msg_tree,hf_display_use_date_format,tvb,offset,1,FALSE);
1020 offset+=1;msg_len-=1;
1023 /*address|no control|no tag|no*/
1024 set_ascii_item(msg_tree,tvb,offset,msg_len);
1028 /*address|yes control|no tag|no*/
1029 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address");
1031 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1032 address_byte=tvb_get_guint8(tvb,offset);
1033 proto_tree_add_item(address_tree,hf_basic_bit_field,
1034 tvb,offset,1,FALSE);
1035 proto_tree_add_item(address_tree,hf_display_write_address_numeric,
1036 tvb,offset,1,FALSE);
1037 proto_tree_add_item(address_tree,hf_display_write_address_context,
1038 tvb,offset,1,FALSE);
1039 proto_tree_add_item(address_tree,hf_display_write_address_line,
1040 tvb,offset,1,FALSE);
1041 proto_tree_add_item(address_tree,hf_display_write_address_soft_key,
1042 tvb,offset,1,FALSE);
1043 proto_tree_add_item(address_tree,hf_display_write_address_soft_label,
1044 tvb,offset,1,FALSE);
1046 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1047 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG){
1048 proto_tree_add_item(address_tree,
1049 hf_display_write_address_softkey_id,
1050 tvb,offset,1,FALSE);
1052 offset+=1;msg_len-=1;
1053 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1054 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1055 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1056 proto_tree_add_item(address_tree,
1057 hf_display_write_address_char_pos,
1058 tvb,offset,1,FALSE);
1059 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)!=
1060 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1061 offset+=1;msg_len-=1;
1064 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1065 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1066 proto_tree_add_item(address_tree,
1067 hf_display_write_address_line_number,
1068 tvb,offset,1,FALSE);
1069 offset+=1;msg_len-=1;
1072 /* I'm guessing this will work flakily at best */
1073 uinfo->string_data = tvb_get_string(tvb,offset,msg_len);
1074 set_ascii_item(msg_tree,tvb,offset,msg_len);
1080 /*address|no control|yes tag|no*/
1081 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1082 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1083 tvb,offset,1,FALSE);
1084 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1085 tvb,offset,1,FALSE);
1086 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1087 tvb,offset,1,FALSE);
1088 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1089 tvb,offset,1,FALSE);
1090 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1091 tvb,offset,1,FALSE);
1092 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1093 tvb,offset,1,FALSE);
1094 offset+=1;msg_len-=1;
1095 set_ascii_item(msg_tree,tvb,offset,msg_len);
1097 proto_tree_add_item(msg_tree,hf_generic_string,
1098 tvb,offset,msg_len,FALSE);
1102 /*address|yes control|yes tag|no*/
1103 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address Data");
1104 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1105 address_byte=tvb_get_guint8(tvb,offset);
1106 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1107 proto_tree_add_item(address_tree,
1108 hf_display_write_address_numeric,
1109 tvb,offset,1,FALSE);
1110 proto_tree_add_item(address_tree,
1111 hf_display_write_address_context,
1112 tvb,offset,1,FALSE);
1113 proto_tree_add_item(address_tree,
1114 hf_display_write_address_line,
1115 tvb,offset,1,FALSE);
1116 proto_tree_add_item(address_tree,
1117 hf_display_write_address_soft_key,
1118 tvb,offset,1,FALSE);
1119 proto_tree_add_item(address_tree,
1120 hf_display_write_address_soft_label,
1121 tvb,offset,1,FALSE);
1122 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1123 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG){
1124 proto_tree_add_item(address_tree,hf_display_write_address_softkey_id,
1125 tvb,offset,1,FALSE);
1126 offset+=1; msg_len-=1;
1128 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1129 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1130 proto_tree_add_item(address_tree,
1131 hf_display_write_address_char_pos,
1132 tvb,offset,1,FALSE);
1133 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)!=
1134 DISPLAY_WRITE_ADDRESS_LINE_FLAG)
1135 offset+=1;msg_len-=1;
1137 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1138 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1139 proto_tree_add_item(address_tree,
1140 hf_display_write_address_line_number,
1141 tvb,offset,1,FALSE);
1142 offset+=1;msg_len-=1;
1144 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1145 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1146 tvb,offset,1,FALSE);
1147 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1148 tvb,offset,1,FALSE);
1149 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1150 tvb,offset,1,FALSE);
1151 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1152 tvb,offset,1,FALSE);
1153 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1154 tvb,offset,1,FALSE);
1155 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1156 tvb,offset,1,FALSE);
1157 offset+=1;msg_len-=1;
1158 set_ascii_item(msg_tree,tvb,offset,msg_len);
1162 /*address|no control|no tag|yes*/
1163 proto_tree_add_item(msg_tree,hf_display_write_tag,tvb,offset,1,FALSE);
1164 offset+=1;msg_len-=1;
1165 set_ascii_item(msg_tree,tvb,offset,msg_len);
1169 /*address|yes control|no tag|yes*/
1170 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address Data");
1171 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1172 address_byte=tvb_get_guint8(tvb,offset);
1173 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1174 proto_tree_add_item(address_tree,hf_display_write_address_numeric,tvb,
1176 proto_tree_add_item(address_tree,hf_display_write_address_context,
1177 tvb,offset,1,FALSE);
1178 proto_tree_add_item(address_tree,hf_display_write_address_line,
1179 tvb,offset,1,FALSE);
1180 proto_tree_add_item(address_tree,hf_display_write_address_soft_key,
1181 tvb,offset,1,FALSE);
1182 proto_tree_add_item(address_tree,hf_display_write_address_soft_label,
1183 tvb,offset,1,FALSE);
1184 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1185 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)
1186 proto_tree_add_item(address_tree,
1187 hf_display_write_address_softkey_id,
1188 tvb,offset,1,FALSE);
1189 offset+=1; msg_len-=1;
1190 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1191 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1192 proto_tree_add_item(address_tree,
1193 hf_display_write_address_char_pos,
1194 tvb,offset,1,FALSE);
1195 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)!=
1196 DISPLAY_WRITE_ADDRESS_LINE_FLAG)
1197 offset+=1;msg_len-=1;
1199 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1200 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1201 proto_tree_add_item(address_tree,hf_display_write_address_line_number,
1202 tvb,offset,1,FALSE);
1203 offset+=1;msg_len-=1;
1205 set_ascii_item(msg_tree,tvb,offset,msg_len);
1209 /*address|no control|yes tag|yes*/
1210 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1211 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1212 tvb,offset,1,FALSE);
1213 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1214 tvb,offset,1,FALSE);
1215 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1216 tvb,offset,1,FALSE);
1217 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1218 tvb,offset,1,FALSE);
1219 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1220 tvb,offset,1,FALSE);
1221 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1222 tvb,offset,1,FALSE);
1223 offset+=1;msg_len-=1;
1225 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1227 proto_tree_add_item(msg_tree,hf_display_write_tag,tvb,offset,1,FALSE);
1228 offset+=1;msg_len-=1;
1229 set_ascii_item(msg_tree,tvb,offset,msg_len);
1233 /*address|yes control|yes tag|yes*/
1234 tmp_ti=proto_tree_add_text(msg_tree,tvb,offset,0,"Address");
1235 address_tree=proto_item_add_subtree(tmp_ti,ett_unistim);
1236 address_byte=tvb_get_guint8(tvb,offset);
1237 proto_tree_add_item(address_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1238 proto_tree_add_item(address_tree,hf_display_write_address_numeric,
1239 tvb,offset,1,FALSE);
1240 proto_tree_add_item(address_tree,hf_display_write_address_context,
1241 tvb,offset,1,FALSE);
1242 proto_tree_add_item(address_tree,hf_display_write_address_line,
1243 tvb,offset,1,FALSE);
1244 proto_tree_add_item(address_tree,hf_display_write_address_soft_key,
1245 tvb,offset,1,FALSE);
1246 proto_tree_add_item(address_tree,hf_display_write_address_soft_label,
1247 tvb,offset,1,FALSE);
1248 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)==
1249 DISPLAY_WRITE_ADDRESS_SOFT_KEY_FLAG)
1250 proto_tree_add_item(address_tree,hf_display_write_address_softkey_id,
1251 tvb,offset,1,FALSE);
1252 offset+=1; msg_len-=1;
1253 proto_tree_add_item(msg_tree,hf_generic_string,
1254 tvb,offset,msg_len,FALSE);
1256 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)==
1257 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG){
1258 proto_tree_add_item(address_tree,hf_display_write_address_char_pos,
1259 tvb,offset,1,FALSE);
1260 if((address_byte&DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)!=
1261 DISPLAY_WRITE_ADDRESS_SOFT_LABEL_FLAG)
1262 offset+=1;msg_len-=1;
1264 if((address_byte&DISPLAY_WRITE_ADDRESS_LINE_FLAG)==
1265 DISPLAY_WRITE_ADDRESS_LINE_FLAG){
1266 proto_tree_add_item(address_tree,
1267 hf_display_write_address_line_number,
1268 tvb,offset,1,FALSE);
1269 offset+=1;msg_len-=1;
1271 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1272 proto_tree_add_item(msg_tree,hf_display_write_cursor_move,
1273 tvb,offset,1,FALSE);
1274 proto_tree_add_item(msg_tree,hf_display_write_clear_left,
1275 tvb,offset,1,FALSE);
1276 proto_tree_add_item(msg_tree,hf_display_write_clear_right,
1277 tvb,offset,1,FALSE);
1278 proto_tree_add_item(msg_tree,hf_display_write_shift_left,
1279 tvb,offset,1,FALSE);
1280 proto_tree_add_item(msg_tree,hf_display_write_shift_right,
1281 tvb,offset,1,FALSE);
1282 proto_tree_add_item(msg_tree,hf_display_write_highlight,
1283 tvb,offset,1,FALSE);
1284 offset+=1;msg_len-=1;
1285 proto_tree_add_item(msg_tree,hf_display_write_tag,
1286 tvb,offset,1,FALSE);
1287 offset+=1;msg_len-=1;
1288 set_ascii_item(msg_tree,tvb,offset,msg_len);
1292 /*Context Info Bar Format*/
1294 proto_tree_add_item(msg_tree,hf_display_context_format,tvb,offset,1,FALSE);
1295 proto_tree_add_item(msg_tree,hf_display_context_field,tvb,offset,1,FALSE);
1296 offset+=1;msg_len-=1;
1300 /*Set Default Character Table Configuration VERY UGLY*/
1301 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1305 /*Special Character Download*/
1306 proto_tree_add_item(msg_tree,hf_display_char_address,tvb,offset,1,FALSE);
1307 offset+=1;msg_len-=1;
1308 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1312 /*Highlighted Field Definition*/
1313 highlight_cmd=tvb_get_guint8(tvb,offset);
1314 proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,FALSE);
1315 proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,FALSE);
1316 proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,FALSE);
1317 proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,FALSE);
1318 proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,FALSE);
1319 offset+=1;msg_len-=1;proto_tree_add_item(msg_tree,hf_display_hlight_start,tvb,offset,1,FALSE);
1320 offset+=1;msg_len-=1;
1321 proto_tree_add_item(msg_tree,hf_display_hlight_end,tvb,offset,1,FALSE);
1322 offset+=1;msg_len-=1;
1325 if((highlight_cmd&DISPLAY_CURSOR_LINE)==DISPLAY_CURSOR_LINE){
1326 proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,FALSE);
1327 proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,FALSE);
1328 offset+=1;msg_len-=1;
1330 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1335 proto_tree_add_item(msg_tree,hf_display_contrast,tvb,offset,1,FALSE);
1336 offset+=1;msg_len-=1;
1339 /*Caller Log Download*/
1340 proto_tree_add_item(msg_tree,hf_broadcast_hour,tvb,offset,msg_len,FALSE);
1341 offset+=1;msg_len-=1;
1342 proto_tree_add_item(msg_tree,hf_broadcast_minute,tvb,offset,msg_len,FALSE);
1343 offset+=1;msg_len-=1;
1344 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1348 /*Layered Softkey Text Download*/
1349 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1350 offset+=1;msg_len-=1;
1351 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1352 offset+=1;msg_len-=1;
1353 set_ascii_item(msg_tree,tvb,offset,msg_len);
1357 /*Layered Softkey Clear*/
1358 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1359 proto_tree_add_item(msg_tree,hf_display_layer_all_skeys,tvb,offset,msg_len,FALSE);
1360 offset+=1;msg_len-=1;
1361 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1362 offset+=1;msg_len-=1;
1365 /*Set Visible Softkey Layer*/
1366 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1367 proto_tree_add_item(msg_tree,hf_display_layer_all_skeys,tvb,offset,msg_len,FALSE);
1368 offset+=1;msg_len-=1;
1369 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1370 offset+=1;msg_len-=1;
1373 /*Layered Softkey Cadence Download*/
1374 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1375 proto_tree_add_item(msg_tree,hf_display_once_or_cyclic,tvb,offset,msg_len,FALSE);
1376 offset+=1;msg_len-=1;
1378 proto_tree_add_item(msg_tree,hf_display_layer_number,tvb,offset,1,FALSE);
1379 offset+=1;msg_len-=1;
1380 proto_tree_add_item(msg_tree,hf_display_layer_duration,tvb,offset,1,FALSE);
1381 offset+=1;msg_len-=1;
1385 /*Layered Softkey Cadencing On*/
1386 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1387 offset+=1;msg_len-=1;
1390 /*Layered Softkey Cadencing Off*/
1391 proto_tree_add_item(msg_tree,hf_display_layer_skey_id,tvb,offset,1,FALSE);
1392 offset+=1;msg_len-=1;
1398 proto_tree_add_item(msg_tree,hf_generic_data,
1399 tvb,offset,msg_len,FALSE);
1407 dissect_display_phone(proto_tree *msg_tree,
1408 tvbuff_t *tvb,gint offset,guint msg_len){
1410 guint highlight_cmd;
1411 display_cmd=tvb_get_guint8(tvb,offset);
1412 proto_tree_add_item(msg_tree,hf_display_phone_cmd,tvb,offset,1,FALSE);
1414 switch(display_cmd){
1416 /*Display Manager Attributes Info*/
1417 proto_tree_add_item(msg_tree,hf_display_line_width,tvb,offset,1,FALSE);
1418 proto_tree_add_item(msg_tree,hf_display_lines,tvb,offset,1,FALSE);
1419 offset+=1;msg_len-=1;
1420 proto_tree_add_item(msg_tree,hf_display_softkey_width,tvb,offset,1,FALSE);
1421 proto_tree_add_item(msg_tree,hf_display_softkeys,tvb,offset,1,FALSE);
1422 proto_tree_add_item(msg_tree,hf_display_icon,tvb,offset,1,FALSE);
1423 offset+=1;msg_len-=1;
1424 proto_tree_add_item(msg_tree,hf_display_softlabel_key_width,tvb,offset,1,FALSE);
1425 proto_tree_add_item(msg_tree,hf_display_context_width,tvb,offset,1,FALSE);
1426 offset+=1;msg_len-=1;
1427 proto_tree_add_item(msg_tree,hf_display_numeric_width,tvb,offset,1,FALSE);
1428 proto_tree_add_item(msg_tree,hf_display_time_width,tvb,offset,1,FALSE);
1429 proto_tree_add_item(msg_tree,hf_display_date_width,tvb,offset,1,FALSE);
1430 offset+=1;msg_len-=1;
1431 proto_tree_add_item(msg_tree,hf_display_char_dload,tvb,offset,1,FALSE);
1432 proto_tree_add_item(msg_tree,hf_display_freeform_icon_dload,tvb,offset,1,FALSE);
1433 proto_tree_add_item(msg_tree,hf_display_icon_type,tvb,offset,1,FALSE);
1434 offset+=1;msg_len-=1;
1435 proto_tree_add_item(msg_tree,hf_display_charsets,tvb,offset,1,FALSE);
1436 offset+=1;msg_len-=1;
1440 /*Contrast Level Report*/
1441 proto_tree_add_item(msg_tree,hf_display_contrast,tvb,offset,1,FALSE);
1442 offset+=1;msg_len-=1;
1445 /*Cursor Location Report*/
1446 proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,FALSE);
1447 proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,FALSE);
1448 proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,FALSE);
1449 proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,FALSE);
1450 proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,FALSE);
1451 offset+=1;msg_len-=1;
1452 proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,FALSE);
1453 proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,FALSE);
1454 offset+=1;msg_len-=1;
1457 /*Highlight Status On*/
1458 highlight_cmd=tvb_get_guint8(tvb,offset);
1459 proto_tree_add_item(msg_tree,hf_display_cursor_numeric,tvb,offset,1,FALSE);
1460 proto_tree_add_item(msg_tree,hf_display_cursor_context ,tvb,offset,1,FALSE);
1461 proto_tree_add_item(msg_tree,hf_display_cursor_line,tvb,offset,1,FALSE);
1462 proto_tree_add_item(msg_tree,hf_display_cursor_softkey,tvb,offset,1,FALSE);
1463 proto_tree_add_item(msg_tree,hf_display_cursor_softkey_id,tvb,offset,1,FALSE);
1464 offset+=1;msg_len-=1;proto_tree_add_item(msg_tree,hf_display_hlight_start,tvb,offset,1,FALSE);
1465 offset+=1;msg_len-=1;
1466 proto_tree_add_item(msg_tree,hf_display_hlight_end,tvb,offset,1,FALSE);
1467 offset+=1;msg_len-=1;
1468 if((highlight_cmd&DISPLAY_CURSOR_LINE)==DISPLAY_CURSOR_LINE){
1469 proto_tree_add_item(msg_tree,hf_display_cursor_char_pos,tvb,offset,1,FALSE);
1470 proto_tree_add_item(msg_tree,hf_display_cursor_line_number,tvb,offset,1,FALSE);
1471 offset+=1;msg_len-=1;
1475 /*Current Character Table Configuration Status VERY UGLY*/
1476 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1480 /*Default Character Table Configuration Status VERY UGLY*/
1481 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1485 /*Timer And Date Format Report*/
1486 proto_tree_add_item(msg_tree,hf_display_time_format,tvb,offset,1,FALSE);
1487 proto_tree_add_item(msg_tree,hf_display_date_format,tvb,offset,1,FALSE);
1488 offset+=1;msg_len-=1;
1491 /*Status Bar Icon State Report*/
1492 proto_tree_add_item(msg_tree,hf_icon_id,tvb,offset,msg_len,FALSE);
1493 offset+=1;msg_len-=1;
1494 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,tvb,offset,msg_len,FALSE);
1495 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,tvb,offset,msg_len,FALSE);
1496 offset+=1;msg_len-=1;
1499 /*Highlight Status Off length = 3*/
1505 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1514 dissect_key_indicator_switch(proto_tree *msg_tree,
1515 tvbuff_t *tvb, gint offset,guint msg_len){
1517 key_cmd=tvb_get_guint8(tvb,offset);
1518 proto_tree_add_item(msg_tree,hf_key_switch_cmd,tvb,offset,1,FALSE);
1519 offset+=1;msg_len-=1;
1523 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1524 proto_tree_add_item(msg_tree,hf_key_led_cadence,tvb,offset,1,FALSE);
1525 proto_tree_add_item(msg_tree,hf_key_led_id,tvb,offset,1,FALSE);
1526 offset+=1;msg_len-=1;
1529 /*Query Hookswitch length = 3 */
1532 /*User Activity Timer Stop length = 3*/
1535 /*User Activity Timer Start length = 3*/
1538 /*Downloadable Free Form Icon Access (Hardcoded) length of 3*/
1541 /*Downloadable Free Form Icon Access (Downloadable) length of 3*/
1544 /*Query Key/Indicator Manager*/
1545 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1549 /*Key/Indicator Manager Options*/
1550 proto_tree_add_item(msg_tree,hf_keys_send_key_rel,tvb,offset,1,FALSE);
1551 proto_tree_add_item(msg_tree,hf_keys_enable_vol,tvb,offset,1,FALSE);
1552 proto_tree_add_item(msg_tree,hf_keys_conspic_prog_key,tvb,offset,1,FALSE);
1553 proto_tree_add_item(msg_tree,hf_keys_acd_super_control,tvb,offset,1,FALSE);
1554 proto_tree_add_item(msg_tree,hf_keys_local_dial_feedback,tvb,offset,1,FALSE);
1555 offset+=1;msg_len-=1;
1558 /*Logical Icon Mapping*/
1559 proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,FALSE);
1560 proto_tree_add_item(msg_tree,hf_keys_admin_command,tvb,offset,1,FALSE);
1561 offset+=1;msg_len-=1;
1562 proto_tree_add_item(msg_tree,hf_keys_logical_icon_id,tvb,offset,2,FALSE);
1563 offset+=2;msg_len-=2;
1566 /*Key Repeat Timer Download*/
1567 proto_tree_add_item(msg_tree,hf_keys_repeat_timer_one,tvb,offset,1,FALSE);
1568 offset+=1;msg_len-=1;
1569 proto_tree_add_item(msg_tree,hf_keys_repeat_timer_two,tvb,offset,1,FALSE);
1570 offset+=1;msg_len-=1;
1574 proto_tree_add_item(msg_tree,hf_keys_led_id,tvb,offset,1,FALSE);
1575 offset+=1;msg_len-=1;
1578 /*Query Phone Icon State*/
1579 proto_tree_add_item(msg_tree,hf_keys_phone_icon_id,tvb,offset,1,FALSE);
1580 offset+=1;msg_len-=1;
1583 /*Indicator Cadence Download*/
1585 proto_tree_add_item(msg_tree,hf_keys_cadence_on_time,tvb,offset,1,FALSE);
1586 offset+=1;msg_len-=1;
1587 proto_tree_add_item(msg_tree,hf_keys_cadence_off_time,tvb,offset,1,FALSE);
1588 offset+=1;msg_len-=1;
1592 /*User Activity Timer Download*/
1593 proto_tree_add_item(msg_tree,hf_keys_user_activity_timeout,tvb,offset,1,FALSE);
1594 offset+=1;msg_len-=1;
1597 /*Free Form Icon Download*/
1598 proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,FALSE);
1599 offset+=1;msg_len-=1;
1600 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1604 /*Phone Icon Update*/
1605 proto_tree_add_item(msg_tree,hf_key_icon_id,tvb,offset,1,FALSE);
1606 offset+=1;msg_len-=1;
1607 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1608 proto_tree_add_item(msg_tree,hf_broadcast_icon_state,tvb,offset,1,FALSE);
1609 proto_tree_add_item(msg_tree,hf_broadcast_icon_cadence,tvb,offset,1,FALSE);
1610 offset+=1;msg_len-=1;
1614 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1618 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1627 dissect_key_indicator_phone(proto_tree *msg_tree,
1628 tvbuff_t *tvb,gint offset, guint msg_len){
1630 key_cmd=tvb_get_guint8(tvb,offset);
1631 proto_tree_add_item(msg_tree,hf_key_phone_cmd,tvb,offset,1,FALSE);
1632 offset+=1;msg_len-=1;
1636 /* Set the tap info */
1637 uinfo->key_state = tvb_get_guint8(tvb,offset);
1638 uinfo->key_state >>= 6;
1639 /* Extract the key code */
1640 uinfo->key_val = (tvb_get_guint8(tvb,offset) & 0x3F);
1642 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1643 proto_tree_add_item(msg_tree,hf_key_code,tvb,offset,1,FALSE);
1644 proto_tree_add_item(msg_tree,hf_key_command,tvb,offset,1,FALSE);
1648 /*LED Status Report*/
1649 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1653 /*On Hook length = 3*/
1654 /* Set tap info.. */
1655 uinfo->hook_state = 0;
1659 /*Off Hook length = 3*/
1660 /* Set tap info.. */
1661 uinfo->hook_state = 1;
1665 /*User Activity Timer Expired length = 3*/
1668 /*Hookswitch State (on hook) length = 3*/
1671 /*Hookswitch State (off hook) length = 3*/
1674 /*Key/Indicator Manager Attributes Info*/
1675 proto_tree_add_item(msg_tree,hf_key_programmable_keys,tvb,offset,1,FALSE);
1676 proto_tree_add_item(msg_tree,hf_keys_soft_keys,tvb,offset,1,FALSE);
1677 offset+=1;msg_len-=1;
1678 proto_tree_add_item(msg_tree,hf_keys_hd_key,tvb,offset,1,FALSE);
1679 proto_tree_add_item(msg_tree,hf_keys_mute_key,tvb,offset,1,FALSE);
1680 proto_tree_add_item(msg_tree,hf_keys_quit_key,tvb,offset,1,FALSE);
1681 proto_tree_add_item(msg_tree,hf_keys_copy_key,tvb,offset,1,FALSE);
1682 proto_tree_add_item(msg_tree,hf_keys_mwi_key,tvb,offset,1,FALSE);
1683 offset+=1;msg_len-=1;
1684 proto_tree_add_item(msg_tree,hf_keys_num_nav_keys,tvb,offset,1,FALSE);
1685 proto_tree_add_item(msg_tree,hf_keys_num_conspic_keys,tvb,offset,1,FALSE);
1686 offset+=1;msg_len-=1;
1690 /*Key/Indicator Manager Options Report*/
1691 proto_tree_add_item(msg_tree,hf_keys_send_key_rel,tvb,offset,1,FALSE);
1692 proto_tree_add_item(msg_tree,hf_keys_enable_vol,tvb,offset,1,FALSE);
1693 proto_tree_add_item(msg_tree,hf_keys_conspic_prog_key,tvb,offset,1,FALSE);
1694 proto_tree_add_item(msg_tree,hf_keys_acd_super_control,tvb,offset,1,FALSE);
1695 proto_tree_add_item(msg_tree,hf_keys_local_dial_feedback,tvb,offset,1,FALSE);
1696 offset+=1;msg_len-=1;
1699 /*Phone Icon Status Report*/
1700 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1707 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1717 dissect_network_switch(proto_tree *msg_tree,
1718 tvbuff_t *tvb,gint offset, guint msg_len){
1720 network_cmd=tvb_get_guint8(tvb,offset);
1721 proto_tree_add_item(msg_tree,hf_network_switch_cmd,tvb,offset,1,FALSE);
1722 offset+=1;msg_len-=1;
1723 switch(network_cmd){
1731 /*Query Network Manager*/
1732 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1733 proto_tree_add_item(msg_tree,hf_net_diag_flag,tvb,offset,1,FALSE);
1734 proto_tree_add_item(msg_tree,hf_net_managers_flag,tvb,offset,1,FALSE);
1735 proto_tree_add_item(msg_tree,hf_net_attributes_flag,tvb,offset,1,FALSE);
1736 proto_tree_add_item(msg_tree,hf_net_serv_info_flag,tvb,offset,1,FALSE);
1737 proto_tree_add_item(msg_tree,hf_net_options_flag,tvb,offset,1,FALSE);
1738 proto_tree_add_item(msg_tree,hf_net_sanity_flag,tvb,offset,1,FALSE);
1742 /*Network Manager Options*/
1743 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1744 proto_tree_add_item(msg_tree,hf_net_enable_diag,tvb,offset,1,FALSE);
1745 proto_tree_add_item(msg_tree,hf_net_enable_rudp,tvb,offset,1,FALSE);
1749 /*QoS Configuration*/
1750 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1754 /*Set RTCP Source Description Item*/
1755 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1759 /*Download Server Information*/
1760 proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,FALSE);
1762 proto_tree_add_item(msg_tree,hf_net_server_port,tvb,offset,2,FALSE);
1764 proto_tree_add_item(msg_tree,hf_net_server_action,tvb,offset,1,FALSE);
1766 proto_tree_add_item(msg_tree,hf_net_server_retry_count,tvb,offset,1,FALSE);
1768 proto_tree_add_item(msg_tree,hf_net_server_failover_id,tvb,offset,1,FALSE);
1770 proto_tree_add_item(msg_tree,hf_net_server_ip_address,tvb,offset,4,FALSE);
1775 proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,FALSE);
1779 /*Query Network Configuration Element*/
1780 proto_tree_add_item(msg_tree,hf_net_server_config_element,
1781 tvb,offset-1,1,FALSE);
1785 /*Download Software Upgrade*/
1786 proto_tree_add_item(msg_tree,hf_net_file_xfer_mode,tvb,offset,1,FALSE);
1787 proto_tree_add_item(msg_tree,hf_net_force_download,tvb,offset,1,FALSE);
1788 proto_tree_add_item(msg_tree,hf_net_use_file_server_port,tvb,offset,1,FALSE);
1789 proto_tree_add_item(msg_tree,hf_net_use_local_port,tvb,offset,1,FALSE);
1790 offset+=1;msg_len-=1;
1791 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,1,FALSE);
1792 offset+=1;msg_len-=1;
1793 set_ascii_null_term_item(msg_tree,tvb,offset,msg_len,"Full Pathname :");
1794 set_ascii_null_term_item(msg_tree,tvb,offset,msg_len,"File Identifier :");
1795 proto_tree_add_item(msg_tree,hf_net_file_server_port,tvb,offset,2,FALSE);
1796 offset+=2;msg_len-=2;
1797 proto_tree_add_item(msg_tree,hf_net_local_port,tvb,offset,2,FALSE);
1798 offset+=2;msg_len-=2;
1799 proto_tree_add_item(msg_tree,hf_net_file_server_address,tvb,offset,4,FALSE);
1800 offset+=4;msg_len-=4;
1803 /*Set RTCP Report Interval*/
1804 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1808 /*Set Primary Server*/
1809 proto_tree_add_item(msg_tree,hf_net_server_id,tvb,offset,1,FALSE);
1814 proto_tree_add_item(msg_tree,hf_net_server_time_out,
1815 tvb,offset,2,FALSE);
1819 /*Set Recovery Procedure Time Interval*/
1820 proto_tree_add_item(msg_tree,hf_net_server_recovery_time_low,
1821 tvb,offset,2,FALSE);
1823 proto_tree_add_item(msg_tree,hf_net_server_recovery_time_high,
1824 tvb,offset,2,FALSE);
1828 /*Transport Reliability Layer Parameters Download*/
1829 proto_tree_add_item(msg_tree,hf_generic_data,
1830 tvb,offset,msg_len,FALSE);
1835 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1839 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1849 dissect_network_phone(proto_tree *msg_tree,
1850 tvbuff_t *tvb,gint offset, guint msg_len){
1852 proto_tree *server_tree;
1855 network_cmd=tvb_get_guint8(tvb,offset);
1856 proto_tree_add_item(msg_tree,hf_network_phone_cmd,tvb,offset,1,FALSE);
1858 switch(network_cmd){
1860 /*Soft Reset Ack done length = 3*/
1863 /*Sanity OK done length = 3*/
1866 /*Network Manager Attributes Info*/
1867 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1871 /*Network Manager Diagnostic Info*/
1872 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1873 proto_tree_add_item(msg_tree,hf_net_phone_rx_ovr_flag,
1874 tvb,offset,1,FALSE);
1875 proto_tree_add_item(msg_tree,hf_net_phone_tx_ovr_flag,
1876 tvb,offset,1,FALSE);
1877 proto_tree_add_item(msg_tree,hf_net_phone_rx_empty_flag,
1878 tvb,offset,1,FALSE);
1879 proto_tree_add_item(msg_tree,hf_net_phone_invalid_msg_flag,
1880 tvb,offset,1,FALSE);
1881 proto_tree_add_item(msg_tree,hf_net_phone_eeprom_insane_flag,
1882 tvb,offset,1,FALSE);
1883 proto_tree_add_item(msg_tree,hf_net_phone_eeprom_unsafe_flag,
1884 tvb,offset,1,FALSE);
1889 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1893 /*Network Manager Options Report*/
1894 proto_tree_add_boolean(msg_tree,hf_net_phone_diag,tvb,offset,1,FALSE);
1895 proto_tree_add_item(msg_tree,hf_net_phone_rudp,tvb,offset,1,FALSE);
1899 /*Resume Connection with Server done*/
1902 /*Suspend Connection with Server done*/
1905 /*Network Configuration Element Report*/
1906 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1910 /*Server Information Report*/
1911 proto_tree_add_item(msg_tree,hf_net_phone_primary_server_id,
1912 tvb,offset,1,FALSE);
1913 offset+=1;msg_len-=1;
1914 for (i=1; msg_len>8; i++){
1915 /*if less than 9 not full report so punt*/
1916 /* guint16 port_num;
1917 port_num=tvb_get_ntohs(tvb,offset);
1921 server=proto_tree_add_text(msg_tree,tvb,offset,9,
1922 "Server (S%d) Server ID: %X",i,i-1);
1923 server_tree=proto_item_add_subtree(server,ett_unistim);
1924 proto_tree_add_item(server_tree,
1925 hf_net_phone_server_port,
1926 tvb,offset,2,FALSE);
1927 offset+=2;msg_len-=2;
1928 proto_tree_add_item(server_tree,
1929 hf_net_phone_server_action,
1930 tvb,offset,1,FALSE);
1931 offset+=1;msg_len-=1;
1932 proto_tree_add_item(server_tree,
1933 hf_net_phone_server_retry_count,
1934 tvb,offset,1,FALSE);
1935 offset+=1;msg_len-=1;
1936 proto_tree_add_item(server_tree,
1937 hf_net_phone_server_failover_id,
1938 tvb,offset,1,FALSE);
1939 offset+=1;msg_len-=1;
1940 proto_tree_add_item(server_tree,hf_net_phone_server_ip,
1941 tvb,offset,4,FALSE);
1942 offset+=4;msg_len-=4;
1949 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
1957 dissect_audio_switch(proto_tree *msg_tree,packet_info *pinfo,
1958 tvbuff_t *tvb,gint offset,guint msg_len){
1959 proto_tree *param_tree;
1964 guint vocoder_param;
1965 audio_cmd=tvb_get_guint8(tvb,offset);
1966 proto_tree_add_item(msg_tree,hf_audio_switch_cmd,tvb,offset,1,FALSE);
1967 offset+=1;msg_len-=1;
1970 /*Query Audio Manager*/
1971 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1972 proto_tree_add_item(msg_tree,hf_audio_mgr_attr,tvb,offset,1,FALSE);
1973 proto_tree_add_item(msg_tree,hf_audio_mgr_opts,tvb,offset,1,FALSE);
1974 proto_tree_add_item(msg_tree,hf_audio_mgr_alert,tvb,offset,1,FALSE);
1975 proto_tree_add_item(msg_tree,hf_audio_mgr_adj_rx_vol,tvb,offset,1,FALSE);
1976 proto_tree_add_item(msg_tree,hf_audio_mgr_def_rx_vol,tvb,offset,1,FALSE);
1977 proto_tree_add_item(msg_tree,hf_audio_mgr_handset,tvb,offset,1,FALSE);
1978 proto_tree_add_item(msg_tree,hf_audio_mgr_headset,tvb,offset,1,FALSE);
1980 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
1981 tvb,offset,1,FALSE);
1985 /*Query Supervisor Headset Status*/
1989 /*Audio Manager Options*/
1990 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
1991 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_max_vol,
1992 tvb,offset,1,FALSE);
1993 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_adj_vol,
1994 tvb,offset,1,FALSE);
1995 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_aa_rx_vol_rpt,
1996 tvb,offset,1,FALSE);
1997 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_hs_on_air,
1998 tvb,offset,1,FALSE);
1999 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_hd_on_air,
2000 tvb,offset,1,FALSE);
2001 proto_tree_add_item(msg_tree,hf_audio_mgr_opt_noise_squelch,
2002 tvb,offset,1,FALSE);
2008 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2009 proto_tree_add_item(msg_tree,hf_audio_mgr_mute,tvb,offset,1,FALSE);
2010 proto_tree_add_item(msg_tree,hf_audio_mgr_tx_rx,tvb,offset,1,FALSE);
2011 offset+=1;msg_len-=1;
2012 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,
2013 tvb,offset,1,FALSE);
2014 offset+=1;msg_len-=1;
2018 /*Transducer Based Tone On*/
2019 proto_tree_add_item(msg_tree,
2020 hf_audio_mgr_transducer_based_tone_id,
2021 tvb,offset,1,FALSE);
2022 proto_tree_add_item(msg_tree,hf_audio_mgr_attenuated,
2023 tvb,offset,1,FALSE);
2027 /*Transducer Based Tone Off*/
2028 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_based_tone_id,
2029 tvb,offset,1,FALSE);
2033 /*Alerting Tone Configuration*/
2034 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2035 proto_tree_add_item(msg_tree,hf_audio_mgr_warbler_select,
2036 tvb,offset,1,FALSE);
2037 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
2038 tvb,offset,1,FALSE);
2040 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2041 proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
2042 tvb,offset,1,FALSE);
2043 proto_tree_add_item(msg_tree,hf_audio_mgr_cadence_select,
2044 tvb,offset,1,FALSE);
2048 /*Special Tone Configuration*/
2049 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
2050 tvb,offset,1,FALSE);
2052 proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
2053 tvb,offset,1,FALSE);
2055 proto_tree_add_item(msg_tree,hf_audio_special_tone,tvb,offset,1,FALSE);
2059 /*Paging Tone Configuration*/
2060 proto_tree_add_item(msg_tree,hf_audio_mgr_transducer_routing,
2061 tvb,offset,1,FALSE);
2063 proto_tree_add_item(msg_tree,hf_audio_mgr_tone_vol_range,
2064 tvb,offset,1,FALSE);
2065 proto_tree_add_item(msg_tree,hf_audio_mgr_cadence_select,
2066 tvb,offset,1,FALSE);
2070 /*Alerting Tone Cadence Download*/
2071 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2076 /*Paging Tone Cadence Download*/
2077 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2082 /*Transducer Based Tone Volume Level*/
2083 proto_tree_add_item(msg_tree,hf_basic_bit_field,
2084 tvb,offset,1,FALSE);
2085 proto_tree_add_item(msg_tree,
2086 hf_audio_mgr_transducer_based_tone_id,
2087 tvb,offset,1,FALSE);
2088 proto_tree_add_item(msg_tree,hf_audio_tone_level,tvb,offset,1,FALSE);
2092 /*Visual Transducer Based Tone Enable*/
2093 proto_tree_add_item(msg_tree,hf_audio_visual_tones,
2094 tvb,offset,1,FALSE);
2098 /*Stream Based Tone On*/
2099 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2100 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_id,
2101 tvb,offset,1,FALSE);
2102 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_rx_tx,
2103 tvb,offset,1,FALSE);
2104 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_mute,
2105 tvb,offset,1,FALSE);
2107 proto_tree_add_item(msg_tree,hf_audio_stream_id,tvb,offset,1,FALSE);
2109 proto_tree_add_item(msg_tree,hf_audio_stream_based_volume,tvb,offset,1,FALSE);
2113 /*Stream Based Tone Off*/
2114 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2115 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_id,
2116 tvb,offset,1,FALSE);
2117 proto_tree_add_item(msg_tree,hf_audio_stream_based_tone_rx_tx,
2118 tvb,offset,1,FALSE);
2120 proto_tree_add_item(msg_tree,hf_audio_stream_id,tvb,offset,1,FALSE);
2124 /*Stream Based Tone Frequency Component List Download*/
2125 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2129 /*Stream Based Tone Cadence Download*/
2130 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2134 /*Select Adjustable Rx Volume*/
2135 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
2136 tvb,offset,1,FALSE);
2139 /*Set APB's Rx Volume Level*/
2140 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2144 /*Change Adjustable Rx Volume (quieter) DONE*/
2145 proto_tree_add_item(msg_tree,hf_generic_data,
2146 tvb,offset,msg_len,FALSE);
2150 /*Change Adjustable Rx Volume (louder) DONE*/
2151 proto_tree_add_item(msg_tree,hf_generic_data,
2152 tvb,offset,msg_len,FALSE);
2156 /*Adjust Default Rx Volume(quieter)*/
2157 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
2158 tvb,offset,1,FALSE);
2161 /*Adjust Default Rx Volume(louder)*/
2162 proto_tree_add_item(msg_tree,hf_audio_default_rx_vol_id,
2163 tvb,offset,1,FALSE);
2167 proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,FALSE);
2168 offset+=1;msg_len-=1;
2170 apb_op_code=tvb_get_guint8(tvb,offset);
2171 proto_tree_add_item(msg_tree,hf_audio_apb_op_code,tvb,
2173 offset+=1;msg_len-=1;
2174 if(apb_op_code>0x39){
2175 /*should have a len + data*/
2176 apb_data_len=tvb_get_guint8(tvb,offset);
2177 proto_tree_add_item(msg_tree,hf_audio_apb_param_len,tvb,
2179 offset+=1;msg_len-=1;
2180 proto_tree_add_item(msg_tree,hf_audio_apb_data,tvb,
2181 offset,apb_data_len,FALSE);
2182 offset+=apb_data_len;msg_len-=apb_data_len;
2187 /*Open Audio Stream*/
2188 /* Set the tap info */
2189 uinfo->stream_connect = 1;
2191 proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,FALSE);
2192 offset+=1;msg_len-=1;
2193 proto_tree_add_item(msg_tree,hf_audio_tx_stream_id,tvb,offset,1,FALSE);
2194 offset+=1;msg_len-=1;
2195 proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,FALSE);
2196 offset+=1;msg_len-=1;
2197 proto_tree_add_item(msg_tree,hf_tx_vocoder_type,tvb,offset,1,FALSE);
2198 offset+=1;msg_len-=1;
2199 proto_tree_add_item(msg_tree,hf_frames_per_packet,tvb,offset,1,FALSE);
2200 offset+=1;msg_len-=1;
2201 proto_tree_add_item(msg_tree,hf_audio_tos,tvb,offset,1,FALSE);
2202 proto_tree_add_item(msg_tree,hf_audio_precedence,tvb,offset,1,FALSE);
2203 proto_tree_add_item(msg_tree,hf_audio_frf_11,tvb,offset,1,FALSE);
2204 offset+=1;msg_len-=1;
2205 proto_tree_add_item(msg_tree,hf_rtcp_bucket_id,
2206 tvb,offset,1,FALSE);
2207 offset+=1;msg_len-=1;
2208 proto_tree_add_item(msg_tree,hf_generic_data,
2209 tvb,offset,4,FALSE);
2210 offset+=4;msg_len-=4;
2211 proto_tree_add_item(msg_tree,hf_audio_lcl_rtp_port,
2212 tvb,offset,2,FALSE);
2213 offset+=2;msg_len-=2;
2214 proto_tree_add_item(msg_tree,hf_audio_lcl_rtcp_port,
2215 tvb,offset,2,FALSE);
2216 offset+=2;msg_len-=2;
2218 proto_tree_add_item(msg_tree,hf_audio_far_rtp_port,
2219 tvb,offset,2,FALSE);
2220 offset+=2;msg_len-=2;
2221 proto_tree_add_item(msg_tree,hf_audio_far_rtcp_port,
2222 tvb,offset,2,FALSE);
2223 offset+=2;msg_len-=2;
2225 /* Sometimes the open stream does not specify an endpoint */
2226 /* In this circumstance the packet is truncated at the far end */
2229 proto_tree_add_item(msg_tree,hf_audio_far_ip_add,tvb,offset,4,FALSE);
2230 offset+=4;msg_len-=4;
2232 guint32 far_ip_addr;
2236 far_ip_addr = tvb_get_ipv4(tvb, offset-4);
2237 SET_ADDRESS(&far_addr, AT_IPv4, 4, &far_ip_addr);
2239 far_port = tvb_get_ntohs(tvb, offset-8);
2240 rtp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num, NULL);
2242 far_port = tvb_get_ntohs(tvb, offset-6);
2243 rtcp_add_address(pinfo, &far_addr, far_port, 0, "UNISTIM", pinfo->fd->num);
2248 /*Close Audio Stream*/
2249 /* Set the tap info */
2250 uinfo->stream_connect = 0;
2252 proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,FALSE);
2253 offset+=1;msg_len-=1;
2254 proto_tree_add_item(msg_tree,hf_audio_tx_stream_id,tvb,offset,1,FALSE);
2255 offset+=1;msg_len-=1;
2258 /*Connect Transducer*/
2259 /* Tap info again */
2260 uinfo->trans_connect = 1;
2262 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
2263 proto_tree_add_item(msg_tree,hf_audio_transducer_pair,tvb,offset,1,FALSE);
2264 proto_tree_add_item(msg_tree,hf_audio_rx_enable,tvb,offset,1,FALSE);
2265 proto_tree_add_item(msg_tree,hf_audio_tx_enable,tvb,offset,1,FALSE);
2266 offset+=1;msg_len-=1;
2267 proto_tree_add_item(msg_tree,hf_basic_bit_field, tvb,offset,1,FALSE);
2268 proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,FALSE);
2269 proto_tree_add_item(msg_tree,hf_audio_sidetone_disable,tvb,offset,1,FALSE);
2270 proto_tree_add_item(msg_tree,hf_audio_destruct_additive,tvb,offset,1,FALSE);
2271 proto_tree_add_item(msg_tree,hf_audio_dont_force_active,tvb,offset,1,FALSE);
2272 offset+=1;msg_len-=1;
2274 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,TRUE);
2275 offset+=1;msg_len-=1;
2279 /*Filter Block Download*/
2280 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2284 /*Query RTCP Statistics*/
2285 proto_tree_add_item(msg_tree,hf_audio_rtcp_bucket_id,tvb,offset,1,FALSE);
2286 proto_tree_add_item(msg_tree,hf_audio_clear_bucket,tvb,offset,1,FALSE);
2288 offset+=1;msg_len-=1;
2291 /*Configure Vocoder Parameters*/
2292 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,TRUE);
2293 offset+=1;msg_len-=1;
2294 proto_tree_add_item(msg_tree,hf_audio_vocoder_id,tvb,offset,1,FALSE),
2295 offset+=1;msg_len-=1;
2297 param=proto_tree_add_text(msg_tree,tvb,offset,0,"Param");
2298 param_tree=proto_item_add_subtree(param,ett_unistim);
2299 vocoder_param=tvb_get_guint8(tvb,offset);
2300 proto_tree_add_item(param_tree,hf_basic_bit_field,
2301 tvb,offset,1,FALSE);
2302 proto_tree_add_item(param_tree,hf_audio_vocoder_param,
2303 tvb,offset,1,FALSE);
2304 proto_tree_add_item(param_tree,hf_audio_vocoder_entity,
2305 tvb,offset,1,FALSE);
2306 offset+=1;msg_len-=1;
2307 if((vocoder_param&0x0a)==0x0a){
2308 proto_tree_add_item(param_tree,hf_audio_vocoder_annexa,
2309 tvb,offset,1,FALSE);
2310 proto_tree_add_item(param_tree,hf_audio_vocoder_annexb,
2311 tvb,offset,1,FALSE);
2312 offset+=1;msg_len-=1;
2314 else if((vocoder_param&0x0b)==0x0b){
2315 proto_tree_add_item(param_tree,hf_audio_sample_rate,
2316 tvb,offset,1,FALSE);
2317 offset+=1;msg_len-=1;
2319 else if((vocoder_param&0x0c)==0x0c){
2320 proto_tree_add_item(param_tree,hf_audio_rtp_type,
2321 tvb,offset,1,FALSE);
2322 offset+=1;msg_len-=1;
2324 else if((vocoder_param&0x20)==0x20){
2325 proto_tree_add_item(param_tree,hf_audio_bytes_per_frame,
2326 tvb,offset,2,FALSE);
2327 offset+=2;msg_len-=2;
2332 /*Query RTCP Bucket's SDES Information*/
2333 proto_tree_add_item(msg_tree,hf_audio_source_descr,tvb,offset,msg_len,FALSE);
2334 proto_tree_add_item(msg_tree,hf_audio_sdes_rtcp_bucket,tvb,offset,msg_len,FALSE);
2335 offset+=1;msg_len-=1;
2338 /*Jitter Buffer Parameters Configuration*/
2339 proto_tree_add_item(msg_tree,hf_audio_rx_stream_id,tvb,offset,1,FALSE);
2340 offset+=1;msg_len-=1;
2341 proto_tree_add_item(msg_tree,hf_audio_desired_jitter,tvb,offset,1,FALSE);
2342 offset+=1;msg_len-=1;
2343 proto_tree_add_item(msg_tree,hf_audio_high_water_mark,tvb,offset,1,FALSE);
2344 offset+=1;msg_len-=1;
2345 proto_tree_add_item(msg_tree,hf_audio_early_packet_resync_thresh,tvb,
2347 offset+=4;msg_len-=4;
2348 proto_tree_add_item(msg_tree,hf_audio_late_packet_resync_thresh,tvb,
2350 offset+=4;msg_len-=4;
2353 /*Resolve Port Mapping*/
2354 proto_tree_add_item(msg_tree,hf_audio_resolve_phone_port,tvb,offset,1,FALSE);
2355 offset+=2;msg_len-=2;
2356 proto_tree_add_item(msg_tree,hf_audio_far_end_echo_port,tvb,offset,1,FALSE);
2357 offset+=2;msg_len-=2;
2358 proto_tree_add_item(msg_tree,hf_audio_far_end_ip_address,tvb,offset,1,FALSE);
2359 offset+=4;msg_len-=4;
2362 /*Port Mpping Discovery Ack*/
2363 proto_tree_add_item(msg_tree,hf_audio_nat_port,tvb,offset,1,FALSE);
2364 offset+=2;msg_len-=2;
2365 proto_tree_add_item(msg_tree,hf_audio_nat_ip_address,tvb,offset,1,FALSE);
2366 offset+=4;msg_len-=4;
2369 /*Query Audio Stream Status*/
2370 proto_tree_add_item(msg_tree,hf_audio_direction_code,tvb,offset,1,FALSE);
2371 offset+=1;msg_len-=1;
2372 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,FALSE);
2373 offset+=1;msg_len-=1;
2378 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2387 dissect_audio_phone(proto_tree *msg_tree,
2388 tvbuff_t *tvb,gint offset,guint msg_len){
2394 audio_cmd=tvb_get_guint8(tvb,offset);
2395 proto_tree_add_item(msg_tree,hf_audio_phone_cmd,tvb,offset,1,FALSE);
2396 offset+=1;msg_len-=1;
2399 /*Handset Connected length =3*/
2400 /* Set the tap info */
2401 uinfo->hook_state = 1;
2404 /*Handset Disconnected length =3*/
2405 /* Set the tap info */
2406 uinfo->hook_state = 0;
2409 /*Headset Connected length =3*/
2410 /* Set the tap info */
2411 uinfo->hook_state = 1;
2414 /*Headset Disconnected length =3*/
2415 /* Set the tap info */
2416 uinfo->hook_state = 0;
2419 /*Supervisor Headset Connected length =3*/
2420 /* Set the tap info */
2421 uinfo->hook_state = 1;
2424 /*Supervisor Headset Disconnected length =3*/
2425 /* Set the tap info */
2426 uinfo->hook_state = 0;
2429 /*Audio Manager Attributes Info*/
2430 proto_tree_add_item(msg_tree,hf_audio_hf_support,tvb,1,msg_len,FALSE);
2431 offset+=1;msg_len-=1;
2433 proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,FALSE);
2434 offset+=1;msg_len-=1;
2438 /*Audio Manager Options Report*/
2439 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2440 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_max,tvb,offset,1,FALSE);
2441 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_adj_vol,tvb,offset,1,FALSE);
2442 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_auto_adj_vol,tvb,offset,1,FALSE);
2443 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_hs_on_air,tvb,offset,1,FALSE);
2444 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_hd_on_air,tvb,offset,1,FALSE);
2445 proto_tree_add_item(msg_tree,hf_audio_opt_rpt_noise_squelch,tvb,offset,1,FALSE);
2446 offset+=1;msg_len-=1;
2449 /*Adjustable Rx Volume Report*/
2450 proto_tree_add_item(msg_tree,hf_basic_bit_field,tvb,offset,1,FALSE);
2451 proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,FALSE);
2452 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,FALSE);
2453 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,FALSE);
2454 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,FALSE);
2455 offset+=1;msg_len-=1;
2458 /*Adjustable Rx Volume Information*/
2459 proto_tree_add_item(msg_tree,hf_audio_current_adj_vol_id,tvb,offset,1,FALSE);
2460 proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,FALSE);
2461 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,FALSE);
2462 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,FALSE);
2463 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,FALSE);
2464 offset+=1;msg_len-=1;
2465 proto_tree_add_item(msg_tree,hf_audio_current_rx_level,tvb,offset,1,FALSE);
2466 offset+=1;msg_len-=1;
2467 proto_tree_add_item(msg_tree,hf_audio_current_rx_range,tvb,offset,1,FALSE);
2468 offset+=1;msg_len-=1;
2471 /*APB's Default Rx Volume Value*/
2472 proto_tree_add_item(msg_tree,hf_audio_current_adj_vol_id,tvb,offset,1,FALSE);
2473 proto_tree_add_item(msg_tree,hf_audio_rx_vol_apb_rpt,tvb,offset,1,FALSE);
2474 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_up,tvb,offset,1,FALSE);
2475 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_floor,tvb,offset,1,FALSE);
2476 proto_tree_add_item(msg_tree,hf_audio_rx_vol_vol_ceiling,tvb,offset,1,FALSE);
2477 offset+=1;msg_len-=1;
2478 proto_tree_add_item(msg_tree,hf_audio_current_rx_level,tvb,offset,1,FALSE);
2479 offset+=1;msg_len-=1;
2480 proto_tree_add_item(msg_tree,hf_audio_current_rx_range,tvb,offset,1,FALSE);
2481 offset+=1;msg_len-=1;
2484 /*Alerting Tone Select*/
2485 proto_tree_add_item(msg_tree,hf_audio_cadence_select,tvb,offset,1,FALSE);
2486 proto_tree_add_item(msg_tree,hf_audio_warbler_select,tvb,offset,1,FALSE);
2487 offset+=1;msg_len-=1;
2490 /*RTCP Statistics Report UGLY*/
2491 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2495 /*Open Audio Stream Report*/
2496 proto_tree_add_item(msg_tree,hf_audio_open_stream_rpt,tvb,offset,1,FALSE);
2497 offset+=1;msg_len-=1;
2500 /*RTCP Bucket SDES Information Report*/
2501 proto_tree_add_item(msg_tree,hf_audio_sdes_rpt_source_desc,tvb,offset,1,FALSE);
2502 proto_tree_add_item(msg_tree,hf_audio_sdes_rpt_buk_id,tvb,offset,1,FALSE);
2503 offset+=1;msg_len-=1;
2504 set_ascii_item(msg_tree,tvb,offset,msg_len);
2508 /*Port Mapping Discovery*/
2509 proto_tree_add_item(msg_tree,hf_audio_phone_port,tvb,offset,2,FALSE);
2510 offset+=2;msg_len-=2;
2511 proto_tree_add_item(msg_tree,hf_audio_phone_ip,tvb,offset,4,FALSE);
2512 offset+=4;msg_len-=4;
2515 /*Resolve Port Mapping*/
2516 proto_tree_add_item(msg_tree,hf_audio_nat_listen_port,tvb,offset,2,FALSE);
2517 offset+=2;msg_len-=2;
2518 proto_tree_add_item(msg_tree,hf_audio_nat_ip,tvb,offset,4,FALSE);
2519 offset+=4;msg_len-=4;
2520 proto_tree_add_item(msg_tree,hf_audio_nat_add_len,tvb,offset,1,FALSE);
2521 offset+=1;msg_len-=1;
2522 proto_tree_add_item(msg_tree,hf_audio_phone_port,tvb,offset,2,FALSE);
2523 offset+=2;msg_len-=2;
2524 proto_tree_add_item(msg_tree,hf_audio_phone_ip,tvb,offset,4,FALSE);
2525 offset+=4;msg_len-=4;
2526 proto_tree_add_item(msg_tree,hf_audio_phone_add_len,tvb,offset,1,FALSE);
2527 offset+=1;msg_len-=1;
2530 /*Audio Stream Status Report*/
2531 stream_dir=tvb_get_guint8(tvb,offset);
2532 proto_tree_add_item(msg_tree,hf_audio_stream_direction_code,tvb,offset,1,FALSE);
2533 offset+=1;msg_len-=1;
2534 proto_tree_add_item(msg_tree,hf_audio_mgr_stream_id,tvb,offset,1,FALSE);
2535 offset+=1;msg_len-=1;
2536 stream_state=tvb_get_guint8(tvb,offset);
2537 proto_tree_add_item(msg_tree,hf_audio_stream_state,tvb,offset,1,FALSE);
2538 offset+=1;msg_len-=1;
2539 if((AUDIO_STREAM_STATE&stream_state)!=AUDIO_STREAM_STATE)
2541 if((AUDIO_STREAM_DIRECTION_RX&stream_dir)==AUDIO_STREAM_DIRECTION_RX)
2542 proto_tree_add_item(msg_tree,hf_rx_vocoder_type,tvb,offset,1,FALSE);
2543 else if((AUDIO_STREAM_DIRECTION_TX&stream_dir)==AUDIO_STREAM_DIRECTION_TX)
2544 proto_tree_add_item(msg_tree,hf_tx_vocoder_type,tvb,offset,1,FALSE);
2546 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,1,FALSE);
2547 offset+=1;msg_len-=1;
2548 proto_tree_add_item(msg_tree,hf_frames_per_packet,tvb,offset,1,FALSE);
2549 offset+=1;msg_len-=1;
2550 proto_tree_add_item(msg_tree,hf_audio_tos,tvb,offset,1,FALSE);
2551 proto_tree_add_item(msg_tree,hf_audio_precedence,tvb,offset,1,FALSE);
2552 proto_tree_add_item(msg_tree,hf_audio_frf_11,tvb,offset,1,FALSE);
2553 offset+=1;msg_len-=1;
2554 proto_tree_add_item(msg_tree,hf_rtcp_bucket_id,tvb,offset,1,FALSE);
2555 offset+=1;msg_len-=1;
2556 proto_tree_add_item(msg_tree,hf_audio_lcl_rtp_port,tvb,offset,2,FALSE);
2557 offset+=2;msg_len-=2;
2558 proto_tree_add_item(msg_tree,hf_audio_lcl_rtcp_port,tvb,offset,2,FALSE);
2559 offset+=2;msg_len-=2;
2560 proto_tree_add_item(msg_tree,hf_audio_far_rtp_port,tvb,offset,2,FALSE);
2561 offset+=2;msg_len-=2;
2562 proto_tree_add_item(msg_tree,hf_audio_far_rtcp_port,tvb,offset,2,FALSE);
2563 offset+=2;msg_len-=2;
2564 proto_tree_add_item(msg_tree,hf_audio_far_ip_add,tvb,offset,4,FALSE);
2565 offset+=4;msg_len-=4;
2566 proto_tree_add_item(msg_tree,hf_audio_transducer_list_length,tvb,offset,1,FALSE);
2567 offset+=1;msg_len-=1;
2569 proto_tree_add_item(msg_tree,hf_audio_transducer_pair,tvb,offset,1,FALSE);
2570 offset+=1;msg_len-=1;
2573 /*Query APB Response*/
2574 proto_tree_add_item(msg_tree,hf_audio_apb_number,tvb,offset,1,FALSE);
2575 offset+=1;msg_len-=1;
2577 apb_op_code=tvb_get_guint8(tvb,offset);
2578 proto_tree_add_item(msg_tree,hf_audio_apb_op_code,tvb,
2580 offset+=1;msg_len-=1;
2581 if(apb_op_code>0x39){
2582 /*should have a len + data*/
2583 apb_data_len=tvb_get_guint8(tvb,offset);
2584 proto_tree_add_item(msg_tree,hf_audio_apb_param_len,tvb,
2586 offset+=1;msg_len-=1;
2587 proto_tree_add_item(msg_tree,hf_audio_apb_data,tvb,
2588 offset,apb_data_len,FALSE);
2589 offset+=apb_data_len;msg_len-=apb_data_len;
2597 proto_tree_add_item(msg_tree,hf_generic_data,tvb,offset,msg_len,FALSE);
2605 set_ascii_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len){
2607 gsize buffer_index=0;
2608 guint16 msg_index=0;
2610 char *label="DATA: ";
2611 #define MAX_BUFFER 1024
2612 buffer=ep_alloc(MAX_BUFFER);
2614 buffer_index=g_strlcpy(buffer,label,MAX_BUFFER);
2615 while((buffer_index<MAX_BUFFER-2)&&(msg_index<msg_len)){
2616 character=tvb_get_guint8(tvb,offset+msg_index);
2618 if((character>0x1f)&&(character<0x7f)){
2619 /*g_vsnprintf called in proto_tree_add_text blows up if you end up with %s as text so escape %*/
2621 buffer[buffer_index]='%';
2624 buffer[buffer_index]=character;
2628 buffer[buffer_index]='.';
2632 buffer[buffer_index]='\0';
2634 proto_tree_add_text(msg_tree,tvb,offset,msg_len,"%s",buffer);
2638 set_ascii_null_term_item(proto_tree *msg_tree,tvbuff_t *tvb, gint offset,guint msg_len,char *label){
2640 gsize buffer_index=0;
2641 guint16 msg_index=0;
2643 #define MAX_BUFFER 1024
2644 buffer=ep_alloc(MAX_BUFFER);
2646 buffer_index=g_strlcpy(buffer,label,MAX_BUFFER);
2647 while((buffer_index<MAX_BUFFER-2)&&(msg_index<msg_len)){
2648 character=tvb_get_guint8(tvb,offset+msg_index);
2650 if((character>0x1f)&&(character<0x7f)){
2651 /*g_vsnprintf called in proto_tree_add_text blows up if you end up with %s as text so escape %*/
2653 buffer[buffer_index]='%';
2656 buffer[buffer_index]=character;
2659 else if(character==0x00)
2662 buffer[buffer_index]='.';
2666 buffer[buffer_index]='\0';
2668 proto_tree_add_text(msg_tree,tvb,offset,msg_len,"%s",buffer);