diff options
author | Anders Broman <anders.broman@ericsson.com> | 2012-02-08 17:01:09 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2012-02-08 17:01:09 +0000 |
commit | c324f2e3e68a8d5c21404682546fabbb3d20489f (patch) | |
tree | 4f14dd07ae56e5958098483495b02da43e45edfe | |
parent | af901885b741980e575dc845b7c943bcff18f4f4 (diff) |
From Sylvain Munaut:
Fix the windows build by filling up stuct with dummy member
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6798
svn path=/trunk/; revision=40932
-rw-r--r-- | epan/dissectors/packet-gmr1_bcch.c | 59 | ||||
-rw-r--r-- | epan/dissectors/packet-gsmtap.c | 74 |
2 files changed, 117 insertions, 16 deletions
diff --git a/epan/dissectors/packet-gmr1_bcch.c b/epan/dissectors/packet-gmr1_bcch.c index c160d9e466..3de2a4d374 100644 --- a/epan/dissectors/packet-gmr1_bcch.c +++ b/epan/dissectors/packet-gmr1_bcch.c @@ -262,13 +262,14 @@ typedef struct { Seg2A_LAInfo_t LAInfo; } Segment2Abis_t; -#if 0 typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment2B_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment2Bbis_t; -#endif + /* Segment 3A - [1] 11.5.2.71 */ typedef struct { guint16 MCC; @@ -306,88 +307,115 @@ typedef struct { Seg3A_MiscInfo_t MiscInfo; guint8 Spare; } Segment3A_t; -#if 0 + typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3B_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3Bbis_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3C_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3D_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3E_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3Ebis_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3F_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3G_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3Gbis_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3H_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3I_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3J_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3Jbis_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3Kbis_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3L_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment3M_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4A_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4B_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4C_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4D_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4E_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4F_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4G_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4H_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4I_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4J_t; typedef struct { + guint8 _dummy; /* Remove when dissection is written */ } Segment4K_t; -#endif + /* System informations structures */ /* System Information type 1 - [1] 10.1.31 */ @@ -397,7 +425,7 @@ typedef struct { guint8 Randomization_Period; guint8 Spare; } SI1_Block_Header_t; -#if 0 + typedef struct { SI1_Block_Header_t Block_Header; Segment1A_t Segment1A; @@ -429,14 +457,14 @@ typedef struct { Segment4K_t Segment4K; } u; } SystemInformation1_t; -#endif + /* System Information type 2 - [1] 10.1.32 */ typedef struct { guint8 Protocol_Version; guint8 Block_Type; guint8 Spare; } SI2_Block_Header_t; -#if 0 + typedef struct { SI2_Block_Header_t Block_Header; guint8 SegmentType; @@ -449,7 +477,7 @@ typedef struct { Segment3J_t Segment3J; } u; } SystemInformation2_t; -#endif + /* ------------------------------------------------------------------------ */ /* CSN1 parsing definitions */ @@ -828,7 +856,7 @@ CSN_DESCR_BEGIN(SI1_Block_Header_t) M_UINT (SI1_Block_Header_t, Randomization_Period, 2, &hf_si1_randomization_period), M_UINT (SI1_Block_Header_t, Spare, 1, &hf_si_spare), CSN_DESCR_END (SI1_Block_Header_t); -#if 0 + static const CSN_ChoiceElement_t SI1_SegmentChoice[] = { @@ -857,6 +885,7 @@ CSN_ChoiceElement_t SI1_SegmentChoice[] = {7, 0x69, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4J, Segment4J_t, "Segment 4J")}, {7, 0x6a, 1, M_TYPE_LABEL(SystemInformation1_t, u.Segment4K, Segment4K_t, "Segment 4K")}, }; + static const CSN_DESCR_BEGIN(SystemInformation1_t) M_TYPE_LABEL (SystemInformation1_t, Block_Header, SI1_Block_Header_t, "Block Header"), @@ -889,7 +918,6 @@ CSN_DESCR_BEGIN(SystemInformation2_t) M_CHOICE_IL (SystemInformation2_t, SegmentType, SI2_SegmentChoice, ElementsOf(SI2_SegmentChoice)), CSN_DESCR_END (SystemInformation2_t) -#endif /* ------------------------------------------------------------------------ */ /* Fields values */ @@ -999,8 +1027,8 @@ static const value_string si1_randomization_period_vals[] = { static void dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) { - /* proto_item *bcch_item = NULL; */ - /* proto_tree *bcch_tree = NULL; */ + proto_item *bcch_item = NULL; + proto_tree *bcch_tree = NULL; csnStream_t ar; gboolean is_si1; @@ -1008,14 +1036,14 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) is_si1 = tvb_get_bits8(tvb, 0, 5) & 1; - /* bcch_item = */ proto_tree_add_protocol_format( + bcch_item = proto_tree_add_protocol_format( tree, proto_gmr1_bcch, tvb, 0, -1, "GMR-1 BCCH - System Information type %d", is_si1 ? 1 : 2 ); - /* bcch_tree = proto_item_add_subtree(bcch_item, ett_gmr1_bcch); */ + bcch_tree = proto_item_add_subtree(bcch_item, ett_gmr1_bcch); csnStreamInit(&ar, 0, tvb_length(tvb)*8); -#if 0 + /* SI1 or SI2 */ if (is_si1) { SystemInformation1_t *data; @@ -1036,7 +1064,6 @@ dissect_gmr1_bcch(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) SI2_SegmentChoice[data->SegmentType].descr.sz ); } -#endif } void diff --git a/epan/dissectors/packet-gsmtap.c b/epan/dissectors/packet-gsmtap.c index 8681520117..869fcd5d21 100644 --- a/epan/dissectors/packet-gsmtap.c +++ b/epan/dissectors/packet-gsmtap.c @@ -74,6 +74,7 @@ #define GSMTAP_TYPE_WMX_BURST 0x07 /* WiMAX burst */ #define GSMTAP_TYPE_GB_LLC 0x08 /* GPRS Gb interface: LLC */ #define GSMTAP_TYPE_GB_SNDCP 0x09 /* GPRS Gb interface: SNDCP */ +#define GSMTAP_TYPE_GMR1_UM 0x0a /* GMR-1 L2 packets */ /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ #define GSMTAP_BURST_UNKNOWN 0x00 @@ -125,6 +126,28 @@ #define GSMTAP_TETRA_STCH 0x07 #define GSMTAP_TETRA_TCH_F 0x08 +/* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ +/* sub-types for TYPE_GMR1 */ +#define GSMTAP_GMR1_UNKNOWN 0x00 +#define GSMTAP_GMR1_BCCH 0x01 +#define GSMTAP_GMR1_CCCH 0x02 /* either AGCH or PCH */ +#define GSMTAP_GMR1_PCH 0x03 +#define GSMTAP_GMR1_AGCH 0x04 +#define GSMTAP_GMR1_BACH 0x05 +#define GSMTAP_GMR1_RACH 0x06 +#define GSMTAP_GMR1_CBCH 0x07 +#define GSMTAP_GMR1_SDCCH 0x08 +#define GSMTAP_GMR1_TACCH 0x09 +#define GSMTAP_GMR1_GBCH 0x0a + +#define GSMTAP_GMR1_SACCH 0x01 /* to be combined with _TCH{6,9} */ +#define GSMTAP_GMR1_FACCH 0x02 /* to be combines with _TCH{3,6,9} */ +#define GSMTAP_GMR1_DKAB 0x03 /* to be combined with _TCH3 */ +#define GSMTAP_GMR1_TCH3 0x10 +#define GSMTAP_GMR1_TCH6 0x14 +#define GSMTAP_GMR1_TCH9 0x18 + + #define GSMTAP_ARFCN_F_PCS 0x8000 #define GSMTAP_ARFCN_F_UPLINK 0x4000 #define GSMTAP_ARFCN_MASK 0x3fff @@ -167,6 +190,7 @@ static int hf_gsmtap_frame_nr = -1; static int hf_gsmtap_burst_type = -1; static int hf_gsmtap_channel_type = -1; static int hf_gsmtap_tetra_channel_type = -1; +static int hf_gsmtap_gmr1_channel_type = -1; static int hf_gsmtap_antenna = -1; static int hf_sacch_l1h_power_lev = -1; @@ -193,6 +217,8 @@ enum { GSMTAP_SUB_PHY_ATTRIBUTES, GSMTAP_SUB_CBCH, GSMTAP_SUB_SIM, + /* GMR-1 sub handles */ + GSMTAP_SUB_GMR1_BCCH, GSMTAP_SUB_MAX }; @@ -262,6 +288,35 @@ static const value_string gsmtap_tetra_channels[] = { { 0, NULL }, }; +static const value_string gsmtap_gmr1_channels[] = { + { GSMTAP_GMR1_BCCH, "BCCH" }, + { GSMTAP_GMR1_CCCH, "CCCH" }, + { GSMTAP_GMR1_PCH, "PCH" }, + { GSMTAP_GMR1_AGCH, "AGCH" }, + { GSMTAP_GMR1_BACH, "BACH" }, + { GSMTAP_GMR1_RACH, "RACH" }, + { GSMTAP_GMR1_CBCH, "CBCH" }, + { GSMTAP_GMR1_SDCCH, "SDCCH" }, + { GSMTAP_GMR1_TACCH, "TACCH" }, + { GSMTAP_GMR1_GBCH, "GBCH" }, + { GSMTAP_GMR1_TCH3, "TCH3" }, + { GSMTAP_GMR1_TCH3| + GSMTAP_GMR1_FACCH, "FACCH3" }, + { GSMTAP_GMR1_TCH3| + GSMTAP_GMR1_DKAB, "DKAB" }, + { GSMTAP_GMR1_TCH6, "TCH6" }, + { GSMTAP_GMR1_TCH6| + GSMTAP_GMR1_FACCH, "FACCH6" }, + { GSMTAP_GMR1_TCH6| + GSMTAP_GMR1_SACCH, "SACCH6" }, + { GSMTAP_GMR1_TCH9, "TCH9" }, + { GSMTAP_GMR1_TCH9| + GSMTAP_GMR1_FACCH, "FACCH9" }, + { GSMTAP_GMR1_TCH9| + GSMTAP_GMR1_SACCH, "SACCH9" }, + { 0, NULL }, +}; + /* the mapping is not complete */ static const int gsmtap_to_tetra[9] = { 0, @@ -283,6 +338,7 @@ static const value_string gsmtap_types[] = { { GSMTAP_TYPE_TETRA_I1, "TETRA V+D"}, { GSMTAP_TTPE_TETRA_I1_BURST, "TETRA V+D burst"}, { GSMTAP_TYPE_WMX_BURST,"WiMAX burst" }, + { GSMTAP_TYPE_GMR1_UM, "GMR-1 air interfeace (MES-MS<->GTS)" }, { 0, NULL }, }; @@ -404,6 +460,8 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) channel = tvb_get_guint8(tvb, offset+12); if (type == GSMTAP_TYPE_TETRA_I1) channel_str = val_to_str(channel, gsmtap_tetra_channels, "Unknown: %d"); + else if (type == GSMTAP_TYPE_GMR1_UM) + channel_str = val_to_str(channel, gsmtap_gmr1_channels, "Unknown: %d"); else channel_str = val_to_str(channel, gsmtap_channels, "Unknown: %d"); @@ -446,6 +504,9 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) else if (type == GSMTAP_TYPE_WMX_BURST) proto_tree_add_item(gsmtap_tree, hf_gsmtap_burst_type, tvb, offset+12, 1, ENC_BIG_ENDIAN); + else if (type == GSMTAP_TYPE_GMR1_UM) + proto_tree_add_item(gsmtap_tree, hf_gsmtap_gmr1_channel_type, + tvb, offset+12, 1, ENC_BIG_ENDIAN); proto_tree_add_item(gsmtap_tree, hf_gsmtap_antenna, tvb, offset+13, 1, ENC_BIG_ENDIAN); proto_tree_add_item(gsmtap_tree, hf_gsmtap_subslot, @@ -528,6 +589,16 @@ dissect_gsmtap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) sub_handle = GSMTAP_SUB_DATA; break; } + break; + case GSMTAP_TYPE_GMR1_UM: + switch (sub_type) { + case GSMTAP_GMR1_BCCH: + sub_handle = GSMTAP_SUB_GMR1_BCCH; + break; + default: + sub_handle = GSMTAP_SUB_DATA; + break; + } break; case GSMTAP_TYPE_UM_BURST: default: @@ -570,6 +641,8 @@ proto_register_gsmtap(void) FT_UINT8, BASE_DEC, VALS(gsmtap_channels), 0, NULL, HFILL }}, { &hf_gsmtap_tetra_channel_type, { "Channel Type", "gsmtap.tetra_chan_type", FT_UINT8, BASE_DEC, VALS(gsmtap_tetra_channels), 0, NULL, HFILL }}, + { &hf_gsmtap_gmr1_channel_type, { "Channel Type", "gsmtap.gmr1_chan_type", + FT_UINT8, BASE_DEC, VALS(gsmtap_gmr1_channels), 0, NULL, HFILL }}, { &hf_gsmtap_antenna, { "Antenna Number", "gsmtap.antenna", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL } }, { &hf_gsmtap_subslot, { "Sub-Slot", "gsmtap.sub_slot", @@ -613,6 +686,7 @@ proto_reg_handoff_gsmtap(void) sub_handles[GSMTAP_SUB_HACK] = find_dissector("wimax_hack_burst_handler"); sub_handles[GSMTAP_SUB_PHY_ATTRIBUTES] = find_dissector("wimax_phy_attributes_burst_handler"); sub_handles[GSMTAP_SUB_CBCH] = find_dissector("gsm_cbch"); + sub_handles[GSMTAP_SUB_GMR1_BCCH] = find_dissector("gmr1_bcch"); gsmtap_handle = create_dissector_handle(dissect_gsmtap, proto_gsmtap); dissector_add_uint("udp.port", GSMTAP_UDP_PORT, gsmtap_handle); } |