Prettify som 3GPP AVP:s
authorAnders Broman <anders.broman@ericsson.com>
Fri, 20 May 2011 13:55:21 +0000 (13:55 -0000)
committerAnders Broman <anders.broman@ericsson.com>
Fri, 20 May 2011 13:55:21 +0000 (13:55 -0000)
svn path=/trunk/; revision=37326

diameter/dictionary.xml
epan/dissectors/packet-diameter_3gpp.c

index d5c00d4a560471d94b181ad6e5f499ebe841d855..e5ab403614e5fb0a1d019260ef5c2707304991de 100644 (file)
@@ -4316,10 +4316,16 @@ Note: The AVP codes from 1119 to 1199 are reserved for TS 29.140
                <avp name="PoC-Change-Time" code="1262" vendor-bit="must" vendor-id="TGPP">
                        <type type-name="Time"/>
                </avp>
-               <avp name="Access-Network-Information" code="1263" vendor-bit="must" vendor-id="TGPP">
-                       <type type-name="OctetString"/>
-               </avp>
-               <avp name="Trigger" code="1264" vendor-bit="must" vendor-id="TGPP">
+    <!-- The Access-Network-Information AVP (AVP code 1263) is of type OctetString and indicates the SIP P-header
+        "P-Access-Network-Information".
+        As it's a SIP Header the actual content will be text so for Wireshark displays sake we treat this as
+        an UTF8String
+        -->
+    <avp name="Access-Network-Information" code="1263" vendor-bit="must" vendor-id="TGPP">
+      <!-- <type type-name="OctetString"/>  -->
+      <type type-name="UTF8String"/>
+    </avp>
+    <avp name="Trigger" code="1264" vendor-bit="must" vendor-id="TGPP">
                                        <grouped>
                                        <gavp name="Trigger-Type"/>
                                        </grouped>
index 5c5dc340274b2d0eaf1d41fe53b2dd3bf4406ca3..b876cb3a296020dd25eda21985fe69edc06970c4 100644 (file)
@@ -48,6 +48,7 @@
 /* Initialize the protocol and registered fields */
 static int proto_diameter_3gpp                 = -1;
 
+static int hf_diameter_3gpp_visited_nw_id                      = -1;
 static int hf_diameter_3gpp_msisdn                                     = -1;
 static int hf_diameter_3gpp_path                                       = -1;
 static int hf_diameter_3gpp_contact                                    = -1;
@@ -55,6 +56,7 @@ static int hf_diameter_3gpp_user_data                         = -1;
 static int hf_diameter_3gpp_ipaddr                                     = -1;
 static int hf_diameter_3gpp_mbms_required_qos_prio     = -1;
 static int hf_diameter_3gpp_tmgi                                       = -1;
+static int hf_diameter_3gpp_service_ind                                = -1;
 static int hf_diameter_mbms_service_id                         = -1;
 static int hf_diameter_address_digits = -1;
 static int hf_diameter_3gpp_spare_bits = -1;
@@ -123,6 +125,32 @@ static gint diameter_3gpp_idr_flags_ett = -1;
 static dissector_handle_t xml_handle;
 
 
