⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plugins-wimax-msg_dlmap.c

📁 Intel的WIMAX代码,主要是mac层code
💻 C
📖 第 1 页 / 共 5 页
字号:
    XBIT(data,  2, "Reserved");
    for (i = 0; i < num_region; i++) {
        XBIT(data,  8, "OFDMA Symbol Offset");
        if (zone_permut == 0) {
            XBIT(data,  8, "Subchannel offset");
            XBIT(data,  5, "No. OFDMA triple symbols");
            XBIT(data,  6, "No. subchannels");
        } else {
            XBIT(data,  6, "Subchannel offset");
            XBIT(data,  7, "No. OFDMA triple symbols");
            XBIT(data,  6, "No. subchannels");
        }
        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);
            XBIT(encoding_mode,  2, "Encoding Mode");
            XBIT(cqich_alloc,  1, "CQICH Allocation");
            XBIT(ackch_alloc,  1, "ACKCH Allocation");
            XBIT(pilot_pattern,  1, "Pilot Pattern Modifier");
            if (aas_preamble) {
                XBIT(data,  4, "Preamble Modifier Index");
            }
            if (pilot_pattern) {
                XBIT(data,  2, "Pilot Pattern");
                XBIT(data,  1, "Reserved");
            } else {
                XBIT(data,  3, "Reserved");
            }
            if (encoding_mode == 0x0) {
                XBIT(data,  4, "DIUC");
                XBIT(data,  2, "Repetition Coding Indication");
                XBIT(data,  2, "Reserved");
            }
            if (encoding_mode == 0x1) {
                if (ackch_alloc) {
                    XBIT(data,  5, "ACK CH Index");
                } else {
                    XBIT(data,  1, "Reserved");
                }
                XBIT(data,  4, "DIUC");
                XBIT(data,  2, "Repetition Coding Indication");
                XBIT(data,  4, "ACID");
                XBIT(data,  1, "AI_SN");
            }
            if (encoding_mode == 0x2) {
                if (ackch_alloc) {
                    XBIT(data,  5, "ACK CH Index");
                } else {
                    XBIT(data,  1, "Reserved");
                }
                XBIT(data,  4, "N(EP)");
                XBIT(data,  4, "N(SCH)");
                XBIT(data,  2, "SPID");
                XBIT(data,  4, "ACID");
                XBIT(data,  1, "AI_SN");
            }
            if (encoding_mode == 0x3) {
                if (ackch_alloc) {
                    XBIT(data,  5, "ACK CH Index");
                    XBIT(data,  2, "Reserved");
                } else {
                    XBIT(data,  3, "Reserved");
                }
                XBIT(data,  4, "DIUC");
                XBIT(data,  2, "Repetition Coding Indication");
                XBIT(data,  2, "SPID");
                XBIT(data,  4, "ACID");
                XBIT(data,  1, "AI_SN");
            }
            if (cqich_alloc) {
                XBIT(data,  6, "Allocation Index");
                XBIT(data,  3, "Period (p)");
                XBIT(data,  3, "Frame offset");
                XBIT(data,  4, "Duration (d)");
            }
        }
    }
    data = BIT_PADDING(bit,4);
    /* Should this be an optional field? Or do we want it, even if it has a length of zero? */
    proto_tree_add_text(tree, tvb, BITHI(bit,data), "Padding: %d bits", data);
    bit += data;

    return BIT_TO_NIB(bit);
}



/********************************************************************
 * DL-MAP Extended IEs
 *******************************************************************/

gint Channel_Measurement_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 0 */
    /* 8.4.5.3.5 [1] Channel_Measurement_IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint nib;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    nib = offset;

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Channel_Measurement_IE");
    tree = proto_item_add_subtree(ti, ett_280);

    XNIB(data,  1, "Extended DIUC");
    XNIB(data,  1, "Length");

    XNIB(data, 2, "Channel Nr");
    XNIB(data, 2, "OFDMA Symbol Offset");
    data = NIB_WORD(nib, bufptr);
    proto_tree_add_text(tree, tvb, NIBHI(nib,4), "CID: %d", data);
    nib += 4;
    return nib;
}

gint STC_Zone_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 1 */
    /* 8.4.5.3.4 STC_Zone_IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    /* set globals: STC_Zone_Dedicated_Pilots, STC_Zone_Matrix
     * used in 8.4.5.3.21.1 Dedicated MIMO Control IE 286t */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    bit = NIB_TO_BIT(offset);

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "STC_Zone_IE");
    tree = proto_item_add_subtree(ti, ett_279);

    XBIT(data,  4, "Extended DIUC");
    XBIT(data,  4, "Length");

    XBIT(data, 8, "OFDMA Symbol Offset");
    XBIT(data, 2, "Permutations");
    XBIT(data, 1, "Use All SC indicator");
    XBIT(data, 2, "STC");
    XBIT(STC_Zone_Matrix, 2, "Matrix indicator");
    XBIT(data, 5, "DL_PermBase");
    XBIT(data, 2, "PRBS_ID");
    XBIT(data, 2, "AMC type");
    XBIT(data, 1, "Midamble Presence");
    XBIT(data, 1, "Midamble Boosting");
    XBIT(data, 1, "2/3 antenna select");
    XBIT(STC_Zone_Dedicated_Pilots, 1, "Dedicated Pilots");
    XBIT(data, 4, "Reserved");

    return BIT_TO_NIB(bit);
}

