From Pascal Quantin:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 1 Dec 2011 05:42:07 +0000 (05:42 +0000)
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>
Thu, 1 Dec 2011 05:42:07 +0000 (05:42 +0000)
adds to the Protocol Configuration Options the decoding of
the following container identifiers:
- Selected Bearer Control Mode
- DSMIPv6 Home Agent Address
- DSMIPv6 Home Network Prefix
- DSMIPv6 IPv4 Home Agent Address
- P-CSCF IPv4 Address
- DNS Server IPv4 Address

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6636

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

epan/dissectors/packet-gsm_a_gm.c

index b06b62b801db2b30761209ad933c98b41ecbf723..f72f62f850f2650a8151f0341c3813cbe03d962d 100644 (file)
@@ -3669,6 +3669,7 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g
        guchar  oct;
        struct e_in6_addr ipv6_addr;
        int     link_dir;
+       guint32 ipv4_addr;
 
        curr_len = len;
        curr_offset = offset;
@@ -3725,30 +3726,47 @@ de_sm_pco(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offset, g
                switch ( prot )
                {
                        case 0x0001:
-                       {
-                               if (e_len > 0) {
+                       case 0x0003:
+                       case 0x0007:
+                               if ((link_dir == P2P_DIR_DL) && (e_len > 0)) {
                                        tvb_get_ipv6(tvb, curr_offset, &ipv6_addr);
-                                       proto_tree_add_text(tree,
-                                       tvb, curr_offset, 16,
-                                       "IPv6: %s", ip6_to_str(&ipv6_addr));
+                                       proto_tree_add_text(tree, tvb, curr_offset, 16, "IPv6: %s", ip6_to_str(&ipv6_addr));
                                }
                                break;
-                       }
                        case 0x0002:
+                       case 0x0006:
+                       case 0x000A:
+                       case 0x000B:
                                break;
-                       case 0x0003:
-                       {
-                               if (e_len > 0) {
+                       case 0x0004:
+                               if (link_dir == P2P_DIR_DL) {
+                                       oct = tvb_get_guint8(tvb, curr_offset);
+                                       proto_tree_add_text(tree,tvb, curr_offset, 1, "Reject Code: 0x%02x (%u)", e_len , e_len);
+                               }
+                               break;
+                       case 0x0005:
+                               if ((link_dir == P2P_DIR_DL) && (e_len == 1)) {
+                                       oct = tvb_get_guint8(tvb, curr_offset);
+                                       proto_tree_add_text(tree, tvb, curr_offset, 1, "%s", (oct == 1) ? "MS only" :
+                                                                               ((oct == 2) ? "MS/NW" : "Unknown"));
+                               }
+                               break;
+                       case 0x0008:
+                               if ((link_dir == P2P_DIR_DL) && (e_len > 0)) {
                                        tvb_get_ipv6(tvb, curr_offset, &ipv6_addr);
-                                       proto_tree_add_text(tree,
-                                       tvb, curr_offset, 16,
-                                       "IPv6: %s", ip6_to_str(&ipv6_addr));
+                                       proto_tree_add_text(tree, tvb, curr_offset, 16, "IPv6: %s", ip6_to_str(&ipv6_addr));
+                                       oct = tvb_get_guint8(tvb, curr_offset+16);
+                                       proto_tree_add_text(tree, tvb, curr_offset+16, 1, "Prefix length: %u", oct);
                                }
                                break;
-                       }
-                       case 0x0004:
-                               oct = tvb_get_guint8(tvb, curr_offset);
-                               proto_tree_add_text(tree,tvb, curr_offset, 1, "Reject Code: 0x%02x (%u)", e_len , e_len);
+                       case 0x0009:
+                       case 0x000C:
+                       case 0x000D:
+                               if ((link_dir == P2P_DIR_DL) && (e_len > 0)) {
+                                       ipv4_addr = tvb_get_ipv4(tvb, curr_offset);
+                                       proto_tree_add_text(tree, tvb, curr_offset, 4,  "IPv4: %s",
+                                                                               ip_to_str((guint8 *)&ipv4_addr));
+                               }
                                break;
                        default:
                        {
@@ -3823,7 +3841,7 @@ de_sm_pdp_addr(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, guint32 offs
        }
        else if (pdp_type_org == 1)
        {
-               /* IETF allocated addres */
+               /* IETF allocated address */
                switch (pdp_type_num)
                {
                        case 0x21: str="IPv4 address"; break;