+
+
+/* AVP Code: 600 Visited-Network-Identifier
+ * imscxdx.xml
+ * 6.3.1 Visited-Network-Identifier AVP
+ * The Visited-Network-Identifier AVP is of type OctetString. This AVP contains an identifier that helps the home
+ * network to identify the visited network (e.g. the visited network domain name).
+ */
+
+static int
+dissect_diameter_3gpp_visited_nw_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) {
+
+       proto_item* item;
+       int offset = 0, i;
+       int length = tvb_length(tvb);
+
+       for(i = 0; i < length; i++)
+               if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
+                       return length;
+
+       item = proto_tree_add_item(tree, hf_diameter_3gpp_visited_nw_id, tvb, offset, length, ENC_BIG_ENDIAN);
+       PROTO_ITEM_SET_GENERATED(item);
+
+
+       return length;
+}
 /* AVP Code: 630 Feature-List
  * imscxdx.xml
  * IMS Cx Dx AVPS 3GPP TS 29.229
@@ -196,9 +224,11 @@ dissect_diameter_3gpp_path(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tr
 static int
 dissect_diameter_3gpp_contact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) {
 
+       proto_item* item;
        int offset = 0;
 
-       proto_tree_add_item(tree, hf_diameter_3gpp_contact, tvb, offset, -1, ENC_BIG_ENDIAN);
+       item = proto_tree_add_item(tree, hf_diameter_3gpp_contact, tvb, offset, -1, ENC_BIG_ENDIAN);
+       PROTO_ITEM_SET_GENERATED(item);
 
        return tvb_length(tvb);
 }
@@ -253,6 +283,26 @@ dissect_diameter_3gpp_user_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tre
 
 }
 
+/*
+ * AVP Code: 704 Service-Indication
+ */
+static int
+dissect_diameter_3gpp_service_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) {
+
+       proto_item* item;
+       int offset = 0, i;
+       int length = tvb_length(tvb);
+
+       for(i = 0; i < length; i++)
+               if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
+                       return length;
+
+       item = proto_tree_add_item(tree, hf_diameter_3gpp_service_ind, tvb, offset, length, ENC_BIG_ENDIAN);
+       PROTO_ITEM_SET_GENERATED(item);
+
+       return length;
+}
+
 /* AVP Code: 900 TMGI */
 static int
 dissect_diameter_3gpp_tmgi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) {
@@ -561,6 +611,9 @@ proto_reg_handoff_diameter_3gpp(void)
         * Registered by packet-gtpv2.c
         */
 
+       /* AVP Code: 600 Visited-Network-Identifier */
+       dissector_add_uint("diameter.3gpp", 600, new_create_dissector_handle(dissect_diameter_3gpp_visited_nw_id, proto_diameter_3gpp));
+
        /* AVP Code: 606 User-Data */
        dissector_add_uint("diameter.3gpp", 606, new_create_dissector_handle(dissect_diameter_3gpp_user_data, proto_diameter_3gpp));
 
@@ -579,6 +632,9 @@ proto_reg_handoff_diameter_3gpp(void)
        /* AVP Code: 702 User-Data */
        dissector_add_uint("diameter.3gpp", 702, new_create_dissector_handle(dissect_diameter_3gpp_user_data, proto_diameter_3gpp));
 
+       /* AVP Code: 704 Service-Indication  */
+       dissector_add_uint("diameter.3gpp", 704, new_create_dissector_handle(dissect_diameter_3gpp_service_ind, proto_diameter_3gpp));
+
        /* AVP Code: 900 TMGI */
        dissector_add_uint("diameter.3gpp", 900, new_create_dissector_handle(dissect_diameter_3gpp_tmgi, proto_diameter_3gpp));
 
@@ -637,6 +693,11 @@ proto_register_diameter_3gpp(void)
                        FT_STRING, BASE_NONE, NULL, 0x0,
                        NULL, HFILL }
                },
+               { &hf_diameter_3gpp_visited_nw_id,
+                       { "Visited-Network-Identifier",           "diameter.3gpp.visited_nw_id",
+                       FT_STRING, BASE_NONE, NULL, 0x0,
+                       NULL, HFILL }
+               },
                { &hf_diameter_3gpp_msisdn,
                        { "MSISDN",           "diameter.3gpp.msisdn",
                        FT_BYTES, BASE_NONE, NULL, 0x0,
@@ -662,6 +723,11 @@ proto_register_diameter_3gpp(void)
                        FT_BYTES, BASE_NONE, NULL, 0x0,
                        NULL, HFILL }
                },
+               { &hf_diameter_3gpp_service_ind,
+                       { "Service-Indication",           "diameter.3gpp.service_ind",
+                       FT_STRING, BASE_NONE, NULL, 0x0,
+                       NULL, HFILL }
+               },
                { &hf_diameter_mbms_service_id,
                        { "MBMS Service ID",           "diameter.3gpp.mbms_service_id",
                        FT_UINT24, BASE_HEX, NULL, 0x0,