static int hf_wimaxasncp_tlv_type = -1;
static int hf_wimaxasncp_tlv_length = -1;
static int hf_wimaxasncp_tlv_value_bytes = -1;
+static int hf_wimaxasncp_tlv_value_bitflags8 = -1;
static int hf_wimaxasncp_tlv_value_bitflags16 = -1;
static int hf_wimaxasncp_tlv_value_bitflags32 = -1;
static int hf_wimaxasncp_tlv_value_protocol = -1;
static gint ett_wimaxasncp = -1;
static gint ett_wimaxasncp_flags = -1;
static gint ett_wimaxasncp_tlv = -1;
+static gint ett_wimaxasncp_tlv_value_bitflags8 = -1;
static gint ett_wimaxasncp_tlv_value_bitflags16 = -1;
static gint ett_wimaxasncp_tlv_value_bitflags32 = -1;
static gint ett_wimaxasncp_tlv_protocol_list = -1;
{ WIMAXASNCP_TLV_ETHER, "WIMAXASNCP_TLV_ETHER"},
{ WIMAXASNCP_TLV_ASCII_STRING, "WIMAXASNCP_TLV_ASCII_STRING"},
{ WIMAXASNCP_TLV_FLAG0, "WIMAXASNCP_TLV_FLAG0"},
+ { WIMAXASNCP_TLV_BITFLAGS8, "WIMAXASNCP_TLV_BITFLAGS8"},
{ WIMAXASNCP_TLV_BITFLAGS16, "WIMAXASNCP_TLV_BITFLAGS16"},
{ WIMAXASNCP_TLV_BITFLAGS32, "WIMAXASNCP_TLV_BITFLAGS32"},
{ WIMAXASNCP_TLV_ID, "WIMAXASNCP_TLV_ID"},
return;
}
+ case WIMAXASNCP_TLV_BITFLAGS8:
+ {
+ if (length != 1)
+ {
+ /* encoding error */
+ break;
+ }
+
+ if (tlv_info->enums == NULL)
+ {
+ /* enum values missing */
+ }
+
+ if (tree)
+ {
+ proto_tree *flags_tree;
+ proto_item *item;
+ guint8 value;
+ guint i;
+
+ value = tvb_get_guint8(tvb, offset);
+
+ item = proto_tree_add_uint_format(
+ tree, tlv_info->hf_value,
+ tvb, offset, length, value,
+ "Value: %s",
+ decode_numeric_bitfield(value, 0xff, 8, "0x%02x"));
+
+ proto_item_append_text(tlv_item, " - 0x%02x", value);
+
+ if (value != 0)
+ {
+ flags_tree = proto_item_add_subtree(
+ item, ett_wimaxasncp_tlv_value_bitflags8);
+
+ for (i = 0; i < 8; ++i)
+ {
+ guint8 mask;
+ mask = 1 << (7 - i);
+
+ if (value & mask)
+ {
+ const gchar *s;
+
+ s = wimaxasncp_get_enum_name(tlv_info, value & mask);
+
+ proto_tree_add_uint_format(
+ flags_tree, hf_wimaxasncp_tlv_value_bitflags8,
+ tvb, offset, length, value,
+ "Bit #%u is set: %s", i, s);
+ }
+ }
+ }
+ }
+
+ return;
+ }
case WIMAXASNCP_TLV_BITFLAGS16:
{
if (length != 2)
add_reg_info(
&tlv->hf_value, name, abbrev, FT_STRING, BASE_NONE, blurb);
break;
+
+ case WIMAXASNCP_TLV_BITFLAGS8:
+ add_reg_info(
+ &tlv->hf_value, name, abbrev, FT_UINT8, BASE_HEX, blurb);
+ break;
case WIMAXASNCP_TLV_BITFLAGS16:
add_reg_info(
HFILL
}
},
+ {
+ &hf_wimaxasncp_tlv_value_bitflags8,
+ {
+ "Value",
+ "wimaxasncp.tlv_value_bitflags8",
+ FT_UINT8,
+ BASE_HEX,
+ NULL,
+ 0xff,
+ NULL,
+ HFILL
+ }
+ },
{
&hf_wimaxasncp_tlv_value_bitflags16,
{
&ett_wimaxasncp,
&ett_wimaxasncp_flags,
&ett_wimaxasncp_tlv,
+ &ett_wimaxasncp_tlv_value_bitflags8,
&ett_wimaxasncp_tlv_value_bitflags16,
&ett_wimaxasncp_tlv_value_bitflags32,
&ett_wimaxasncp_tlv_protocol_list,
<tlv name="Authorization Policy"
type="21"
- decoder="WIMAXASNCP_TLV_ENUM8">
+ decoder="WIMAXASNCP_TLV_BITFLAGS8">
<enum name="RSA authorization"
- code="0x01"/>
+ code="WIMAXASNCP_BIT8(7)"/>
<enum name="EAP authorization"
- code="0x02"/>
+ code="WIMAXASNCP_BIT8(6)"/>
<enum name="Authenticated-EAP authorization"
- code="0x04"/>
+ code="WIMAXASNCP_BIT8(5)"/>
<enum name="HMAC supported"
- code="0x08"/>
+ code="WIMAXASNCP_BIT8(4)"/>
<enum name="RSA Authentication at Re-entry"
- code="0x10"/>
+ code="WIMAXASNCP_BIT8(3)"/>
<enum name="EAP Authentication at Re-entry"
- code="0x20"/>
+ code="WIMAXASNCP_BIT8(2)"/>
<enum name="Authenticated EAP-based authorization at reentry"
- code="0x30"/>
+ code="WIMAXASNCP_BIT8(1)"/>
+
+ <enum name="Reserved"
+ code="WIMAXASNCP_BIT8(0)"/>
</tlv>
<!-- ****************************************************************** -->