Harald Welte | 4bf40c0 | 2011-01-13 11:03:51 +0100 | [diff] [blame^] | 1 | Index: wireshark/epan/dissectors/packet-rsl.c |
| 2 | =================================================================== |
| 3 | --- wireshark.orig/epan/dissectors/packet-rsl.c 2011-01-13 10:03:21.000000000 +0100 |
| 4 | +++ wireshark/epan/dissectors/packet-rsl.c 2011-01-13 11:00:13.000000000 +0100 |
| 5 | @@ -207,6 +207,7 @@ |
| 6 | static proto_tree *top_tree; |
| 7 | static dissector_handle_t gsm_a_ccch_handle; |
| 8 | static dissector_handle_t gsm_a_dtap_handle; |
| 9 | +static dissector_handle_t bssgp_handle; |
| 10 | |
| 11 | static gboolean is_si2q = FALSE; |
| 12 | |
| 13 | @@ -239,9 +240,11 @@ |
| 14 | { 0x08, "TRX Management messages" }, |
| 15 | { 0x16, "Location Services messages" }, |
| 16 | { 0x3f, "ip.access Vendor Specific messages" }, |
| 17 | + { 0x80, "HSL Vendor Specific messages" }, |
| 18 | { 0, NULL } |
| 19 | }; |
| 20 | #define RSL_MSGDISC_IPACCESS 0x3f |
| 21 | +#define RSL_MSGDISC_HSL 0x40 |
| 22 | |
| 23 | /* |
| 24 | * 9.2 MESSAGE TYPE |
| 25 | @@ -353,6 +356,14 @@ |
| 26 | #define RSL_IE_IPAC_RTP_MPLEX 0xfd |
| 27 | #define RSL_IE_IPAC_RTP_MPLEX_ID 0xfe |
| 28 | |
| 29 | +/* Vendor-Specific messages of HSL femtocell. There is no public documentation |
| 30 | + * about those extensions, all information in this dissector is based on lawful |
| 31 | + * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */ |
| 32 | +#define RSL_MSG_TYPE_HSL_CONN_TRAU 0x81 |
| 33 | +#define RSL_MSG_TYPE_HSL_BSSGP 0x82 |
| 34 | +#define RSL_MSG_TYPE_HSL_GPRS_TS_ALLOC 0x83 |
| 35 | +#define RSL_MSG_TYPE_HSL_L1_PRIM 0x8a |
| 36 | + |
| 37 | static const value_string rsl_msg_type_vals[] = { |
| 38 | /* 0 0 0 0 - - - - Radio Link Layer Management messages: */ |
| 39 | { 0x01, "DATA REQuest" }, /* 8.3.1 */ |
| 40 | @@ -434,6 +445,11 @@ |
| 41 | { 0x77, "ip.access DLCX" }, |
| 42 | { 0x78, "ip.access DLCX ACK" }, |
| 43 | { 0x79, "ip.access DLCX NACK" }, |
| 44 | + /* HSL */ |
| 45 | + { 0x81, "HSL CONNECT TRAU" }, |
| 46 | + { 0x82, "HSL BSSGP" }, |
| 47 | + { 0x83, "HSL GPRS TS ALLOC" }, |
| 48 | + { 0x8a, "HSL L1 PRIMITIVE" }, |
| 49 | { 0, NULL } |
| 50 | }; |
| 51 | |
| 52 | @@ -3279,17 +3295,47 @@ |
| 53 | } |
| 54 | |
| 55 | static int |
| 56 | +dissct_rsl_hsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) |
| 57 | +{ |
| 58 | + guint8 msg_type; |
| 59 | + tvbuff_t *next_tvb; |
| 60 | + |
| 61 | + msg_type = tvb_get_guint8(tvb, offset)&0x7f; |
| 62 | + offset++; |
| 63 | + |
| 64 | + switch (msg_type) { |
| 65 | + case RSL_MSG_TYPE_HSL_CONN_TRAU: |
| 66 | + proto_tree_add_item(tree, hf_rsl_remote_ip, tvb, |
| 67 | + offset+6, 4, FALSE); |
| 68 | + break; |
| 69 | + case RSL_MSG_TYPE_HSL_BSSGP: |
| 70 | + next_tvb = tvb_new_subset(tvb, offset, -1, tvb_length(tvb)); |
| 71 | + call_dissector(bssgp_handle, next_tvb, pinfo, tree); |
| 72 | + break; |
| 73 | + case RSL_MSG_TYPE_HSL_GPRS_TS_ALLOC: |
| 74 | + break; |
| 75 | + case RSL_MSG_TYPE_HSL_L1_PRIM: |
| 76 | + break; |
| 77 | + } |
| 78 | + return offset; |
| 79 | +} |
| 80 | + |
| 81 | +static int |
| 82 | dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) |
| 83 | { |
| 84 | guint8 msg_disc, msg_type; |
| 85 | |
| 86 | msg_disc = tvb_get_guint8(tvb, offset++) >> 1; |
| 87 | - msg_type = tvb_get_guint8(tvb,offset)&0x7f; |
| 88 | + msg_type = tvb_get_guint8(tvb,offset)&0xff; |
| 89 | proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE); |
| 90 | |
| 91 | - if (msg_disc == RSL_MSGDISC_IPACCESS) { |
| 92 | + switch (msg_disc) { |
| 93 | + case RSL_MSGDISC_IPACCESS: |
| 94 | offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset); |
| 95 | return offset; |
| 96 | + case RSL_MSGDISC_HSL: |
| 97 | + offset = dissct_rsl_hsl_msg(tvb, pinfo, tree, offset); |
| 98 | + return offset; |
| 99 | } |
| 100 | offset++; |
| 101 | |
| 102 | @@ -3924,7 +3970,7 @@ |
| 103 | col_set_str(pinfo->cinfo, COL_PROTOCOL, "RSL"); |
| 104 | col_clear(pinfo->cinfo, COL_INFO); |
| 105 | |
| 106 | - msg_type = tvb_get_guint8(tvb,offset+1)&0x7f; |
| 107 | + msg_type = tvb_get_guint8(tvb,offset+1)&0xff; |
| 108 | |
| 109 | if (check_col(pinfo->cinfo, COL_INFO)){ |
| 110 | col_append_fstr(pinfo->cinfo, COL_INFO, "%s ",val_to_str(msg_type, rsl_msg_type_vals,"unknown %u")); |
| 111 | @@ -3955,6 +4001,7 @@ |
| 112 | |
| 113 | gsm_a_ccch_handle = find_dissector("gsm_a_ccch"); |
| 114 | gsm_a_dtap_handle = find_dissector("gsm_a_dtap"); |
| 115 | + bssgp_handle = find_dissector("bssgp"); |
| 116 | } |
| 117 | |
| 118 | /* Register the protocol with Wireshark */ |
| 119 | @@ -3975,7 +4022,7 @@ |
| 120 | }, |
| 121 | { &hf_rsl_msg_type, |
| 122 | { "Message type", "rsl.msg_type", |
| 123 | - FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0x7f, |
| 124 | + FT_UINT8, BASE_HEX_DEC, VALS(rsl_msg_type_vals), 0xff, |
| 125 | NULL, HFILL } |
| 126 | }, |
| 127 | { &hf_rsl_ie_id, |