gint AAS_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 2 */
    /* 8.4.5.3.3 AAS_DL_IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    bit = NIB_TO_BIT(offset);

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "AAS_DL_IE");
    tree = proto_item_add_subtree(ti, ett_278);

    XBIT(data,  4, "Extended DIUC");
    XBIT(data,  4, "Length");

    XBIT(data, 8, "OFDMA Symbol Offset");
    XBIT(data, 3, "Permutation");
    XBIT(data, 6, "DL_PermBase");
    XBIT(data, 2, "Downlink_preamble_config");
    XBIT(data, 1, "Preamble type");
    XBIT(data, 2, "PRBS_ID");
    XBIT(data, 1, "Diversity Map");
    XBIT(data, 1, "Reserved");

    return BIT_TO_NIB(bit);
}

gint Data_location_in_another_BS_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 3 */
    /* 8.4.5.3.6 Data_location_in_another_BS_IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    bit = NIB_TO_BIT(offset);

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Data location in another BS IE");
    tree = proto_item_add_subtree(ti, ett_281);

    XBIT(data,  4, "Extended DIUC");
    XBIT(data,  4, "Length");

    XBIT(data, 2, "Segment");
    XBIT(data, 6, "Used subchannels");
    XBIT(data, 4, "DIUC");
    XBIT(data, 3, "Frame Advance");
    XBIT(data, 1, "Reserved");
    XBIT(data, 8, "OFDMA Symbol Offset");
    XBIT(data, 6, "Subchannel Offset");
    XBIT(data, 3, "Boosting");
    XBIT(data, 7, "Preamble Index");
    XBIT(data, 8, "No. OFDMA Symbols");
    XBIT(data, 6, "No. Subchannels");
    XBIT(data, 2, "Repetition Coding Indication");
    XBIT(data, 16, "CID");

    return BIT_TO_NIB(bit);
}

gint CID_Switch_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 4 */
    /* 8.4.5.3.7 [1] CID_Switch_IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint nib;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    nib = offset;

    INC_CID = INC_CID ? 0 : 1;

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "CID_Switch_IE");
    proto_item_append_text(ti, " (INC_CID = %d)",INC_CID);
    tree = proto_item_add_subtree(ti, ett_282);

    XNIB(data,  1, "Extended DIUC");
    XNIB(data,  1, "Length");

    return nib;
}

gint MIMO_DL_Basic_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 5 */
    /* 8.4.5.3.8 MIMO_DL_Basic_IE (not implemented) */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint nib;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    nib = offset;

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_DL_Basic_IE");
    tree = proto_item_add_subtree(ti, ett_283);

    XNIB(data,  1, "Extended-2 DIUC");
    XNIB(data,  2, "Length");
    proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-2), "(not implemented)");
    return nib;
}

gint MIMO_DL_Enhanced_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 6 */
    /* 8.4.5.3.9 MIMO_DL_Enhanced_IE (not implemented) */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint nib;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    nib = offset;

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "MIMO_DL_Enhanced_IE");
    tree = proto_item_add_subtree(ti, ett_284);

    XNIB(data,  1, "Extended-2 DIUC");
    XNIB(data,  2, "Length");
    proto_tree_add_text(diuc_tree, tvb, NIBHI(nib, length-2), "(not implemented)");
    return nib;
}

