aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rrlp.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2015-01-18 13:13:00 +0100
committerPascal Quantin <pascal.quantin@gmail.com>2015-01-18 13:30:56 +0000
commite7593ea19de8df681f19e59b3a9a5f69e67693ba (patch)
tree5a9487da6648c88e1672c8baf9dae470b3b8ff22 /epan/dissectors/packet-rrlp.c
parent12d17d2ceaad8ea12171bfbf97c8483063430788 (diff)
asn2wrs: autodetect if 64 bits variant is required for constrained integers
It does not work with defines, but is already a great step forward Change-Id: I346d4124690ec46a2299d4eae8031bbb19a3db8e Reviewed-on: https://code.wireshark.org/review/6617 Reviewed-by: Anders Broman <a.broman58@gmail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-rrlp.c')
-rw-r--r--epan/dissectors/packet-rrlp.c81
1 files changed, 18 insertions, 63 deletions
diff --git a/epan/dissectors/packet-rrlp.c b/epan/dissectors/packet-rrlp.c
index fc6535d282..2c317ef3c8 100644
--- a/epan/dissectors/packet-rrlp.c
+++ b/epan/dissectors/packet-rrlp.c
@@ -472,12 +472,12 @@ static int hf_rrlp_cnavDeltaA = -1; /* INTEGER_M33554432_33554431
static int hf_rrlp_cnavAdot = -1; /* INTEGER_M16777216_16777215 */
static int hf_rrlp_cnavDeltaNo = -1; /* INTEGER_M65536_65535 */
static int hf_rrlp_cnavDeltaNoDot = -1; /* INTEGER_M4194304_4194303 */
-static int hf_rrlp_cnavMo = -1; /* T_cnavMo */
-static int hf_rrlp_cnavE = -1; /* T_cnavE */
-static int hf_rrlp_cnavOmega = -1; /* T_cnavOmega */
-static int hf_rrlp_cnavOMEGA0 = -1; /* T_cnavOMEGA0 */
+static int hf_rrlp_cnavMo = -1; /* INTEGER_M4294967296_4294967295 */
+static int hf_rrlp_cnavE = -1; /* INTEGER_0_8589934591 */
+static int hf_rrlp_cnavOmega = -1; /* INTEGER_M4294967296_4294967295 */
+static int hf_rrlp_cnavOMEGA0 = -1; /* INTEGER_M4294967296_4294967295 */
static int hf_rrlp_cnavDeltaOmegaDot = -1; /* INTEGER_M65536_65535 */
-static int hf_rrlp_cnavIo = -1; /* T_cnavIo */
+static int hf_rrlp_cnavIo = -1; /* INTEGER_M4294967296_4294967295 */
static int hf_rrlp_cnavIoDot = -1; /* INTEGER_M16384_16383 */
static int hf_rrlp_cnavCis = -1; /* INTEGER_M32768_32767 */
static int hf_rrlp_cnavCic = -1; /* INTEGER_M32768_32767 */
@@ -656,7 +656,6 @@ static int hf_rrlp_ephemerisExtensionDuration = -1; /* INTEGER_1_512 */
static int hf_rrlp_ganssEphExtDay = -1; /* INTEGER_0_8191 */
static int hf_rrlp_ganssEphExtTOD = -1; /* GANSSTOD */
static int hf_rrlp_keplerToe_01 = -1; /* INTEGER_0_37799 */
-static int hf_rrlp_keplerW_01 = -1; /* T_keplerW */
static int hf_rrlp_SeqOfGANSSRefOrbit_item = -1; /* GANSSReferenceOrbit */
static int hf_rrlp_ganssOrbitModel_01 = -1; /* ReferenceNavModel */
static int hf_rrlp_GANSSEphemerisDeltaMatrix_item = -1; /* GANSSEphemerisDeltaEpoch */
@@ -3569,7 +3568,7 @@ dissect_rrlp_INTEGER_M4194304_4194303(tvbuff_t *tvb _U_, int offset _U_, asn1_ct
static int
-dissect_rrlp_T_cnavMo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+dissect_rrlp_INTEGER_M4294967296_4294967295(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
G_GINT64_CONSTANT(-4294967296), 4294967295U, NULL, FALSE);
@@ -3579,7 +3578,7 @@ dissect_rrlp_T_cnavMo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, p
static int
-dissect_rrlp_T_cnavE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
+dissect_rrlp_INTEGER_0_8589934591(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
0U, G_GUINT64_CONSTANT(8589934591), NULL, FALSE);
@@ -3587,36 +3586,6 @@ dissect_rrlp_T_cnavE(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, pr
}
-
-static int
-dissect_rrlp_T_cnavOmega(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- G_GINT64_CONSTANT(-4294967296), 4294967295U, NULL, FALSE);
-
- return offset;
-}
-
-
-
-static int
-dissect_rrlp_T_cnavOMEGA0(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- G_GINT64_CONSTANT(-4294967296), 4294967295U, NULL, FALSE);
-
- return offset;
-}
-
-
-
-static int
-dissect_rrlp_T_cnavIo(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- G_GINT64_CONSTANT(-4294967296), 4294967295U, NULL, FALSE);
-
- return offset;
-}
-
-
static const per_sequence_t NavModel_CNAVKeplerianSet_sequence[] = {
{ &hf_rrlp_cnavTop , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_0_2015 },
{ &hf_rrlp_cnavURAindex , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M16_15 },
@@ -3624,12 +3593,12 @@ static const per_sequence_t NavModel_CNAVKeplerianSet_sequence[] = {
{ &hf_rrlp_cnavAdot , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M16777216_16777215 },
{ &hf_rrlp_cnavDeltaNo , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M65536_65535 },
{ &hf_rrlp_cnavDeltaNoDot , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M4194304_4194303 },
- { &hf_rrlp_cnavMo , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_T_cnavMo },
- { &hf_rrlp_cnavE , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_T_cnavE },
- { &hf_rrlp_cnavOmega , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_T_cnavOmega },
- { &hf_rrlp_cnavOMEGA0 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_T_cnavOMEGA0 },
+ { &hf_rrlp_cnavMo , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M4294967296_4294967295 },
+ { &hf_rrlp_cnavE , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_0_8589934591 },
+ { &hf_rrlp_cnavOmega , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M4294967296_4294967295 },
+ { &hf_rrlp_cnavOMEGA0 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M4294967296_4294967295 },
{ &hf_rrlp_cnavDeltaOmegaDot, ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M65536_65535 },
- { &hf_rrlp_cnavIo , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_T_cnavIo },
+ { &hf_rrlp_cnavIo , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M4294967296_4294967295 },
{ &hf_rrlp_cnavIoDot , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M16384_16383 },
{ &hf_rrlp_cnavCis , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M32768_32767 },
{ &hf_rrlp_cnavCic , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M32768_32767 },
@@ -4455,19 +4424,9 @@ dissect_rrlp_GANSSEphemerisExtensionHeader(tvbuff_t *tvb _U_, int offset _U_, as
}
-
-static int
-dissect_rrlp_T_keplerW(tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
- offset = dissect_per_constrained_integer_64b(tvb, offset, actx, tree, hf_index,
- G_MININT32, 2147483647U, NULL, FALSE);
-
- return offset;
-}
-
-
static const per_sequence_t ReferenceNavModel_sequence[] = {
{ &hf_rrlp_keplerToe_01 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_0_37799 },
- { &hf_rrlp_keplerW_01 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_T_keplerW },
+ { &hf_rrlp_keplerW , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M2147483648_2147483647 },
{ &hf_rrlp_keplerDeltaN , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M32768_32767 },
{ &hf_rrlp_keplerM0 , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M2147483648_2147483647 },
{ &hf_rrlp_keplerOmegaDot , ASN1_NO_EXTENSIONS , ASN1_NOT_OPTIONAL, dissect_rrlp_INTEGER_M8388608_8388607 },
@@ -8809,19 +8768,19 @@ void proto_register_rrlp(void) {
{ &hf_rrlp_cnavMo,
{ "cnavMo", "rrlp.cnavMo",
FT_INT64, BASE_DEC, NULL, 0,
- NULL, HFILL }},
+ "INTEGER_M4294967296_4294967295", HFILL }},
{ &hf_rrlp_cnavE,
{ "cnavE", "rrlp.cnavE",
FT_UINT64, BASE_DEC, NULL, 0,
- NULL, HFILL }},
+ "INTEGER_0_8589934591", HFILL }},
{ &hf_rrlp_cnavOmega,
{ "cnavOmega", "rrlp.cnavOmega",
FT_INT64, BASE_DEC, NULL, 0,
- NULL, HFILL }},
+ "INTEGER_M4294967296_4294967295", HFILL }},
{ &hf_rrlp_cnavOMEGA0,
{ "cnavOMEGA0", "rrlp.cnavOMEGA0",
FT_INT64, BASE_DEC, NULL, 0,
- NULL, HFILL }},
+ "INTEGER_M4294967296_4294967295", HFILL }},
{ &hf_rrlp_cnavDeltaOmegaDot,
{ "cnavDeltaOmegaDot", "rrlp.cnavDeltaOmegaDot",
FT_INT32, BASE_DEC, NULL, 0,
@@ -8829,7 +8788,7 @@ void proto_register_rrlp(void) {
{ &hf_rrlp_cnavIo,
{ "cnavIo", "rrlp.cnavIo",
FT_INT64, BASE_DEC, NULL, 0,
- NULL, HFILL }},
+ "INTEGER_M4294967296_4294967295", HFILL }},
{ &hf_rrlp_cnavIoDot,
{ "cnavIoDot", "rrlp.cnavIoDot",
FT_INT32, BASE_DEC, NULL, 0,
@@ -9542,10 +9501,6 @@ void proto_register_rrlp(void) {
{ "keplerToe", "rrlp.keplerToe",
FT_UINT32, BASE_DEC, NULL, 0,
"INTEGER_0_37799", HFILL }},
- { &hf_rrlp_keplerW_01,
- { "keplerW", "rrlp.keplerW",
- FT_INT32, BASE_DEC, NULL, 0,
- NULL, HFILL }},
{ &hf_rrlp_SeqOfGANSSRefOrbit_item,
{ "GANSSReferenceOrbit", "rrlp.GANSSReferenceOrbit_element",
FT_NONE, BASE_NONE, NULL, 0,