From Anders: fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6839 :
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 17 Feb 2012 15:38:36 +0000 (15:38 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 17 Feb 2012 15:38:36 +0000 (15:38 +0000)
A patch to set for PayloadType = 1 for Connectionless-Information

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

asn1/lcsap/lcsap.cnf
epan/dissectors/packet-lcsap.c

index 287825c4bbbb065959ea8c829ddf3292c4e71017..fc18c2c09c95958f0b9948f28da263597ceeedad 100644 (file)
@@ -56,16 +56,24 @@ ProtocolIE-Field/value ie_field_value
 #.END
 
 
-#.FN_PARS ProtocolIE-Field/value  FN_VARIANT=_pdu_new  TYPE_REF_FN=dissect_ProtocolIEFieldValue 
+#.FN_PARS ProtocolIE-Field/value  FN_VARIANT=_pdu_new  TYPE_REF_FN=dissect_ProtocolIEFieldValue
 #.FN_PARS ProtocolExtensionID  VAL_PTR=&ProtocolExtensionID
 #.FN_PARS ProtocolExtensionField/extensionValue  FN_VARIANT=_pdu_new  TYPE_REF_FN=dissect_ProtocolExtensionFieldExtensionValue
 
 #.FN_PARS Payload-Type VAL_PTR=&PayloadType
 
+# LCSAP connectionless-transfer
+# procedures, which according to 3GPP TS 29.171 LCS-AP, can only contain an LPPa
+# payload within the APDU IE of the procedure.
+
+#.FN_HDR Connectionless-Information
+
+  PayloadType = 1;  /* LPPa */
+
 #.FN_BODY APDU VAL_PTR = &parameter_tvb
 
   tvbuff_t *parameter_tvb=NULL;
-  
+
 %(DEFAULT_BODY)s
 
   if (parameter_tvb) {
@@ -94,9 +102,9 @@ ProtocolIE-Field/value ie_field_value
        if (check_col(actx->pinfo->cinfo, COL_INFO))
        {
                guint8 tmp = tvb_get_guint8(tvb, 0);
-                       
+
                if(tmp == 0)
-                               
+
                col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sReq",
                           val_to_str(ProcedureCode, lcsap_ProcedureCode_vals,
                                "unknown message"));
@@ -107,18 +115,18 @@ ProtocolIE-Field/value ie_field_value
                                    "unknown message"));
                        else
                                col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s",
-                                 val_to_str(ProcedureCode, lcsap_ProcedureCode_vals,   
+                                 val_to_str(ProcedureCode, lcsap_ProcedureCode_vals,
                                    "unknown message"));
+
        }
 
-        if (ProcedureCode != 0) 
+        if (ProcedureCode != 0)
        {
-                
+
                _pro_code.code = ProcedureCode;
+
                actx->pinfo->private_data = &_pro_code;
-   
+
        }
 #.END
 
@@ -164,9 +172,9 @@ ProtocolIE-Field/value ie_field_value
   tvbuff_t *parameter_tvb=NULL;
   offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
                                        3, 3, FALSE, &parameter_tvb);
-       if(tvb_length(tvb)==0) 
+       if(tvb_length(tvb)==0)
                return offset;
-               
+
        if (!parameter_tvb)
                return offset;
        dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, tree, 0, FALSE);
@@ -238,9 +246,9 @@ Velocity-Estimate                       N lcsap.ies id-Velocity-Estimate
 
 
 
-Location-Request                       N lcsap.proc.imsg id-Location-Service-Request 
-Location-Response                      N lcsap.proc.sout id-Location-Service-Request 
-Location-Response                      N lcsap.proc.uout id-Location-Service-Request 
+Location-Request                       N lcsap.proc.imsg id-Location-Service-Request
+Location-Response                      N lcsap.proc.sout id-Location-Service-Request
+Location-Response                      N lcsap.proc.uout id-Location-Service-Request
 
 Connection-Oriented-Information        N lcsap.proc.imsg id-Connection-Oriented-Information-Transfer
 
index 228983c13358c835fa2b864942e74c3bcd4a8456..b99711abc66342d7b1fbf98e16242dd85c603a94 100644 (file)
@@ -1,7 +1,7 @@
 /* Do not modify this file.                                                   */
 /* It is created automatically by the ASN.1 to Wireshark dissector compiler   */
 /* packet-lcsap.c                                                             */
