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 |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 4 | +++ wireshark/epan/dissectors/packet-rsl.c 2011-01-14 10:41:18.000000000 +0100 |
| 5 | @@ -2,7 +2,7 @@ |
| 6 | * Routines for Radio Signalling Link (RSL) dissection. |
| 7 | * |
| 8 | * Copyright 2007, Anders Broman <anders.broman@ericsson.com> |
| 9 | - * Copyright 2009, Harald Welte <laforge@gnumonks.org> |
| 10 | + * Copyright 2009-2011, Harald Welte <laforge@gnumonks.org> |
| 11 | * |
| 12 | * $Id: packet-rsl.c 35224 2010-12-20 05:35:29Z guy $ |
| 13 | * |
| 14 | @@ -137,6 +137,12 @@ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 15 | static int hf_rsl_cstat_lost_pkts = -1; |
| 16 | static int hf_rsl_cstat_ia_jitter = -1; |
| 17 | static int hf_rsl_cstat_avg_tx_dly = -1; |
| 18 | +/* HSL */ |
| 19 | +static int hf_rsl_hsl_bts_serno = -1; |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 20 | +static int hf_rsl_hsl_bts_ver = -1; |
| 21 | +static int hf_rsl_hsl_l1_prim = -1; |
| 22 | +static int hf_rsl_hsl_trau_remote_port = -1; |
| 23 | +static int hf_rsl_hsl_trau_remote_ip = -1; |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 24 | |
| 25 | /* Initialize the subtree pointers */ |
| 26 | static int ett_rsl = -1; |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 27 | @@ -207,6 +213,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 28 | static proto_tree *top_tree; |
| 29 | static dissector_handle_t gsm_a_ccch_handle; |
| 30 | static dissector_handle_t gsm_a_dtap_handle; |
| 31 | +static dissector_handle_t bssgp_handle; |
| 32 | |
| 33 | static gboolean is_si2q = FALSE; |
| 34 | |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 35 | @@ -239,9 +246,11 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 36 | { 0x08, "TRX Management messages" }, |
| 37 | { 0x16, "Location Services messages" }, |
| 38 | { 0x3f, "ip.access Vendor Specific messages" }, |
| 39 | + { 0x80, "HSL Vendor Specific messages" }, |
| 40 | { 0, NULL } |
| 41 | }; |
| 42 | #define RSL_MSGDISC_IPACCESS 0x3f |
| 43 | +#define RSL_MSGDISC_HSL 0x40 |
| 44 | |
| 45 | /* |
| 46 | * 9.2 MESSAGE TYPE |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 47 | @@ -353,6 +362,22 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 48 | #define RSL_IE_IPAC_RTP_MPLEX 0xfd |
| 49 | #define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe |
| 50 | |
| 51 | +/* Vendor-Specific messages of HSL femtocell. There is no public documentation |
| 52 | + * about those extensions, all information in this dissector is based on lawful |
| 53 | + * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 54 | +#define RSL_MSG_TYPE_HSL_IDENTIFY 0x80 |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 55 | +#define RSL_MSG_TYPE_HSL_CONN_TRAU 0x81 |
| 56 | +#define RSL_MSG_TYPE_HSL_BSSGP 0x82 |
| 57 | +#define RSL_MSG_TYPE_HSL_GPRS_TS_ALLOC 0x83 |
| 58 | +#define RSL_MSG_TYPE_HSL_L1_PRIM 0x8a |
| 59 | + |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 60 | +#define RSL_IE_HSL_BTS_SERNO 0xc0 |
| 61 | +#define RSL_IE_HSL_TRAU_PARAMS 0xc1 |
| 62 | +#define RSL_IE_HSL_L1_PRIM 0xc4 |
| 63 | +#define RSL_IE_HSL_BTS_VERSION 0xc5 |
| 64 | +#define RSL_IE_HSL_UNKNOWN_VERSION1 0xc6 |
| 65 | +#define RSL_IE_HSL_UNKNOWN_VERSION2 0xc7 |
| 66 | + |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 67 | static const value_string rsl_msg_type_vals[] = { |
| 68 | /* 0 0 0 0 - - - - Radio Link Layer Management messages: */ |
| 69 | { 0x01, "DATA REQuest" }, /* 8.3.1 */ |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 70 | @@ -434,6 +459,12 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 71 | { 0x77, "ip.access DLCX" }, |
| 72 | { 0x78, "ip.access DLCX ACK" }, |
| 73 | { 0x79, "ip.access DLCX NACK" }, |
| 74 | + /* HSL */ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 75 | + { 0x80, "HSL IDENTIFY" }, |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 76 | + { 0x81, "HSL CONNECT TRAU" }, |
| 77 | + { 0x82, "HSL BSSGP" }, |
| 78 | + { 0x83, "HSL GPRS TS ALLOC" }, |
| 79 | + { 0x8a, "HSL L1 PRIMITIVE" }, |
| 80 | { 0, NULL } |
| 81 | }; |
| 82 | |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 83 | @@ -573,6 +604,7 @@ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 84 | Not used |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 85 | |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 86 | */ |
| 87 | + /* ip.access */ |
| 88 | { 0xe0, "SRTP Configuration" }, |
| 89 | { 0xe1, "BSC Proxy UDP Port" }, |
| 90 | { 0xe2, "BSC Multiplex Timeout" }, |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 91 | @@ -591,6 +623,13 @@ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 92 | { 0xfc, "RTP Payload Type 2" }, |
| 93 | { 0xfd, "RTP Multiplex" }, |
| 94 | { 0xfe, "RTP Multiplex Identifier" }, |
| 95 | + /* HSL */ |
| 96 | + { 0xc0, "HSL Serial Number" }, |
| 97 | + { 0xc1, "HSL TRAU Parameters" }, |
| 98 | + { 0xc4, "HSL L1 Primitive" }, |
| 99 | + { 0xc5, "HSL BTS SW Version" }, |
| 100 | + { 0xc6, "HSL Unknown Version" }, |
| 101 | + { 0xc7, "HSL Unknown Version" }, |
| 102 | { 0, NULL } |
| 103 | }; |
| 104 | |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 105 | @@ -714,6 +753,13 @@ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 106 | [RSL_IE_IPAC_SPEECH_MODE] = { TLV_TYPE_TV, 0 }, |
| 107 | [RSL_IE_IPAC_CONN_ID] = { TLV_TYPE_FIXED, 2 }, |
| 108 | [RSL_IE_IPAC_RTP_PAYLOAD2] = { TLV_TYPE_TV, 0 }, |
| 109 | + /* HSL */ |
| 110 | + [RSL_IE_HSL_BTS_SERNO] = { TLV_TYPE_TLV,0 }, |
| 111 | + [RSL_IE_HSL_TRAU_PARAMS] = { TLV_TYPE_TLV,0 }, |
| 112 | + [RSL_IE_HSL_L1_PRIM] = { TLV_TYPE_TV, 0 }, |
| 113 | + [RSL_IE_HSL_BTS_VERSION] = { TLV_TYPE_TLV, 0 }, |
| 114 | + [RSL_IE_HSL_UNKNOWN_VERSION1] = { TLV_TYPE_TLV, 0 }, |
| 115 | + [RSL_IE_HSL_UNKNOWN_VERSION2] = { TLV_TYPE_TLV, 0 }, |
| 116 | }, |
| 117 | }; |
| 118 | |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 119 | @@ -3120,7 +3166,7 @@ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 120 | guint16 local_port = 0; |
| 121 | address src_addr; |
| 122 | |
| 123 | - msg_type = tvb_get_guint8(tvb, offset)&0x7f; |
| 124 | + msg_type = tvb_get_guint8(tvb, offset)&0xff; |
| 125 | offset++; |
| 126 | |
| 127 | #if 0 |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 128 | @@ -3259,6 +3305,35 @@ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 129 | proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb, |
| 130 | offset+24, 4, FALSE); |
| 131 | break; |
| 132 | + /* HSL */ |
| 133 | + case RSL_IE_HSL_BTS_SERNO: |
| 134 | + proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_serno, tvb, |
| 135 | + offset, len, FALSE); |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 136 | + col_append_fstr(pinfo->cinfo, COL_INFO, "SerNo %s ", |
| 137 | + tvb_get_string(tvb, offset, len)); |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 138 | + break; |
| 139 | + case RSL_IE_HSL_TRAU_PARAMS: |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 140 | + proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_port, tvb, |
| 141 | + offset+2, 2, TRUE); |
| 142 | + proto_tree_add_item(tree, hf_rsl_hsl_trau_remote_ip, tvb, |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 143 | + offset+4, 4, FALSE); |
| 144 | + /* FIXME: other fields !! */ |
| 145 | + break; |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 146 | + case RSL_IE_HSL_L1_PRIM: |
| 147 | + proto_tree_add_item(ie_tree, hf_rsl_hsl_l1_prim, tvb, |
| 148 | + offset, len, FALSE); |
| 149 | + break; |
| 150 | + case RSL_IE_HSL_BTS_VERSION: |
| 151 | + proto_tree_add_item(ie_tree, hf_rsl_hsl_bts_ver, tvb, |
| 152 | + offset, len, FALSE); |
| 153 | + break; |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 154 | + case RSL_IE_L3_INF: |
| 155 | + if (msg_type == RSL_MSG_TYPE_HSL_BSSGP) { |
| 156 | + tvbuff_t *next_tvb; |
| 157 | + next_tvb = tvb_new_subset(tvb, offset, -1, len); |
| 158 | + call_dissector(bssgp_handle, next_tvb, pinfo, tree); |
| 159 | + } |
| 160 | + break; |
| 161 | } |
| 162 | offset += len; |
| 163 | } |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 164 | @@ -3284,10 +3359,12 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 165 | guint8 msg_disc, msg_type; |
| 166 | |
| 167 | msg_disc = tvb_get_guint8(tvb, offset++) >> 1; |
| 168 | - msg_type = tvb_get_guint8(tvb,offset)&0x7f; |
| 169 | + msg_type = tvb_get_guint8(tvb,offset)&0xff; |
| 170 | proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE); |
| 171 | |
| 172 | - if (msg_disc == RSL_MSGDISC_IPACCESS) { |
| 173 | + switch (msg_disc) { |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 174 | + case RSL_MSGDISC_HSL: |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 175 | + case RSL_MSGDISC_IPACCESS: |
| 176 | offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset); |
| 177 | return offset; |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 178 | } |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 179 | @@ -3924,7 +4001,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 180 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL"); |
| 181 | col_clear(pinfo->cinfo, COL_INFO); |
| 182 | |
| 183 | - msg_type = tvb_get_guint8(tvb,offset+1)&0x7f; |
| 184 | + msg_type = tvb_get_guint8(tvb,offset+1)&0xff; |
| 185 | |
| 186 | if (check_col(pinfo->cinfo, COL_INFO)){ |
| 187 | col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u")); |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 188 | @@ -3955,6 +4032,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 189 | |
| 190 | gsm_a_ccch_handle = find_dissector("gsm_a_ccch"); |
| 191 | gsm_a_dtap_handle = find_dissector("gsm_a_dtap"); |
| 192 | + bssgp_handle = find_dissector("bssgp"); |
| 193 | } |
| 194 | |
| 195 | /* Register the protocol with Wireshark */ |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 196 | @@ -3975,7 +4053,7 @@ |
Harald Welte | 2268a8b | 2011-01-13 11:03:51 +0100 | [diff] [blame] | 197 | }, |
| 198 | { &hf_rsl_msg_type, |
| 199 | { "Message type", "rsl.msg_type", |
| 200 | - FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f, |
| 201 | + FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0xff, |
| 202 | NULL, HFILL } |
| 203 | }, |
| 204 | { &hf_rsl_ie_id, |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 205 | @@ -4392,6 +4470,28 @@ |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 206 | { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay", |
| 207 | FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } |
| 208 | }, |
| 209 | + /* HSL */ |
| 210 | + { &hf_rsl_hsl_bts_serno, |
| 211 | + { "BTS Serial Number", "rsl.hsl.bts_serno", |
| 212 | + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } |
| 213 | + }, |
Harald Welte | c19170b | 2011-01-15 13:07:44 +0100 | [diff] [blame^] | 214 | + { &hf_rsl_hsl_l1_prim, |
| 215 | + { "Layer 1 Primitive?", "rsl.hsl.l1_prim", |
| 216 | + FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL } |
| 217 | + }, |
| 218 | + { &hf_rsl_hsl_bts_ver, |
| 219 | + { "BTS Version Number", "rsl.hsl.bts_ver", |
| 220 | + FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL } |
| 221 | + }, |
| 222 | + { &hf_rsl_hsl_trau_remote_port, |
| 223 | + { "HSL TRAU Remote RTP Port", "rsl.hsl.trau.remote_port", |
| 224 | + FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }, |
| 225 | + }, |
| 226 | + { &hf_rsl_hsl_trau_remote_ip, |
| 227 | + { "HSL TRAU Remote IP Address", "rsl.hsl.trau.remote_ip", |
| 228 | + FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }, |
| 229 | + }, |
| 230 | + |
Harald Welte | 98aa613 | 2011-01-13 23:23:13 +0100 | [diff] [blame] | 231 | }; |
| 232 | static gint *ett[] = { |
| 233 | &ett_rsl, |