diff options
author | Yasuyuki Tanaka <yatch1.tanaka@toshiba.co.jp> | 2017-06-27 21:51:10 +0900 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-07-03 20:06:04 +0000 |
commit | 1aa8ded9a3de8e6fb5b6a7b7dcca9d93bb50dcdd (patch) | |
tree | 809458023bec6f4bf1cb33f158dd5c9361fc7220 /epan | |
parent | b6f36e95fa2f549604c4c7a9ae72fd8eb361bf1a (diff) |
ieee802154: support 6top protocol (6P) draft-07
- support draft-ietf-6tisch-6top-protocol-07
- replace proto_tree_add_subtree_format() to make manageable JSON output
- use constant values defined for the 1st F-Interop 6TiSCH Interop Event
Bug: 13868
Change-Id: Ifa1a20aa2e8d2c75bb0660f595de71768a20d082
Reviewed-on: https://code.wireshark.org/review/22500
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-ieee802154.c | 220 | ||||
-rw-r--r-- | epan/dissectors/packet-ieee802154.h | 33 |
2 files changed, 162 insertions, 91 deletions
diff --git a/epan/dissectors/packet-ieee802154.c b/epan/dissectors/packet-ieee802154.c index b5e5d132e7..bba5d2140c 100644 --- a/epan/dissectors/packet-ieee802154.c +++ b/epan/dissectors/packet-ieee802154.c @@ -342,6 +342,7 @@ static int hf_ieee802154_payload_ie_id = -1; static int hf_ieee802154_payload_ie_length = -1; static int hf_ieee802154_payload_ie_data = -1; static int hf_ieee802154_payload_ie_vendor_oui = -1; +static int hf_ieee802154_payload_ie_ietf = -1; static int hf_ieee802154_timeslot_ie = -1; static int hf_ieee802154_enhanced_beacon_filter_ie = -1; static int hf_ieee802154_mlme_ie_data = -1; @@ -380,14 +381,14 @@ static int hf_ieee802154_psie_eb_filter_attr_id = -1; static int hf_ieee802154_psie_eb_filter_attr_id_bitmap = -1; static int hf_ieee802154_p_ie_ietf_sub_id = -1; +static int hf_ieee802154_6top = -1; static int hf_ieee802154_6top_version = -1; static int hf_ieee802154_6top_type = -1; static int hf_ieee802154_6top_flags_reserved = -1; static int hf_ieee802154_6top_code = -1; static int hf_ieee802154_6top_sfid = -1; static int hf_ieee802154_6top_seqnum = -1; -static int hf_ieee802154_6top_gab = -1; -static int hf_ieee802154_6top_gba = -1; +static int hf_ieee802154_6top_gen = -1; static int hf_ieee802154_6top_metadata = -1; static int hf_ieee802154_6top_cell_options = -1; static int hf_ieee802154_6top_cell_option_tx = -1; @@ -395,11 +396,16 @@ static int hf_ieee802154_6top_cell_option_rx = -1; static int hf_ieee802154_6top_cell_option_shared = -1; static int hf_ieee802154_6top_cell_option_reserved = -1; static int hf_ieee802154_6top_num_cells = -1; +static int hf_ieee802154_6top_cell_list = -1; +static int hf_ieee802154_6top_rel_cell_list = -1; +static int hf_ieee802154_6top_cand_cell_list = -1; +static int hf_ieee802154_6top_cell = -1; static int hf_ieee802154_6top_reserved = -1; static int hf_ieee802154_6top_offset = -1; static int hf_ieee802154_6top_max_num_cells = -1; static int hf_ieee802154_6top_slot_offset = -1; static int hf_ieee802154_6top_channel_offset = -1; +static int hf_ieee802154_6top_total_num_cells = -1; static int proto_zboss = -1; static int hf_zboss_direction = -1; @@ -499,6 +505,7 @@ static gint ett_ieee802154_hie_ht2 = -1; static gint ett_ieee802154_hie_csl = -1; static gint ett_ieee802154_payload = -1; static gint ett_ieee802154_payload_ie = -1; +static gint ett_ieee802154_payload_ie_ietf = -1; static gint ett_ieee802154_mlme = -1; static gint ett_ieee802154_mlme_payload = -1; static gint ett_ieee802154_mlme_payload_data = -1; @@ -515,10 +522,10 @@ static gint ett_ieee802154_psie_slotframe_link_slotframes = -1; static gint ett_ieee802154_zigbee = -1; static gint ett_ieee802154_zboss = -1; static gint ett_ieee802154_p_ie_6top = -1; -static gint ett_ieee802154_p_ie_6top_version_type = -1; -static gint ett_ieee802154_p_ie_6top_seqnum_gab_gba = -1; static gint ett_ieee802154_p_ie_6top_cell_options = -1; static gint ett_ieee802154_p_ie_6top_cell_list = -1; +static gint ett_ieee802154_p_ie_6top_cand_cell_list = -1; +static gint ett_ieee802154_p_ie_6top_rel_cell_list = -1; static gint ett_ieee802154_p_ie_6top_cell = -1; static expert_field ei_ieee802154_invalid_addressing = EI_INIT; @@ -768,31 +775,46 @@ static const value_string ietf_6top_types[] = { }; static const value_string ietf_6top_command_identifiers[] = { - { IETF_6TOP_CMD_ADD, "Add" }, - { IETF_6TOP_CMD_DELETE, "Delete" }, - { IETF_6TOP_CMD_STATUS, "Status" }, - { IETF_6TOP_CMD_LIST, "List" }, - { IETF_6TOP_CMD_CLEAR, "Clear" }, + { IETF_6TOP_CMD_ADD, "ADD" }, + { IETF_6TOP_CMD_DELETE, "DELETE" }, + { IETF_6TOP_CMD_RELOCATE, "RELOCATE" }, + { IETF_6TOP_CMD_COUNT, "COUNT" }, + { IETF_6TOP_CMD_LIST, "LIST" }, + { IETF_6TOP_CMD_CLEAR, "CLEAR" }, { 0, NULL } }; static const value_string ietf_6top_return_codes[] = { { IETF_6TOP_RC_SUCCESS, "SUCCESS" }, - { IETF_6TOP_RC_ERR_VER, "ERR_VER" }, - { IETF_6TOP_RC_ERR_SFID, "ERR_SFID" }, - { IETF_6TOP_RC_ERR_GEN, "ERR_GEN" }, - { IETF_6TOP_RC_ERR_BUSY, "ERR_BUSY" }, - { IETF_6TOP_RC_ERR_NORES, "ERR_NORES" }, - { IETF_6TOP_RC_ERR_RESET, "ERR_RESET" }, - { IETF_6TOP_RC_ERR, "ERR" }, + { IETF_6TOP_RC_ERROR, "ERROR" }, + { IETF_6TOP_RC_EOL, "EOL" }, + { IETF_6TOP_RC_RESET, "RESET" }, + { IETF_6TOP_RC_VER_ERR, "VER_ERR" }, + { IETF_6TOP_RC_SFID_ERR, "SFID_ERR" }, + { IETF_6TOP_RC_GEN_ERR, "GEN_ERR" }, + { IETF_6TOP_RC_BUSY, "BUSY" }, + { IETF_6TOP_RC_NORES, "NORES" }, + { IETF_6TOP_RC_CELLLIST_ERR, "CELLLIST_ERR" }, { 0, NULL } }; static const value_string ietf_6top_generation_numbers[] = { - { 0, "clean" }, - { 1, "counter" }, - { 2, "counter" }, - { 3, "reserved" }, + { 0, "Clear" }, + { 1, "Lollipop Counter Value" }, + { 2, "Lollipop Counter Value" }, + { 3, "Lollipop Counter Value" }, + { 4, "Lollipop Counter Value" }, + { 5, "Lollipop Counter Value" }, + { 6, "Lollipop Counter Value" }, + { 7, "Lollipop Counter Value" }, + { 8, "Lollipop Counter Value" }, + { 9, "Lollipop Counter Value" }, + { 10, "Reserved" }, + { 11, "Reserved" }, + { 12, "Reserved" }, + { 13, "Reserved" }, + { 14, "Reserved" }, + { 15, "Reserved" }, { 0, NULL} }; @@ -2118,22 +2140,21 @@ dissect_802154_tsch_slotframe_link(tvbuff_t *tvb, proto_tree *tree, guint16 psie static int dissect_ieee802154_6top(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p_inf_elem_tree, guint offset, gint pie_length) { - const guint8 supported_6p_version = 1; + const guint8 supported_6p_version = 0x00; guint8 subie; guint8 version; guint8 type; guint8 code; - guint8 seqnum; - guint8 gab; - guint8 gba; + guint8 num_cells; int orig_offset = offset; gboolean have_cell_list = FALSE; int i; + proto_item *sixtop_item = NULL; proto_tree *sixtop_tree = NULL; - proto_tree *version_type_tree = NULL; - proto_tree *seqnum_gab_gba_tree = NULL; + proto_item *cell_list_item = NULL; proto_tree *cell_list_tree = NULL; + proto_item *cell_item = NULL; proto_tree *cell_tree = NULL; proto_item *type_item = NULL; proto_item *code_item = NULL; @@ -2159,25 +2180,19 @@ dissect_ieee802154_6top(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p_inf_ele type = (tvb_get_guint8(tvb, offset + 1) & IETF_6TOP_TYPE) >> 4; code = tvb_get_guint8(tvb, offset + 2); - seqnum = tvb_get_guint8(tvb, offset + 4) & IETF_6TOP_SEQNUM; - gab = (tvb_get_guint8(tvb, offset + 4) & IETF_6TOP_GAB) >> 4; - gba = (tvb_get_guint8(tvb, offset + 4) & IETF_6TOP_GBA) >> 6; proto_tree_add_item(p_inf_elem_tree, hf_ieee802154_p_ie_ietf_sub_id, tvb, offset, 1, ENC_LITTLE_ENDIAN); - sixtop_tree = proto_tree_add_subtree_format(p_inf_elem_tree, tvb, offset, pie_length, ett_ieee802154_p_ie_6top, NULL, "6top IE Content"); - version_type_tree = proto_tree_add_subtree_format(sixtop_tree, tvb, offset + 1, 1, ett_ieee802154_p_ie_6top_version_type, NULL, - "Version: %u, Type: %s", version, val_to_str_const(type, ietf_6top_types,"Unknown")); - proto_tree_add_item(version_type_tree, hf_ieee802154_6top_version, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN); - type_item = proto_tree_add_item(version_type_tree, hf_ieee802154_6top_type, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN); - proto_tree_add_item(version_type_tree, hf_ieee802154_6top_flags_reserved, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN); + sixtop_item = proto_tree_add_item(p_inf_elem_tree, hf_ieee802154_6top, tvb, offset, pie_length, ENC_NA); + sixtop_tree = proto_item_add_subtree(sixtop_item, ett_ieee802154_p_ie_6top); + + proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_version, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN); + type_item = proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_type, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_flags_reserved, tvb, offset + 1, 1, ENC_LITTLE_ENDIAN); code_item = proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_code, tvb, offset + 2, 1, ENC_LITTLE_ENDIAN); proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_sfid, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN); - seqnum_gab_gba_tree = proto_tree_add_subtree_format(sixtop_tree, tvb, offset + 4, 1, ett_ieee802154_p_ie_6top_seqnum_gab_gba, NULL, - "Seqnum: %u, GAB: %u, GBA: %u", seqnum, gab, gba); - proto_tree_add_item(seqnum_gab_gba_tree, hf_ieee802154_6top_seqnum, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN); - proto_tree_add_item(seqnum_gab_gba_tree, hf_ieee802154_6top_gab, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN); - proto_tree_add_item(seqnum_gab_gba_tree, hf_ieee802154_6top_gba, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_seqnum, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN); + proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_gen, tvb, offset + 4, 1, ENC_LITTLE_ENDIAN); col_set_str(pinfo->cinfo, COL_PROTOCOL, "6top"); if (type == IETF_6TOP_TYPE_REQUEST) { @@ -2197,19 +2212,21 @@ dissect_ieee802154_6top(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p_inf_ele switch (code) { case IETF_6TOP_CMD_ADD: case IETF_6TOP_CMD_DELETE: + case IETF_6TOP_CMD_RELOCATE: if (pie_length < 4) { break; } proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_metadata, tvb, offset, 2, ENC_LITTLE_ENDIAN); proto_tree_add_bitmask(sixtop_tree, tvb, offset + 2, hf_ieee802154_6top_cell_options, ett_ieee802154_p_ie_6top_cell_options, cell_options, ENC_LITTLE_ENDIAN); proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_num_cells, tvb, offset + 3, 1, ENC_LITTLE_ENDIAN); + num_cells = tvb_get_guint8(tvb, offset + 3); pie_length -= 4; offset += 4; if (pie_length > 0 && (pie_length % 4) == 0) { have_cell_list = TRUE; } break; - case IETF_6TOP_CMD_STATUS: + case IETF_6TOP_CMD_COUNT: if (pie_length < 3) { break; } @@ -2247,22 +2264,28 @@ dissect_ieee802154_6top(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p_inf_ele switch(code) { case IETF_6TOP_RC_SUCCESS: if (pie_length > 0) { - if (pie_length == 1) { - proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_num_cells, tvb, offset, 1, ENC_LITTLE_ENDIAN); - pie_length -= 1; - offset += 1; - } else if ((pie_length % 4) == 0) { + if (pie_length == 2) { + proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_total_num_cells, tvb, offset, 2, ENC_LITTLE_ENDIAN); + pie_length -= 2; + offset += 2; + } else if (pie_length > 0 && (pie_length % 4) == 0) { have_cell_list = TRUE; } } break; - case IETF_6TOP_RC_ERR_VER: - case IETF_6TOP_RC_ERR_SFID: - case IETF_6TOP_RC_ERR_GEN: - case IETF_6TOP_RC_ERR_BUSY: - case IETF_6TOP_RC_ERR_NORES: - case IETF_6TOP_RC_ERR_RESET: - case IETF_6TOP_RC_ERR: + case IETF_6TOP_RC_EOL: + if(pie_length > 0 && (pie_length % 4) == 0) { + have_cell_list = TRUE; + } + break; + case IETF_6TOP_RC_ERROR: + case IETF_6TOP_RC_RESET: + case IETF_6TOP_RC_VER_ERR: + case IETF_6TOP_RC_SFID_ERR: + case IETF_6TOP_RC_GEN_ERR: + case IETF_6TOP_RC_BUSY: + case IETF_6TOP_RC_NORES: + case IETF_6TOP_RC_CELLLIST_ERR: /* They have no other field */ break; default: @@ -2276,13 +2299,34 @@ dissect_ieee802154_6top(tvbuff_t *tvb, packet_info *pinfo, proto_tree *p_inf_ele } if (have_cell_list) { - cell_list_tree = proto_tree_add_subtree_format(sixtop_tree, tvb, offset, pie_length, ett_ieee802154_p_ie_6top_cell_list, NULL, - "Cell List"); - for (i = 0; pie_length > 0; pie_length -= 4, offset += 4, i++) { - cell_tree = proto_tree_add_subtree_format(cell_list_tree, tvb, offset, 4, ett_ieee802154_p_ie_6top_cell, NULL, - "Cell [%u]", i); - proto_tree_add_item(cell_tree, hf_ieee802154_6top_slot_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN); - proto_tree_add_item(cell_tree, hf_ieee802154_6top_channel_offset, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); + if (type == IETF_6TOP_TYPE_REQUEST && code == IETF_6TOP_CMD_RELOCATE) { + cell_list_item = proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_rel_cell_list, tvb, offset, pie_length, ENC_NA); + cell_list_tree = proto_item_add_subtree(cell_list_item, ett_ieee802154_p_ie_6top_rel_cell_list); + /* num_cells is expected to be set properly */ + for (i = 0; i < num_cells; offset += 4, i++) { + cell_item = proto_tree_add_item(cell_list_tree, hf_ieee802154_6top_cell, tvb, offset, 4, ENC_NA); + cell_tree = proto_item_add_subtree(cell_item, ett_ieee802154_p_ie_6top_cell); + proto_tree_add_item(cell_tree, hf_ieee802154_6top_slot_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(cell_tree, hf_ieee802154_6top_channel_offset, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); + } + pie_length -= num_cells * 4; + cell_list_item = proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_cand_cell_list, tvb, offset, pie_length, ENC_NA); + cell_list_tree = proto_item_add_subtree(cell_list_item, ett_ieee802154_p_ie_6top_cand_cell_list); + for (i = 0; pie_length > 0; pie_length -= 4, offset += 4, i++) { + cell_item = proto_tree_add_item(cell_list_tree, hf_ieee802154_6top_cell, tvb, offset, 4, ENC_NA); + cell_tree = proto_item_add_subtree(cell_item, ett_ieee802154_p_ie_6top_cell); + proto_tree_add_item(cell_tree, hf_ieee802154_6top_slot_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(cell_tree, hf_ieee802154_6top_channel_offset, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); + } + } else { + cell_list_item = proto_tree_add_item(sixtop_tree, hf_ieee802154_6top_cell_list, tvb, offset, pie_length, ENC_NA); + cell_list_tree = proto_item_add_subtree(cell_list_item, ett_ieee802154_p_ie_6top_cell_list); + for (i = 0; pie_length > 0; pie_length -= 4, offset += 4, i++) { + cell_item = proto_tree_add_item(cell_list_tree, hf_ieee802154_6top_cell, tvb, offset, 4, ENC_NA); + cell_tree = proto_item_add_subtree(cell_item, ett_ieee802154_p_ie_6top_cell); + proto_tree_add_item(cell_tree, hf_ieee802154_6top_slot_offset, tvb, offset, 2, ENC_LITTLE_ENDIAN); + proto_tree_add_item(cell_tree, hf_ieee802154_6top_channel_offset, tvb, offset + 2, 2, ENC_LITTLE_ENDIAN); + } } } @@ -2938,6 +2982,8 @@ dissect_ieee802154_payload_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree proto_tree *payload_tree; proto_item *mlme_item; proto_tree *mlme_subtree; + proto_item *ietf_item; + proto_tree *ietf_subtree; guint16 payload_ie; guint16 pie_id; int pie_length; @@ -2993,12 +3039,13 @@ dissect_ieee802154_payload_ie(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree break; case IEEE802154_PAYLOAD_IE_IETF: - subtree = proto_tree_add_subtree(payload_tree, tvb, offset, pie_length + 2, ett_ieee802154_payload, NULL, "Payload IE"); - proto_item_append_text(subtree, ", %s, Length: %d", val_to_str_const(pie_id, ieee802154_payload_ie_names, "Unknown IE"), pie_length); - proto_tree_add_bitmask(subtree, tvb, (const guint) offset, hf_ieee802154_payload_ie_tlv, ett_ieee802154_payload_ie, fields, ENC_LITTLE_ENDIAN); + ietf_item = proto_tree_add_item(payload_tree, hf_ieee802154_payload_ie_ietf, tvb, offset, pie_length + 2, ENC_NA); + ietf_subtree = proto_item_add_subtree(ietf_item, ett_ieee802154_payload_ie_ietf); + proto_item_append_text(ietf_item, ", Length: %d", pie_length); + proto_tree_add_bitmask(ietf_subtree, tvb, (const guint) offset, hf_ieee802154_payload_ie_tlv, ett_ieee802154_payload_ie, fields, ENC_LITTLE_ENDIAN); offset += 2; - offset += dissect_ieee802154_6top(tvb, pinfo, subtree, (guint) offset, pie_length); + offset += dissect_ieee802154_6top(tvb, pinfo, ietf_subtree, (guint) offset, pie_length); break; default: @@ -4351,6 +4398,9 @@ void proto_register_ieee802154(void) { "Vendor OUI", "wpan.payload_ie.vendor_oui", FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_ieee802154_payload_ie_ietf, + { "Payload IE, IETF IE", "wpan.payload_ie.ietf", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }}, + { &hf_ieee802154_mlme_ie_data, { "Data", "wpan.mlme_sub_ie.data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, @@ -4361,6 +4411,9 @@ void proto_register_ieee802154(void) NULL, HFILL }}, /* IETF IE - 6top IE */ + { &hf_ieee802154_6top, + { "6top IE", "wpan.6top", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, { &hf_ieee802154_6top_version, { "6P Version", "wpan.6top_version", FT_UINT8, BASE_DEC, NULL, IETF_6TOP_VERSION, @@ -4386,12 +4439,8 @@ void proto_register_ieee802154(void) { "SeqNum", "wpan.6top_seqnum", FT_UINT8, BASE_DEC, NULL, IETF_6TOP_SEQNUM, NULL, HFILL }}, - { &hf_ieee802154_6top_gab, - { "GAB", "wpan.6top_gab", FT_UINT8, BASE_DEC, VALS(ietf_6top_generation_numbers), IETF_6TOP_GAB, - NULL, HFILL }}, - - { &hf_ieee802154_6top_gba, - { "GBA", "wpan.6top_gba", FT_UINT8, BASE_DEC, VALS(ietf_6top_generation_numbers), IETF_6TOP_GBA, + { &hf_ieee802154_6top_gen, + { "GEN", "wpan.6top_gen", FT_UINT8, BASE_DEC, VALS(ietf_6top_generation_numbers), IETF_6TOP_GEN, NULL, HFILL }}, { &hf_ieee802154_6top_metadata, @@ -4419,7 +4468,23 @@ void proto_register_ieee802154(void) NULL, HFILL }}, { &hf_ieee802154_6top_num_cells, - { "Number of Cells", "wpan.6top_num_cells", FT_UINT16, BASE_DEC, NULL, 0x0, + { "Number of Cells", "wpan.6top_num_cells", FT_UINT8, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + + { &hf_ieee802154_6top_cell_list, + { "CellList", "wpan.6top_cell_list", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + { &hf_ieee802154_6top_rel_cell_list, + { "Rel. CellList", "wpan.6top_rel_cell_list", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + { &hf_ieee802154_6top_cand_cell_list, + { "Cand. CellList", "wpan.6top_cand_cell_list", FT_NONE, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + + { &hf_ieee802154_6top_cell, + { "Cell", "wpan.6top_cell", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }}, { &hf_ieee802154_6top_reserved, @@ -4442,6 +4507,10 @@ void proto_register_ieee802154(void) { "Channel Offset", "wpan.6top_channel_offset", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_ieee802154_6top_total_num_cells, + { "Total Number of Cells", "wpan.6top_total_num_cells", FT_UINT16, BASE_DEC, NULL, 0x0, + NULL, HFILL }}, + /* Command Frame Specific Fields */ { &hf_ieee802154_cmd_id, @@ -4684,6 +4753,7 @@ void proto_register_ieee802154(void) &ett_ieee802154_hie_csl, &ett_ieee802154_payload, &ett_ieee802154_payload_ie, + &ett_ieee802154_payload_ie_ietf, &ett_ieee802154_tsch_timeslot, &ett_ieee802154_tsch_synch, &ett_ieee802154_channel_hopping, @@ -4700,10 +4770,10 @@ void proto_register_ieee802154(void) &ett_ieee802154_zigbee, &ett_ieee802154_zboss, &ett_ieee802154_p_ie_6top, - &ett_ieee802154_p_ie_6top_version_type, - &ett_ieee802154_p_ie_6top_seqnum_gab_gba, &ett_ieee802154_p_ie_6top_cell_options, &ett_ieee802154_p_ie_6top_cell_list, + &ett_ieee802154_p_ie_6top_rel_cell_list, + &ett_ieee802154_p_ie_6top_cand_cell_list, &ett_ieee802154_p_ie_6top_cell }; @@ -4735,11 +4805,11 @@ void proto_register_ieee802154(void) { &ei_ieee802154_6top_unsupported_type, { "wpan.6top_unsupported_type", PI_PROTOCOL, PI_WARN, "Unsupported Type of Message", EXPFILL }}, { &ei_ieee802154_6top_unsupported_command, { "wpan.6top_unsupported_command", PI_PROTOCOL, PI_WARN, - "Unsupported 6Top command", EXPFILL }}, + "Unsupported 6top command", EXPFILL }}, { &ei_ieee802154_time_correction_error, { "wpan.time_correction.error", PI_PROTOCOL, PI_WARN, "Incorrect value. Reference: IEEE-802.15.4-2015. Table 7-8: Values of the Time Sync Info field for ACK with timing Information", EXPFILL}}, { &ei_ieee802154_6top_unsupported_return_code, { "wpan.6top_unsupported_code", PI_PROTOCOL, PI_WARN, - "Unsupported 6Top return code", EXPFILL }}, + "Unsupported 6top return code", EXPFILL }}, { &ei_ieee802154_ie_unsupported_element_id, { "wpan.ie_unsupported_element_id", PI_PROTOCOL, PI_WARN, "Unsupported IE element ID", EXPFILL }}, { &ei_ieee802154_ie_unknown_element_id, { "wpan.ie_unknown_element_id", PI_PROTOCOL, PI_WARN, diff --git a/epan/dissectors/packet-ieee802154.h b/epan/dissectors/packet-ieee802154.h index be2b8d51a0..5d2821c6de 100644 --- a/epan/dissectors/packet-ieee802154.h +++ b/epan/dissectors/packet-ieee802154.h @@ -255,8 +255,7 @@ typedef enum { #define IEEE802154_PAYLOAD_IE_ESDU 0x0 /* Encapsulated Service Data Unit */ #define IEEE802154_PAYLOAD_IE_MLME 0x1 /* Media Access Control (MAC) subLayer Management Entity */ #define IEEE802154_PAYLOAD_IE_VENDOR 0x2 /* Vendor Specific */ - /*For the Plugtest - Paris 2016, 6top group ID took the reserved value 0x3*/ -#define IEEE802154_PAYLOAD_IE_IETF 0x3 +#define IEEE802154_PAYLOAD_IE_IETF 0x5 /* IETF IE, RFC 8137 */ /* Reserved 0x3-0xe */ #define IEEE802154_PAYLOAD_IE_GID_TERM 0xf @@ -298,7 +297,7 @@ typedef enum { /* 0x37-0x7f Reserved */ /* IETF IE - Sub IE */ -#define IEEE802154_IETF_SUBIE_6TOP 0x00 /* not formally assigned yet */ +#define IEEE802154_IETF_SUBIE_6TOP 0xC9 /* not formally assigned yet */ /* IEEE 802.15.4 cipher block size. */ #define IEEE802154_CIPHER_SIZE 16 @@ -313,23 +312,25 @@ typedef enum { #define IETF_6TOP_TYPE 0x30 #define IETF_6TOP_FLAGS_RESERVED 0xC0 #define IETF_6TOP_SEQNUM 0x0F -#define IETF_6TOP_GAB 0x30 -#define IETF_6TOP_GBA 0xC0 +#define IETF_6TOP_GEN 0xF0 /* SIXTOP CMD and RC identifiers */ #define IETF_6TOP_CMD_ADD 0x01 #define IETF_6TOP_CMD_DELETE 0x02 -#define IETF_6TOP_CMD_STATUS 0x03 -#define IETF_6TOP_CMD_LIST 0x04 -#define IETF_6TOP_CMD_CLEAR 0x05 -#define IETF_6TOP_RC_SUCCESS 0x06 -#define IETF_6TOP_RC_ERR_VER 0x07 -#define IETF_6TOP_RC_ERR_SFID 0x08 -#define IETF_6TOP_RC_ERR_GEN 0x09 -#define IETF_6TOP_RC_ERR_BUSY 0x0A -#define IETF_6TOP_RC_ERR_NORES 0x0B -#define IETF_6TOP_RC_ERR_RESET 0x0C -#define IETF_6TOP_RC_ERR 0x0D +#define IETF_6TOP_CMD_RELOCATE 0x03 +#define IETF_6TOP_CMD_COUNT 0x04 +#define IETF_6TOP_CMD_LIST 0x05 +#define IETF_6TOP_CMD_CLEAR 0x06 +#define IETF_6TOP_RC_SUCCESS 0x00 +#define IETF_6TOP_RC_ERROR 0x01 +#define IETF_6TOP_RC_EOL 0x02 +#define IETF_6TOP_RC_RESET 0x03 +#define IETF_6TOP_RC_VER_ERR 0x04 +#define IETF_6TOP_RC_SFID_ERR 0x05 +#define IETF_6TOP_RC_GEN_ERR 0x06 +#define IETF_6TOP_RC_BUSY 0x07 +#define IETF_6TOP_RC_NORES 0x08 +#define IETF_6TOP_RC_CELLLIST_ERR 0x09 /* SIXTOP Message Types */ #define IETF_6TOP_TYPE_REQUEST 0x00 |