Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 1 | Index: wireshark/epan/dissectors/packet-rsl.c |
| 2 | =================================================================== |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 3 | --- wireshark.orig/epan/dissectors/packet-rsl.c 2011-01-13 12:51:02.000000000 +0100 |
| 4 | +++ wireshark/epan/dissectors/packet-rsl.c 2011-01-13 20:26:51.000000000 +0100 |
| 5 | @@ -137,6 +137,8 @@ |
| 6 | static int hf_rsl_cstat_lost_pkts = -1; |
| 7 | static int hf_rsl_cstat_ia_jitter = -1; |
| 8 | static int hf_rsl_cstat_avg_tx_dly = -1; |
| 9 | +/* HSL */ |
| 10 | +static int hf_rsl_hsl_bts_serno = -1; |
| 11 | |
| 12 | /* Initialize the subtree pointers */ |
| 13 | static int ett_rsl = -1; |
| 14 | @@ -207,6 +209,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 15 | static proto_tree *top_tree; |
| 16 | static dissector_handle_t gsm_a_ccch_handle; |
| 17 | static dissector_handle_t gsm_a_dtap_handle; |
| 18 | +static dissector_handle_t bssgp_handle; |
| 19 | |
| 20 | static gboolean is_si2q = FALSE; |
| 21 | |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 22 | @@ -239,9 +242,11 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 23 | { 0x08, "TRX Management messages" }, |
| 24 | { 0x16, "Location Services messages" }, |
| 25 | { 0x3f, "ip.access Vendor Specific messages" }, |
| 26 | + { 0x80, "HSL Vendor Specific messages" }, |
| 27 | { 0, NULL } |
| 28 | }; |
| 29 | #define RSL_MSGDISC_IPACCESS 0x3f |
| 30 | +#define RSL_MSGDISC_HSL 0x40 |
| 31 | |
| 32 | /* |
| 33 | * 9.2 MESSAGE TYPE |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 34 | @@ -353,6 +358,22 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 35 | #define RSL_IE_IPAC_RTP_MPLEX 0xfd |
| 36 | #define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe |
| 37 | |
| 38 | +/* Vendor-Specific messages of HSL femtocell. There is no public documentation |
| 39 | + * about those extensions, all information in this dissector is based on lawful |
| 40 | + * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 41 | +#define RSL_MSG_TYPE_HSL_IDENTIFY 0x80 |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 42 | +#define RSL_MSG_TYPE_HSL_CONN_TRAU 0x81 |
| 43 | +#define RSL_MSG_TYPE_HSL_BSSGP 0x82 |
| 44 | +#define RSL_MSG_TYPE_HSL_GPRS_TS_ALLOC 0x83 |
| 45 | +#define RSL_MSG_TYPE_HSL_L1_PRIM 0x8a |
| 46 | + |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 47 | +#define RSL_IE_HSL_BTS_SERNO 0xc0 |
| 48 | +#define RSL_IE_HSL_TRAU_PARAMS 0xc1 |
| 49 | +#define RSL_IE_HSL_L1_PRIM 0xc4 |
| 50 | +#define RSL_IE_HSL_BTS_VERSION 0xc5 |
| 51 | +#define RSL_IE_HSL_UNKNOWN_VERSION1 0xc6 |
| 52 | +#define RSL_IE_HSL_UNKNOWN_VERSION2 0xc7 |
| 53 | + |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 54 | static const value_string rsl_msg_type_vals[] = { |
| 55 | /* 0 0 0 0 - - - - Radio Link Layer Management messages: */ |
| 56 | { 0x01, "DATA REQuest" }, /* 8.3.1 */ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 57 | @@ -434,6 +455,12 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 58 | { 0x77, "ip.access DLCX" }, |
| 59 | { 0x78, "ip.access DLCX ACK" }, |
| 60 | { 0x79, "ip.access DLCX NACK" }, |
| 61 | + /* HSL */ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 62 | + { 0x80, "HSL IDENTIFY" }, |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 63 | + { 0x81, "HSL CONNECT TRAU" }, |
| 64 | + { 0x82, "HSL BSSGP" }, |
| 65 | + { 0x83, "HSL GPRS TS ALLOC" }, |
| 66 | + { 0x8a, "HSL L1 PRIMITIVE" }, |
| 67 | { 0, NULL } |
| 68 | }; |
| 69 | |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 70 | @@ -573,6 +600,7 @@ |
| 71 | Not used |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 72 | |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 73 | */ |
| 74 | + /* ip.access */ |
| 75 | { 0xe0, "SRTP Configuration" }, |
| 76 | { 0xe1, "BSC Proxy UDP Port" }, |
| 77 | { 0xe2, "BSC Multiplex Timeout" }, |
| 78 | @@ -591,6 +619,13 @@ |
| 79 | { 0xfc, "RTP Payload Type 2" }, |
| 80 | { 0xfd, "RTP Multiplex" }, |
| 81 | { 0xfe, "RTP Multiplex Identifier" }, |
| 82 | + /* HSL */ |
| 83 | + { 0xc0, "HSL Serial Number" }, |
| 84 | + { 0xc1, "HSL TRAU Parameters" }, |
| 85 | + { 0xc4, "HSL L1 Primitive" }, |
| 86 | + { 0xc5, "HSL BTS SW Version" }, |
| 87 | + { 0xc6, "HSL Unknown Version" }, |
| 88 | + { 0xc7, "HSL Unknown Version" }, |
| 89 | { 0, NULL } |
| 90 | }; |
| 91 | |
| 92 | @@ -714,6 +749,13 @@ |
| 93 | [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 }, |
| 94 | [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 }, |
| 95 | [RSL_IE_IPAC_RTP_PAYLOAD2] = { TLV_TYPE_TV, 0 }, |
| 96 | + /* HSL */ |
| 97 | + [RSL_IE_HSL_BTS_SERNO] = { TLV_TYPE_TLV,0 }, |
| 98 | + [RSL_IE_HSL_TRAU_PARAMS] = { TLV_TYPE_TLV,0 }, |
| 99 | + [RSL_IE_HSL_L1_PRIM] = { TLV_TYPE_TV, 0 }, |
| 100 | + [RSL_IE_HSL_BTS_VERSION] = { TLV_TYPE_TLV, 0 }, |
| 101 | + [RSL_IE_HSL_UNKNOWN_VERSION1] = { TLV_TYPE_TLV, 0 }, |
| 102 | + [RSL_IE_HSL_UNKNOWN_VERSION2] = { TLV_TYPE_TLV, 0 }, |
| 103 | }, |
| 104 | }; |
| 105 | |
| 106 | @@ -3120,7 +3162,7 @@ |
| 107 | guint16 local_port = 0; |
| 108 | address src_addr; |
| 109 | |
| 110 | - msg_type = tvb_get_guint8(tvb, offset)&0x7f; |
| 111 | + msg_type = tvb_get_guint8(tvb, offset)&0xff; |
| 112 | offset++; |
| 113 | |
| 114 | #if 0 |
| 115 | @@ -3259,6 +3301,25 @@ |
| 116 | proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb, |
| 117 | offset+24, 4, FALSE); |
| 118 | break; |
| 119 | + /* HSL */ |
| 120 | + case RSL_IE_HSL_BTS_SERNO: |
| 121 | + proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_serno, tvb, |
| 122 | + offset, len, FALSE); |
| 123 | + break; |
| 124 | + case RSL_IE_HSL_TRAU_PARAMS: |
| 125 | + proto_tree_add_item(tree, hf_rsl_remote_port, tvb, |
| 126 | + offset+2, 2, FALSE); |
| 127 | + proto_tree_add_item(tree, hf_rsl_remote_ip, tvb, |
| 128 | + offset+4, 4, FALSE); |
| 129 | + /* FIXME: other fields !! */ |
| 130 | + break; |
| 131 | + case RSL_IE_L3_INF: |
| 132 | + if (msg_type == RSL_MSG_TYPE_HSL_BSSGP) { |
| 133 | + tvbuff_t *next_tvb; |
| 134 | + next_tvb = tvb_new_subset(tvb, offset, -1, len); |
| 135 | + call_dissector(bssgp_handle, next_tvb, pinfo, tree); |
| 136 | + } |
| 137 | + break; |
| 138 | } |
| 139 | offset += len; |
| 140 | } |
| 141 | @@ -3284,10 +3345,12 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 142 | guint8 msg_disc, msg_type; |
| 143 | |
| 144 | msg_disc = tvb_get_guint8(tvb, offset++) >> 1; |
| 145 | - msg_type = tvb_get_guint8(tvb,offset)&0x7f; |
| 146 | + msg_type = tvb_get_guint8(tvb,offset)&0xff; |
| 147 | proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE); |
| 148 | |
| 149 | - if (msg_disc == RSL_MSGDISC_IPACCESS) { |
| 150 | + switch (msg_disc) { |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 151 | + case RSL_MSGDISC_HSL: |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 152 | + case RSL_MSGDISC_IPACCESS: |
| 153 | offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset); |
| 154 | return offset; |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 155 | } |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 156 | @@ -3924,7 +3987,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 157 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL"); |
| 158 | col_clear(pinfo->cinfo, COL_INFO); |
| 159 | |
| 160 | - msg_type = tvb_get_guint8(tvb,offset+1)&0x7f; |
| 161 | + msg_type = tvb_get_guint8(tvb,offset+1)&0xff; |
| 162 | |
| 163 | if (check_col(pinfo->cinfo, COL_INFO)){ |
| 164 | col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u")); |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 165 | @@ -3955,6 +4018,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 166 | |
| 167 | gsm_a_ccch_handle = find_dissector("gsm_a_ccch"); |
| 168 | gsm_a_dtap_handle = find_dissector("gsm_a_dtap"); |
| 169 | + bssgp_handle = find_dissector("bssgp"); |
| 170 | } |
| 171 | |
| 172 | /* Register the protocol with Wireshark */ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 173 | @@ -3975,7 +4039,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 174 | }, |
| 175 | { &hf_rsl_msg_type, |
| 176 | { "Message type", "rsl.msg_type", |
| 177 | - FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f, |
| 178 | + FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0xff, |
| 179 | NULL, HFILL } |
| 180 | }, |
| 181 | { &hf_rsl_ie_id, |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 182 | @@ -4392,6 +4456,11 @@ |
| 183 | { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay", |
| 184 | FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } |
| 185 | }, |
| 186 | + /* HSL */ |
| 187 | + { &hf_rsl_hsl_bts_serno, |
| 188 | + { "BTS Serial Number", "rsl.hsl.bts_serno", |
| 189 | + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } |
| 190 | + }, |
| 191 | }; |
| 192 | static gint *ett[] = { |
| 193 | &ett_rsl, |