gint HARQ_Map_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 7 */
    /* 8.4.5.3.10 [2] HARQ_Map_Pointer_IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;
    gint length_in_bits, rep, map, diuc, slots, idle, sleep, mask_len;

    bit = NIB_TO_BIT(offset);

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "HARQ_Map_Pointer_IE");
    tree = proto_item_add_subtree(ti, ett_285);

    XBIT(data,  4, "Extended DIUC");
    XBIT(data,  4, "Length");

    length_in_bits = NIB_TO_BIT(length-1);
    while (bit < length_in_bits) {
	XBIT(diuc, 4, "DIUC");
	XBIT(slots, 8, "No. Slots");
	XBIT(rep, 2, "Repetition Coding Indication");
	XBIT(map, 2, "Map Version");
        if (map == 2) {
	    XBIT(idle, 1, "Idle users");
	    XBIT(sleep, 1, "Sleep users");
	    XBIT(mask_len, 2, "CID Mask Length");
            if (mask_len == 0) {
                /* 12 bits */
                proto_tree_add_text(diuc_tree, tvb, BITHI(bit,12), "CID Mask: 12 bits");
                bit += 12;
            } else if (mask_len == 1) {
                /* 20 bits */
                proto_tree_add_text(diuc_tree, tvb, BITHI(bit,20), "CID Mask: 20 bits");
                bit += 20;
            } else if (mask_len == 2) {
                /* 36 bits */
                proto_tree_add_text(diuc_tree, tvb, BITHI(bit,36), "CID Mask: 36 bits");
                bit += 36;
            } else if (mask_len == 3) {
                /* 52 bits */
                proto_tree_add_text(diuc_tree, tvb, BITHI(bit,52), "CID Mask: 52 bits");
                bit += 52;
            }
        }
    }
    return BIT_TO_NIB(bit);
}

gint PHYMOD_DL_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 8 */
    /* 8.4.5.3.11 PHYMOD_DL_IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;
    gint pmt;

    bit = NIB_TO_BIT(offset);

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "PHYMOD_DL_IE");
    tree = proto_item_add_subtree(ti, ett_286);

    XBIT(data,  4, "Extended DIUC");
    XBIT(data,  4, "Length");

    XBIT(pmt, 1, "Preamble Modifier Type");
    if (pmt == 0) {
	XBIT(data, 4, "Preamble frequency shift index");
    } else {
	XBIT(data, 4, "Preamble Time Shift Index");
    }
    XBIT(data, 1, "Pilot Pattern Modifier");
    XBIT(data, 2, "Pilot Pattern Index");

    return BIT_TO_NIB(bit);
}

gint Broadcast_Control_Pointer_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL-MAP Extended IE = 0xA */
    /* 8.4.5.3.25 Broadcast Control Pointer IE */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;
    gint skip;

    bit = NIB_TO_BIT(offset);

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "Broadcast Control Pointer IE");
    tree = proto_item_add_subtree(ti, ett_286x);

    XBIT(data,  4, "Extended DIUC");
    XBIT(data,  4, "Length");

    XBIT(data,  7, "DCD_UCD Transmission Frame");
    XBIT(skip,  1, "Skip Broadcast_System_Update");
    if (skip == 0) {
        XBIT(data,  1, "Broadcast_System_Update_Type");
        XBIT(data,  7, "Broadcast_System_Update_Transmission_Frame");
    }
    return BIT_TO_NIB(bit);
}

gint DL_PUSC_Burst_Allocation_in_Other_Segment_IE(proto_tree *diuc_tree, const guint8 *bufptr, 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 */
    /* offset of TLV in nibbles, length of TLV in nibbles */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_tree *tree = NULL;

    bit = NIB_TO_BIT(offset);

    ti = proto_tree_add_text(diuc_tree, tvb, NIBHI(offset, length), "DL_PUSC_Burst_Allocation_in_Other_Segment_IE");
    tree = proto_item_add_subtree(ti, ett_286b);

    XBIT(data,  4, "Extended DIUC");
    XBIT(data,  4, "Length");

    XBIT(data, 16, "CID");
    XBIT(data,  4, "DIUC");
    XBIT(data,  2, "Segment");
    XBIT(data,  3, "Boosting");
    XBIT(data,  5, "IDcell");
    XBIT(data,  5, "DL_PermBase");
    XBIT(data,  2, "PRBS_ID");
    XBIT(data,  2, "Repetition coding indication");
    XBIT(data,  6, "Used Subchannels");
    XBIT(data,  8, "OFDMA symbol offset");
    XBIT(data,  1, "Reserved");
    XBIT(data,  7, "# OFDMA symbols");
    XBIT(data,  6, "Subchannel offset");
    XBIT(data,  6, "# subchannels");
    XBIT(data,  7, "Reserved");
    return BIT_TO_NIB(bit);
}

gint PUSC_ASCA_Alloc_IE(proto_tree *diuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* DL

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -