shift_value = get_byte_offset(bo);
mask = make_mask(num_bits, shift_value);
- data = tvb_get_ntohs(tvb, get_start_octet(bo));
+ if (( mask & 0xff ) == 0 ) data = tvb_get_guint8(tvb, get_start_octet(bo)) << 8;
+ else data = tvb_get_ntohs(tvb, get_start_octet(bo));
return (data & mask) >> (16 - shift_value - num_bits);
}
bit_proto_tree_add_bit_field8(proto_tree *tree, tvbuff_t *tvb,
guint64 bo, guint8 bl) {
/* XXX: Use varargs */
- guint16 value = tvb_get_ntohs(tvb, get_start_octet(bo));
guint16 mask = make_mask(bl, get_byte_offset(bo));
- char *label = get_bit_field_label16(value, mask);
+ guint16 value;
guint8 end_i;
int i;
proto_item *pi;
+ char *label;
+ if (( mask & 0xff ) == 0 ) value = tvb_get_guint8 ( tvb , get_start_octet(bo)) << 8;
+ else value = tvb_get_ntohs(tvb, get_start_octet(bo));
+ label = get_bit_field_label16(value, mask);
DISSECTOR_ASSERT(bl < 9);
value = tvb_get_bits8(tvb, bo, bl);
if (value == 1) {
bo += bl;
- bl = 1;
- if (!struct_bits_exist(start_bo, struct_length, bo, bl)) return;
ti = bit_proto_tree_add_text(tree, tvb, bo, bl, "Multislot capability");
- /* Temporary length */
- bo += bl;
tf = proto_item_add_subtree(ti, ett_bssgp_msrac_multislot_capability);
/* HSCSD Multislot Class */
proto_item_append_text(pi, ": Reserved");
}
}
+ else
+ {
+ pi = bit_proto_tree_add_bit_field8(tf, tvb, bo-1, bl);
+ proto_item_append_text(pi, "HSCSD Multislot Class - Bits are not available" );
+ }
/* GPRS Multislot Class, GPRS Extended Dynamic Allocation Capability */
bl = 1;
proto_item_append_text(pi, "GPRS Extended Dynamic Allocation Capability: Extended Dynamic Allocation for GPRS is%s implemented",
value == 0 ? " not" : "");
}
+ else
+ {
+ pi = bit_proto_tree_add_bit_field8(tf, tvb, bo-1, bl);
+ proto_item_append_text(pi, "GPRS Multislot Class: Multislot Class - Bits are not available" );
+ }
/* SMS Value, SM Value */
bl = 1;
"SM_VALUE: %u/4 timeslot (~%u microseconds)",
value + 1, (value + 1) * 144);
}
+ else
+ {
+ pi = bit_proto_tree_add_bit_field8(tf, tvb, bo-1, bl);
+ proto_item_append_text(pi, "SMS Value, SM Value - Bits are not available" );
+ }
+
/* Additions in release 99 */
/* ECSD Multislot Class */
proto_item_append_text(pi, ": Reserved");
}
}
+ else
+ {
+ pi = bit_proto_tree_add_bit_field8(tf, tvb, bo-1, bl);
+ proto_item_append_text(pi, "ECSD Multislot Class - Bits are not available" );
+ }
/* EGPRS Multislot Class, EGPRS Extended Dynamic Allocation Capability */
bl = 1;
proto_item_append_text(pi, "EGPRS Extended Dynamic Allocation Capability: Extended Dynamic Allocation for EGPRS is%s implemented",
value == 0 ? " not" : "");
}
+ else
+ {
+ pi = bit_proto_tree_add_bit_field8(tf, tvb, bo-1, bl);
+ proto_item_append_text(pi, "EGPRS Multislot Class: Multislot Class - Bits are not available");
+ }
/* DTM GPRS Multislot Class */
bl = 1;
m_bits = ctrl_fld_fb & 0x0F;
info_len = crc_start - offset;
-
+
switch (m_bits)
{
case U_DM:
tmp = byte1 & 0x7C;
tmp = tmp >> 2;
- uinfo_field = proto_tree_add_text(ui_tree, tvb, location, (ending - 1),
- "XID Parameter Type: %s",
- val_to_str(tmp, xid_param_type_str,"Reserved Type:%X"));
+
+ if (( xid_param_len > 0 ) && ( xid_param_len <=4 ))
+ {
+ unsigned long value = 0;
+ int i;
+ for (i=1;i<=xid_param_len;i++) {
+ value <<= 8;
+ value |= (unsigned long)tvb_get_guint8(tvb, location+i );
+ }
+ uinfo_field = proto_tree_add_text(ui_tree, tvb, location, (ending - 1),
+ "XID Parameter Type: %s - Value: %lu",
+ val_to_str(tmp, xid_param_type_str,"Reserved Type:%X"),value);
+ }
+ else
+ uinfo_field = proto_tree_add_text(ui_tree, tvb, location, (ending - 1),
+ "XID Parameter Type: %s",
+ val_to_str(tmp, xid_param_type_str,"Reserved Type:%X"));
uinfo_tree = proto_item_add_subtree(uinfo_field, ett_ui);
proto_tree_add_uint(uinfo_tree, hf_llcgprs_xid_xl, tvb, location,