-/* ../../tools/asn2wrs.py -p lcsap -c ./lcsap.cnf -s ./packet-lcsap-template -D . -O ../../epan/dissectors LCS-AP-CommonDataTypes.asn LCS-AP-Constants.asn LCS-AP-Containers.asn LCS-AP-IEs.asn LCS-AP-PDU-Contents.asn LCS-AP-PDU-Descriptions.asn */
+/* ../../../tools/asn2wrs.py -p lcsap -c ../../../asn1/lcsap/lcsap.cnf -s ../../../asn1/lcsap/packet-lcsap-template -D ../../../asn1/lcsap -O ../../../epan/dissectors LCS-AP-CommonDataTypes.asn LCS-AP-Constants.asn LCS-AP-Containers.asn LCS-AP-IEs.asn LCS-AP-PDU-Contents.asn LCS-AP-PDU-Descriptions.asn */
 
 /* Input file: packet-lcsap-template.c */
 
@@ -345,14 +345,14 @@ dissect_lcsap_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
   offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_index,
                                                             0U, 255U, &ProcedureCode, FALSE);
 
-#line 93 "../../asn1/lcsap/lcsap.cnf"
+#line 101 "../../asn1/lcsap/lcsap.cnf"
 
        if (check_col(actx->pinfo->cinfo, COL_INFO))
        {
                guint8 tmp = tvb_get_guint8(tvb, 0);
-                       
+
                if(tmp == 0)
-                               
+
                col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%sReq",
                           val_to_str(ProcedureCode, lcsap_ProcedureCode_vals,
                                "unknown message"));
@@ -363,18 +363,18 @@ dissect_lcsap_ProcedureCode(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx
                                    "unknown message"));
                        else
                                col_add_fstr(actx->pinfo->cinfo, COL_INFO, "%s",
-                                 val_to_str(ProcedureCode, lcsap_ProcedureCode_vals,   
+                                 val_to_str(ProcedureCode, lcsap_ProcedureCode_vals,
                                    "unknown message"));
+
        }
 
-        if (ProcedureCode != 0) 
+        if (ProcedureCode != 0)
        {
-                
+
                _pro_code.code = ProcedureCode;
+
                actx->pinfo->private_data = &_pro_code;
-   
+
        }
 
   return offset;
@@ -513,10 +513,10 @@ dissect_lcsap_ProtocolExtensionContainer(tvbuff_t *tvb _U_, int offset _U_, asn1
 
 static int
 dissect_lcsap_APDU(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 66 "../../asn1/lcsap/lcsap.cnf"
+#line 74 "../../asn1/lcsap/lcsap.cnf"
 
   tvbuff_t *parameter_tvb=NULL;
-  
+
   offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
                                        NO_BOUND, NO_BOUND, FALSE, &parameter_tvb);
 
@@ -678,13 +678,13 @@ dissect_lcsap_DegreesLongitude(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *ac
 
 static int
 dissect_lcsap_PLMN_ID(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
-#line 164 "../../asn1/lcsap/lcsap.cnf"
+#line 172 "../../asn1/lcsap/lcsap.cnf"
   tvbuff_t *parameter_tvb=NULL;
   offset = dissect_per_octet_string(tvb, offset, actx, tree, hf_index,
                                        3, 3, FALSE, &parameter_tvb);
-       if(tvb_length(tvb)==0) 
+       if(tvb_length(tvb)==0)
                return offset;
-               
+
        if (!parameter_tvb)
                return offset;
        dissect_e212_mcc_mnc(parameter_tvb, actx->pinfo, tree, 0, FALSE);
@@ -1678,6 +1678,11 @@ static const per_sequence_t Connectionless_Information_sequence[] = {
 
 static int
 dissect_lcsap_Connectionless_Information(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+#line 70 "../../asn1/lcsap/lcsap.cnf"
+
+  PayloadType = 1;  /* LPPa */
+
+
   offset = dissect_per_sequence(tvb, offset, actx, tree, hf_index,
                                    ett_lcsap_Connectionless_Information, Connectionless_Information_sequence);