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

📄 plugins-wimax-msg_ulmap.c

📁 Intel的WIMAX代码,主要是mac层code
💻 C
📖 第 1 页 / 共 5 页
字号:
	    }
    },
    {
	    &hf_ulmap_reserved,
	    {
		    "Reserved", "wimax.ulmap.rsv",
		    FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_alloc_start_time,
	    {
		    "Uplink Channel ID", "wimax.ulmap.start",
		    FT_UINT32, BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_ucd_count,
	    {
		    "UCD Count", "wimax.ulmap.ucd",
		    FT_UINT8, BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc0_numsub,
	    {
		    "No. subchannels", "wimax.ulmap.uiuc0.numsub",
		    FT_UINT32,  BASE_DEC, NULL, 0x000003f8, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc0_numsym,
	    {
		    "No. OFDMA symbols", "wimax.ulmap.uiuc0.numsym",
		    FT_UINT32,  BASE_DEC, NULL, 0x0001fc00, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc0_rsv,
	    {
		    "Reserved", "wimax.ulmap.uiuc0.rsv",
		    FT_UINT32,  BASE_DEC, NULL, 0x00000007, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc0_subofs,
	    {
		    "Subchannel offset", "wimax.ulmap.uiuc0.subofs",
		    FT_UINT32,  BASE_DEC, NULL, 0x00fe0000, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc0_symofs,
	    {
		    "OFDMA symbol offset", "wimax.ulmap.uiuc0.symofs",
		    FT_UINT32,  BASE_DEC, NULL, 0xff000000, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc11_data,
	    {
		    "Data", "wimax.ulmap.uiuc11.data",
		    FT_BYTES,  BASE_HEX, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc11_ext,
	    {
		    "Extended 2 UIUC", "wimax.ulmap.uiuc11.ext",
		    FT_UINT8,  BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc11_len,
	    {
		    "Length", "wimax.ulmap.uiuc11.len",
		    FT_UINT8,  BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc12_dri,
	    {
		    "Dedicated ranging indicator", "wimax.ulmap.uiuc12.dri",
		    FT_UINT32, BASE_DEC, NULL, 0x00000001, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc10_dur,
	    {
		    "Duration", "wimax.ulmap.uiuc12.dur",
		    FT_UINT16, BASE_DEC, NULL, 0xFFc0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc12_method,
	    {
		    "Ranging Method", "wimax.ulmap.uiuc12.method",
		    FT_UINT32, BASE_DEC, NULL, 0x00000006, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc12_numsub,
	    {
		    "No. Subchannels", "wimax.ulmap.uiuc12.numsub",
		    FT_UINT32, BASE_DEC, NULL, 0x000003F8, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc12_numsym,
	    {
		    "No. OFDMA Symbols", "wimax.ulmap.uiuc12.numsym",
		    FT_UINT32, BASE_DEC, NULL, 0x0001Fc00, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc10_rep,
	    {
		    "Repetition Coding indication", "wimax.ulmap.uiuc12.rep",
		    FT_UINT16, BASE_DEC, NULL, 0x0030, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc12_subofs,
	    {
		    "Subchannel Offset", "wimax.ulmap.uiuc12.subofs",
		    FT_UINT32, BASE_DEC, NULL, 0x00Fe0000, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc12_symofs,
	    {
		    "OFDMA Symbol Offset", "wimax.ulmap.uiuc12.symofs",
		    FT_UINT32, BASE_DEC, NULL, 0xFF000000, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc13_numsub,
	    {
		    "No. Subchannels/SZ Shift Value", "wimax.ulmap.uiuc13.numsub",
		    FT_UINT32,  BASE_DEC, NULL, 0x000003f8, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc13_numsym,
	    {
		    "No. OFDMA symbols", "wimax.ulmap.uiuc13.numsym",
		    FT_UINT32,  BASE_DEC, NULL, 0x0001fc00, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc13_papr,
	    {
		    "PAPR Reduction/Safety Zone", "wimax.ulmap.uiuc13.papr",
		    FT_UINT32,  BASE_DEC, NULL, 0x00000004, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc13_rsv,
	    {
		    "Reserved", "wimax.ulmap.uiuc13.rsv",
		    FT_UINT32,  BASE_DEC, NULL, 0x00000001, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc13_subofs,
	    {
		    "Subchannel offset", "wimax.ulmap.uiuc13.subofs",
		    FT_UINT32,  BASE_DEC, NULL, 0x00fe0000, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc13_symofs,
	    {
		    "OFDMA symbol offset", "wimax.ulmap.uiuc13.symofs",
		    FT_UINT32,  BASE_DEC, NULL, 0xff000000, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc13_zone,
	    {
		    "Sounding Zone", "wimax.ulmap.uiuc13.zone",
		    FT_UINT32,  BASE_DEC, NULL, 0x00000002, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_bwr,
	    {
		    "BW request mandatory", "wimax.ulmap.uiuc14.bwr",
		    FT_UINT8,  BASE_DEC, NULL, 0x01, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_code,
	    {
		    "Ranging code", "wimax.ulmap.uiuc14.code",
		    FT_UINT8,  BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_dur,
	    {
		    "Duration", "wimax.ulmap.uiuc14.dur",
		    FT_UINT16, BASE_DEC, NULL, 0xfc00, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_idx,
	    {
		    "Frame Number Index", "wimax.ulmap.uiuc14.idx",
		    FT_UINT16, BASE_DEC, NULL, 0x000F, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_rep,
	    {
		    "Repetition Coding Indication", "wimax.ulmap.uiuc14.rep",
		    FT_UINT16, BASE_DEC, NULL, 0x0030, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_sub,
	    {
		    "Ranging subchannel", "wimax.ulmap.uiuc14.sub",
		    FT_UINT8,  BASE_DEC, NULL, 0xfe, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_sym,
	    {
		    "Ranging symbol", "wimax.ulmap.uiuc14.sym",
		    FT_UINT8,  BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc14_uiuc,
	    {
		    "UIUC", "wimax.ulmap.uiuc14.uiuc",
		    FT_UINT16, BASE_DEC, NULL, 0x03c0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc15_data,
	    {
		    "Data", "wimax.ulmap.uiuc15.data",
		    FT_BYTES,  BASE_HEX, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc15_ext,
	    {
		    "Extended UIUC", "wimax.ulmap.uiuc15.ext",
		    FT_UINT8,  BASE_DEC, NULL, 0x0, "", HFILL
	    }
    },
    {
	    &hf_ulmap_uiuc15_len,
	    {
		    "Length", "wimax.ulmap.uiuc15.len",
		    FT_UINT8,  BASE_DEC, NULL, 0x0, "", HFILL
	    }
    }
};

/*  This gets called each time a capture file is loaded. */
void init_wimax_globals()
{
    cqich_id_size = 0;
    harq = 0;
    ir_type = 0;
    N_layer = 0;
    RCID_Type = 0;
}

/********************************************************************
 * UL-MAP HARQ Sub-Burst IEs
 * 8.4.5.4.24 table 302j
 * these functions take offset/length in bits
 *******************************************************************/

gint Dedicated_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* 8.4.5.4.24.1 Dedicated_UL_Control_IE -- table 302r */
    /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_item *tree = NULL;
    gint sdma;

    bit = offset;

    ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_UL_Control_IE");
    tree = proto_item_add_subtree(ti, ett_302r);

    XBIT(data, 4, "Length");
    XBIT(sdma, 4, "Control Header");
    if ((sdma & 1) == 1) {
        XBIT(data, 2, "Num SDMA layers");
        XBIT(data, 2, "Pilot Pattern");
    }
    return (bit - offset); /* length in bits */
}

gint Dedicated_MIMO_UL_Control_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* 8.4.5.4.24.2 Dedicated_MIMO_UL_Control_IE -- table 302s */
    /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_item *tree = NULL;

    bit = offset;

    ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "Dedicated_MIMO_UL_Control_IE");
    tree = proto_item_add_subtree(ti, ett_302s);

    XBIT(data, 2, "Matrix");
    XBIT(N_layer, 2, "N_layer");

    return (bit - offset); /* length in bits */
}

/* begin Sub-Burst IEs */

gint UL_HARQ_Chase_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* 8.4.5.4.24 UL_HARQ_Chase_sub_burst_IE -- table 302k */
    /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_item *tree = NULL;
    proto_item *generic_item = NULL;
    gint duci;
    guint16 calculated_crc;

    bit = offset;

    ti = proto_tree_add_text(uiuc_tree, tvb, BITHI(offset,length), "UL_HARQ_Chase_Sub_Burst_IE");
    tree = proto_item_add_subtree(ti, ett_302k);

    bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
    XBIT(duci, 1, "Dedicated UL Control Indicator");
    if (duci == 1) {
        bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
    }
    XBIT(data, 4, "UIUC");
    XBIT(data, 2, "Repetition Coding Indication");
    XBIT(data,10, "Duration");
    XBIT(data, 4, "ACID");
    XBIT(data, 1, "AI_SN");
    XBIT(data, 1, "ACK_disable");
    XBIT(data, 1, "Reserved");

    if (include_cor2_changes)
    {
	/* CRC-16 is always appended */
	data = BIT_BITS(bit, bufptr, 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((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
	if (data != calculated_crc)
	{
		proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
	}
	bit += 16;
    }

    return (bit - offset); /* length in bits */
}

gint UL_HARQ_IR_CTC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)
{
    /* 8.4.5.4.24 UL_HARQ_IR_CTC_sub_burst_IE -- table 302l */
    /* UL-MAP HARQ Sub-Burst IE * offset/length are in bits */
    gint bit;
    gint data;
    proto_item *ti = NULL;
    proto_item *tree = NULL;
    proto_item *generic_item = NULL;
    gint duci;
    guint16 calculated_crc;

    bit = offset;

    ti = proto_tree_add_text(uiuc_tree, tvb, NIBHI(offset, length), "UL_HARQ_IR_CTC_Sub_Burst_IE");
    tree = proto_item_add_subtree(ti, ett_302l);

    bit += RCID_IE(tree, bufptr, bit, length, tvb, RCID_Type);
    XBIT(duci, 1, "Dedicated UL Control Indicator");
    if (duci == 1) {
        bit += Dedicated_UL_Control_IE(tree, bufptr, bit, length, tvb);
    }
    XBIT(data, 4, "N(EP)");
    XBIT(data, 4, "N(SCH)");
    XBIT(data, 2, "SPID");
    XBIT(data, 4, "ACIN");
    XBIT(data, 1, "AI_SN");
    XBIT(data, 1, "ACK_disable");
    XBIT(data, 3, "Reserved");

    if (include_cor2_changes)
    {
	/* CRC-16 is always appended */
	data = BIT_BITS(bit, bufptr, 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((guint8 *)tvb_get_ptr(tvb, 0, BIT_TO_BYTE(bit)), BIT_TO_BYTE(bit));
	if (data != calculated_crc)
	{
		proto_item_append_text(generic_item, " - incorrect! (should be: 0x%x)", calculated_crc);
	}
	bit += 16;
    }

    return (bit - offset); /* length in bits */
}

gint UL_HARQ_IR_CC_Sub_Burst_IE(proto_tree *uiuc_tree, const guint8 *bufptr, gint offset, gint length, tvbuff_t *tvb)

⌨️ 快捷键说明

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