root/wireshark/rsl-ipaccess.patch

Revision 2fb7ccf95f381534d08710bc5064ce1423a87384, 21.5 kB (checked in by Holger Hans Peter Freyther <zecke@selfish.org>, 4 months ago)

wireshark: Fix the patches and rebase against a recent wireshark version

My previous attempt to only add the hunks I changed broke the
format of the patch and this time I am just dumping my current
patch on top of these patches.

  • Property mode set to 100644
  • epan/dissectors/packet-rsl.c

    From 8f35d623641dbba90e6186604c11e892bf515ecc Mon Sep 17 00:00:00 2001
    From: Holger Hans Peter Freyther <zecke@selfish.org>
    Date: Mon, 19 Apr 2010 13:32:58 +0800
    Subject: [PATCH 2/2] RSL patch
    
    ---
     epan/dissectors/packet-rsl.c |  522 +++++++++++++++++++++++++++++++++++++++++-
     1 files changed, 515 insertions(+), 7 deletions(-)
    
    diff --git a/epan/dissectors/packet-rsl.c b/epan/dissectors/packet-rsl.c
    index b10a671..a455cf3 100644
    a b  
    22 * Routines for Radio Signalling Link (RSL) dissection. 
    33 * 
    44 * Copyright 2007, Anders Broman <anders.broman@ericsson.com> 
     5 * Copyright 2009, Harald Welte <laforge@gnumonks.org> 
    56 * 
    67 * $Id$ 
    78 * 
     
    4243#include <epan/lapd_sapi.h> 
    4344 
    4445#include "packet-gsm_a_common.h" 
     46#include "packet-rtp.h" 
     47#include "packet-rtcp.h" 
    4548 
    4649/* Initialize the protocol and registered fields */ 
    4750static int proto_rsl            = -1; 
     
    115118static int hf_rsl_rtd                           = -1; 
    116119static int hf_rsl_delay_ind                     = -1; 
    117120static int hf_rsl_tfo                           = -1; 
     121static int hf_rsl_speech_mode_s                 = -1; 
     122static int hf_rsl_speech_mode_m                 = -1; 
     123static int hf_rsl_conn_stat                     = -1; 
     124static int hf_rsl_conn_id                       = -1; 
     125static int hf_rsl_rtp_payload                   = -1; 
     126static int hf_rsl_rtp_csd_fmt_d                 = -1; 
     127static int hf_rsl_rtp_csd_fmt_ir                = -1; 
     128static int hf_rsl_local_port                    = -1; 
     129static int hf_rsl_remote_port                   = -1; 
     130static int hf_rsl_local_ip                      = -1; 
     131static int hf_rsl_remote_ip                     = -1; 
     132static int hf_rsl_cstat_tx_pkts                 = -1; 
     133static int hf_rsl_cstat_tx_octs                 = -1; 
     134static int hf_rsl_cstat_rx_pkts                 = -1; 
     135static int hf_rsl_cstat_rx_octs                 = -1; 
     136static int hf_rsl_cstat_lost_pkts               = -1; 
     137static int hf_rsl_cstat_ia_jitter               = -1; 
     138static int hf_rsl_cstat_avg_tx_dly              = -1; 
    118139 
    119140/* Initialize the subtree pointers */ 
    120141static int ett_rsl = -1; 
     
    172193static int ett_ie_meas_res_no = -1; 
    173194static int ett_ie_message_id = -1; 
    174195static int ett_ie_sys_info_type = -1; 
     196static int ett_ie_speech_mode = -1; 
     197static int ett_ie_conn_stat = -1; 
     198static int ett_ie_conn_id = -1; 
     199static int ett_ie_remote_ip = -1; 
     200static int ett_ie_remote_port = -1; 
     201static int ett_ie_local_port = -1; 
     202static int ett_ie_local_ip = -1; 
     203static int ett_ie_rtp_payload = -1; 
     204 
    175205 
    176206proto_tree *top_tree; 
    177207dissector_handle_t gsm_a_ccch_handle; 
     
    207237        {  0x06,                "Common Channel Management messages" }, 
    208238        {  0x08,                "TRX Management messages" }, 
    209239        {  0x16,                "Location Services messages" }, 
     240        {  0x3f,                "ip.access Vendor Specific messages" }, 
    210241        { 0,                    NULL } 
    211242}; 
     243#define RSL_MSGDISC_IPACCESS    0x3f 
     244 
    212245/* 
    213246 * 9.2 MESSAGE TYPE 
    214247 */ 
     
    275308        /*      0 1 - - - - - - Location Services messages: */ 
    276309#define RSL_MSG_LOC_INF                                 65      /* 8.7.1 */ 
    277310 
     311/* Vendor-Specific messages of ip.access nanoBTS. There is no public documentation 
     312 * about those extensions, all information in this dissector is based on lawful 
     313 * protocol reverse enginering by Harald Welte <laforge@gnumonks.org> */ 
     314#define RSL_MSG_TYPE_IPAC_MEAS_PP_DEF   0x60 
     315#define RSL_MSG_TYPE_IPAC_HO_CAND_INQ   0x61 
     316#define RSL_MSG_TYPE_IPAC_HO_CAND_RESP  0x62 
     317 
     318#define RSL_MSG_TYPE_IPAC_PDCH_ACT      0x48 
     319#define RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK  0x49 
     320#define RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK 0x4a 
     321#define RSL_MSG_TYPE_IPAC_PDCH_DEACT    0x4b 
     322#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK 0x4c 
     323#define RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK 0x4d 
     324 
     325#define RSL_MSG_TYPE_IPAC_CRCX          0x70 
     326#define RSL_MSG_TYPE_IPAC_CRCX_ACK      0x71 
     327#define RSL_MSG_TYPE_IPAC_CRCX_NACK     0x72 
     328#define RSL_MSG_TYPE_IPAC_MDCX          0x73 
     329#define RSL_MSG_TYPE_IPAC_MDCX_ACK      0x74 
     330#define RSL_MSG_TYPE_IPAC_MDCX_NACK     0x75 
     331#define RSL_MSG_TYPE_IPAC_DLCX_IND      0x76 
     332#define RSL_MSG_TYPE_IPAC_DLCX          0x77 
     333#define RSL_MSG_TYPE_IPAC_DLCX_ACK      0x78 
     334#define RSL_MSG_TYPE_IPAC_DLCX_NACK     0x79 
     335 
     336#define RSL_IE_IPAC_SRTP_CONFIG         0xe0 
     337#define RSL_IE_IPAC_PROXY_UDP           0xe1 
     338#define RSL_IE_IPAC_BSCMPL_TOUT         0xe2 
     339#define RSL_IE_IPAC_REMOTE_IP           0xf0 
     340#define RSL_IE_IPAC_REMOTE_PORT         0xf1 
     341#define RSL_IE_IPAC_RTP_PAYLOAD         0xf2 
     342#define RSL_IE_IPAC_LOCAL_PORT          0xf3 
     343#define RSL_IE_IPAC_SPEECH_MODE         0xf4 
     344#define RSL_IE_IPAC_LOCAL_IP            0xf5 
     345#define RSL_IE_IPAC_CONN_STAT           0xf6 
     346#define RSL_IE_IPAC_HO_C_PARMS          0xf7 
     347#define RSL_IE_IPAC_CONN_ID             0xf8 
     348#define RSL_IE_IPAC_RTP_CSD_FMT         0xf9 
     349#define RSL_IE_IPAC_RTP_JIT_BUF         0xfa 
     350#define RSL_IE_IPAC_RTP_COMPR           0xfb 
     351#define RSL_IE_IPAC_RTP_PAYLOAD2        0xfc 
     352#define RSL_IE_IPAC_RTP_MPLEX           0xfd 
     353#define RSL_IE_IPAC_RTP_MPLEX_ID        0xfe 
    278354 
    279355static const value_string rsl_msg_type_vals[] = { 
    280356          /*    0 0 0 0 - - - - Radio Link Layer Management messages: */ 
     
    337413        {  0x3f,        "TFO MODification REQuest" },                                   /* 8.4.31 */ 
    338414        /*      0 1 - - - - - - Location Services messages: */ 
    339415        {  0x41,        "Location Information" },                                               /* 8.7.1 */ 
     416        /* ip.access */ 
     417        {  0x48,        "ip.access PDCH ACTIVATION" }, 
     418        {  0x49,        "ip.access PDCH ACTIVATION ACK" }, 
     419        {  0x4a,        "ip.access PDCH ACTIVATION NACK" }, 
     420        {  0x4b,        "ip.access PDCH DEACTIVATION" }, 
     421        {  0x4c,        "ip.access PDCH DEACTIVATION ACK" }, 
     422        {  0x4d,        "ip.access PDCH DEACTIVATION NACK" }, 
     423        {  0x60,        "ip.access MEASurement PREPROCessing DeFauLT" }, 
     424        {  0x61,        "ip.access HANDOover CANDidate ENQuiry" }, 
     425        {  0x62,        "ip.access HANDOover CANDidate RESPonse" }, 
     426        {  0x70,        "ip.access CRCX" }, 
     427        {  0x71,        "ip.access CRCX ACK" }, 
     428        {  0x72,        "ip.access CRCX NACK" }, 
     429        {  0x73,        "ip.access MDCX" }, 
     430        {  0x74,        "ip.access MDCX ACK" }, 
     431        {  0x75,        "ip.access MDCX NACK" }, 
     432        {  0x76,        "ip.access DLCX INDication" }, 
     433        {  0x77,        "ip.access DLCX" }, 
     434        {  0x78,        "ip.access DLCX ACK" }, 
     435        {  0x79,        "ip.access DLCX NACK" }, 
    340436        { 0,            NULL } 
    341437}; 
    342438 
     
    370466#define RSL_IE_MESSAGE_ID               28 
    371467 
    372468#define RSL_IE_SYS_INFO_TYPE    30 
    373  
    374  
    375  
    376  
     469#define RSL_IE_MS_POWER_PARAM           31 
     470#define RSL_IE_BS_POWER_PARAM           32 
     471#define RSL_IE_PREPROC_PARAM            33 
     472#define RSL_IE_PREPROC_MEAS             34 
    377473#define RSL_IE_FULL_IMM_ASS_INF                 35 
    378474#define RSL_IE_SMSCB_INF                                36 
    379475#define RSL_IE_FULL_MS_TIMING_OFFSET    37 
     
    476572                        Not used 
    477573 
    478574        */ 
     575        { 0xe0,         "SRTP Configuration" }, 
     576        { 0xe1,         "BSC Proxy UDP Port" }, 
     577        { 0xe2,         "BSC Multiplex Timeout" }, 
     578        { 0xf0,         "Remote IP Address" }, 
     579        { 0xf1,         "Remote RTP Port" }, 
     580        { 0xf2,         "RTP Payload Type" }, 
     581        { 0xf3,         "Local RTP Port" }, 
     582        { 0xf4,         "Speech Mode" }, 
     583        { 0xf5,         "Local IP Address" }, 
     584        { 0xf6,         "Connection Statistics" }, 
     585        { 0xf7,         "Handover C Parameters" }, 
     586        { 0xf8,         "Connection Identifier" }, 
     587        { 0xf9,         "RTP CSD Format" }, 
     588        { 0xfa,         "RTP Jitter Buffer" }, 
     589        { 0xfb,         "RTP Compression" }, 
     590        { 0xfc,         "RTP Payload Type 2" }, 
     591        { 0xfd,         "RTP Multiplex" }, 
     592        { 0xfe,         "RTP Multiplex Identifier" }, 
    479593        { 0,                    NULL } 
    480594}; 
    481595 
     
    512626        { 0,                    NULL } 
    513627}; 
    514628 
     629/* From openbsc/include/openbsc/tlv.h */ 
     630enum tlv_type { 
     631        TLV_TYPE_FIXED, 
     632        TLV_TYPE_T, 
     633        TLV_TYPE_TV, 
     634        TLV_TYPE_TLV, 
     635        TLV_TYPE_TL16V, 
     636}; 
     637 
     638struct tlv_def { 
     639        enum tlv_type type; 
     640        u_int8_t fixed_len; 
     641}; 
     642 
     643struct tlv_definition { 
     644        struct tlv_def def[0xff]; 
     645}; 
     646 
     647static const struct tlv_definition rsl_att_tlvdef = { 
     648        .def = { 
     649                [RSL_IE_CH_NO]                  = { TLV_TYPE_TV, 0 }, 
     650                [RSL_IE_LINK_ID]                = { TLV_TYPE_TV, 0 }, 
     651                [RSL_IE_ACT_TYPE]               = { TLV_TYPE_TV, 0 }, 
     652                [RSL_IE_BS_POW]                 = { TLV_TYPE_TV, 0 }, 
     653                [RSL_IE_CH_ID]                  = { TLV_TYPE_TLV, 0 }, 
     654                [RSL_IE_CH_MODE]                = { TLV_TYPE_TLV, 0 }, 
     655                [RSL_IE_ENC_INF]                = { TLV_TYPE_TLV, 0 }, 
     656                [RSL_IE_FRAME_NO]               = { TLV_TYPE_FIXED, 2 }, 
     657                [RSL_IE_HO_REF]                 = { TLV_TYPE_TV, 0 }, 
     658                [RSL_IE_L1_INF]                 = { TLV_TYPE_FIXED, 2 }, 
     659                [RSL_IE_L3_INF]                 = { TLV_TYPE_TL16V, 0 }, 
     660                [RSL_IE_MS_ID]                  = { TLV_TYPE_TLV, 0 }, 
     661                [RSL_IE_MS_POW]                 = { TLV_TYPE_TV, 0 }, 
     662                [RSL_IE_PAGING_GRP]             = { TLV_TYPE_TV, 0 }, 
     663                [RSL_IE_PAGING_LOAD]            = { TLV_TYPE_FIXED, 2 }, 
     664                [RSL_IE_PHY_CTX]                = { TLV_TYPE_TLV, 0 }, 
     665                [RSL_IE_ACCESS_DELAY]           = { TLV_TYPE_TV, 0 }, 
     666                [RSL_IE_RACH_LOAD]              = { TLV_TYPE_TLV, 0 }, 
     667                [RSL_IE_REQ_REF]                = { TLV_TYPE_FIXED, 3 }, 
     668                [RSL_IE_REL_MODE]               = { TLV_TYPE_TV, 0 }, 
     669                [RSL_IE_RESOURCE_INF]           = { TLV_TYPE_TLV, 0 }, 
     670                [RSL_IE_RLM_CAUSE]              = { TLV_TYPE_TLV, 0 }, 
     671                [RSL_IE_STARTING_TIME]          = { TLV_TYPE_FIXED, 2 }, 
     672                [RSL_IE_TIMING_ADV]             = { TLV_TYPE_TV, 0 }, 
     673                [RSL_IE_UPLINK_MEAS]            = { TLV_TYPE_TLV, 0 }, 
     674                [RSL_IE_CAUSE]                  = { TLV_TYPE_TLV, 0 }, 
     675                [RSL_IE_MEAS_RES_NO]            = { TLV_TYPE_TV, 0 }, 
     676                [RSL_IE_MESSAGE_ID]             = { TLV_TYPE_TV, 0 }, 
     677                [RSL_IE_SYS_INFO_TYPE]          = { TLV_TYPE_TV, 0 }, 
     678                [RSL_IE_MS_POWER_PARAM]         = { TLV_TYPE_TLV, 0 }, 
     679                [RSL_IE_BS_POWER_PARAM]         = { TLV_TYPE_TLV, 0 }, 
     680                [RSL_IE_PREPROC_PARAM]          = { TLV_TYPE_TLV, 0 }, 
     681                [RSL_IE_PREPROC_MEAS]           = { TLV_TYPE_TLV, 0 }, 
     682                //[RSL_IE_IMM_ASS_INFO]         = { TLV_TYPE_TLV, 0 }, 
     683                //[RSL_IE_SMSCB_INFO]           = { TLV_TYPE_FIXED, 23 }, 
     684                //[RSL_IE_MS_TIMING_OFFSET]     = { TLV_TYPE_TV, 0 }, 
     685                [RSL_IE_ERR_MSG]                = { TLV_TYPE_TLV, 0 }, 
     686                [RSL_IE_FULL_BCCH_INF]          = { TLV_TYPE_TLV, 0 }, 
     687                [RSL_IE_CH_NEEDED]              = { TLV_TYPE_TV, 0 }, 
     688                [RSL_IE_CB_CMD_TYPE]            = { TLV_TYPE_TV, 0 }, 
     689                [RSL_IE_SMSCB_MESS]             = { TLV_TYPE_TLV, 0 }, 
     690                [RSL_IE_FULL_IMM_ASS_INF]       = { TLV_TYPE_TLV, 0 }, 
     691                //[RSL_IE_SACCH_INFO]           = { TLV_TYPE_TLV, 0 }, 
     692                [RSL_IE_CBCH_LOAD_INF]          = { TLV_TYPE_TV, 0 }, 
     693                [RSL_IE_SMSCB_CH_IND]           = { TLV_TYPE_TV, 0 }, 
     694                [RSL_IE_GRP_CALL_REF]           = { TLV_TYPE_TLV, 0 }, 
     695                [RSL_IE_CH_DESC]                = { TLV_TYPE_TLV, 0 }, 
     696                [RSL_IE_NCH_DRX_INF]            = { TLV_TYPE_TLV, 0 }, 
     697                [RSL_IE_CMD_IND]                = { TLV_TYPE_TLV, 0 }, 
     698                [RSL_IE_EMLPP_PRIO]             = { TLV_TYPE_TV, 0 }, 
     699                [RSL_IE_UIC]                    = { TLV_TYPE_TLV, 0 }, 
     700                [RSL_IE_MAIN_CH_REF]            = { TLV_TYPE_TV, 0 }, 
     701                [RSL_IE_MULTIRATE_CONF]         = { TLV_TYPE_TLV, 0 }, 
     702                [RSL_IE_MULTIRATE_CNTRL]        = { TLV_TYPE_TV, 0 }, 
     703                [RSL_IE_SUP_CODEC_TYPES]        = { TLV_TYPE_TLV, 0 }, 
     704                [RSL_IE_CODEC_CONF]             = { TLV_TYPE_TLV, 0 }, 
     705                [RSL_IE_RTD]                    = { TLV_TYPE_TV, 0 }, 
     706                [RSL_IE_TFO_STATUS]             = { TLV_TYPE_TV, 0 }, 
     707                [RSL_IE_LLP_APDU]               = { TLV_TYPE_TLV, 0 }, 
     708                [RSL_IE_IPAC_REMOTE_IP]         = { TLV_TYPE_FIXED, 4 }, 
     709                [RSL_IE_IPAC_REMOTE_PORT]       = { TLV_TYPE_FIXED, 2 }, 
     710                [RSL_IE_IPAC_LOCAL_IP]          = { TLV_TYPE_FIXED, 4 }, 
     711                [RSL_IE_IPAC_CONN_STAT]         = { TLV_TYPE_TLV, 0 }, 
     712                [RSL_IE_IPAC_LOCAL_PORT]        = { TLV_TYPE_FIXED, 2 }, 
     713                [RSL_IE_IPAC_SPEECH_MODE]       = { TLV_TYPE_TV, 0 }, 
     714                [RSL_IE_IPAC_CONN_ID]           = { TLV_TYPE_FIXED, 2 }, 
     715                [RSL_IE_IPAC_RTP_PAYLOAD2]      = { TLV_TYPE_TV, 0 }, 
     716        }, 
     717}; 
     718 
    515719/* 9.3.1 Channel number                 9.3.1   M TV 2 */ 
    516720static int 
    517721dissect_rsl_ie_ch_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, gboolean is_mandatory) 
     
    20422246        proto_item_set_len(ti, length+2); 
    20432247 
    20442248        proto_tree_add_item(ie_tree, hf_rsl_ie_length, tvb, offset, 1, FALSE); 
    2045         offset++; 
    20462249 
    20472250        /* Received Message */ 
    20482251        offset = dissct_rsl_msg(tvb, pinfo, ie_tree, offset); 
     
    29073110} 
    29083111 
    29093112static int 
     3113dissct_rsl_ipaccess_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,                                int offset) 
     3114{ 
     3115        guint8 msg_type; 
     3116        guint32 local_addr = 0; 
     3117        guint16 local_port = 0; 
     3118        address src_addr; 
     3119 
     3120        msg_type = tvb_get_guint8(tvb, offset)&0x7f; 
     3121        offset++; 
     3122 
     3123#if 0 
     3124        switch (msg_type) { 
     3125        case RSL_MSG_TYPE_IPAC_CRCX: 
     3126        case RSL_MSG_TYPE_IPAC_CRCX_ACK: 
     3127        case RSL_MSG_TYPE_IPAC_CRCX_NACK: 
     3128        case RSL_MSG_TYPE_IPAC_MDCX: 
     3129        case RSL_MSG_TYPE_IPAC_MDCX_ACK: 
     3130        case RSL_MSG_TYPE_IPAC_MDCX_NACK: 
     3131        case RSL_MSG_TYPE_IPAC_DLCX_IND: 
     3132        case RSL_MSG_TYPE_IPAC_DLCX: 
     3133        case RSL_MSG_TYPE_IPAC_DLCX_ACK: 
     3134        case RSL_MSG_TYPE_IPAC_DLCX_NACK: 
     3135        case RSL_MSG_TYPE_IPAC_PDCH_ACT: 
     3136        case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK: 
     3137        case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK: 
     3138        case RSL_MSG_TYPE_IPAC_PDCH_DEACT: 
     3139        case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK: 
     3140        case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK: 
     3141                /* Channel number                       9.3.1   M TV 2          */ 
     3142                offset = dissect_rsl_ie_ch_no(tvb, pinfo, tree, offset, TRUE); 
     3143                break; 
     3144        } 
     3145#endif 
     3146        /* parse TLV attributes */ 
     3147        while (tvb_reported_length_remaining(tvb, offset) != 0) { 
     3148                guint8 tag; 
     3149                unsigned int len, hlen, len_len; 
     3150                const struct tlv_def *tdef; 
     3151                proto_item *ti; 
     3152                proto_tree *ie_tree; 
     3153 
     3154                tag = tvb_get_guint8(tvb, offset); 
     3155                tdef = &rsl_att_tlvdef.def[tag]; 
     3156 
     3157                switch (tdef->type) { 
     3158                case TLV_TYPE_FIXED: 
     3159                        hlen = 1; 
     3160                        len_len = 0; 
     3161                        len = tdef->fixed_len; 
     3162                        break; 
     3163                case TLV_TYPE_T: 
     3164                        hlen = 1; 
     3165                        len_len = 0; 
     3166                        len = 0; 
     3167                        break; 
     3168                case TLV_TYPE_TV: 
     3169                        hlen = 1; 
     3170                        len_len = 0; 
     3171                        len = 1; 
     3172                        break; 
     3173                case TLV_TYPE_TLV: 
     3174                        hlen = 2; 
     3175                        len_len = 1; 
     3176                        len = tvb_get_guint8(tvb, offset+1); 
     3177                        break; 
     3178                case TLV_TYPE_TL16V: 
     3179                        hlen = 3; 
     3180                        len_len = 2; 
     3181                        len = tvb_get_guint8(tvb, offset+1) << 8 | 
     3182                                        tvb_get_guint8(tvb, offset+2); 
     3183                        break; 
     3184                default: 
     3185                        hlen = len_len = len = 0; 
     3186                        DISSECTOR_ASSERT_NOT_REACHED(); 
     3187                        break; 
     3188                } 
     3189 
     3190                ti = proto_tree_add_item(tree, hf_rsl_ie_id, tvb, offset, 1, FALSE); 
     3191                ie_tree = proto_item_add_subtree(ti, ett_ie_local_port); 
     3192                offset += hlen; 
     3193 
     3194                switch (tag) { 
     3195                case RSL_IE_CH_NO: 
     3196                        dissect_rsl_ie_ch_no(tvb, pinfo, ie_tree, offset, FALSE); 
     3197                        break; 
     3198                case RSL_IE_FRAME_NO: 
     3199                        dissect_rsl_ie_frame_no(tvb, pinfo, ie_tree, offset, FALSE); 
     3200                        break; 
     3201                case RSL_IE_MS_POW: 
     3202                        dissect_rsl_ie_ms_pow(tvb, pinfo, ie_tree, offset, FALSE); 
     3203                        break; 
     3204                case RSL_IE_IPAC_REMOTE_IP: 
     3205                        proto_tree_add_item(ie_tree, hf_rsl_remote_ip, tvb, 
     3206                                            offset, len, FALSE); 
     3207                        break; 
     3208                case RSL_IE_IPAC_REMOTE_PORT: 
     3209                        proto_tree_add_item(ie_tree, hf_rsl_remote_port, tvb, 
     3210                                            offset, len, FALSE); 
     3211                        break; 
     3212                case RSL_IE_IPAC_LOCAL_IP: 
     3213                        proto_tree_add_item(ie_tree, hf_rsl_local_ip, tvb, 
     3214                                            offset, len, FALSE); 
     3215                        local_addr = tvb_get_ipv4(tvb, offset); 
     3216                        break; 
     3217                case RSL_IE_IPAC_LOCAL_PORT: 
     3218                        proto_tree_add_item(ie_tree, hf_rsl_local_port, tvb, 
     3219                                            offset, len, FALSE); 
     3220                        local_port = tvb_get_ntohs(tvb, offset); 
     3221                        break; 
     3222                case RSL_IE_IPAC_SPEECH_MODE: 
     3223                        proto_tree_add_item(ie_tree, hf_rsl_speech_mode_s, tvb, 
     3224                                            offset, len, FALSE); 
     3225                        proto_tree_add_item(ie_tree, hf_rsl_speech_mode_m, tvb, 
     3226                                            offset, len, FALSE); 
     3227                        break; 
     3228                case RSL_IE_IPAC_RTP_PAYLOAD: 
     3229                case RSL_IE_IPAC_RTP_PAYLOAD2: 
     3230                        proto_tree_add_item(ie_tree, hf_rsl_rtp_payload, tvb, 
     3231                                            offset, len, FALSE); 
     3232                        break; 
     3233                case RSL_IE_IPAC_RTP_CSD_FMT: 
     3234                        proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_d, tvb, 
     3235                                            offset, len, FALSE); 
     3236                        proto_tree_add_item(ie_tree, hf_rsl_rtp_csd_fmt_ir, tvb, 
     3237                                            offset, len, FALSE); 
     3238                        break; 
     3239                case RSL_IE_IPAC_CONN_ID: 
     3240                        proto_tree_add_item(ie_tree, hf_rsl_conn_id, tvb, 
     3241                                            offset, len, FALSE); 
     3242                        break; 
     3243                case RSL_IE_IPAC_CONN_STAT: 
     3244                        proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_pkts, tvb, 
     3245                                            offset, 4, FALSE); 
     3246                        proto_tree_add_item(ie_tree, hf_rsl_cstat_tx_octs, tvb, 
     3247                                            offset+4, 4, FALSE); 
     3248                        proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_pkts, tvb, 
     3249                                            offset+8, 4, FALSE); 
     3250                        proto_tree_add_item(ie_tree, hf_rsl_cstat_rx_octs, tvb, 
     3251                                            offset+12, 4, FALSE); 
     3252                        proto_tree_add_item(ie_tree, hf_rsl_cstat_lost_pkts, tvb, 
     3253                                            offset+16, 4, FALSE); 
     3254                        proto_tree_add_item(ie_tree, hf_rsl_cstat_ia_jitter, tvb, 
     3255                                            offset+20, 4, FALSE); 
     3256                        proto_tree_add_item(ie_tree, hf_rsl_cstat_avg_tx_dly, tvb, 
     3257                                            offset+24, 4, FALSE); 
     3258                        break; 
     3259                } 
     3260                offset += len; 
     3261        } 
     3262 
     3263        switch (msg_type) { 
     3264        case RSL_MSG_TYPE_IPAC_CRCX_ACK: 
     3265                /* Notify the RTP and RTCP dissectors about a new RTP stream */ 
     3266                src_addr.type = AT_IPv4; 
     3267                src_addr.len = 4; 
     3268                src_addr.data = (guint8 *)&local_addr; 
     3269                rtp_add_address(pinfo, &src_addr, local_port, 0, 
     3270                                "GSM A-bis/IP", pinfo->fd->num, 0, NULL); 
     3271                rtcp_add_address(pinfo, &src_addr, local_port+1, 0, 
     3272                                 "GSM A-bis/IP", pinfo->fd->num); 
     3273                break; 
     3274        } 
     3275        return offset; 
     3276} 
     3277 
     3278static int 
    29103279dissct_rsl_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset) 
    29113280{ 
    2912         guint8  msg_type; 
     3281        guint8  msg_disc, msg_type; 
    29133282 
     3283        msg_disc = tvb_get_guint8(tvb, offset++) >> 1; 
    29143284        msg_type = tvb_get_guint8(tvb,offset)&0x7f; 
    29153285        proto_tree_add_item(tree, hf_rsl_msg_type, tvb, offset, 1, FALSE); 
     3286 
     3287        if (msg_disc == RSL_MSGDISC_IPACCESS) { 
     3288                offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset); 
     3289                return offset; 
     3290        } 
    29163291        offset++; 
    29173292 
    29183293        switch (msg_type){ 
     
    34803855                /* LLP APDU 9.3.58 M LV 2-N */ 
    34813856                offset = dissect_rsl_ie_llp_apdu(tvb, pinfo, tree, offset, TRUE); 
    34823857                break; 
     3858        /* the following messages are ip.access specific but sent without 
     3859         * ip.access memssage discriminator */ 
     3860        case RSL_MSG_TYPE_IPAC_MEAS_PP_DEF: 
     3861        case RSL_MSG_TYPE_IPAC_HO_CAND_INQ: 
     3862        case RSL_MSG_TYPE_IPAC_HO_CAND_RESP: 
     3863        case RSL_MSG_TYPE_IPAC_PDCH_ACT: 
     3864        case RSL_MSG_TYPE_IPAC_PDCH_ACT_ACK: 
     3865        case RSL_MSG_TYPE_IPAC_PDCH_ACT_NACK: 
     3866        case RSL_MSG_TYPE_IPAC_PDCH_DEACT: 
     3867        case RSL_MSG_TYPE_IPAC_PDCH_DEACT_ACK: 
     3868        case RSL_MSG_TYPE_IPAC_PDCH_DEACT_NACK: 
     3869                offset = dissct_rsl_ipaccess_msg(tvb, pinfo, tree, offset-1); 
    34833870        default: 
    34843871                break; 
    34853872        } 
     
    34873874        return offset; 
    34883875 
    34893876} 
     3877 
     3878static const value_string rsl_ipacc_spm_s_vals[] = { 
     3879        { 0,    "GSM FR codec (GSM type 1, FS)" }, 
     3880        { 1,    "GSM EFR codec (GSM type 2, FS)" }, 
     3881        { 2,    "GSM AMR/FR codec (GSM type 3, FS)" }, 
     3882        { 3,    "GSM HR codec (GSM type 1, HS)" }, 
     3883        { 5,    "GSM AMR/HR codec (GSM type 3, HS)" }, 
     3884        { 0xf,  "As specified by RTP Payload Type IE" }, 
     3885        { 0,    NULL } 
     3886}; 
     3887 
     3888static const value_string rsl_ipacc_spm_m_vals[] = { 
     3889        { 0,    "Send and Receive" }, 
     3890        { 1,    "Receive Only" }, 
     3891        { 2,    "Send Only" }, 
     3892        { 0,    NULL } 
     3893}; 
     3894 
     3895static const value_string rsl_ipacc_rtp_csd_fmt_d_vals[] = { 
     3896        { 0,    "External TRAU format" }, 
     3897        { 1,    "Non-TRAU Packed format" }, 
     3898        { 2,    "TRAU within the BTS" }, 
     3899        { 3,    "IWF-Free BTS-BTS Data" }, 
     3900        { 0,    NULL } 
     3901}; 
     3902 
     3903static const value_string rsl_ipacc_rtp_csd_fmt_ir_vals[] = { 
     3904        { 0,    "8kb/s" }, 
     3905        { 1,    "16kb/s" }, 
     3906        { 2,    "32kb/s" }, 
     3907        { 3,    "64kb/s" }, 
     3908        { 0,    NULL } 
     3909}; 
     3910 
    34903911static void 
    34913912dissect_rsl(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) 
    34923913{ 
     
    35143935                /* 9.1 Message discriminator */ 
    35153936                proto_tree_add_item(rsl_tree, hf_rsl_msg_dsc, tvb, offset, 1, FALSE); 
    35163937                proto_tree_add_item(rsl_tree, hf_rsl_T_bit, tvb, offset, 1, FALSE); 
    3517                 offset++; 
    35183938 
    35193939                offset = dissct_rsl_msg(tvb, pinfo, rsl_tree, offset); 
    35203940 
     
    38844304                        FT_UINT8, BASE_DEC, VALS(rsl_emlpp_prio_vals), 0x03, 
    38854305                        NULL, HFILL } 
    38864306                }, 
     4307                { &hf_rsl_speech_mode_s, 
     4308                        { "ip.access Speech Mode S", "rsl.ipacc.speech_mode_s", 
     4309                          FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_s_vals), 
     4310                          0xf, NULL, HFILL } 
     4311                }, 
     4312                { &hf_rsl_speech_mode_m, 
     4313                        { "ip.access Speech Mode M", "rsl.ipacc.speech_mode_m", 
     4314                          FT_UINT8, BASE_HEX, VALS(rsl_ipacc_spm_m_vals), 
     4315                          0xf0, NULL, HFILL } 
     4316                }, 
     4317                { &hf_rsl_conn_stat, 
     4318                        { "ip.access Connection Statistics","rsl.ipacc.conn_stat", 
     4319                          FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } 
     4320                }, 
     4321                { &hf_rsl_conn_id, 
     4322                        { "ip.access Connection ID",    "rsl.ipacc.conn_id", 
     4323                          FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL } 
     4324                }, 
     4325                { &hf_rsl_rtp_payload, 
     4326                        { "ip.access RTP Payload Type", "rsl.ipacc.rtp_payload", 
     4327                          FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } 
     4328                }, 
     4329                { &hf_rsl_rtp_csd_fmt_d, 
     4330                        { "ip.access RTP CSD Format D", "rsl.ipacc.rtp_csd_fmt_d", 
     4331                          FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_d_vals), 
     4332                          0x0f, NULL, HFILL }, 
     4333                }, 
     4334                { &hf_rsl_rtp_csd_fmt_ir, 
     4335                        { "ip.access RTP CSD Format IR", "rsl.ipacc.rtp_csd_fmt_ir", 
     4336                          FT_UINT8, BASE_HEX, VALS(rsl_ipacc_rtp_csd_fmt_ir_vals), 
     4337                          0xf0, NULL, HFILL }, 
     4338                }, 
     4339                { &hf_rsl_local_port, 
     4340                        { "ip.access Local RTP Port",   "rsl.ipacc.local_port", 
     4341                          FT_UINT16, BASE_DEC, NULL, 0x0, 
     4342                          "ip.access Local RTP Port", HFILL }, 
     4343                }, 
     4344                { &hf_rsl_remote_port, 
     4345                        { "ip.access Remote RTP Port",  "rsl.ipacc.remote_port", 
     4346                          FT_UINT16, BASE_DEC, NULL, 0x0, 
     4347                          "ip.access Remote RTP Port", HFILL }, 
     4348                }, 
     4349                { &hf_rsl_local_ip, 
     4350                        { "ip.access Local IP Address", "rsl.ipacc.local_ip", 
     4351                          FT_IPv4, BASE_NONE, NULL, 0x0, 
     4352                          "ip.access Local IP Address", HFILL }, 
     4353                }, 
     4354                { &hf_rsl_remote_ip, 
     4355                        { "ip.access Remote IP Address", "rsl.ipacc.remote_ip", 
     4356                          FT_IPv4, BASE_NONE, NULL, 0x0, 
     4357                          "ip.access Remote IP Address", HFILL }, 
     4358                }, 
     4359                { &hf_rsl_cstat_tx_pkts, 
     4360                        { "Packets Sent", "rsl.ipacc.cstat.tx_pkts", 
     4361                          FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } 
     4362                }, 
     4363                { &hf_rsl_cstat_tx_octs, 
     4364                        { "Octets Sent", "rsl.ipacc.cstat.tx_octets", 
     4365                          FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } 
     4366                }, 
     4367                { &hf_rsl_cstat_rx_pkts, 
     4368                        { "Packets Received", "rsl.ipacc.cstat.rx_pkts", 
     4369                          FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } 
     4370                }, 
     4371                { &hf_rsl_cstat_rx_octs, 
     4372                        { "Octets Received", "rsl.ipacc.cstat.rx_octets", 
     4373                          FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } 
     4374                }, 
     4375                { &hf_rsl_cstat_lost_pkts, 
     4376                        { "Packets Lost", "rsl.ipacc.cstat.lost_pkts", 
     4377                          FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } 
     4378                }, 
     4379                { &hf_rsl_cstat_ia_jitter, 
     4380                        { "Inter-arrival Jitter", "rsl.ipacc.cstat.ia_jitter", 
     4381                          FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } 
     4382                }, 
     4383                { &hf_rsl_cstat_avg_tx_dly, 
     4384                        { "Average Tx Delay", "rsl.ipacc.cstat.avg_tx_delay", 
     4385                          FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL } 
     4386                }, 
    38874387        }; 
    38884388        static gint *ett[] = { 
    38894389                &ett_rsl, 
     
    39414441                &ett_ie_meas_res_no, 
    39424442                &ett_ie_message_id, 
    39434443                &ett_ie_sys_info_type, 
     4444                &ett_ie_speech_mode, 
     4445                &ett_ie_conn_stat, 
     4446                &ett_ie_conn_id, 
     4447                &ett_ie_remote_ip, 
     4448                &ett_ie_remote_port, 
     4449                &ett_ie_local_port, 
     4450                &ett_ie_local_ip, 
     4451                &ett_ie_rtp_payload, 
    39444452        }; 
    39454453 
    39464454        /* Register the protocol name and description */ 
Note: See TracBrowser for help on using the browser.