diff options
author | Michael Mann <mmann78@netscape.net> | 2014-07-30 09:58:53 -0400 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2014-07-30 15:45:26 +0000 |
commit | ede5a9d4c0364c184bb79786128244343b0abe06 (patch) | |
tree | 29ac9cd7e5401cd524a4cff74c14109eedd91a0f /plugins/wimax/msg_dlmap.c | |
parent | 82bb8008ce9baf2c509afac1e1e7343cdc2c6c9c (diff) |
Convert tvb_get_ptr buffer access macros to use much safer tvb access macros.
Added a few filterable fields in the process of trying to figure out the macros. Much more can be done to add many more filterable fields (and remove proto_tree_add_text calls hidden in the macros), but that'll be done some other time.
bug:10281
Change-Id: I9788f176c0e721ff4f243d4ecb79d7d0114fffc0
Reviewed-on: https://code.wireshark.org/review/3262
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'plugins/wimax/msg_dlmap.c')
-rw-r--r-- | plugins/wimax/msg_dlmap.c | 461 |
1 files changed, 270 insertions, 191 deletions
diff --git a/plugins/wimax/msg_dlmap.c b/plugins/wimax/msg_dlmap.c index b4176f79db..5078cca92c 100644 --- a/plugins/wimax/msg_dlmap.c +++ b/plugins/wimax/msg_dlmap.c @@ -43,25 +43,32 @@ void proto_reg_handoff_mac_mgmt_msg_dlmap(void); #define XBIT(var, bits, desc) \ do { \ - var = BIT_BITS(bit, bufptr, bits); \ + var = TVB_BIT_BITS(bit, tvb, bits); \ proto_tree_add_text(tree, tvb, BITHI(bit, bits), desc ": %d", var); \ bit += bits; \ } while(0) #define VBIT(var, bits, hf) \ do { \ - var = BIT_BITS(bit, bufptr, bits); \ + var = TVB_BIT_BITS(bit, tvb, bits); \ proto_tree_add_uint(tree, hf, tvb, BITHI(bit,bits), var); \ bit += bits; \ } while(0) #define XNIB(var, nibs, desc) \ do { \ - var = NIB_NIBS(nib, bufptr, nibs); \ + var = TVB_NIB_NIBS(nib, tvb, nibs); \ proto_tree_add_text(tree, tvb, NIBHI(nib, nibs), desc ": %d", var); \ nib += nibs; \ } while(0) +#define VNIB(var, nibs, hf) \ + do { \ + var = TVB_NIB_NIBS(nib, tvb, nibs); \ + proto_tree_add_uint(tree, hf, tvb, NIBHI(nib, nibs), var); \ + nib += nibs; \ + } while(0) + gint harq = 0; /* 1 if HARQ enabled (TODO) */ gint fusc = 0; /* 1 if current zone permutation is FUSC or optional FUSC (TODO) */ gint tusc = 0; /* 1 if current zone permutation is AMC, TUSC1 or TUSC2 (TODO) */ @@ -250,6 +257,17 @@ static gint hf_dlmap_bsid = -1; static gint hf_dlmap_ofdma_sym = -1; /* static gint hf_dlmap_ie = -1; */ static gint hf_dlmap_ie_diuc = -1; +static gint hf_dlmap_ie_diuc_ext = -1; +static gint hf_dlmap_ie_length = -1; +static gint hf_dlmap_ie_bitmap = -1; +static gint hf_dlmap_ie_bitmap_cqi = -1; +static gint hf_dlmap_ie_bitmap_pusc = -1; +static gint hf_dlmap_ie_bitmap_opt_pusc = -1; +static gint hf_dlmap_ie_bitmap_amc = -1; +static gint hf_dlmap_ie_bitmap_aas = -1; +static gint hf_dlmap_ie_bitmap_periodic_ranging = -1; +static gint hf_dlmap_ie_bitmap_sounding = -1; +static gint hf_dlmap_ie_bitmap_mimo = -1; static gint hf_dlmap_ie_ncid = -1; static gint hf_dlmap_ie_cid = -1; static gint hf_dlmap_ie_offsym = -1; @@ -299,7 +317,7 @@ static gint hf_mac_header_compress_dlmap_crc = -1; * DL-MAP Miscellaneous IEs and TLVs *******************************************************************/ -gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type_lcl) +gint RCID_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb, gint RCID_Type_lcl) { /* RCID_IE 8.4.5.3 and 8.4.5.3.20.1 */ /* offset of IE in bits, length is variable */ @@ -312,7 +330,7 @@ gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint leng if (RCID_Type_lcl == 0) length = 16; else { - Prefix = BIT_BIT(bit, bufptr); + Prefix = TVB_BIT_BIT(bit, tvb); if (Prefix == 1) length = 12; else if (RCID_Type_lcl == 1) length = 12; else if (RCID_Type_lcl == 2) length = 8; @@ -353,7 +371,7 @@ gint RCID_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint leng * DL-MAP Extended-2 HARQ sub-burst IEs (8.4.5.3.21) *******************************************************************/ -static gint Dedicated_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Dedicated_DL_Control_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* 8.4.5.3.20 */ /* offset of IE in nibbles, length is variable */ @@ -364,17 +382,17 @@ static gint Dedicated_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, nib = offset; - length = NIB_NIBBLE(nib, bufptr); /* length in nibbles */ + length = TVB_NIB_NIBBLE(nib, tvb); /* length in nibbles */ tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(nib, length+1), ett_286i, NULL, "Dedicated_DL_Control_IE"); proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Length: %d", length); nib++; - nibble = NIB_NIBBLE(nib, bufptr); + nibble = TVB_NIB_NIBBLE(nib, tvb); proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Control Header: %d", nibble); nib++; if ((nibble & 1) == 1) { - nibble = NIB_NIBBLE(nib, bufptr); + nibble = TVB_NIB_NIBBLE(nib, tvb); proto_tree_add_text(tree, tvb, NIBHI(nib,1), "Num SDMA Layers: %d", (nibble >> 2) & 0x3); /* Bit padding */ if ((nib*4)+2 < (offset+length)*4) { @@ -391,7 +409,7 @@ static gint Dedicated_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, return (length + 1); } -static gint Dedicated_MIMO_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Dedicated_MIMO_DL_Control_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* offset of IE in bits, length is variable */ gint bit; @@ -462,7 +480,7 @@ static gint Dedicated_MIMO_DL_Control_IE(proto_tree *diuc_tree, const guint8 *bu return (bit - offset); } -static gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* 8.4.5.3.21 DL_HARQ_Chase_sub_burst_IE */ /* offset of IE in nibbles, length is variable */ @@ -482,7 +500,7 @@ static gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp nsub += 1; for (j = 0; j < nsub; j++) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); XBIT(dur, 10, "Duration"); XBIT(sbi, 1, "Sub-Burst DIUC Indicator"); XBIT(res, 1, "Reserved"); @@ -508,7 +526,7 @@ static gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp } if ((ddci & 2) == 2) { - bit += Dedicated_DL_Control_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb) * 4; + bit += Dedicated_DL_Control_IE(tree, BIT_TO_NIB(bit), length, tvb) * 4; } } @@ -516,7 +534,7 @@ static gint DL_HARQ_Chase_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp return (BIT_TO_NIB(bit) - offset); } -static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* offset of IE in nibbles, length is variable */ gint bit; @@ -537,7 +555,7 @@ static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *buf nsub += 1; for (j = 0; j < nsub; j++) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); XBIT(data, 4, "N(EP)"); XBIT(data, 4, "N(SCH)"); @@ -558,14 +576,14 @@ static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *buf } } if ((ddci & 2) == 2) { - bit += Dedicated_DL_Control_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + bit += Dedicated_DL_Control_IE(tree, BIT_TO_NIB(bit), length, tvb); } } if (include_cor2_changes) { /* CRC-16 is always appended */ - data = BIT_BITS(bit, bufptr, 16); + data = TVB_BIT_BITS(bit, tvb, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); @@ -579,7 +597,7 @@ static gint DL_HARQ_IR_CTC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *buf return (BIT_TO_NIB(bit) - offset); } -static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* offset of IE in nibbles, length is variable */ gint bit; @@ -600,7 +618,7 @@ static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp nsub += 1; for (j = 0; j < nsub; j++) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type) / 4; + bit += RCID_IE(tree, bit, length, tvb, RCID_Type) / 4; XBIT(data, 10, "Duration"); XBIT(sbdi, 1, "Sub-Burst DIUC Indicator"); @@ -629,14 +647,14 @@ static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp } } if ((ddci & 2) == 2) { - bit += Dedicated_DL_Control_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + bit += Dedicated_DL_Control_IE(tree, BIT_TO_NIB(bit), length, tvb); } } if (include_cor2_changes) { /* CRC-16 is always appended */ - data = BIT_BITS(bit, bufptr, 16); + data = TVB_BIT_BITS(bit, tvb, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); @@ -650,7 +668,7 @@ static gint DL_HARQ_IR_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufp return (BIT_TO_NIB(bit) - offset); } -static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* offset of IE in nibbles, length is variable */ gint bit; @@ -675,15 +693,15 @@ static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 XBIT(dci, 1, "Dedicated MIMO DL Control Indicator"); XBIT(akd, 1, "ACK Disable"); if (mui == 0) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); } if (dci == 1) { - bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb); + bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb); } XBIT(data, 10, "Duration"); for (i = 0; i < N_layer; i++) { if (mui == 1) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); } XBIT(data, 4, "DIUC"); XBIT(data, 2, "Repetition Coding Indication"); @@ -703,7 +721,7 @@ static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 if (include_cor2_changes) { /* CRC-16 is always appended */ - data = BIT_BITS(bit, bufptr, 16); + data = TVB_BIT_BITS(bit, tvb, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); @@ -717,7 +735,7 @@ static gint MIMO_DL_Chase_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 return (BIT_TO_NIB(bit) - offset); } -static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* offset of IE in nibbles, length is variable */ gint bit; @@ -742,15 +760,15 @@ static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bu XBIT(dci, 1, "Dedicated MIMO DL Control Indicator"); XBIT(akd, 1, "ACK Disable"); if (mui == 0) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); } if (dci == 1) { - bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb); + bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb); } XBIT(data, 4, "N(SCH)"); for (i = 0; i < N_layer; i++) { if (mui == 1) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); } XBIT(data, 4, "N(EP)"); if (akd) { @@ -764,7 +782,7 @@ static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bu if (include_cor2_changes) { /* CRC-16 is always appended */ - data = BIT_BITS(bit, bufptr, 16); + data = TVB_BIT_BITS(bit, tvb, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); @@ -778,7 +796,7 @@ static gint MIMO_DL_IR_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bu return (BIT_TO_NIB(bit) - offset); } -static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* offset of IE in nibbles, length is variable */ gint bit; @@ -803,15 +821,15 @@ static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const gui XBIT(dci, 1, "Dedicated MIMO DL Control Indicator"); XBIT(akd, 1, "ACK Disable"); if (mui == 0) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); } if (dci == 1) { - bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb); + bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb); } XBIT(data, 10, "Duration"); for (i = 0; i < N_layer; i++) { if (mui == 1) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); } XBIT(data, 4, "DIUC"); XBIT(data, 2, "Repetition Coding Indication"); @@ -826,7 +844,7 @@ static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const gui if (include_cor2_changes) { /* CRC-16 is always appended */ - data = BIT_BITS(bit, bufptr, 16); + data = TVB_BIT_BITS(bit, tvb, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); @@ -840,7 +858,7 @@ static gint MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(proto_tree *diuc_tree, const gui return (BIT_TO_NIB(bit) - offset); } -static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* offset of IE in nibbles, length is variable */ gint bit; @@ -868,12 +886,12 @@ static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *b if (sbi == 1) { XBIT(data, 8, "Sub-burst offset"); } - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); XBIT(akd, 1, "ACK Disable"); if (txc == 0) { XBIT(dmci, 1, "Dedicated MIMO DL Control Indicator"); if (dmci == 1) { - bit += Dedicated_MIMO_DL_Control_IE(tree, bufptr, bit, length, tvb); + bit += Dedicated_MIMO_DL_Control_IE(tree, bit, length, tvb); } XBIT(data, 4, "DIUC"); XBIT(data, 2, "Repetition coding Indication"); @@ -886,7 +904,7 @@ static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *b if (include_cor2_changes) { /* CRC-16 is always appended */ - data = BIT_BITS(bit, bufptr, 16); + data = TVB_BIT_BITS(bit, tvb, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); @@ -904,7 +922,7 @@ static gint MIMO_DL_STC_HARQ_sub_burst_IE(proto_tree *diuc_tree, const guint8 *b * DL-MAP Extended-2 IEs *******************************************************************/ -static gint MBS_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MBS_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 0 */ /* 8.4.5.3.12 MBS_MAP_IE */ @@ -919,7 +937,7 @@ static gint MBS_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286a, NULL, "MBS_MAP_IE"); XBIT(data, 4, "Extended-2 DIUC"); - XBIT(data, 8, "Length"); + VBIT(data, 8, hf_dlmap_ie_length); XBIT(data, 7, "MBS Zone identifier"); XBIT(mde, 1, "Macro diversity enhanced"); @@ -961,7 +979,7 @@ static gint MBS_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, return BIT_TO_NIB(bit); } -static gint HO_Anchor_Active_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint HO_Anchor_Active_DL_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 1 */ /* 8.4.5.3.14 [2] HO_Anchor_Active_DL-MAP_IE TODO 1.1 */ @@ -975,12 +993,12 @@ static gint HO_Anchor_Active_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufp tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286c, NULL, "HO_Anchor_Active_DL_MAP_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)"); return nib; } -static gint HO_Active_Anchor_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint HO_Active_Anchor_DL_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 2 */ /* 8.4.5.3.15 HO_Active_Anchor_DL_MAP_IE TODO 1.1 */ @@ -994,12 +1012,12 @@ static gint HO_Active_Anchor_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufp tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286d, NULL, "HO_Active_Anchor_DL_MAP_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)"); return nib; } -static gint HO_CID_Translation_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint HO_CID_Translation_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 3 */ /* 8.4.5.3.16 HO_CID_Translation_MAP_IE TODO 1.1 */ @@ -1013,12 +1031,12 @@ static gint HO_CID_Translation_MAP_IE(proto_tree *diuc_tree, const guint8 *bufpt tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286e, NULL, "CID_Translation_MAP_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)"); return nib; } -static gint MIMO_in_another_BS_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MIMO_in_another_BS_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 4 */ /* 8.4.5.3.17 [2] MIMO_in_another_BS_IE (not implemented)*/ @@ -1032,12 +1050,12 @@ static gint MIMO_in_another_BS_IE(proto_tree *diuc_tree, const guint8 *bufptr, g tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286f, NULL, "MIMO_in_another_BS_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)"); return nib; } -static gint Macro_MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Macro_MIMO_DL_Basic_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* dl-map extended-2 ie = 5 */ /* 8.4.5.3.18 [2] Macro-MIMO_DL_Basic_IE (not implemented) */ @@ -1051,12 +1069,12 @@ static gint Macro_MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286g, NULL, "Macro_MIMO_DL_Basic_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)"); return nib; } -static gint Skip_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Skip_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 6 */ /* 8.4.5.3.20.2 Skip_IE */ @@ -1070,7 +1088,7 @@ static gint Skip_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gi tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286k, NULL, "Skip_IE"); XBIT(data, 4, "Extended-2 DIUC"); - XBIT(data, 8, "Length"); + VBIT(data, 8, hf_dlmap_ie_length); XBIT(data, 1, "Mode"); XBIT(data, 7, "Reserved"); @@ -1078,7 +1096,7 @@ static gint Skip_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gi return BIT_TO_NIB(bit); } -static gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 7 */ /* 8.4.5.3.21 [2] HARQ_DL_MAP_IE */ @@ -1093,7 +1111,7 @@ static gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286l, NULL, "HARQ_DL_MAP_IE"); XBIT(data, 4, "Extended-2 DIUC"); - XBIT(len, 8, "Length"); + VBIT(len, 2, hf_dlmap_ie_length); XBIT(RCID_Type, 2, "RCID_Type"); XBIT(data, 2, "Reserved"); @@ -1129,19 +1147,19 @@ static gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off /* 8.4.5.3.21 */ /* length of these are variable, each returns length in nibbles */ if (mode == 0) { - DL_HARQ_Chase_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + DL_HARQ_Chase_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb); } else if (mode == 1) { - DL_HARQ_IR_CTC_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + DL_HARQ_IR_CTC_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb); } else if (mode == 2) { - DL_HARQ_IR_CC_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + DL_HARQ_IR_CC_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb); } else if (mode == 3) { - MIMO_DL_Chase_HARQ_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + MIMO_DL_Chase_HARQ_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb); } else if (mode == 4) { - MIMO_DL_IR_HARQ_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + MIMO_DL_IR_HARQ_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb); } else if (mode == 5) { - MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + MIMO_DL_IR_HARQ_for_CC_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb); } else if (mode == 6) { - MIMO_DL_STC_HARQ_sub_burst_IE(tree, bufptr, BIT_TO_NIB(bit), length, tvb); + MIMO_DL_STC_HARQ_sub_burst_IE(tree, BIT_TO_NIB(bit), length, tvb); } else { proto_tree_add_text(tree, tvb, BITHI(bit,1), "(reserved Mode)"); break; /* cannot continue */ @@ -1158,7 +1176,7 @@ static gint HARQ_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off return BIT_TO_NIB(bit); } -static gint HARQ_ACK_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint HARQ_ACK_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 8 */ /* 8.4.5.3.22 HARQ_ACK IE */ @@ -1172,14 +1190,14 @@ static gint HARQ_ACK_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286u, NULL, "HARQ_ACK_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib,length-3), "(bitmap data)"); return nib; } -static gint Enhanced_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Enhanced_DL_MAP_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 9 */ /* 8.4.5.3.23 Enhanced DL MAP IE */ @@ -1195,7 +1213,7 @@ static gint Enhanced_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286v, NULL, "Enhanced_DL-MAP_IE"); XBIT(data, 4, "Extended-2 DIUC"); - XBIT(data, 8, "Length"); + VBIT(data, 8, hf_dlmap_ie_length); XBIT(numass, 4, "Num_Assignment"); for (i = 0; i < numass; i++) { @@ -1214,7 +1232,7 @@ static gint Enhanced_DL_MAP_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint return BIT_TO_NIB(bit); } -static gint Closed_loop_MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Closed_loop_MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 0xA */ /* 8.4.5.3.24 Closed-loop MIMO DL Enhanced IE (not implemented) */ @@ -1228,12 +1246,12 @@ static gint Closed_loop_MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286w, NULL, "CL_MIMO_DL_Enhanced_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-3), "(not implemented)"); return nib; } -static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended-2 IE = 0xE */ /* 8.4.5.3.26 AAS_SDMA_DL_IE */ @@ -1251,7 +1269,7 @@ static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286y, NULL, "AAS_SDMA_DL_IE"); XBIT(data, 4, "Extended-2 DIUC"); - XBIT(data, 8, "Length"); + VBIT(data, 8, hf_dlmap_ie_length); XBIT(RCID_Type, 2, "RCID_Type"); XBIT(num_region, 4, "Num_Burst_Region"); @@ -1270,7 +1288,7 @@ static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off XBIT(num_users, 3, "Number of Users"); XBIT(data, 2, "Reserved"); for (j = 0; j < num_users; j++) { - bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type); + bit += RCID_IE(tree, bit, length, tvb, RCID_Type); XBIT(encoding_mode, 2, "Encoding Mode"); XBIT(cqich_alloc, 1, "CQICH Allocation"); XBIT(ackch_alloc, 1, "ACKCH Allocation"); @@ -1347,7 +1365,7 @@ static gint AAS_SDMA_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint off * DL-MAP Extended IEs *******************************************************************/ -static gint Channel_Measurement_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Channel_Measurement_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 0 */ /* 8.4.5.3.5 [1] Channel_Measurement_IE */ @@ -1360,18 +1378,18 @@ static gint Channel_Measurement_IE(proto_tree *diuc_tree, const guint8 *bufptr, tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_280, NULL, "Channel_Measurement_IE"); - XNIB(data, 1, "Extended DIUC"); - XNIB(data, 1, "Length"); + VNIB(data, 1, hf_dlmap_ie_diuc_ext); + VNIB(data, 1, hf_dlmap_ie_length); XNIB(data, 2, "Channel Nr"); XNIB(data, 2, "OFDMA Symbol Offset"); - data = NIB_WORD(nib, bufptr); + data = TVB_NIB_WORD(nib, tvb); proto_tree_add_text(tree, tvb, NIBHI(nib,4), "CID: %d", data); nib += 4; return nib; } -static gint STC_Zone_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint STC_Zone_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 1 */ /* 8.4.5.3.4 STC_Zone_IE */ @@ -1386,8 +1404,8 @@ static gint STC_Zone_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_279, NULL, "STC_Zone_IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); XBIT(data, 8, "OFDMA Symbol Offset"); XBIT(data, 2, "Permutations"); @@ -1406,7 +1424,7 @@ static gint STC_Zone_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset return BIT_TO_NIB(bit); } -static gint AAS_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint AAS_DL_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 2 */ /* 8.4.5.3.3 AAS_DL_IE */ @@ -1419,8 +1437,8 @@ static gint AAS_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_278, NULL, "AAS_DL_IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); XBIT(data, 8, "OFDMA Symbol Offset"); XBIT(data, 3, "Permutation"); @@ -1434,7 +1452,7 @@ static gint AAS_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, return BIT_TO_NIB(bit); } -static gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 3 */ /* 8.4.5.3.6 Data_location_in_another_BS_IE */ @@ -1447,8 +1465,8 @@ static gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, const guint8 * tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_281, NULL, "Data location in another BS IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); XBIT(data, 2, "Segment"); XBIT(data, 6, "Used subchannels"); @@ -1467,7 +1485,7 @@ static gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, const guint8 * return BIT_TO_NIB(bit); } -static gint CID_Switch_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint CID_Switch_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 4 */ /* 8.4.5.3.7 [1] CID_Switch_IE */ @@ -1482,13 +1500,13 @@ static gint CID_Switch_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offs tree = proto_tree_add_subtree_format(diuc_tree, tvb, NIBHI(offset, length), ett_282, NULL, "CID_Switch_IE (INC_CID = %d)", INC_CID); - XNIB(data, 1, "Extended DIUC"); - XNIB(data, 1, "Length"); + VNIB(data, 1, hf_dlmap_ie_diuc_ext); + VNIB(data, 1, hf_dlmap_ie_length); return nib; } -static gint MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MIMO_DL_Basic_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 5 */ /* 8.4.5.3.8 MIMO_DL_Basic_IE (not implemented) */ @@ -1502,12 +1520,12 @@ static gint MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint o tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_283, NULL, "MIMO_DL_Basic_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-2), "(not implemented)"); return nib; } -static gint MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 6 */ /* 8.4.5.3.9 MIMO_DL_Enhanced_IE (not implemented) */ @@ -1521,12 +1539,12 @@ static gint MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 *bufptr, gin tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_284, NULL, "MIMO_DL_Enhanced_IE"); XNIB(data, 1, "Extended-2 DIUC"); - XNIB(data, 2, "Length"); + VNIB(data, 2, hf_dlmap_ie_length); proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-2), "(not implemented)"); return nib; } -static gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 7 */ /* 8.4.5.3.10 [2] HARQ_Map_Pointer_IE */ @@ -1540,8 +1558,8 @@ static gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gin tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_285, NULL, "HARQ_Map_Pointer_IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); length_in_bits = NIB_TO_BIT(length-1); while (bit < length_in_bits) { @@ -1575,7 +1593,7 @@ static gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gin return BIT_TO_NIB(bit); } -static gint PHYMOD_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint PHYMOD_DL_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 8 */ /* 8.4.5.3.11 PHYMOD_DL_IE */ @@ -1589,8 +1607,8 @@ static gint PHYMOD_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offse tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286, NULL, "PHYMOD_DL_IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); XBIT(pmt, 1, "Preamble Modifier Type"); if (pmt == 0) { @@ -1604,7 +1622,7 @@ static gint PHYMOD_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offse return BIT_TO_NIB(bit); } -static gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 0xA */ /* 8.4.5.3.25 Broadcast Control Pointer IE */ @@ -1618,8 +1636,8 @@ static gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, const guint8 *bu tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286x, NULL, "Broadcast Control Pointer IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); XBIT(data, 7, "DCD_UCD Transmission Frame"); XBIT(skip, 1, "Skip Broadcast_System_Update"); @@ -1630,7 +1648,7 @@ static gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, const guint8 *bu return BIT_TO_NIB(bit); } -static gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 0xB */ /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ @@ -1643,8 +1661,8 @@ static gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286b, NULL, "DL_PUSC_Burst_Allocation_in_Other_Segment_IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); XBIT(data, 16, "CID"); XBIT(data, 4, "DIUC"); @@ -1664,7 +1682,7 @@ static gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, return BIT_TO_NIB(bit); } -static gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 0xC */ /* 8.4.5.3.27 PUSC_ASCA_Alloc_IE */ @@ -1677,8 +1695,8 @@ static gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286z, NULL, "PUSC_ASCA_Alloc_IE"); - XBIT(data, 4, "Extended DIUC"); - XBIT(data, 4, "Length"); + VBIT(data, 4, hf_dlmap_ie_diuc_ext); + VBIT(data, 4, hf_dlmap_ie_length); XBIT(data, 4, "DIUC"); XBIT(data, 12, "Short Basic CID"); XBIT(data, 8, "OFDMA Symbol offset"); @@ -1692,48 +1710,44 @@ static gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint return BIT_TO_NIB(bit); } -static gint UL_interference_and_noise_level_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint UL_interference_and_noise_level_IE(proto_tree *diuc_tree, gint offset, gint length, tvbuff_t *tvb) { /* DL-MAP Extended IE = 0xF */ /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ /* offset of TLV in nibbles, length of TLV in nibbles */ - gint nib; - gint data; proto_tree *tree; - gint bitmap; - - nib = offset; + gint nib = offset; + gint bitmap, data; tree = proto_tree_add_subtree(diuc_tree, tvb, NIBHI(offset, length), ett_286h, NULL, "UL_interference_and_noise_level_IE"); - XNIB(data, 1, "Extended DIUC"); - XNIB(data, 1, "Length"); - - XNIB(bitmap, 2, "Bitmap"); + VNIB(data, 1, hf_dlmap_ie_diuc_ext); + VNIB(data, 1, hf_dlmap_ie_length); + VNIB(bitmap, 2, hf_dlmap_ie_bitmap); if (bitmap & 0x01) { - XNIB(data, 2, "CQI/ACK/Periodic Ranging region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_cqi); } if (bitmap & 0x02) { - XNIB(data, 2, "PUSC region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_pusc); } if (bitmap & 0x04) { - XNIB(data, 2, "Optional PUSC region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_opt_pusc); } if (bitmap & 0x08) { - XNIB(data, 2, "AMC region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_amc); } if (bitmap & 0x10) { - XNIB(data, 2, "AAS region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_aas); } if (bitmap & 0x20) { - XNIB(data, 2, "Periodic Ranging region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_periodic_ranging); } if (bitmap & 0x40) { - XNIB(data, 2, "Sounding region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_sounding); } if (bitmap & 0x80) { - XNIB(data, 2, "MIMO region NI"); + VNIB(data, 2, hf_dlmap_ie_bitmap_mimo); } return nib; @@ -1743,15 +1757,14 @@ static gint UL_interference_and_noise_level_IE(proto_tree *diuc_tree, const guin * DL-MAP Plugin *******************************************************************/ -extern gint wimax_decode_ulmapc(proto_tree *base_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb); +extern gint wimax_decode_ulmapc(proto_tree *base_tree, gint offset, gint length, tvbuff_t *tvb); - -static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb) +static gint dissect_dlmap_ie(proto_tree *ie_tree, gint offset, gint length, tvbuff_t *tvb) { /* decode a single DL-MAP IE and return the * length of the IE in nibbles * offset = start of IE (nibbles) - * length = total length of bufptr (nibbles) */ + * length = total length of IE (nibbles) */ proto_item *ti = NULL; proto_tree *tree = NULL; @@ -1770,12 +1783,12 @@ static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint off gint n_cid; /* 8.4.5.3 DL-MAP IE format - table 275 */ - diuc = NIB_NIBBLE(nibble, bufptr); + diuc = TVB_NIB_NIBBLE(nibble, tvb); if (diuc == 14) { /* 8.4.5.3.2.2 [2] Extended-2 DIUC dependent IE table 277b */ - ext2_diuc = NIB_NIBBLE(1+nibble, bufptr); - len = NIB_BYTE(1+nibble+1, bufptr); + ext2_diuc = TVB_NIB_NIBBLE(1+nibble, tvb); + len = TVB_NIB_BYTE(1+nibble+1, tvb); ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, 1+3+len*2), diuc); proto_item_append_text(ti, " (Extended-2)"); @@ -1789,57 +1802,57 @@ static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint off { case 0x00: /* 8.4.5.3.12 MBS_MAP_IE */ - nibble = MBS_MAP_IE(tree, bufptr, nibble, len, tvb); + nibble = MBS_MAP_IE(tree, nibble, len, tvb); break; case 0x01: /* 8.4.5.3.14 HO_Anchor_Active_DL-MAP_IE */ - nibble = HO_Anchor_Active_DL_MAP_IE(tree, bufptr, nibble, len, tvb); + nibble = HO_Anchor_Active_DL_MAP_IE(tree, nibble, len, tvb); break; case 0x02: /* 8.4.5.3.15 HO_Active_Anchor_DL_MAP_IE */ - nibble = HO_Active_Anchor_DL_MAP_IE(tree, bufptr, nibble, len, tvb); + nibble = HO_Active_Anchor_DL_MAP_IE(tree, nibble, len, tvb); break; case 0x03: /* 8.4.5.3.16 HO_CID_Translation_MAP_IE */ - nibble = HO_CID_Translation_MAP_IE(tree, bufptr, nibble, len, tvb); + nibble = HO_CID_Translation_MAP_IE(tree, nibble, len, tvb); break; case 0x04: /* 8.4.5.3.17 MIMO_in_another_BS_IE */ - nibble = MIMO_in_another_BS_IE(tree, bufptr, nibble, len, tvb); + nibble = MIMO_in_another_BS_IE(tree, nibble, len, tvb); break; case 0x05: /* 8.4.5.3.18 Macro-MIMO_DL_Basic_IE */ - nibble = Macro_MIMO_DL_Basic_IE(tree, bufptr, nibble, len, tvb); + nibble = Macro_MIMO_DL_Basic_IE(tree, nibble, len, tvb); break; case 0x06: /* 8.4.5.3.20.2 Skip_IE */ - nibble = Skip_IE(tree, bufptr, nibble, len, tvb); + nibble = Skip_IE(tree, nibble, len, tvb); break; case 0x07: /* 8.4.5.3.21 HARQ_DL_MAP_IE */ - nibble = HARQ_DL_MAP_IE(tree, bufptr, nibble, len, tvb); + nibble = HARQ_DL_MAP_IE(tree, nibble, len, tvb); break; case 0x08: /* 8.4.5.3.22 HARQ_ACK IE */ - nibble = HARQ_ACK_IE(tree, bufptr, nibble, len, tvb); + nibble = HARQ_ACK_IE(tree, nibble, len, tvb); break; case 0x09: /* 8.4.5.3.23 Enhanced DL MAP IE */ - nibble = Enhanced_DL_MAP_IE(tree, bufptr, nibble, len, tvb); + nibble = Enhanced_DL_MAP_IE(tree, nibble, len, tvb); break; case 0x0a: /* 8.4.5.3.24 Closed-loop MIMO DL Enhanced IE */ - nibble = Closed_loop_MIMO_DL_Enhanced_IE(tree, bufptr, nibble, len, tvb); + nibble = Closed_loop_MIMO_DL_Enhanced_IE(tree, nibble, len, tvb); break; case 0x0b: - nibble = MIMO_DL_Basic_IE(tree, bufptr, nibble, len, tvb); + nibble = MIMO_DL_Basic_IE(tree, nibble, len, tvb); break; case 0x0c: - nibble = MIMO_DL_Enhanced_IE(tree, bufptr, nibble, len, tvb); + nibble = MIMO_DL_Enhanced_IE(tree, nibble, len, tvb); break; case 0x0e: - nibble = AAS_SDMA_DL_IE(tree, bufptr, nibble, len, tvb); + nibble = AAS_SDMA_DL_IE(tree, nibble, len, tvb); break; default: @@ -1852,8 +1865,8 @@ static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint off else if (diuc == 15) { /* 8.4.5.3.2.1 [1] Extended DIUC dependent IE - table 277 */ - ext_diuc = NIB_NIBBLE(1+nibble, bufptr); - len = NIB_NIBBLE(1+nibble+1, bufptr); + ext_diuc = TVB_NIB_NIBBLE(1+nibble, tvb); + len = TVB_NIB_NIBBLE(1+nibble+1, tvb); ti = proto_tree_add_uint(ie_tree, hf_dlmap_ie_diuc, tvb, NIBHI(nibble, 1+2+len*2), diuc); proto_item_append_text(ti, " (Extended)"); @@ -1869,47 +1882,47 @@ static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint off { case 0x00: /* 8.4.5.3.? Channel_Measurement_IE */ - nibble = Channel_Measurement_IE(tree, bufptr, nibble, len, tvb); + nibble = Channel_Measurement_IE(tree, nibble, len, tvb); break; case 0x01: /* 8.4.5.3.4 STC_Zone_IE */ - nibble = STC_Zone_IE(tree, bufptr, nibble, len, tvb); + nibble = STC_Zone_IE(tree, nibble, len, tvb); break; case 0x02: /* 8.4.5.3.3 AAS_DL_IE */ - nibble = AAS_DL_IE(tree, bufptr, nibble, len, tvb); + nibble = AAS_DL_IE(tree, nibble, len, tvb); break; case 0x03: /* 8.4.5.3.6 Data_location_in_another_BS_IE */ - nibble = Data_location_in_another_BS_IE(tree, bufptr, nibble, len, tvb); + nibble = Data_location_in_another_BS_IE(tree, nibble, len, tvb); break; case 0x04: /* 8.4.5.3.7 CID_Switch_IE */ - nibble = CID_Switch_IE(tree, bufptr, nibble, len, tvb); + nibble = CID_Switch_IE(tree, nibble, len, tvb); break; case 0x07: /* 8.4.5.3.10 HARQ_Map_Pointer_IE */ - nibble = HARQ_Map_Pointer_IE(tree, bufptr, nibble, len, tvb); + nibble = HARQ_Map_Pointer_IE(tree, nibble, len, tvb); break; case 0x08: /* 8.4.5.3.11 PHYMOD_DL_IE */ - nibble = PHYMOD_DL_IE(tree, bufptr, nibble, len, tvb); + nibble = PHYMOD_DL_IE(tree, nibble, len, tvb); break; case 0x0a: /* 8.4.5.3.25 Broadcast Control Pointer IE */ - nibble = Broadcast_Control_Pointer_IE(tree, bufptr, nibble, len, tvb); + nibble = Broadcast_Control_Pointer_IE(tree, nibble, len, tvb); break; case 0x0b: /* 8.4.5.3.13 DL PUSC Burst Allocation in Other Segment IE */ - nibble = DL_PUSC_Burst_Allocation_in_Other_Segment_IE(tree, bufptr, nibble, len, tvb); + nibble = DL_PUSC_Burst_Allocation_in_Other_Segment_IE(tree, nibble, len, tvb); break; case 0x0c: - nibble = PUSC_ASCA_Alloc_IE(tree, bufptr, nibble, len, tvb); + nibble = PUSC_ASCA_Alloc_IE(tree, nibble, len, tvb); break; case 0x0f: /* 8.4.5.3.19 UL_interference_and_noise_level_IE */ - nibble = UL_interference_and_noise_level_IE(tree, bufptr, nibble, len, tvb); + nibble = UL_interference_and_noise_level_IE(tree, nibble, len, tvb); break; default: @@ -1929,7 +1942,7 @@ static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint off /* precalculate IE len for correct highlighting */ if (INC_CID && !sub_dl_ul_map) { - ie_len += 2 + (NIB_BYTE(nibble+1, bufptr) * 4); + ie_len += 2 + (TVB_NIB_BYTE(nibble+1, tvb) * 4); } /* DL-MAP_IE */ @@ -1946,7 +1959,7 @@ static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint off if (INC_CID) { - n_cid = NIB_BYTE(nibble, bufptr); + n_cid = TVB_NIB_BYTE(nibble, tvb); proto_tree_add_uint(tree, hf_dlmap_ie_ncid, tvb, NIBHI(nibble, 2), n_cid); nibble += 2; @@ -1955,16 +1968,16 @@ static gint dissect_dlmap_ie(proto_tree *ie_tree, const guint8 *bufptr, gint off if (sub_dl_ul_map) { /* RCID_IE 8.4.5.3 and 8.4.5.3.20.1, only part of SUB-DL-UL-MAP */ /* RCID_Type comes from 6.3.2.3.43.2 [2] Format_configuration_IE in Compact_DL-MAP_IE */ - nibble += RCID_IE(tree, bufptr, nibble*4, length, tvb, RCID_Type) / 4; + nibble += RCID_IE(tree, nibble*4, length, tvb, RCID_Type) / 4; } else { - data = NIB_WORD(nibble, bufptr); + data = TVB_NIB_WORD(nibble, tvb); proto_tree_add_uint(tree, hf_dlmap_ie_cid, tvb, NIBHI(nibble, 4), data); nibble += 4; } } } - data = NIB_LONG(nibble, bufptr); + data = TVB_NIB_LONG(nibble, tvb); if (alt_format) { proto_tree_add_uint(tree, hf_dlmap_ie_offsym2, tvb, NIBHI(nibble, 8), data); proto_tree_add_uint(tree, hf_dlmap_ie_offsub2, tvb, NIBHI(nibble, 8), data); @@ -1998,8 +2011,6 @@ static void dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo proto_tree *ie_tree = NULL; proto_tree *phy_tree = NULL; gint tvb_len = tvb_reported_length(tvb); - /* XXX This should be removed, and regular tvb accessors should be used instead. */ - const guint8 *bufptr = tvb_get_ptr(tvb, offset, tvb_len); INC_CID = 0; @@ -2032,7 +2043,7 @@ static void dissect_mac_mgmt_msg_dlmap_decoder(tvbuff_t *tvb, packet_info *pinfo nib = BYTE_TO_NIB(offset); while (nib < ((tvb_len*2)-1)) { - nib += dissect_dlmap_ie(ie_tree, bufptr, nib, tvb_len * 2, tvb); + nib += dissect_dlmap_ie(ie_tree, nib, tvb_len * 2, tvb); } pad = NIB_PADDING(nib); if (pad) { @@ -2058,8 +2069,6 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre guint length, lennib, pad; guint mac_len, dl_ie_count; guint tvb_len = tvb_reported_length(tvb); - /* XXX This should be removed, and regular tvb accessors should be used instead. */ - const guint8 * bufptr = tvb_get_ptr(tvb, offset, tvb_len); guint nib = 0; guint32 mac_crc, calculated_crc; @@ -2107,7 +2116,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre /* length = BYTE_TO_NIB(mac_len - (int)sizeof(mac_crc) - 1); */ /* convert length to nibbles */ while (dl_ie_count--) { - nib += dissect_dlmap_ie(ie_tree, bufptr, nib, tvb_len * 2, tvb); + nib += dissect_dlmap_ie(ie_tree, nib, tvb_len * 2, tvb); } pad = NIB_PADDING(nib); if (pad) { @@ -2129,7 +2138,7 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre col_append_sep_str(pinfo->cinfo, COL_INFO, NULL, "Compressed UL-MAP"); /* subtract 8 from lennib (CRC) */ - wimax_decode_ulmapc(base_tree, bufptr, nib, lennib - 8, tvb); + wimax_decode_ulmapc(base_tree, nib, lennib - 8, tvb); } /* CRC is always appended */ @@ -2154,16 +2163,13 @@ gint wimax_decode_dlmapc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *base_tre return mac_len; } -extern gint dissect_ulmap_ie(proto_tree *ie_tree, - const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb); -extern gint wimax_decode_ulmap_reduced_aas(proto_tree *ie_tree, - const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb); +extern gint dissect_ulmap_ie(proto_tree *ie_tree, gint offset, gint length, tvbuff_t *tvb); +extern gint wimax_decode_ulmap_reduced_aas(proto_tree *ie_tree, gint offset, gint length, tvbuff_t *tvb); gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *base_tree) { /* decode a SUB-DL-UL-MAP message 6.3.2.3.60 and return the length in bytes */ /* first three bits are 0x7, which following a compressed DL map indicates this message */ - guint offset = 0; proto_tree *tree = NULL; proto_tree *ie_tree = NULL; proto_item *generic_item = NULL; @@ -2172,8 +2178,6 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre guint16 calculated_crc; gint length = tvb_reported_length(tvb); - /* XXX This should be removed, and regular tvb accessors should be used instead. */ - const guint8 * bufptr = tvb_get_ptr(tvb, offset, length); gint nib = 0; gint lennib = BYTE_TO_NIB(length); @@ -2181,7 +2185,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre tree = proto_tree_add_subtree(base_tree, tvb, NIBHI(nib,lennib-nib), ett_109x, NULL, "SUB-DL-UL-MAP"); - data = NIB_WORD(nib,bufptr); + data = TVB_NIB_WORD(nib,tvb); proto_tree_add_uint(tree, hf_109x_cmi, tvb, NIBHI(nib,4), data); proto_tree_add_uint(tree, hf_109x_len, tvb, NIBHI(nib,4), data); proto_tree_add_uint(tree, hf_109x_rcid, tvb, NIBHI(nib,4), data); @@ -2190,28 +2194,28 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* HARQ ACK offset indicator */ if (data & 1) { - data = NIB_BYTE(nib,bufptr); + data = TVB_NIB_BYTE(nib,tvb); proto_tree_add_uint(tree, hf_109x_dl, tvb, NIBHI(nib,2), data); nib += 2; - data = NIB_BYTE(nib,bufptr); + data = TVB_NIB_BYTE(nib,tvb); proto_tree_add_uint(tree, hf_109x_ul, tvb, NIBHI(nib,2), data); nib += 2; } - numie = NIB_BYTE(nib,bufptr); + numie = TVB_NIB_BYTE(nib,tvb); proto_tree_add_uint(tree, hf_109x_dlie, tvb, NIBHI(nib,2), numie); nib += 2; /* DL-MAP IEs */ ie_tree = proto_tree_add_subtree(tree, tvb, NIBHI(nib,1), ett_109x_dl, NULL, "DL-MAP IEs"); for (i = 0; i < numie; i++) { - nib += dissect_dlmap_ie(ie_tree, bufptr, nib, lennib - nib, tvb); + nib += dissect_dlmap_ie(ie_tree, nib, lennib - nib, tvb); } - data = NIB_BYTE(nib,bufptr); + data = TVB_NIB_BYTE(nib,tvb); proto_tree_add_uint(tree, hf_109x_symofs, tvb, NIBHI(nib,2), data); nib += 2; - data = NIB_BYTE(nib,bufptr); + data = TVB_NIB_BYTE(nib,tvb); proto_tree_add_uint(tree, hf_109x_subofs, tvb, NIBHI(nib,2), data); proto_tree_add_uint(tree, hf_109x_rsv, tvb, NIBHI(nib,2), data); nib += 2; @@ -2219,7 +2223,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre /* UL-MAP IEs */ ie_tree = proto_tree_add_subtree(tree, tvb, NIBHI(nib,lennib-nib), ett_109x_ul, NULL, "UL-MAP IEs"); for ( ; nib < lennib - 1; ) { - nib += dissect_ulmap_ie(ie_tree, bufptr, nib, lennib - nib, tvb); + nib += dissect_ulmap_ie(ie_tree, nib, lennib - nib, tvb); } /* padding */ @@ -2229,7 +2233,7 @@ gint wimax_decode_sub_dl_ul_map(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre } /* CRC-16 is always appended */ - data = NIB_WORD(nib, bufptr); + data = TVB_NIB_WORD(nib, tvb); generic_item = proto_tree_add_text(tree, tvb, NIBHI(nib,4), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, NIB_TO_BYTE(nib)), NIB_TO_BYTE(nib)); @@ -2255,8 +2259,6 @@ gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo _U_, proto gint ulmap_appended; gint length; gint tvb_len = tvb_reported_length(tvb); - /* XXX This should be removed, and regular tvb accessors should be used instead. */ - const guint8 * bufptr = tvb_get_ptr(tvb, offset, tvb_len); gint bit = 0; guint data, pad, mult; gint numie = 1; @@ -2343,7 +2345,7 @@ gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo _U_, proto XBIT(data, 2, "Repetition Coding Indication"); if (ulmap_appended) { /* offset and length are in bits */ - bit += wimax_decode_ulmap_reduced_aas(tree, bufptr, offset, length*8, tvb); + bit += wimax_decode_ulmap_reduced_aas(tree, offset, length*8, tvb); } XBIT(data, 3, "Reserved"); } @@ -2356,7 +2358,7 @@ gint wimax_decode_dlmap_reduced_aas(tvbuff_t *tvb, packet_info *pinfo _U_, proto } /* CRC-16 is always appended */ - data = BIT_BITS(bit, bufptr, 16); + data = TVB_BIT_BITS(bit, tvb, 16); generic_item = proto_tree_add_text(tree, tvb, BITHI(bit,16), "CRC-16: 0x%04x",data); /* calculate the CRC */ calculated_crc = wimax_mac_calc_crc16(tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit)); @@ -2434,6 +2436,83 @@ void proto_register_mac_mgmt_msg_dlmap(void) } }, { + &hf_dlmap_ie_diuc_ext, + { + "Extended DIUC", "wmx.dlmap.ie.ext_diuc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_length, + { + "Length", "wmx.dlmap.ie.length", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap, + { + "Bitmap", "wmx.dlmap.ie.bitmap", + FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_cqi, + { + "CQI/ACK/Periodic Ranging region NI", "wmx.dlmap.ie.bitmap.cqi", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_pusc, + { + "PUSC region NI", "wmx.dlmap.ie.bitmap.pusc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_opt_pusc, + { + "Optional PUSC region NI", "wmx.dlmap.ie.bitmap.opt_pusc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_amc, + { + "AMC region NI", "wmx.dlmap.ie.bitmap.amc", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_aas, + { + "AAS region NI", "wmx.dlmap.ie.bitmap.aas", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_periodic_ranging, + { + "Periodic Ranging region NI", "wmx.dlmap.ie.bitmap.periodic_ranging", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_sounding, + { + "Sounding region NI", "wmx.dlmap.ie.bitmap.sounding", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { + &hf_dlmap_ie_bitmap_mimo, + { + "MIMO region NI", "wmx.dlmap.ie.bitmap.mimo", + FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL + } + }, + { &hf_dlmap_ie_ncid, { "N_CID", "wmx.dlmap.ie.ncid", |