diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2009-12-18 15:24:18 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2009-12-18 15:24:18 +0000 |
commit | 71e627342ca0369b574588563b9e855a52cf6d35 (patch) | |
tree | 472abe395116f1a3cfb77f0f4edce3800589b05c | |
parent | 901cdc8a9c81a326c561a813c3428a62ed81897c (diff) |
Regenerated with SIZE constraints checking.
Added MMSUpperBounds.asn.
svn path=/trunk/; revision=31312
-rw-r--r-- | asn1/s4406/MMSUpperBounds.asn | 26 | ||||
-rw-r--r-- | asn1/s4406/Makefile.common | 4 | ||||
-rw-r--r-- | asn1/s4406/packet-s4406-template.c | 2 | ||||
-rw-r--r-- | asn1/s4406/s4406.asn | 8 | ||||
-rw-r--r-- | epan/dissectors/packet-s4406.c | 57 | ||||
-rw-r--r-- | epan/dissectors/packet-s4406.h | 2 |
6 files changed, 70 insertions, 29 deletions
diff --git a/asn1/s4406/MMSUpperBounds.asn b/asn1/s4406/MMSUpperBounds.asn new file mode 100644 index 0000000000..52118e9a93 --- /dev/null +++ b/asn1/s4406/MMSUpperBounds.asn @@ -0,0 +1,26 @@ +-- $Id$ +MMSUpperBounds {iso(1) identified-organization(3) nato(26) stanags(0) + mmhs(4406) object-identifiers(0) module(0) upper-bounds(0)} DEFINITIONS +IMPLICIT TAGS ::= +BEGIN + +-- Prologue +-- Exports Everything +IMPORTS -- nothing -- ; + +-- Upper Bounds +ub-military-string INTEGER ::= 69 + +ub-military-number-of-sics INTEGER ::= 8 + +lb-military-sic INTEGER ::= 3 + +ub-military-sic INTEGER ::= 8 + +ub-military-bigstring INTEGER ::= 128 + +ub-data-size INTEGER ::= 65535 + +-- size of ACP127DATADATA +END -- of MMSUpperBounds + diff --git a/asn1/s4406/Makefile.common b/asn1/s4406/Makefile.common index 2825d1ae24..86cdef9855 100644 --- a/asn1/s4406/Makefile.common +++ b/asn1/s4406/Makefile.common @@ -28,7 +28,7 @@ DISSECTOR_FILES=packet-$(PROTOCOL_NAME).c \ EXT_ASN_FILE_LIST = -ASN_FILE_LIST = $(PROTOCOL_NAME).asn +ASN_FILE_LIST = $(PROTOCOL_NAME).asn MMSUpperBounds.asn # The packet-$(PROTOCOL_NAME)-template.h and $(PROTOCOL_NAME).asn # files do not exist for all protocols: Please add/remove as required. @@ -43,7 +43,7 @@ SRC_FILES = \ $(EXTRA_DIST) \ $(EXT_ASN_FILE_LIST) -A2W_FLAGS= -b +A2W_FLAGS= -b -e -C EXTRA_CNF= \ ../x411/x411-exp.cnf \ diff --git a/asn1/s4406/packet-s4406-template.c b/asn1/s4406/packet-s4406-template.c index 7b248a3f57..53bfacab47 100644 --- a/asn1/s4406/packet-s4406-template.c +++ b/asn1/s4406/packet-s4406-template.c @@ -49,6 +49,8 @@ /* Initialize the protocol and registered fields */ static int proto_s4406 = -1; +#include "packet-s4406-val.h" + #include "packet-s4406-hf.c" /* Initialize the subtree pointers */ diff --git a/asn1/s4406/s4406.asn b/asn1/s4406/s4406.asn index e3de8b8551..0bd58c6d4a 100644 --- a/asn1/s4406/s4406.asn +++ b/asn1/s4406/s4406.asn @@ -80,13 +80,13 @@ ExtendedAuthorisationInfo ::= UTCTime -- ::= id-nato-mmhs-mm-distribution-codes DistributionCodes ::= SET { - sics [0] SEQUENCE --SIZE --- (1..ub-military-number-of-sics)-- OF + sics [0] SEQUENCE SIZE + (1..ub-military-number-of-sics) OF Sic OPTIONAL, dist-Extensions [1] SEQUENCE OF DistributionExtensionField OPTIONAL } -Sic ::= PrintableString --(SIZE (lb-military-sic..ub-military-sic)) +Sic ::= PrintableString (SIZE (lb-military-sic..ub-military-sic)) DistributionExtensionField ::= SEQUENCE { dist-type OBJECT IDENTIFIER, @@ -101,7 +101,7 @@ DistributionExtensionField ::= SEQUENCE { HandlingInstructions ::= SEQUENCE OF MilitaryString -MilitaryString ::= PrintableString --(SIZE(1..ub-military-string)) +MilitaryString ::= PrintableString (SIZE(1..ub-military-string)) -- Message instructions diff --git a/epan/dissectors/packet-s4406.c b/epan/dissectors/packet-s4406.c index 9dd4f69386..33ba52bc7a 100644 --- a/epan/dissectors/packet-s4406.c +++ b/epan/dissectors/packet-s4406.c @@ -1,7 +1,7 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-s4406.c */ -/* ../../tools/asn2wrs.py -b -p s4406 -c ./s4406.cnf -s ./packet-s4406-template -D . s4406.asn */ +/* ../../tools/asn2wrs.py -b -e -C -p s4406 -c ./s4406.cnf -s ./packet-s4406-template -D . s4406.asn MMSUpperBounds.asn */ /* Input file: packet-s4406-template.c */ @@ -58,6 +58,19 @@ static int proto_s4406 = -1; +/*--- Included file: packet-s4406-val.h ---*/ +#line 1 "packet-s4406-val.h" +#define ub_military_string 69 +#define ub_military_number_of_sics 8 +#define lb_military_sic 3 +#define ub_military_sic 8 +#define ub_military_bigstring 128 +#define ub_data_size 65535 + +/*--- End of included file: packet-s4406-val.h ---*/ +#line 53 "packet-s4406-template.c" + + /*--- Included file: packet-s4406-hf.c ---*/ #line 1 "packet-s4406-hf.c" static int hf_s4406_InformationObject_PDU = -1; /* InformationObject */ @@ -84,7 +97,7 @@ static int hf_s4406_PriorityLevelQualifier_PDU = -1; /* PriorityLevelQualifier static int hf_s4406_mm = -1; /* IPM */ static int hf_s4406_mn = -1; /* IPN */ static int hf_s4406_ExemptedAddressSeq_item = -1; /* ExemptedAddress */ -static int hf_s4406_sics = -1; /* SEQUENCE_OF_Sic */ +static int hf_s4406_sics = -1; /* SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic */ static int hf_s4406_sics_item = -1; /* Sic */ static int hf_s4406_dist_Extensions = -1; /* SEQUENCE_OF_DistributionExtensionField */ static int hf_s4406_dist_Extensions_item = -1; /* DistributionExtensionField */ @@ -121,7 +134,7 @@ static int hf_s4406_Acp127NotificationType_positive = -1; static int hf_s4406_Acp127NotificationType_transfer = -1; /*--- End of included file: packet-s4406-hf.c ---*/ -#line 53 "packet-s4406-template.c" +#line 55 "packet-s4406-template.c" /* Initialize the subtree pointers */ static gint ett_s4406 = -1; @@ -131,7 +144,7 @@ static gint ett_s4406 = -1; static gint ett_s4406_InformationObject = -1; static gint ett_s4406_ExemptedAddressSeq = -1; static gint ett_s4406_DistributionCodes = -1; -static gint ett_s4406_SEQUENCE_OF_Sic = -1; +static gint ett_s4406_SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic = -1; static gint ett_s4406_SEQUENCE_OF_DistributionExtensionField = -1; static gint ett_s4406_DistributionExtensionField = -1; static gint ett_s4406_HandlingInstructions = -1; @@ -151,7 +164,7 @@ static gint ett_s4406_SEQUENCE_OF_BodyPartSecurityLabel = -1; static gint ett_s4406_BodyPartSecurityLabel = -1; /*--- End of included file: packet-s4406-ett.c ---*/ -#line 57 "packet-s4406-template.c" +#line 59 "packet-s4406-template.c" /*--- Included file: packet-s4406-fn.c ---*/ @@ -231,22 +244,22 @@ dissect_s4406_ExtendedAuthorisationInfo(gboolean implicit_tag _U_, tvbuff_t *tvb static int dissect_s4406_Sic(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, - actx, tree, tvb, offset, hf_index, - NULL); + offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, + actx, tree, tvb, offset, + lb_military_sic, ub_military_sic, hf_index, NULL); return offset; } -static const ber_sequence_t SEQUENCE_OF_Sic_sequence_of[1] = { +static const ber_sequence_t SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic_sequence_of[1] = { { &hf_s4406_sics_item , BER_CLASS_UNI, BER_UNI_TAG_PrintableString, BER_FLAGS_NOOWNTAG, dissect_s4406_Sic }, }; static int -dissect_s4406_SEQUENCE_OF_Sic(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_sequence_of(implicit_tag, actx, tree, tvb, offset, - SEQUENCE_OF_Sic_sequence_of, hf_index, ett_s4406_SEQUENCE_OF_Sic); +dissect_s4406_SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { + offset = dissect_ber_constrained_sequence_of(implicit_tag, actx, tree, tvb, offset, + 1, ub_military_number_of_sics, SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic_sequence_of, hf_index, ett_s4406_SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic); return offset; } @@ -302,7 +315,7 @@ dissect_s4406_SEQUENCE_OF_DistributionExtensionField(gboolean implicit_tag _U_, static const ber_sequence_t DistributionCodes_set[] = { - { &hf_s4406_sics , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_s4406_SEQUENCE_OF_Sic }, + { &hf_s4406_sics , BER_CLASS_CON, 0, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_s4406_SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic }, { &hf_s4406_dist_Extensions, BER_CLASS_CON, 1, BER_FLAGS_OPTIONAL|BER_FLAGS_IMPLTAG, dissect_s4406_SEQUENCE_OF_DistributionExtensionField }, { NULL, 0, 0, 0, NULL } }; @@ -319,9 +332,9 @@ dissect_s4406_DistributionCodes(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, in static int dissect_s4406_MilitaryString(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) { - offset = dissect_ber_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, - actx, tree, tvb, offset, hf_index, - NULL); + offset = dissect_ber_constrained_restricted_string(implicit_tag, BER_UNI_TAG_PrintableString, + actx, tree, tvb, offset, + 1, ub_military_string, hf_index, NULL); return offset; } @@ -873,7 +886,7 @@ static void dissect_PriorityLevelQualifier_PDU(tvbuff_t *tvb _U_, packet_info *p /*--- End of included file: packet-s4406-fn.c ---*/ -#line 59 "packet-s4406-template.c" +#line 61 "packet-s4406-template.c" /* @@ -1009,7 +1022,7 @@ void proto_register_s4406(void) { { &hf_s4406_sics, { "sics", "s4406.sics", FT_UINT32, BASE_DEC, NULL, 0, - "s4406.SEQUENCE_OF_Sic", HFILL }}, + "s4406.SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic", HFILL }}, { &hf_s4406_sics_item, { "Sic", "s4406.Sic", FT_STRING, BASE_NONE, NULL, 0, @@ -1144,7 +1157,7 @@ void proto_register_s4406(void) { NULL, HFILL }}, /*--- End of included file: packet-s4406-hfarr.c ---*/ -#line 93 "packet-s4406-template.c" +#line 95 "packet-s4406-template.c" }; /* List of subtrees */ @@ -1156,7 +1169,7 @@ void proto_register_s4406(void) { &ett_s4406_InformationObject, &ett_s4406_ExemptedAddressSeq, &ett_s4406_DistributionCodes, - &ett_s4406_SEQUENCE_OF_Sic, + &ett_s4406_SEQUENCE_SIZE_1_ub_military_number_of_sics_OF_Sic, &ett_s4406_SEQUENCE_OF_DistributionExtensionField, &ett_s4406_DistributionExtensionField, &ett_s4406_HandlingInstructions, @@ -1176,7 +1189,7 @@ void proto_register_s4406(void) { &ett_s4406_BodyPartSecurityLabel, /*--- End of included file: packet-s4406-ettarr.c ---*/ -#line 99 "packet-s4406-template.c" +#line 101 "packet-s4406-template.c" }; /* Register protocol */ @@ -1218,7 +1231,7 @@ void proto_reg_handoff_s4406(void) { /*--- End of included file: packet-s4406-dis-tab.c ---*/ -#line 114 "packet-s4406-template.c" +#line 116 "packet-s4406-template.c" register_ber_oid_dissector("1.3.26.0.4406.0.4.1", dissect_s4406, proto_s4406, "STANAG 4406"); diff --git a/epan/dissectors/packet-s4406.h b/epan/dissectors/packet-s4406.h index defd0711a7..741505a1b2 100644 --- a/epan/dissectors/packet-s4406.h +++ b/epan/dissectors/packet-s4406.h @@ -1,7 +1,7 @@ /* Do not modify this file. */ /* It is created automatically by the ASN.1 to Wireshark dissector compiler */ /* packet-s4406.h */ -/* ../../tools/asn2wrs.py -b -p s4406 -c ./s4406.cnf -s ./packet-s4406-template -D . s4406.asn */ +/* ../../tools/asn2wrs.py -b -e -C -p s4406 -c ./s4406.cnf -s ./packet-s4406-template -D . s4406.asn MMSUpperBounds.asn */ /* Input file: packet-s4406-template.h */ |