- Add application Id:s to Diameter
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 8 Feb 2008 16:32:12 +0000 (16:32 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 8 Feb 2008 16:32:12 +0000 (16:32 +0000)
- Further dissect 3GPP Radius AVP:s.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@24293 f5534014-38df-0310-8fa8-9805f1628bb7

diameter/dictionary.xml
epan/dissectors/packet-gsm_a.c
epan/dissectors/packet-gtp.c
radius/dictionary.3gpp

index da15aa101566551c78de7398d1c32c3afb4915e8..49579ce2450539b0a9000f526fce19796bf3d914 100644 (file)
                        <enum name="Ericsson Mm" code="16777233"/>
                        <enum name="Vodafone Gx+" code="16777234"/>
                        <enum name="ITU-T Rs" code="16777235"/>
-
                        <enum name="3GPP Rx" code="16777236"/>
                        <enum name="3GPP2 Ty" code="16777237"/>
                        <enum name="3GPP Gx" code="16777238"/>
                        <enum name="Juniper Cluster" code="16777239"/>
                        <enum name="Juniper Policy-Control-AAA" code="16777240"/>
                        <enum name="iptego USPI" code="16777241"/>
+                       <enum name="Covergence-specific SIP routing" code="16777242"/>
+                       <enum name="Policy Processing" code="16777243"/>
+                       <enum name="Juniper Policy-Control-JSRC" code="16777244"/>
+                       <enum name="ITU-T S-TC1" code="16777245"/>                                              <!-- ITU-T Rec. Q.3221 -->
                        <enum name="Relay" code="4294967295"/>
                </avp>          
                <avp name="Acct-Application-Id" code="259" mandatory="must" protected="mustnot" may-encrypt="no" vendor-bit="mustnot">
                        <enum name="Ericsson Mm" code="16777233"/>
                        <enum name="Vodafone Gx+" code="16777234"/>
                        <enum name="ITU-T Rs" code="16777235"/>
-
                        <enum name="3GPP Rx" code="16777236"/>
                        <enum name="3GPP2 Ty" code="16777237"/>
                        <enum name="3GPP Gx" code="16777238"/>
                        <enum name="Juniper Cluster" code="16777239"/>
                        <enum name="Juniper Policy-Control-AAA" code="16777240"/>
                        <enum name="iptego USPI" code="16777241"/>
+                       <enum name="Covergence-specific SIP routing" code="16777242"/>
+                       <enum name="Policy Processing" code="16777243"/>
+                       <enum name="Juniper Policy-Control-JSRC" code="16777244"/>
+                       <enum name="ITU-T S-TC1" code="16777245"/>                                              <!-- ITU-T Rec. Q.3221 -->
                        <enum name="Relay" code="4294967295"/>
                </avp>
                <avp name="Vendor-Specific-Application-Id" code="260" mandatory="must" may-encrypt="no" protected="mustnot" vendor-bit="mustnot">
index 3e2d40d03d301bafa3c33730cf1a3b1352415f93..72e768df44ead653236e6d2bfa4862682689223d 100644 (file)
 #include "packet-gsm_a.h"
 #include "packet-ipv6.h"
 #include "packet-sccp.h"
+#include "packet-e212.h"
 
 #include "packet-ppp.h"
 
@@ -1282,7 +1283,7 @@ static gint ett_gmm_attach_type = -1;
 static gint ett_gmm_context_stat = -1;
 static gint ett_gmm_update_type = -1;
 static gint ett_gmm_radio_cap = -1;
-
+static gint ett_gmm_rai = -1;
 
 static gint ett_sm_tft = -1;
 
@@ -2336,12 +2337,9 @@ be_chan_type(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *
 guint8
 be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string, int string_len, guint8 disc)
 {
-    guint8     octs[3];
     guint32    value;
     guint32    curr_offset;
-    gchar      mcc[4];
-    gchar      mnc[4];
-
     if (add_string)
        add_string[0] = '\0';
     curr_offset = offset;
@@ -2355,19 +2353,8 @@ be_cell_id_aux(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar
        /* FALLTHRU */
 
     case 0x08:  /* For intersystem handover from GSM to UMTS or cdma2000: */
-       octs[0] = tvb_get_guint8(tvb, curr_offset);
-       octs[1] = tvb_get_guint8(tvb, curr_offset + 1);
-       octs[2] = tvb_get_guint8(tvb, curr_offset + 2);
 
-       mcc_mnc_aux(octs, mcc, mnc);
-
-       proto_tree_add_text(tree,
-           tvb, curr_offset, 3,
-           "Mobile Country Code (MCC): %s, Mobile Network Code (MNC): %s",
-           mcc,
-           mnc);
-
-       curr_offset += 3;
+       curr_offset = dissect_e212_mcc_mnc(tvb, tree, curr_offset);
 
        /* FALLTHRU */
 
@@ -10602,6 +10589,9 @@ de_gmm_cause(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *
 guint8
 de_gmm_rai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *add_string _U_, int string_len _U_)
 {
+    proto_tree         *subtree;
+    proto_item         *item;
+
     guint32    mcc;
     guint32    mnc;
     guint32    lac;
@@ -10625,11 +10615,13 @@ de_gmm_rai(tvbuff_t *tvb, proto_tree *tree, guint32 offset, guint len, gchar *ad
     lac |= tvb_get_guint8(tvb, curr_offset+4);
     rac = tvb_get_guint8(tvb, curr_offset+5);
 
-       proto_tree_add_text(tree,
+       item = proto_tree_add_text(tree,
                tvb, curr_offset, 6,
                "Routing area identification: %x-%x-%x-%x",
                mcc,mnc,lac,rac);
 
+       subtree = proto_item_add_subtree(item, ett_gmm_rai);
+       dissect_e212_mcc_mnc(tvb, subtree, offset);
     curr_offset+=6;
 
     /* no length check possible */
@@ -19592,7 +19584,7 @@ proto_register_gsm_a(void)
     };
 
     /* Setup protocol subtree array */
-#define        NUM_INDIVIDUAL_ELEMS    38
+#define        NUM_INDIVIDUAL_ELEMS    39
     static gint *ett[NUM_INDIVIDUAL_ELEMS + NUM_GSM_BSSMAP_MSG +
                        NUM_GSM_DTAP_MSG_MM + NUM_GSM_DTAP_MSG_RR + NUM_GSM_DTAP_MSG_CC +
                        NUM_GSM_DTAP_MSG_GMM + NUM_GSM_DTAP_MSG_SMS +
@@ -19638,8 +19630,9 @@ proto_register_gsm_a(void)
     ett[34] = &ett_gmm_context_stat;
     ett[35] = &ett_gmm_update_type;
     ett[36] = &ett_gmm_radio_cap;
+       ett[37] = &ett_gmm_rai;
 
-    ett[37] = &ett_sm_tft;
+    ett[38] = &ett_sm_tft;
 
 
     last_offset = NUM_INDIVIDUAL_ELEMS;
index a5def5b020926714fa4595f469d75889cf302d99..fadc38bcd4d37180e188d6298d5e3944c8a547c2 100644 (file)
@@ -1343,6 +1343,8 @@ static const value_string gtp_ext_rat_type_vals[] = {
        { 1,    "UTRAN" },
        { 2,    "GERAN" },
        { 3,    "WLAN" },
+       { 4,    "GAN" },
+       { 5,    "HSPA Evolution" },
        { 0,    NULL }
 };
 
@@ -2938,14 +2940,22 @@ decode_gtp_recovery(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre
 /* GPRS:       9.60 v7.6.0, chapter 7.9.13, page 42
  * UMTS:       29.060 v4.0, chapter 7.7.12, page 49
  */
-static int
-decode_gtp_sel_mode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
 
-       guint8  sel_mode;
 
-       sel_mode = tvb_get_guint8(tvb, offset+1) & 0x03;
-       proto_tree_add_uint(tree, hf_gtp_sel_mode, tvb, offset, 2, sel_mode);
+static const gchar* dissect_radius_selection_mode(proto_tree *tree, tvbuff_t *tvb) {
+       guint8 sel_mode;
+
+       /* Value in ASCII(UTF-8) */
+       sel_mode = tvb_get_guint8(tvb,0)- 0x30;
+       proto_tree_add_uint(tree, hf_gtp_sel_mode, tvb, 0, 1, sel_mode);
+
+       return val_to_str(sel_mode, sel_mode_type, "Unknown");
+}
+
+static int
+decode_gtp_sel_mode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
 
+       proto_tree_add_item(tree, hf_gtp_sel_mode, tvb, offset, 2, FALSE);
        return 2;
 }
 
@@ -4756,6 +4766,14 @@ decode_gtp_apn_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree
  * RAT Type
  * Type = 151 (Decimal)
  */
+
+static const gchar* dissect_radius_rat_type(proto_tree *tree, tvbuff_t *tvb) {
+       guint8 octet;
+       octet = tvb_get_guint8(tvb,0);
+       proto_tree_add_item(tree, hf_gtp_ext_rat_type, tvb, 0, 1, FALSE);
+       return val_to_str(octet, gtp_ext_rat_type_vals, "Unknown");
+}
+
 static int
 decode_gtp_rat_type(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
 
@@ -4781,6 +4799,32 @@ decode_gtp_rat_type(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tre
  * User Location Information
  * Type = 152 (Decimal)
  */
+
+static const gchar* dissect_radius_user_loc(proto_tree *tree, tvbuff_t *tvb) {
+
+       int                     offset = 0;
+       guint8          geo_loc_type;
+       guint16         length = tvb_length(tvb);
+
+       /* Geographic Location Type */
+       proto_tree_add_item(tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, FALSE);
+       geo_loc_type = tvb_get_guint8(tvb,offset);
+       offset++;
+       
+       if (geo_loc_type == 0)
+               /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 0) */
+               be_cell_id_aux(tvb, tree, offset, length-1, NULL, 0, 0);
+       if (geo_loc_type == 1){
+               /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
+               be_cell_id_aux(tvb, tree, offset, length-1, NULL, 0, 4);
+               offset = offset + 5;
+               proto_tree_add_item(tree, hf_gtp_ext_sac, tvb, offset, 2, FALSE);
+       }
+
+
+       return tvb_bytes_to_str(tvb, 0, length);
+}
+
 static int
 decode_gtp_usr_loc_inf(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
 
@@ -6121,7 +6165,11 @@ proto_register_gtp(void)
                { &hf_gtp_rp_nsapi, { "NSAPI in Radio Priority", "gtp.rp_nsapi", FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_NSAPI_MASK, "Network layer Service Access Point Identifier in Radio Priority", HFILL }},
                { &hf_gtp_rp_sms, { "Radio Priority SMS", "gtp.rp_sms", FT_UINT8, BASE_DEC, NULL, 0, "Radio Priority for MO SMS", HFILL }},
                { &hf_gtp_rp_spare, { "Reserved", "gtp.rp_spare", FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_SPARE_MASK, "Spare bit", HFILL }},
-               { &hf_gtp_sel_mode, { "Selection mode", "gtp.sel_mode", FT_UINT8, BASE_DEC, VALS(sel_mode_type), 0, "Selection Mode", HFILL }},
+               { &hf_gtp_sel_mode,
+                       { "Selection mode", "gtp.sel_mode",
+                       FT_UINT8, BASE_DEC, VALS(sel_mode_type), 0x03,
+                       "Selection Mode", HFILL }
+               },
                { &hf_gtp_seq_number, { "Sequence number", "gtp.seq_number", FT_UINT16, BASE_HEX, NULL, 0, "Sequence Number", HFILL }},
                { &hf_gtp_sndcp_number, { "SNDCP N-PDU LLC Number", "gtp.sndcp_number", FT_UINT8, BASE_HEX, NULL, 0, "SNDCP N-PDU LLC Number", HFILL }},
                { &hf_gtp_tear_ind, { "Teardown Indicator", "gtp.tear_ind", FT_BOOLEAN, BASE_NONE,NULL, 0, "Teardown Indicator", HFILL }},
@@ -6386,6 +6434,9 @@ proto_reg_handoff_gtp(void)
                ppp_subdissector_table = find_dissector_table("ppp.protocol");
 
                radius_register_avp_dissector(VENDOR_THE3GPP,5,dissect_radius_qos_umts);
+               radius_register_avp_dissector(VENDOR_THE3GPP,12,dissect_radius_selection_mode);
+               radius_register_avp_dissector(VENDOR_THE3GPP,21,dissect_radius_rat_type);
+               radius_register_avp_dissector(VENDOR_THE3GPP,22,dissect_radius_user_loc);
 
                Initialized = TRUE;
        } else {
index 1e46897986aae5df41c30270ee6e64b5e567c833..af0ee34f1b3f1eeb0ad26ca5d8ba4c10cd8ee22d 100644 (file)
@@ -58,4 +58,7 @@ ATTRIBUTE     3GPP-Camel-Charging-Info                        24              octets
 ATTRIBUTE      3GPP-Packet-Filter                                      25              octets
 ATTRIBUTE      3GPP-Negotiated-DSCP                            26              octets
 
+VALUE          3GPP-PDP-Type           IPv4                    0
+VALUE          3GPP-PDP-Type           PPP                             1
+VALUE          3GPP-PDP-Type           IPv6                    2
 END-VENDOR     3GPP